@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --button-rgb: 47 111 221;
  --signal-rgb: 143 184 255;
  --success-rgb: 96 180 255;
  --warning-rgb: 122 162 255;
  --danger-rgb: 213 103 132;
  --shadow-rgb: 44 72 118;
  --background: #edf4ff;
  --background-alt: #fbfdff;
  --foreground: #102540;
  --muted: #6b7fa1;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface-accent: rgb(var(--button-rgb) / 0.1);
  --border: rgba(16, 37, 64, 0.08);
  --button: rgb(var(--button-rgb));
  --button-hover: rgb(34 88 188);
  --signal: rgb(var(--signal-rgb));
  --signal-soft: rgb(var(--signal-rgb) / 0.16);
  --danger: rgb(var(--danger-rgb));
  --danger-bg: rgb(var(--danger-rgb) / 0.12);
  --success: rgb(var(--success-rgb));
  --warning: rgb(var(--warning-rgb));
  --shadow: 0 28px 90px rgb(var(--shadow-rgb) / 0.16);
  --shadow-soft: 0 14px 42px rgb(var(--shadow-rgb) / 0.1);
  --radius: 18px;
  --radius-lg: 30px;
  --transition: 180ms ease;
  --bg: var(--background);
  --bg2: var(--background-alt);
  --card: var(--surface-strong);
  --card-border: var(--border);
  --text: var(--foreground);
  --text-muted: var(--muted);
  --accent: var(--button);
  --accent2: var(--signal);
  --accent-glow: rgb(var(--button-rgb) / 0.12);
}

.light-mode {
  --background: #f4f8ff;
  --background-alt: #ffffff;
  --foreground: #11284a;
  --muted: #6e82a4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --surface-accent: rgb(var(--button-rgb) / 0.08);
  --border: rgba(17, 40, 74, 0.07);
  --shadow: 0 24px 80px rgb(var(--shadow-rgb) / 0.13);
  --shadow-soft: 0 12px 32px rgb(var(--shadow-rgb) / 0.07);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--foreground);
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgb(var(--signal-rgb) / 0.24), transparent 34%),
    radial-gradient(circle at top right, rgb(var(--button-rgb) / 0.14), transparent 28%),
    linear-gradient(180deg, var(--background-alt) 0%, var(--background) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  opacity: 0.55;
  background-image:
    linear-gradient(rgba(17, 32, 51, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 32, 51, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center;
}

body::after {
  z-index: 0;
  background:
    radial-gradient(circle at 15% 24%, rgba(255, 255, 255, 0.32), transparent 26%),
    radial-gradient(circle at 80% 76%, rgb(var(--button-rgb) / 0.08), transparent 22%);
}

main,
.container,
.site-header,
.site-footer,
.modal-overlay,
.global-theme-toggle {
  position: relative;
  z-index: 1;
}

main {
  padding: 1.5rem;
}

.container {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--foreground);
  line-height: 1.05;
}

h1,
.hero-screen h1,
.hero h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 600;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

p,
li,
span,
label,
input,
textarea,
select,
button {
  font-family: inherit;
}

p,
li {
  margin: 0;
  color: var(--muted);
}

strong,
b {
  color: var(--foreground);
}

a {
  color: inherit;
}

code {
  font-family: "Space Grotesk", monospace;
  color: var(--foreground);
  background: rgba(17, 32, 51, 0.06);
  padding: 0.15rem 0.4rem;
  border-radius: 8px;
}

.site-header {
  width: min(1240px, calc(100% - 2rem));
  margin: 1.1rem auto 0;
  padding: 0.95rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  z-index: 120;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--foreground);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-logo::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--signal);
  box-shadow: 0 0 0 6px rgb(var(--signal-rgb) / 0.14);
}

.site-logo .logo-short {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-right: auto;
}

.nav-links a,
.my-party-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.nav-links a:hover,
.my-party-btn:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(17, 32, 51, 0.08);
  transform: translateY(-1px);
}

.nav-links a.active,
.my-party-btn.active {
  color: var(--button);
  background: var(--surface-accent);
  border-color: rgb(var(--button-rgb) / 0.18);
}

.site-header .admin-login {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-left: auto;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(17, 32, 51, 0.08);
}

.site-header .admin-login input {
  width: 9.5rem;
  min-height: 2.35rem;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
}

.site-header .admin-login button {
  min-height: 2.35rem;
  padding-inline: 1rem;
  font-size: 0.82rem;
}

.hamburger-wrap {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.site-header.app-header .hamburger-wrap {
  margin-left: 0;
}

.notif-bell-btn,
.hamburger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  background: rgba(255, 255, 255, 0.56) !important;
  color: var(--foreground) !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px;
  box-shadow: none !important;
  transform: none !important;
}

.hamburger-btn {
  flex-direction: column;
  gap: 4px;
}

.notif-bell-btn {
  position: relative;
}

.notif-bell-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.notif-bell-dot {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.notif-bell-dot[hidden] {
  display: none !important;
}

.notif-bell-btn:hover,
.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: none !important;
  transform: translateY(-1px) !important;
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  border-radius: 999px;
  background: var(--foreground);
}

.hamburger-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 140;
  min-width: 220px;
  padding: 0.45rem;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hamburger-menu.open {
  display: block;
}

.hamburger-menu a {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.hamburger-menu a:hover,
.hamburger-menu a.active {
  color: var(--button);
  background: var(--surface-accent);
}

.menu-divider {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--border);
}

.menu-email {
  display: block;
  padding: 0.5rem 0.9rem;
  color: var(--muted);
  opacity: 0.82;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-logout {
  color: var(--danger) !important;
}

.menu-logout-form {
  margin: 0;
}

/* Buttons inside the hamburger menu look like its links. */
.hamburger-menu .menu-button {
  display: block;
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 0;
  border-radius: 14px;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  color: var(--muted);
  cursor: pointer;
  min-height: 0;
  box-shadow: none;
  transition: background var(--transition), color var(--transition);
}

.hamburger-menu .menu-button:hover {
  color: var(--button);
  background: var(--surface-accent);
  box-shadow: none;
  transform: none;
}

html:not(.light-mode) .hamburger-menu .menu-button {
  background: none;
  color: var(--muted);
  box-shadow: none;
}

.hamburger-menu .menu-logout:hover {
  background: var(--danger-bg);
}

/* The theme toggle lives in the hamburger menu on phones only. */
.menu-theme-toggle {
  display: none !important;
}

.hamburger-menu .mobile-nav-link,
.hamburger-menu .mobile-party-link {
  display: none;
}

.hero-screen,
.hero {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.4rem auto 0;
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 74% 24%, rgba(255, 255, 255, 0.54), transparent 20%),
    radial-gradient(circle at 77% 74%, rgb(var(--signal-rgb) / 0.12), transparent 16%),
    radial-gradient(circle at 68% 18%, rgb(var(--button-rgb) / 0.2), transparent 16%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(238, 245, 255, 0.8));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-screen {
  min-height: min(82vh, 820px);
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.15rem;
}

.hero-screen::before,
.hero-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-screen::before {
  top: 14%;
  right: 10%;
  width: min(22vw, 240px);
  aspect-ratio: 1 / 1;
  border-radius: 40% 60% 55% 45% / 42% 42% 58% 58%;
  background: linear-gradient(145deg, rgb(var(--button-rgb) / 0.92), rgb(var(--signal-rgb) / 0.72));
  box-shadow: 0 28px 64px rgb(var(--button-rgb) / 0.24);
}

.hero-screen::after {
  right: 10%;
  bottom: 14%;
  width: min(18vw, 190px);
  aspect-ratio: 1 / 1;
  border-radius: 52% 48% 44% 56% / 58% 42% 58% 42%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgb(var(--signal-rgb) / 0.12));
  border: 1px solid rgba(17, 32, 51, 0.08);
}

.hero-screen > *,
.hero > * {
  position: relative;
  z-index: 1;
}

.hero-screen h1 {
  max-width: 8.4ch;
  color: var(--foreground);
}

.hero-screen .gradient-text {
  color: var(--button);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(17, 32, 51, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--signal);
}

.tagline,
.hero p {
  max-width: 34rem;
  font-size: 1.03rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.hero {
  padding: 2.4rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  margin-bottom: 0.7rem;
}

.card,
.action-card,
.admin-entry-card,
.stat-card,
.result,
.modal-card,
.carpool-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.card,
.modal-card,
.carpool-card {
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 3vw, 2rem);
}

.card h2,
.modal-card h3,
.carpool-header h2 {
  margin-bottom: 0.35rem;
}

.card-subtitle {
  margin-bottom: 1.3rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.actions {
  text-align: center;
  width: 100%;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.action-card {
  flex: 1 1 260px;
  max-width: 360px;
  padding: 1.7rem;
  border-radius: 26px;
  text-align: left;
  text-decoration: none;
  color: var(--foreground);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.action-card::before {
  content: "";
  position: absolute;
  inset: auto -8% -25% auto;
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--signal-rgb) / 0.14), transparent 68%);
}

.action-card:hover {
  transform: translateY(-3px);
  border-color: rgb(var(--button-rgb) / 0.18);
  box-shadow: 0 22px 56px rgb(var(--shadow-rgb) / 0.14);
}

.action-card .icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-accent);
  color: var(--button);
  font-size: 1.4rem;
}

.action-card h3 {
  margin: 1rem 0 0.45rem;
}

.action-card p {
  font-size: 0.92rem;
}

.btn,
button,
.button-link,
.scroll-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 700;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.btn:hover,
button:hover,
.button-link:hover,
.scroll-button:hover {
  transform: translateY(-1px);
}

.btn-primary,
button,
.button-link {
  background: var(--button);
  color: #ffffff;
  box-shadow: 0 16px 32px rgb(var(--button-rgb) / 0.2);
}

.btn-primary:hover,
button:hover,
.button-link:hover {
  background: var(--button-hover);
  box-shadow: 0 20px 36px rgb(var(--button-rgb) / 0.24);
}

.btn-secondary,
.scroll-button {
  background: rgba(255, 255, 255, 0.62);
  color: var(--foreground);
  border-color: rgba(17, 32, 51, 0.08);
  box-shadow: none;
}

.btn-secondary:hover,
.scroll-button:hover {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(17, 32, 51, 0.12);
}

.btn-danger,
.danger {
  background: var(--danger-bg) !important;
  color: var(--danger) !important;
  border-color: rgb(var(--danger-rgb) / 0.18) !important;
  box-shadow: none !important;
}

.btn-danger:hover,
.danger:hover {
  background: rgb(var(--danger-rgb) / 0.18) !important;
}

.btn-sm {
  min-height: 2.35rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

label,
.form-group label,
label.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.82rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(17, 32, 51, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--foreground);
  font-size: 0.95rem;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(102, 117, 136, 0.72);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgb(var(--button-rgb) / 0.35);
  box-shadow: 0 0 0 4px rgb(var(--button-rgb) / 0.12);
}

input[type="date"],
input[type="time"] {
  color-scheme: light;
}

/* MM/DD/YYYY date field (static/date-input.js) */
.us-date {
  position: relative;
  display: block;
}

.us-date .us-date-text {
  padding-right: 3rem;
}

.us-date .us-date-btn,
html:not(.light-mode) .us-date .us-date-btn {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  width: 2.3rem;
  height: 2.3rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.us-date .us-date-btn:hover,
html:not(.light-mode) .us-date .us-date-btn:hover {
  background: var(--surface-accent);
  color: var(--button);
  box-shadow: none;
}

/* The real date input stays rendered (showPicker needs that) but invisible,
   anchored bottom-right so the calendar opens under the field. */
.us-date .us-date-native {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

select {
  appearance: none;
}

.grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.autocomplete-wrap {
  position: relative;
}

.airline-readonly {
  background: rgb(var(--button-rgb) / 0.08) !important;
  color: var(--button) !important;
  border-color: rgb(var(--button-rgb) / 0.15) !important;
}

.airline-dropdown,
.hamburger-menu,
.flight-suggestions select {
  scrollbar-width: thin;
  scrollbar-color: rgba(17, 32, 51, 0.16) transparent;
}

.airline-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.4rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.airline-dropdown.open {
  display: block;
}

.airline-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.airline-option:hover,
.airline-option.active {
  background: var(--surface-accent);
}

.airline-option .code {
  min-width: 2rem;
  color: var(--button);
  font-weight: 700;
}

.airline-option .name {
  color: var(--muted);
  font-size: 0.84rem;
}

.wizard-card::before {
  content: "";
  position: absolute;
  inset: -10% auto auto 72%;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--button-rgb) / 0.12), transparent 70%);
  pointer-events: none;
}

.wizard-progress {
  margin-bottom: 1.35rem;
}

.wizard-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.wizard-progress-label,
.wizard-step-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wizard-progress-track {
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(17, 32, 51, 0.08);
  overflow: hidden;
}

.wizard-progress-fill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(var(--button-rgb) / 0.88), rgb(var(--signal-rgb) / 0.96));
  transition: width 220ms ease;
}

.wizard-form {
  margin-top: 1.6rem;
}

.wizard-step {
  display: none;
  min-height: 24rem;
  padding: clamp(1.15rem, 2.5vw, 1.6rem);
  border-radius: 28px;
  border: 1px solid rgba(17, 32, 51, 0.08);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(250, 251, 255, 0.86)),
    radial-gradient(circle at top right, rgb(var(--signal-rgb) / 0.12), transparent 36%);
}

.wizard-step.is-active {
  display: block;
  animation: wizard-step-in 220ms ease;
}

.wizard-step-copy {
  max-width: 38rem;
  margin-bottom: 1.2rem;
}

.wizard-step-copy h3 {
  margin: 0.35rem 0 0.35rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
}

.wizard-step-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.wizard-field {
  max-width: 100%;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.wizard-actions .btn {
  min-width: 8.5rem;
}

.modal-actions .btn[hidden],
.wizard-actions .btn[hidden] {
  display: none !important;
}

.wizard-actions #wizard-next,
.wizard-actions #wizard-submit {
  margin-left: auto;
}

.wizard-review {
  padding: 1.1rem;
  border-radius: 24px;
  border: 1px solid rgba(17, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.wizard-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.wizard-review-item {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(17, 32, 51, 0.04);
}

.wizard-review-item-wide {
  grid-column: 1 / -1;
}

.wizard-review-item .label {
  color: var(--muted);
  opacity: 0.82;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

@keyframes wizard-step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flight-suggestions,
.results-container {
  margin-top: 1.35rem;
}

.flight-suggestions select {
  min-height: 0;
  max-height: 16rem;
  padding: 0.35rem;
}

.flight-suggestions small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(17, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.suggestion-item:hover,
.suggestion-item.selected {
  transform: translateY(-1px);
  border-color: rgb(var(--button-rgb) / 0.16);
  box-shadow: 0 18px 36px rgb(var(--shadow-rgb) / 0.1);
}

.suggestion-flight-code {
  color: var(--button);
  font-weight: 700;
}

.suggestion-route,
.suggestion-time {
  font-size: 0.84rem;
}

.result {
  margin-top: 0.95rem;
  padding: 1.2rem;
  border-radius: 24px;
}

.result:hover {
  border-color: rgb(var(--button-rgb) / 0.16);
}

.result-header,
.carpool-header,
.modal-actions,
.result-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Keep result buttons grouped together instead of pushed to opposite edges. */
.result-actions {
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.result-name {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--foreground);
}

.result-badge,
.match-tag,
.member-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-badge.score-high,
.member-badge {
  background: rgb(var(--button-rgb) / 0.12);
  color: var(--button);
}

.result-badge.score-medium {
  background: rgb(var(--signal-rgb) / 0.16);
  color: var(--warning);
}

.result-badge.score-low {
  background: rgba(17, 32, 51, 0.06);
  color: var(--muted);
}

.result-info,
.admin-entry-card .entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.result-info span,
.entry-field {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.result-info .label,
.entry-field .label,
.stat-label {
  color: var(--muted);
  opacity: 0.8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.see-more-notes-btn {
  align-self: flex-start;
  margin-top: 0.4rem;
  min-height: 2rem;
  padding: 0.35rem 0.72rem;
  border-width: 1px;
  font-size: 0.74rem;
  line-height: 1;
  box-shadow: none;
}

.result-detail,
.carpool-members {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}

.match-reasons {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.match-tag {
  background: rgb(var(--signal-rgb) / 0.14);
  color: var(--warning);
}

.message,
#join-message:not(:empty),
.error-banner,
.login-error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  font-size: 0.9rem;
}

.message-success,
#join-message:not(:empty) {
  background: rgb(var(--button-rgb) / 0.08);
  color: var(--button);
  border: 1px solid rgb(var(--button-rgb) / 0.14);
}

.message-error,
.error-banner,
.login-error,
#join-message.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgb(var(--danger-rgb) / 0.18);
}

.join-error-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.75rem;
  border-radius: 999px;
  background: var(--danger-bg);
  border: 1px solid rgb(var(--danger-rgb) / 0.35);
  color: var(--danger);
  font-size: 1.4rem;
  font-weight: 800;
}

.join-error-text {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: var(--danger-bg);
  border: 1px solid rgb(var(--danger-rgb) / 0.25);
  color: var(--foreground);
  font-size: 0.95rem;
}

/* Small text-style action inside a details grid ("+ Add flight"). */
html .link-button {
  display: block;
  align-self: flex-start;
  width: auto;
  text-align: left;
  margin-top: 0.3rem;
  padding: 0;
  min-height: 0;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: var(--button) !important;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

html .link-button:hover {
  text-decoration: underline;
}

.label-optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
}

.flight-info {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.message-info {
  background: rgb(var(--button-rgb) / 0.12);
  color: var(--foreground);
  border: 1px solid rgb(var(--button-rgb) / 0.35);
}

.other-direction-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-align: left;
}

.message-warning {
  background: rgb(var(--signal-rgb) / 0.14);
  color: var(--warning);
  border: 1px solid rgb(var(--signal-rgb) / 0.2);
}

.disclaimer {
  margin-bottom: 1.2rem;
  padding: 0.95rem 1.05rem;
  border-radius: 20px;
  border: 1px solid rgb(var(--signal-rgb) / 0.18);
  background: rgb(var(--signal-rgb) / 0.1);
  font-size: 0.88rem;
  line-height: 1.7;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  text-decoration: none;
  color: var(--button);
  font-weight: 700;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0;
}

.stat-card {
  border-radius: 24px;
  padding: 1.2rem;
  text-align: center;
}

.stat-value {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.3rem;
  font-weight: 600;
  color: var(--button);
}

.table-wrap {
  margin-top: 1.2rem;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
}

.entries-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.entries-table th,
.entries-table td {
  padding: 0.85rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(17, 32, 51, 0.06);
}

.entries-table th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entries-table td {
  color: var(--foreground);
  vertical-align: top;
}

.entries-table tr:hover td {
  background: rgba(255, 255, 255, 0.34);
}

.admin-entry-cards {
  display: none;
}

.admin-entry-card {
  margin-top: 0.9rem;
  padding: 1rem;
  border-radius: 24px;
}

.entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.entry-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.empty-state {
  padding: 2.6rem 1rem;
  text-align: center;
}

.empty-state .icon {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 3.4rem;
  color: var(--signal);
  line-height: 1;
}

.login-page,
.admin-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 240px);
}

.login-card,
.admin-login-card {
  width: min(100%, 470px);
  text-align: center;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.admin-login-form label {
  text-align: left;
}

.google-btn {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.3rem;
  background: rgba(255, 255, 255, 0.74) !important;
  color: var(--foreground) !important;
  border: 1px solid rgba(17, 32, 51, 0.1) !important;
  box-shadow: none !important;
}

.google-btn:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgb(var(--button-rgb) / 0.18) !important;
}

.google-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.google-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.eula-checkbox {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 1rem;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.88rem;
  font-weight: 500;
}

.eula-checkbox input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  min-height: 1.05rem;
  margin-top: 0.1rem;
  accent-color: var(--button);
}

.eula-checkbox a {
  color: var(--button);
}

.eula-wide {
  width: min(1240px, calc(100% - 2rem));
}

.eula-card {
  position: relative;
  padding-right: 4.5rem;
}

.eula-close-btn {
  width: 2.8rem;
  height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(17, 32, 51, 0.08);
  text-decoration: none;
  color: var(--muted);
  font-size: 1.25rem;
}

.eula-close-btn:hover {
  color: var(--button);
}

.eula-panel-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
}

.pdf-viewer {
  margin-top: 1rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.74);
}

.pdf-viewer object {
  display: block;
  width: 100%;
  min-height: 600px;
  height: 80vh;
  border: none;
}

.policy-body {
  font-size: 0.94rem;
  line-height: 1.75;
}

.policy-body h3 {
  margin: 1.5rem 0 0.45rem;
  font-size: 1.15rem;
}

.policy-body h4 {
  margin: 1rem 0 0.35rem;
  font-size: 0.98rem;
  color: var(--foreground);
}

.policy-body p,
.policy-body li {
  color: var(--muted);
}

.policy-body ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}

.policy-meta {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.82;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(17, 32, 51, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-card {
  width: min(100%, 580px);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-copy {
  color: var(--muted);
  line-height: 1.75;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.carpool-card {
  margin-top: 1rem;
}

.carpool-members h3 {
  margin-bottom: 0.7rem;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  list-style: none;
  padding: 0;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(17, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.64);
}

.member-name,
.member-email {
  color: var(--foreground);
  font-size: 0.9rem;
}

.member-email {
  font-family: monospace;
}

.phone-btn {
  height: 2.15rem;
  padding: 0 0.95rem 0 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-shrink: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  background: rgb(var(--button-rgb) / 0.12);
  color: var(--button);
  border: 1px solid rgb(var(--button-rgb) / 0.16);
}

.phone-btn:hover {
  background: rgb(var(--button-rgb) / 0.18);
}

.carpool-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

/* Invite page (/c/<token>) */
.invite-kicker {
  margin-bottom: 0.4rem;
  color: var(--button);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite-card .result-info small {
  color: var(--muted);
  font-size: 0.78rem;
}

.invite-notes {
  margin-top: 1rem;
}

.invite-notes .label {
  color: var(--muted);
  opacity: 0.8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite-notes p {
  margin-top: 0.2rem;
  white-space: pre-wrap;
}

.invite-join {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.invite-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.theme-toggle,
.global-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  color: var(--foreground);
  box-shadow: var(--shadow-soft);
}

.theme-toggle {
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
}

.global-theme-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 999px;
}

.global-theme-toggle .sun-icon,
.global-theme-toggle .moon-icon {
  position: absolute;
  font-size: 1.05rem;
  transition: opacity var(--transition), transform var(--transition);
}

.global-theme-toggle .moon-icon {
  opacity: 0;
  transform: scale(0.78);
}

.light-mode .global-theme-toggle .sun-icon {
  opacity: 0;
  transform: scale(0.78);
}

.light-mode .global-theme-toggle .moon-icon {
  opacity: 1;
  transform: scale(1);
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(17, 32, 51, 0.12);
  border-top-color: var(--button);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.gap-1 {
  gap: 0.5rem;
}

.flex-wrap {
  flex-wrap: wrap;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.text-sm {
  font-size: 0.85rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.4rem 0;
}

.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.compact input {
  width: auto;
  min-width: 4rem;
  min-height: 2.4rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.8rem;
}

.site-footer {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 2rem;
  z-index: 0;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}

html:not(.light-mode) {
  --button-rgb: 125 177 255;
  --signal-rgb: 92 210 255;
  --success-rgb: 118 196 255;
  --warning-rgb: 166 196 255;
  --danger-rgb: 255 129 158;
  --shadow-rgb: 0 0 0;
  --background: #061121;
  --background-alt: #0b1830;
  --foreground: #eef4ff;
  --muted: #94a9cc;
  --surface: rgba(10, 24, 46, 0.8);
  --surface-strong: rgba(8, 19, 38, 0.92);
  --surface-accent: rgb(var(--button-rgb) / 0.14);
  --border: rgba(238, 244, 255, 0.08);
  --button: rgb(var(--button-rgb));
  --button-hover: rgb(151 195 255);
  --signal: rgb(var(--signal-rgb));
  --signal-soft: rgb(var(--signal-rgb) / 0.16);
  --danger: rgb(var(--danger-rgb));
  --danger-bg: rgb(var(--danger-rgb) / 0.12);
  --success: rgb(var(--success-rgb));
  --warning: rgb(var(--warning-rgb));
  --shadow: 0 26px 90px rgb(var(--shadow-rgb) / 0.42);
  --shadow-soft: 0 16px 44px rgb(var(--shadow-rgb) / 0.26);
  --accent-glow: rgb(var(--button-rgb) / 0.16);
}

html:not(.light-mode) body {
  background:
    radial-gradient(circle at top left, rgb(var(--signal-rgb) / 0.14), transparent 32%),
    radial-gradient(circle at top right, rgb(var(--button-rgb) / 0.16), transparent 24%),
    linear-gradient(180deg, #102041 0%, #061121 100%);
}

html:not(.light-mode) body::before {
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(236, 240, 242, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 240, 242, 0.04) 1px, transparent 1px);
}

html:not(.light-mode) body::after {
  background:
    radial-gradient(circle at 16% 24%, rgb(var(--button-rgb) / 0.12), transparent 24%),
    radial-gradient(circle at 82% 74%, rgb(var(--signal-rgb) / 0.1), transparent 20%);
}

html:not(.light-mode) code {
  background: rgba(236, 240, 242, 0.08);
  color: var(--foreground);
}

html:not(.light-mode) .site-header {
  background: rgba(8, 19, 38, 0.86);
  border-color: rgba(236, 240, 242, 0.08);
}

html:not(.light-mode) .site-logo,
html:not(.light-mode) .result-name,
html:not(.light-mode) .member-name,
html:not(.light-mode) .member-email,
html:not(.light-mode) .action-card,
html:not(.light-mode) .action-card h3,
html:not(.light-mode) .stat-value,
html:not(.light-mode) .result-info strong,
html:not(.light-mode) .policy-body h4 {
  color: var(--foreground);
}

html:not(.light-mode) .site-header .admin-login,
html:not(.light-mode) .notif-bell-btn,
html:not(.light-mode) .hamburger-btn,
html:not(.light-mode) .btn-secondary,
html:not(.light-mode) .scroll-button,
html:not(.light-mode) .google-btn,
html:not(.light-mode) input,
html:not(.light-mode) textarea,
html:not(.light-mode) select,
html:not(.light-mode) .airline-dropdown,
html:not(.light-mode) .suggestion-item,
html:not(.light-mode) .member-item,
html:not(.light-mode) .table-wrap,
html:not(.light-mode) .pdf-viewer,
html:not(.light-mode) .eula-close-btn {
  background: rgba(236, 240, 242, 0.04) !important;
  border-color: rgba(236, 240, 242, 0.08) !important;
  color: var(--foreground) !important;
}

html:not(.light-mode) .hamburger-btn span {
  background: var(--foreground);
}

html:not(.light-mode) .notif-bell-dot {
  box-shadow: 0 0 0 2px rgba(8, 19, 38, 0.96);
}

html:not(.light-mode) .notif-bell-btn:hover,
html:not(.light-mode) .hamburger-btn:hover,
html:not(.light-mode) .google-btn:hover {
  background: rgba(236, 240, 242, 0.08) !important;
  border-color: rgba(236, 240, 242, 0.1) !important;
}

html:not(.light-mode) .hamburger-menu {
  background: rgba(8, 19, 38, 0.96);
  border-color: rgba(236, 240, 242, 0.08);
  box-shadow: var(--shadow);
}

html:not(.light-mode) .hamburger-menu a,
html:not(.light-mode) .menu-email,
html:not(.light-mode) .nav-links a,
html:not(.light-mode) .my-party-btn,
html:not(.light-mode) p,
html:not(.light-mode) li,
html:not(.light-mode) .card-subtitle,
html:not(.light-mode) .tagline,
html:not(.light-mode) .result-info span,
html:not(.light-mode) .entry-field,
html:not(.light-mode) .site-footer,
html:not(.light-mode) .text-muted,
html:not(.light-mode) .policy-body p,
html:not(.light-mode) .policy-body li,
html:not(.light-mode) .policy-meta {
  color: var(--muted);
}

html:not(.light-mode) .nav-links a:hover,
html:not(.light-mode) .my-party-btn:hover,
html:not(.light-mode) .hamburger-menu a:hover,
html:not(.light-mode) .hamburger-menu .menu-button:hover,
html:not(.light-mode) .btn-secondary:hover,
html:not(.light-mode) .scroll-button:hover {
  color: var(--foreground) !important;
  background: rgba(236, 240, 242, 0.08) !important;
  border-color: rgba(236, 240, 242, 0.1) !important;
}

html:not(.light-mode) .nav-links a.active,
html:not(.light-mode) .my-party-btn.active,
html:not(.light-mode) .hamburger-menu a.active,
html:not(.light-mode) .badge,
html:not(.light-mode) .action-card .icon,
html:not(.light-mode) .result-badge.score-high,
html:not(.light-mode) .member-badge {
  color: var(--foreground) !important;
  background: rgb(var(--button-rgb) / 0.16) !important;
  border-color: rgb(var(--button-rgb) / 0.24) !important;
}

html:not(.light-mode) .site-logo::before,
html:not(.light-mode) .badge::before {
  background: var(--button);
  box-shadow: 0 0 0 6px rgb(var(--button-rgb) / 0.14);
}

html:not(.light-mode) .card,
html:not(.light-mode) .action-card,
html:not(.light-mode) .admin-entry-card,
html:not(.light-mode) .stat-card,
html:not(.light-mode) .result,
html:not(.light-mode) .modal-card,
html:not(.light-mode) .carpool-card,
html:not(.light-mode) .hero,
html:not(.light-mode) .hero-screen {
  background:
    radial-gradient(circle at top right, rgb(var(--signal-rgb) / 0.08), transparent 24%),
    linear-gradient(145deg, rgba(10, 24, 46, 0.9), rgba(6, 17, 33, 0.88));
  border-color: rgba(236, 240, 242, 0.08);
  box-shadow: var(--shadow-soft);
}

html:not(.light-mode) .hero-screen::before {
  background: linear-gradient(145deg, rgb(var(--button-rgb) / 0.9), rgb(var(--signal-rgb) / 0.76));
}

html:not(.light-mode) .hero-screen::after {
  background: linear-gradient(145deg, rgba(26, 45, 78, 0.94), rgba(8, 19, 38, 0.9));
  border-color: rgba(236, 240, 242, 0.06);
}

html:not(.light-mode) .btn-primary,
html:not(.light-mode) button,
html:not(.light-mode) .button-link {
  background: var(--button);
  color: #071223;
  box-shadow: 0 18px 32px rgb(var(--button-rgb) / 0.2);
}

html:not(.light-mode) .btn-primary:hover,
html:not(.light-mode) button:hover,
html:not(.light-mode) .button-link:hover {
  background: var(--button-hover);
  box-shadow: 0 22px 38px rgb(var(--button-rgb) / 0.24);
}

html:not(.light-mode) .btn-danger,
html:not(.light-mode) .danger,
html:not(.light-mode) .menu-logout {
  color: var(--danger) !important;
}

html:not(.light-mode) input::placeholder,
html:not(.light-mode) textarea::placeholder {
  color: rgba(155, 170, 178, 0.72);
}

html:not(.light-mode) input:focus,
html:not(.light-mode) textarea:focus,
html:not(.light-mode) select:focus {
  background: rgba(236, 240, 242, 0.06) !important;
  border-color: rgb(var(--button-rgb) / 0.32) !important;
  box-shadow: 0 0 0 4px rgb(var(--button-rgb) / 0.12);
}

html:not(.light-mode) .airline-option:hover,
html:not(.light-mode) .airline-option.active,
html:not(.light-mode) .suggestion-item:hover,
html:not(.light-mode) .suggestion-item.selected,
html:not(.light-mode) .result:hover,
html:not(.light-mode) .entries-table tr:hover td {
  background: rgba(236, 240, 242, 0.05) !important;
  border-color: rgb(var(--button-rgb) / 0.18);
}

html:not(.light-mode) .airline-option .code,
html:not(.light-mode) .suggestion-flight-code,
html:not(.light-mode) .phone-btn,
html:not(.light-mode) .back {
  color: var(--button);
}

html:not(.light-mode) .phone-btn {
  background: rgb(var(--button-rgb) / 0.12);
  border-color: rgb(var(--button-rgb) / 0.18);
}

html:not(.light-mode) .result-badge.score-medium,
html:not(.light-mode) .match-tag,
html:not(.light-mode) .message-warning {
  background: rgb(var(--signal-rgb) / 0.14) !important;
  color: var(--warning) !important;
  border-color: rgb(var(--signal-rgb) / 0.2) !important;
}

html:not(.light-mode) .result-badge.score-low {
  background: rgba(236, 240, 242, 0.06);
  color: var(--muted);
}

html:not(.light-mode) .message-success,
html:not(.light-mode) #join-message:not(:empty) {
  background: rgb(var(--signal-rgb) / 0.12);
  border-color: rgb(var(--signal-rgb) / 0.18);
  color: var(--success);
}

html:not(.light-mode) .message-error,
html:not(.light-mode) .error-banner,
html:not(.light-mode) .login-error,
html:not(.light-mode) #join-message.error {
  background: var(--danger-bg);
  border-color: rgb(var(--danger-rgb) / 0.18);
  color: var(--danger);
}

html:not(.light-mode) .disclaimer {
  background: rgb(var(--signal-rgb) / 0.1);
  border-color: rgb(var(--signal-rgb) / 0.16);
}

html:not(.light-mode) .wizard-step,
html:not(.light-mode) .wizard-review,
html:not(.light-mode) .wizard-review-item {
  background: rgba(236, 240, 242, 0.04);
  border-color: rgba(236, 240, 242, 0.08);
}

html:not(.light-mode) .wizard-progress-track {
  background: rgba(236, 240, 242, 0.08);
}

html:not(.light-mode) .wizard-step-copy h3,
html:not(.light-mode) .wizard-review-item strong,
html:not(.light-mode) #wizard-progress-text {
  color: var(--foreground);
}

html:not(.light-mode) .entries-table th {
  background: rgba(8, 19, 38, 0.96);
  color: var(--muted);
}

html:not(.light-mode) .entries-table td {
  color: var(--foreground);
  border-bottom-color: rgba(236, 240, 242, 0.05);
}

html:not(.light-mode) .menu-divider,
html:not(.light-mode) .result-detail,
html:not(.light-mode) .carpool-members {
  border-color: rgba(236, 240, 242, 0.08);
}

html:not(.light-mode) .global-theme-toggle,
html:not(.light-mode) .theme-toggle {
  background: rgba(8, 19, 38, 0.88);
  border-color: rgba(236, 240, 242, 0.08);
  color: var(--foreground);
}

@media (max-width: 1024px) {
  .hero-screen {
    min-height: 0;
    padding-right: 18rem;
  }

  .site-header .nav-links {
    display: none;
  }

  .site-header .hamburger-menu .mobile-nav-link,
  .site-header .hamburger-menu .mobile-party-link {
    display: block;
  }

  .admin-entry-cards {
    display: block;
  }

  .table-wrap {
    display: none;
  }
}

@media (max-width: 860px) {
  main {
    padding: 0.85rem;
  }

  .container,
  .site-header,
  .hero-screen,
  .hero,
  .site-footer,
  .eula-wide {
    width: calc(100% - 1rem);
  }

  .site-header {
    margin-top: 0.7rem;
    border-radius: 28px;
    padding: 0.8rem 0.9rem;
    gap: 0.7rem;
  }

  .site-header .admin-login {
    width: 100%;
    border-radius: 24px;
  }

  .site-header .admin-login input {
    flex: 1 1 160px;
    width: auto;
  }

  .site-logo .logo-short {
    display: none;
  }

  .site-logo .logo-full {
    display: inline;
  }

  .hero-screen,
  .hero {
    margin-top: 1rem;
    border-radius: 28px;
  }

  .hero-screen {
    min-height: 0;
    padding: 1.85rem 1.55rem 1.65rem;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    gap: 1rem;
  }

  .hero-screen h1 {
    max-width: none;
  }

  .hero-screen::before,
  .hero-screen::after {
    opacity: 0.6;
  }

  .hero-screen::before {
    width: 7rem;
    top: 1.1rem;
    right: -1.2rem;
    opacity: 0.34;
  }

  .hero-screen::after {
    width: 5.25rem;
    right: auto;
    left: -1.6rem;
    bottom: 2rem;
    opacity: 0.26;
  }

  .badge {
    justify-content: center;
    max-width: min(100%, 18rem);
    line-height: 1.35;
    text-align: center;
  }

  .tagline,
  .hero p {
    max-width: 28rem;
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .hero-cta,
  .button-row,
  .carpool-actions,
  .result-actions,
  /* Cancel first in the markup, so the main action ends up at the bottom,
     nearest the thumb, the same as the carpool card buttons. */
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .action-card {
    max-width: none;
    /* In the stacked (column) layout the 260px flex-basis would become a
       minimum height and leave empty space at the bottom of each card. */
    flex: 0 0 auto;
  }

  .grid,
  .form-grid,
  .modal-grid,
  .result-info,
  .admin-entry-card .entry-grid {
    grid-template-columns: 1fr;
  }

  .wizard-step {
    min-height: 0;
  }

  .wizard-review-grid {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    flex-wrap: wrap;
  }

  .my-party-btn {
    margin-left: 0;
  }

  .site-header.app-header {
    flex-wrap: nowrap;
  }

  .site-header.app-header .site-logo {
    margin-right: auto;
  }

  .eula-card {
    padding-right: 1.35rem;
    padding-top: 3.6rem;
  }

  .wizard-step {
    padding: 1rem;
    border-radius: 24px;
  }

  .wizard-progress-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .wizard-actions .btn {
    width: 100%;
  }

  .wizard-actions #wizard-next,
  .wizard-actions #wizard-submit,
  .wizard-actions #wizard-back {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.8rem;
    gap: 0.65rem;
  }

  .hamburger-wrap {
    margin-left: auto;
    flex: 0 0 auto;
  }

  .hamburger-btn,
  .notif-bell-btn {
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
  }

  .hamburger-wrap {
    gap: 0.4rem;
  }

  .site-header.app-header {
    gap: 0.45rem;
  }

  .site-header .site-logo {
    min-width: 0;
  }

  /* Keep "My Carpool" on one line next to the bell and menu buttons. */
  .my-party-btn {
    flex: 0 0 auto;
    min-height: 2.25rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .hamburger-menu {
    min-width: min(250px, calc(100vw - 1.8rem));
    top: calc(100% + 0.45rem);
  }

  .site-logo {
    font-size: 1.08rem;
  }

  .nav-links {
    margin-right: 0;
  }

  .site-header .admin-login {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-screen {
    padding: 1.45rem 1.15rem 1.3rem;
    margin-top: 0.9rem;
    border-radius: 30px;
    gap: 0.9rem;
  }

  .hero-screen::before {
    width: 6.3rem;
    top: 1rem;
    right: -1.6rem;
    opacity: 0.28;
  }

  .hero-screen::after {
    display: none;
  }

  .badge {
    min-height: 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    max-width: 16rem;
  }

  h1 {
    font-size: clamp(2.45rem, 12.2vw, 3.8rem);
    line-height: 0.98;
  }

  .tagline,
  .hero p {
    font-size: 0.96rem;
    line-height: 1.68;
  }

  .hero-cta {
    width: 100%;
    justify-content: center;
  }

  .hero-cta .btn {
    min-width: 9.5rem;
  }

  h2 {
    font-size: clamp(1.8rem, 9vw, 2.5rem);
  }

  .card,
  .modal-card,
  .carpool-card {
    padding: 1.2rem;
  }

  .global-theme-toggle {
    width: 3rem;
    height: 3rem;
    right: 0.7rem;
    bottom: 0.7rem;
  }

  /* On phones the floating button covers content, so pages with a menu
     show the toggle inside it instead. */
  .has-menu-theme-toggle .global-theme-toggle {
    display: none;
  }

  .menu-theme-toggle {
    display: block !important;
  }

  .site-footer {
    padding-bottom: 4.2rem;
    font-size: 0.92rem;
  }
}

/* ---------------------------------------------------------------------------
   Admin dashboard (templates/admin.html, static/admin-dashboard.js)
   Chart colors are validated categorical slots 1-3, stepped per theme.
   --------------------------------------------------------------------------- */
.dash {
  --viz-1: #3987e5;
  --viz-2: #d95926;
  --viz-3: #199e70;
  --viz-grid: rgba(236, 240, 242, 0.08);
  --viz-axis: rgba(236, 240, 242, 0.18);
  width: min(1320px, calc(100% - 2rem));
}

.light-mode .dash {
  --viz-1: #2a78d6;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --viz-grid: rgba(17, 40, 74, 0.07);
  --viz-axis: rgba(17, 40, 74, 0.18);
}

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.dash-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.dash-range {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.dash-range a {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.dash-range a.is-active,
.dash-range a:hover {
  background: var(--surface-accent);
  color: var(--foreground);
}

.dash-note {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dash-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.dash-kpi-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Same sans as the rest of the UI, proportional figures. */
.dash-kpi-value {
  color: var(--foreground);
  font-family: inherit;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
}

.dash-kpi-sub {
  color: var(--muted);
  font-size: 0.78rem;
}

.dash-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dash-chart {
  margin: 0;
  padding: 1.1rem 1.2rem;
  min-width: 0;
}

.dash-chart-wide {
  grid-column: 1 / -1;
}

.dash-chart figcaption h3 {
  margin: 0;
  font-size: 1rem;
}

.dash-chart figcaption p {
  margin: 0.1rem 0 0;
}

.dash-plot {
  margin-top: 0.75rem;
  min-width: 0;
}

.dash-plot svg {
  display: block;
  max-width: 100%;
  overflow: visible;
}

.dash-grid {
  stroke: var(--viz-grid);
  stroke-width: 1;
}

.dash-axis {
  stroke: var(--viz-axis);
  stroke-width: 1;
}

.dash-tick,
.dash-cat {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dash-cat {
  fill: var(--foreground);
  font-size: 12px;
  font-weight: 600;
}

.dash-value {
  fill: var(--foreground);
  font-size: 11px;
  font-weight: 700;
}

.dash-bar {
  fill: var(--viz-1);
  transition: opacity var(--transition);
}

.dash-bar.is-hover {
  opacity: 0.75;
}

.dash-hit {
  fill: transparent;
  cursor: default;
  outline: none;
}

.dash-hit:focus-visible {
  stroke: var(--viz-1);
  stroke-width: 1;
}

.dash-seg-matched { fill: var(--viz-1); background: var(--viz-1); }
.dash-seg-solo { fill: var(--viz-2); background: var(--viz-2); }
.dash-seg-cancelled { fill: var(--viz-3); background: var(--viz-3); }
.dash-seg-to { fill: var(--viz-1); background: var(--viz-1); }
.dash-seg-from { fill: var(--viz-2); background: var(--viz-2); }
.dash-seg.is-hover { opacity: 0.8; }

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.dash-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.dash-legend strong {
  color: var(--foreground);
}

.dash-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.dash-chart-total {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.dash-empty {
  padding: 1.5rem 0;
}

.dash-tableview {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.dash-tableview summary {
  color: var(--muted);
  cursor: pointer;
}

.dash-tableview .dash-table {
  margin-top: 0.4rem;
  max-height: 240px;
}

.dash-tooltip {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 0.78rem;
  pointer-events: none;
}

.dash-tooltip[hidden] {
  display: none;
}

.dash-tooltip strong {
  color: var(--foreground);
  font-size: 0.95rem;
}

html:not(.light-mode) .dash-tooltip,
html:not(.light-mode) .dash-kpi {
  background: rgba(8, 19, 38, 0.92);
  border-color: rgba(236, 240, 242, 0.08);
}

.dash-section {
  margin-bottom: 1rem;
}

.dash-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.dash-section-head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.dash-count {
  margin-left: 0.35rem;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}

.dash-filter {
  width: min(320px, 100%);
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
}

.dash-table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dash-tableview .dash-table {
  display: block;
  overflow-y: auto;
}

.dash-table th,
.dash-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.dash-table th {
  position: sticky;
  top: 0;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html:not(.light-mode) .dash-table th {
  background: rgb(10 22 42);
}

.dash-table td.num,
.dash-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dash-table tbody tr:last-child td {
  border-bottom: 0;
}

.dash-row-toggle {
  cursor: pointer;
}

.dash-row-toggle:hover,
.dash-row-toggle:focus-visible,
.dash-row-toggle.is-open {
  background: var(--surface-accent);
  outline: none;
}

.dash-chev {
  color: var(--muted);
  transition: transform var(--transition);
}

.dash-row-toggle.is-open .dash-chev {
  transform: rotate(180deg);
}

.dash-detail td {
  white-space: normal;
  background: var(--surface);
}

.dash-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  padding: 0.25rem 0;
}

.dash-detail-grid h4 {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dash-members {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-members li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
}

.dash-notes {
  margin: 0 0 0.75rem;
  white-space: pre-wrap;
}

.dash-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dash-actions form {
  margin: 0;
}

.dash-detail-text {
  max-width: 320px;
  white-space: normal !important;
  color: var(--muted);
}

.dash-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-accent);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
}

.dash-join-limit {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.dash-limit-blocked {
  color: var(--danger);
  font-weight: 600;
}

.dash-danger {
  border-color: var(--danger-bg);
}

.dash-danger h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
}

.dash-danger form {
  margin-top: 0.75rem;
}

@media (max-width: 720px) {
  .dash-detail-grid {
    grid-template-columns: 1fr;
  }

  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-kpi-value {
    font-size: 1.6rem;
  }
}

/* Avoid a lone word on the last line of big headings. */
h1,
h2 {
  text-wrap: balance;
}

.home-actions {
  margin-top: 4rem;
}

@media (max-width: 560px) {
  .home-actions {
    margin-top: 0.5rem;
  }
}

/* Keep long page titles clear of the close (✕) button. */
.eula-card h2 {
  padding-right: 3.2rem;
}

/* Phones can't show a PDF inside the page; don't reserve a tall empty box
   for it. The fallback text and the "Open PDF" button remain. */
@media (max-width: 860px) {
  .pdf-viewer object {
    min-height: 0;
    height: auto;
  }
}

/* Trip direction picker (create carpool, step 1) */
.direction-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.direction-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  /* These are <label>s; undo the small-caps form-label styling. */
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  font-weight: 400;
  padding: 1.1rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.direction-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.direction-option:hover {
  border-color: rgb(var(--button-rgb) / 0.35);
}

.direction-option.is-selected {
  border-color: var(--button);
  background: var(--surface-accent);
}

.direction-option:focus-within {
  box-shadow: 0 0 0 4px rgb(var(--button-rgb) / 0.18);
}

.direction-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.direction-title {
  color: var(--foreground);
  font-size: 1.05rem;
  font-weight: 700;
}

.direction-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Small "To LAX" / "From LAX" label used on cards */
.trip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-accent);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Trip direction field on Find a Carpool: the first field of the search grid,
   tinted blue / orange like the trip cards. */
.search-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.select-wrap {
  position: relative;
  display: block;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select.direction-select {
  padding-right: 2.6rem;
  font-weight: 600;
  cursor: pointer;
}

/* !important to beat the dark theme's input border override. */
html select.direction-select.trip-to,
html select.direction-select.trip-from {
  border-left: 5px solid var(--trip-color) !important;
}

@media (max-width: 560px) {
  .direction-choice {
    grid-template-columns: 1fr;
  }

}

/* ---------------------------------------------------------------------------
   Trip identity: color by direction (same blue/orange as the admin chart),
   used on My Carpool, search results, invite pages and the admin tables.
   Color is never the only cue: every place also shows the icon and text.
   --------------------------------------------------------------------------- */
:root {
  --trip-to: #3987e5;
  --trip-from: #d95926;
  --trip-to-bg: rgb(57 135 229 / 0.18);
  --trip-from-bg: rgb(217 89 38 / 0.2);
}

.light-mode {
  --trip-to: #2a78d6;
  --trip-from: #eb6834;
  --trip-to-bg: rgb(42 120 214 / 0.12);
  --trip-from-bg: rgb(235 104 52 / 0.14);
}

.trip-to { --trip-color: var(--trip-to); --trip-bg: var(--trip-to-bg); }
.trip-from { --trip-color: var(--trip-from); --trip-bg: var(--trip-from-bg); }

.trip-card {
  position: relative;
}

/* Colored stripe down the left edge of the card (clipped by its radius). */
.trip-stripe {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 6px;
  background: var(--trip-color);
  pointer-events: none;
}

.trip-badge.trip-to,
.trip-badge.trip-from {
  background: var(--trip-bg);
  box-shadow: inset 0 0 0 1px var(--trip-color);
}

.trip-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.trip-countdown {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

html:not(.light-mode) .trip-countdown {
  border-color: rgba(236, 240, 242, 0.16);
}

/* "Your carpools" switcher at the top of My Carpool. */
.trip-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.trip-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.trip-chip:hover {
  background: var(--trip-bg);
  border-color: var(--trip-color);
}

.trip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--trip-color);
  flex: 0 0 auto;
}

/* Land jumped-to cards below the page header. */
.trip-card[id] {
  scroll-margin-top: 1rem;
}

.result.trip-card {
  padding-left: calc(1.25rem + 6px);
}

@media (max-width: 560px) {
  .trip-switcher {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
  }
}

/* Phones: show the short "C2A" logo to free up room in the header. */
@media (max-width: 560px) {
  .site-logo .logo-full {
    display: none;
  }

  .site-logo .logo-short {
    display: inline;
  }
}

/* Terms of Service page */
.terms-actions {
  margin: 0.25rem 0 1.25rem;
}

.terms-summary {
  margin: 1rem 0 1.5rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--button);
  border-radius: 16px;
  background: var(--surface-accent);
}

.terms-summary h3 {
  margin-top: 0;
}

.terms-body h3 {
  scroll-margin-top: 1rem;
}

.terms-caps {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.terms-body blockquote {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--border);
  font-style: italic;
}

/* Printing / PDF export: just the document. */
@media print {
  .site-header,
  .site-footer,
  .global-theme-toggle,
  .eula-close-btn,
  .terms-actions {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .card {
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    padding: 0 !important;
  }

  .terms-body h3 {
    break-after: avoid;
  }
}

/* Field flagged by form validation (e.g. time without a date). Kept at the
   end and doubled up so it beats the theme's input and focus borders. */
html .field-invalid.field-invalid input,
html .field-invalid.field-invalid input:focus {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgb(var(--danger-rgb) / 0.22) !important;
}

/* Trip headings ("UCR → ONT · Fri, Oct 23") fit on one line on phones. */
@media (max-width: 560px) {
  .carpool-header h2,
  .invite-card h2 {
    font-size: 1.65rem;
    line-height: 1.15;
  }
}

/* "Who can see your information" table in the Privacy Policy. */
.policy-table-wrap {
  margin: 0.8rem 0 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.policy-table {
  min-width: 34rem;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.policy-table th,
.policy-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.policy-table th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.policy-table td:first-child {
  font-weight: 600;
  color: var(--foreground);
}
