/* ==========================================================================
   Madrive — design system, v3 "Le corridor"
   The subject is the road between Québec's cities, so the identity comes
   from it: the St. Lawrence corridor drawn as a map (the one bold element,
   on the home page), the yellow lane line that joins every origin to its
   destination, and trips presented as tickets with a tear-off stub.
   Everything around those three ideas stays calm: white surfaces on a cool
   mist background, one typeface (Overpass, the open-source heir of the
   Highway Gothic sign alphabet) used across its full weight range.
   ========================================================================== */

@font-face { font-family: "Overpass"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/overpass-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/overpass-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Overpass"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/overpass-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }

:root {
  /* Palette */
  --ink: #102227;          /* text */
  --ink-2: #4A5D62;        /* secondary text */
  --ink-3: #7B8C90;        /* tertiary text, placeholders */
  --river: #0A3640;        /* deep St. Lawrence: hero, header on dark pages, footer */
  --river-2: #0F4652;      /* river surfaces one step up */
  --river-3: #1A5A67;      /* water on the map, borders on dark */
  --on-river: #D7E7E6;     /* body text on river */
  --on-river-2: #92B1B2;   /* secondary text on river */
  --pine: #0E7C64;         /* actions and links (AA on white) */
  --pine-strong: #0A604E;
  --pine-tint: #E1F2EB;
  --lane: #FFC53D;         /* lane-marking yellow: routes and the main search action only */
  --lane-strong: #F2B01E;
  --lane-tint: #FFF5D9;
  --bg: #F2F5F3;           /* page background (cool mist) */
  --paper: #FFFFFF;
  --line: #DFE6E3;
  --line-2: #ECF1EF;
  --signal: #BE3B26;       /* errors and destructive actions */
  --signal-tint: #FCEBE6;
  --info: #22577A;
  --info-tint: #E6EFF6;

  /* Type: one family, contrast through weight and size (perfect fourth above body) */
  --f: "Overpass", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --t-xs: .8125rem; --t-sm: .9063rem; --t-base: 1rem; --t-md: 1.125rem; --t-lg: 1.375rem;
  --t-xl: 1.75rem; --t-2xl: 2.25rem; --t-3xl: clamp(2.25rem, 4vw, 3.1rem);
  --t-hero: clamp(2.9rem, 6.4vw, 5.6rem);

  --r-xs: 6px; --r-sm: 10px; --r: 14px; --r-lg: 22px;
  --shadow-1: 0 1px 2px rgba(16,34,39,.05);
  --shadow-2: 0 1px 2px rgba(16,34,39,.05), 0 8px 24px -8px rgba(16,34,39,.12);
  --shadow-3: 0 2px 4px rgba(10,54,64,.08), 0 24px 56px -16px rgba(10,54,64,.35);
  --wrap: 1200px;
  --header-h: 68px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--pine);
  --notch-bg: var(--bg);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--t-base)/1.6 var(--f);
  font-feature-settings: "tnum" 1, "kern" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
svg.icon { display: inline-block; vertical-align: -0.18em; fill: none; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pine-strong); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; color: inherit; text-wrap: balance; }
h1 { font-size: var(--t-2xl); letter-spacing: -0.03em; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); font-weight: 750; letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
small, .small { font-size: var(--t-sm); }
.muted { color: var(--ink-2); }
.icon { width: 1.15em; height: 1.15em; flex: none; }
.icon-lg { width: 1.5em; height: 1.5em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
::selection { background: var(--lane); color: var(--ink); }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
.wrap-auth { width: min(100% - 2rem, 470px); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.row-center { justify-content: center; }
.grid-2 { display: grid; gap: 1rem 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 1rem 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.grid-2 > .panel, .grid-3 > .panel { margin-top: 0; }
.skip-link { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: var(--r-xs); z-index: 99; }
.skip-link:focus { left: .5rem; color: #fff; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 850; font-size: 1.45rem; letter-spacing: -0.045em; line-height: 1; }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; color: var(--pine); }
.nav { display: flex; gap: .2rem; align-items: center; margin-left: auto; }
.nav > a { color: var(--ink); text-decoration: none; font-weight: 650; padding: .5rem .8rem; border-radius: 999px; display: inline-flex; gap: .45rem; align-items: center; transition: background .15s; }
.nav > a:hover, .nav > a.is-active { background: var(--line-2); color: var(--ink); }
.nav > a.btn { margin-left: .35rem; padding-inline: 1.05rem; }
.lang-switch { margin-left: .35rem; font-weight: 750 !important; font-size: var(--t-xs); letter-spacing: .04em; color: var(--ink-2) !important; border: 1px solid var(--line); padding: .32rem .6rem !important; border-radius: 999px !important; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; padding: .5rem; color: inherit; cursor: pointer; border-radius: 10px; }
.user-menu { position: relative; margin-left: .25rem; }
.user-menu > button { display: inline-flex; align-items: center; gap: .5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .22rem .65rem .22rem .22rem; font: inherit; font-weight: 650; color: var(--ink); cursor: pointer; }
.user-menu > button:hover { border-color: #C3CFCB; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-3); padding: .45rem; display: none; }
.user-menu.open .menu { display: block; animation: pop .16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.user-menu .menu a, .user-menu .menu button { display: flex; width: 100%; gap: .65rem; align-items: center; padding: .6rem .75rem; color: var(--ink); text-decoration: none; border-radius: var(--r-xs); font: inherit; font-weight: 550; background: none; border: 0; cursor: pointer; text-align: left; }
.user-menu .menu a .icon, .user-menu .menu button .icon { color: var(--ink-3); }
.user-menu .menu a:hover, .user-menu .menu button:hover { background: var(--line-2); }
.user-menu .menu hr { border: 0; border-top: 1px solid var(--line); margin: .35rem 0; }

/* Dark header: home, search, trip pages and sign-in pages sit on the river colour */
.dark-top .site-header { background: var(--river); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.dark-top .site-header.is-scrolled { border-bottom-color: rgba(255,255,255,.08); }
.dark-top .brand, .dark-top .nav > a, .dark-top .menu-toggle { color: #fff; }
.dark-top .brand svg { color: var(--lane); }
.dark-top .nav > a:hover, .dark-top .nav > a.is-active { background: rgba(255,255,255,.1); color: #fff; }
.dark-top .nav > a.btn { background: var(--lane); border-color: var(--lane); color: var(--ink); }
.dark-top .nav > a.btn:hover { background: var(--lane-strong); border-color: var(--lane-strong); }
.dark-top .lang-switch { color: var(--on-river) !important; border-color: rgba(255,255,255,.22); }
.dark-top .user-menu > button { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: var(--header-h); background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: .75rem 1.25rem 1.25rem; box-shadow: var(--shadow-3); }
  .nav.open { display: flex; animation: pop .16s var(--ease); }
  .nav > a { border-radius: var(--r-xs); padding: .75rem .8rem; }
  .nav > a.btn { margin: .4rem 0 0; }
  .lang-switch { align-self: flex-start; margin: .5rem 0 0; }
  .user-menu { margin: 0; }
  .user-menu .menu { position: static; display: block; box-shadow: none; border: 0; padding: 0; border-top: 1px solid var(--line); border-radius: 0; margin-top: .4rem; padding-top: .4rem; }
  .user-menu > button { display: none; }
  .dark-top .nav { background: var(--river-2); border-bottom-color: transparent; }
  .dark-top .user-menu .menu { background: transparent; border-top-color: rgba(255,255,255,.12); }
  .dark-top .user-menu .menu a, .dark-top .user-menu .menu button { color: #fff; }
  .dark-top .user-menu .menu a .icon, .dark-top .user-menu .menu button .icon { color: var(--on-river-2); }
  .dark-top .user-menu .menu a:hover, .dark-top .user-menu .menu button:hover { background: rgba(255,255,255,.08); }
  .dark-top .user-menu .menu hr { border-top-color: rgba(255,255,255,.12); }
}

/* ---------- Avatar ---------- */
.avatar { --av: var(--pine-tint); --av-fg: var(--pine-strong);
  width: 38px; height: 38px; border-radius: 50%; background: var(--av); color: var(--av-fg);
  display: inline-grid; place-items: center; font-weight: 800; font-size: .95rem; object-fit: cover; flex: none; overflow: hidden; line-height: 1; padding-top: .12em; }
img.avatar { padding: 0; }
.avatar.av-1 { --av: #FFF0CC; --av-fg: #7A5300; }
.avatar.av-2 { --av: #E3ECF8; --av-fg: #24508A; }
.avatar.av-3 { --av: #FBE5DD; --av-fg: #8F3A1E; }
.avatar.av-4 { --av: #EDE6F7; --av-fg: #5A3C8C; }
.avatar.av-5 { --av: #E0F1F4; --av-fg: #155D6B; }
.avatar-sm { width: 30px; height: 30px; font-size: .8rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* ---------- Buttons ---------- */
.btn { --bg: var(--pine); --fg: #fff; --bd: var(--pine);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .6rem 1.25rem; border-radius: 999px; border: 1.5px solid var(--bd);
  background: var(--bg); color: var(--fg); font: 750 var(--t-base)/1.1 var(--f); letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.btn:hover { --bg: var(--pine-strong); --bd: var(--pine-strong); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn > .icon { margin-top: -.1em; }
.btn-secondary { --bg: var(--paper); --fg: var(--ink); --bd: var(--line); }
.btn-secondary:hover { --bg: var(--line-2); --bd: #C3CFCB; --fg: var(--ink); }
.btn-ghost { --bg: transparent; --fg: var(--pine); --bd: transparent; }
.btn-ghost:hover { --bg: var(--pine-tint); --bd: transparent; --fg: var(--pine-strong); }
.btn-danger { --bg: var(--paper); --fg: var(--signal); --bd: #EBC0B5; }
.btn-danger:hover { --bg: var(--signal); --fg: #fff; --bd: var(--signal); }
.btn-lane { --bg: var(--lane); --fg: var(--ink); --bd: var(--lane); }
.btn-lane:hover { --bg: var(--lane-strong); --bd: var(--lane-strong); --fg: var(--ink); }
.btn-light { --bg: #fff; --fg: var(--river); --bd: #fff; }
.btn-light:hover { --bg: var(--lane); --bd: var(--lane); --fg: var(--ink); }
.btn-sm { min-height: 36px; padding: .4rem .9rem; font-size: var(--t-sm); }
.btn-lg { min-height: 56px; padding: .8rem 1.6rem; font-size: var(--t-md); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--pine); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; text-decoration: none; }
.link-arrow .icon { transition: transform .15s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field + .field, .field + .grid-2, .grid-2 + .field, .grid-2 + .grid-2, .field + .checks, .checks + .field { margin-top: 1.1rem; }
.grid-2 > .field, .grid-3 > .field, .grid-2 > div > .field:first-child { margin-top: 0; }
label, .label { font-weight: 700; font-size: var(--t-sm); color: var(--ink); }
.hint { font-size: var(--t-xs); color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: .65rem .9rem; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink); font: 450 var(--t-base)/1.4 var(--f); transition: border-color .15s, box-shadow .15s; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234A5D62' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center; }
textarea.input { min-height: 120px; resize: vertical; }
.input:hover { border-color: #C3CFCB; }
.input:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 4px var(--pine-tint); }
.input::placeholder { color: var(--ink-3); }
.field.has-error .input { border-color: var(--signal); }
.field.has-error .input:focus { box-shadow: 0 0 0 4px var(--signal-tint); }
.field-error { color: var(--signal); font-size: var(--t-sm); font-weight: 650; }
.input-group { position: relative; }
.input-group .icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-group .input { padding-left: 2.6rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; font-size: var(--t-sm); padding: .5rem .85rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; transition: border-color .15s, background .15s; }
.check:hover { border-color: #C3CFCB; }
.check:has(input:checked) { border-color: var(--pine); background: var(--pine-tint); color: var(--pine-strong); }
.check input { accent-color: var(--pine); margin: 0; }
.check-line { display: flex; gap: .65rem; align-items: flex-start; font-weight: 450; font-size: var(--t-base); cursor: pointer; }
.check-line input { margin-top: .22rem; accent-color: var(--pine); width: 18px; height: 18px; flex: none; }
.file-drop { border: 1.5px dashed #BCCAC5; border-radius: var(--r); padding: 1rem 1.1rem; background: var(--paper); display: flex; gap: .9rem; align-items: center; transition: border-color .15s, background .15s; }
.file-drop:hover { border-color: var(--pine); background: #FAFDFB; }
.file-drop input[type=file] { font: inherit; font-size: var(--t-sm); max-width: 100%; }
.file-drop input[type=file]::file-selector-button { font: 700 var(--t-sm) var(--f); border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: .4rem .85rem; margin-right: .75rem; cursor: pointer; }
.file-drop .thumb { width: 64px; height: 48px; border-radius: var(--r-xs); object-fit: cover; background: var(--line-2); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 800; font-size: var(--t-md); margin-bottom: .85rem; padding: 0; letter-spacing: -0.01em; }
fieldset + fieldset { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line-2); }
.form-actions { margin-top: 1.6rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.code-input { font-size: 1.75rem !important; letter-spacing: .5em; text-align: center; font-weight: 800 !important; padding-left: 1.25rem !important; }
.password-meter { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: .4rem; }
.password-meter span { display: block; height: 100%; width: 0; background: var(--signal); transition: width .25s var(--ease), background .25s; border-radius: 3px; }

/* ---------- Flash messages ---------- */
.flash { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--r-sm); margin: 1.25rem 0; font-weight: 600; border: 1px solid; }
.flash .icon { margin-top: .12rem; }
.flash-success { background: var(--pine-tint); border-color: #B9DFCF; color: #08503F; }
.flash-error { background: var(--signal-tint); border-color: #F0C3B7; color: #7C2415; }
.flash-info { background: var(--info-tint); border-color: #C5D8E8; color: #173C55; }
.flash-warning { background: var(--lane-tint); border-color: #F5DD9A; color: #5D4708; }
.flash-stack { position: relative; z-index: 2; }
.dark-top .flash-stack { background: var(--river); padding: .1rem 0 .4rem; }
.dark-top .flash-stack .flash { margin: .5rem 0; }

/* ---------- Surfaces ---------- */
.panel { --notch-bg: var(--paper); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem; box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: 1.25rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: var(--t-lg); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* The route sign: river panel with the inset white border of real highway signs. */
.sign { background: var(--river); color: #fff; border-radius: var(--r-lg); padding: 1.9rem; position: relative; border: 0; overflow: hidden; }
.sign::before { content: ""; position: absolute; inset: 7px; border: 2px solid rgba(255,255,255,.75); border-radius: 16px; pointer-events: none; }
.sign > * { position: relative; }
.sign h2, .sign h3 { color: #fff; }
.sign p { color: var(--on-river); }
.sign label, .sign .label { color: var(--on-river); }
.sign .input { border-color: transparent; }
.sign a:not(.btn) { color: #fff; }
.panel.sign { box-shadow: none; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem .12rem; border-radius: 999px; font-size: var(--t-xs); font-weight: 750; background: var(--line-2); color: var(--ink-2); white-space: nowrap; line-height: 1.4; }
.badge .icon { width: 1em; height: 1em; }
.badge-green { background: var(--pine-tint); color: var(--pine-strong); }
.badge-yellow { background: var(--lane-tint); color: #6A5108; }
.badge-red { background: var(--signal-tint); color: #8A2817; }
.badge-blue { background: var(--info-tint); color: var(--info); }

/* ---------- The lane line ---------- */
.lane-h { display: inline-block; height: 4px; border-radius: 2px; background: repeating-linear-gradient(to right, var(--lane) 0 12px, transparent 12px 20px); }

/* Vertical route (trip details, bookings) */
.route-grid { display: grid; grid-template-columns: auto 20px minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: .9rem; }
.route-time { grid-column: 1; font-weight: 800; font-size: var(--t-md); line-height: 1.3; text-align: right; min-width: 4.4rem; letter-spacing: -0.01em; white-space: nowrap; }
.route-time.end { grid-row: 3; color: var(--ink-2); font-weight: 650; }
.route-stop { grid-column: 2; grid-row: 1; justify-self: center; width: 14px; height: 14px; margin-top: .32em; border-radius: 50%; border: 3.5px solid var(--ink); background: var(--paper); }
.route-stop.end { grid-row: 3; background: var(--ink); }
.route-lane { grid-column: 2; grid-row: 2; justify-self: center; width: 4px; min-height: 22px; margin: 4px 0; border-radius: 2px; background: repeating-linear-gradient(to bottom, var(--lane) 0 8px, transparent 8px 14px); }
.route-place { grid-column: 3; line-height: 1.3; min-width: 0; }
.route-place.from { grid-row: 1 / span 2; padding-bottom: 1.1rem; }
.route-place.to { grid-row: 3; }
.route-place strong { display: block; font-size: var(--t-md); font-weight: 800; letter-spacing: -0.01em; }
.route-place span { display: block; font-size: var(--t-sm); color: var(--ink-2); margin-top: .1rem; }
.itinerary .route-time { font-size: var(--t-lg); }
.itinerary .route-place strong { font-size: var(--t-lg); }
.itinerary .route-place.from { padding-bottom: 1.75rem; }
.itinerary .route-stop { margin-top: .42em; }

/* Horizontal route title */
.route-h { display: inline-flex; align-items: center; gap: 1rem; flex-wrap: nowrap; font-weight: 850; letter-spacing: -0.03em; }
.route-h .lane-h { flex: 0 0 72px; height: 5px; background: repeating-linear-gradient(to right, var(--lane) 0 14px, transparent 14px 23px); }
@media (max-width: 560px) { .route-h { gap: .6rem; } .route-h .lane-h { flex-basis: 34px; } }

/* ==========================================================================
   Home
   ========================================================================== */
.hero { position: relative; background: var(--river); color: #fff; padding: 2.5rem 0 7.5rem; overflow: hidden; isolation: isolate; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 140px; background: linear-gradient(to bottom, transparent, rgba(6,38,45,.55)); z-index: -1; pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 2rem; align-items: center; }
.hero-copy { padding: 2rem 0 1rem; position: relative; z-index: 1; }
.hero h1 { font-size: var(--t-hero); line-height: .98; letter-spacing: -0.05em; font-weight: 880; margin: 0 0 1.5rem; max-width: 9ch; color: #fff; }
.hero .lede { font-size: clamp(1.06rem, 1.4vw, 1.2rem); line-height: 1.6; color: var(--on-river); max-width: 40ch; margin-bottom: 2rem; }
.hero-proof { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; color: var(--on-river); font-weight: 650; font-size: var(--t-sm); }
.hero-proof li { display: inline-flex; align-items: center; gap: .5rem; }
.hero-proof .icon { color: var(--lane); }
.hero-map { position: relative; margin: -1rem -2rem -3rem 0; }
.corridor-map { width: 100%; height: auto; overflow: visible; }
.corridor-map .map-dot { fill: rgba(215,231,230,.16); }
.corridor-map .map-water { fill: var(--river-3); }
.corridor-map .map-roads { fill: none; stroke: rgba(215,231,230,.28); stroke-width: 1.6; stroke-linecap: round; }
.corridor-map .map-river-name { fill: rgba(215,231,230,.55); font: italic 500 11.5px var(--f); letter-spacing: .14em; }
.corridor-map .map-route-base { fill: none; stroke: rgba(255,197,61,.22); stroke-width: 9; stroke-linecap: round; }
.corridor-map .map-route { fill: none; stroke: var(--lane); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 9 7; animation: lane-flow 1.6s linear infinite; }
@keyframes lane-flow { to { stroke-dashoffset: -32; } }
.corridor-map .city { fill: var(--river); stroke: #fff; stroke-width: 2.4; }
.corridor-map .city-minor { stroke-width: 2; stroke: var(--on-river); }
.corridor-map .city-dot { fill: var(--on-river-2); stroke: none; }
.corridor-map .city-label { fill: #fff; font: 700 14px var(--f); letter-spacing: -.01em; paint-order: stroke; stroke: var(--river); stroke-width: 4px; stroke-linejoin: round; }
.corridor-map .city-label-minor { fill: var(--on-river); font-weight: 550; font-size: 12px; }
.corridor-map .map-car-dot { fill: #fff; stroke: var(--lane); stroke-width: 3; }
.corridor-map .map-car-glow { fill: var(--lane); opacity: .7; }

/* The finder: the search form, on the home page and on top of results */
.finder { display: grid; grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr) 190px 160px auto; align-items: stretch;
  background: var(--paper); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: .5rem; position: relative; }
.finder-field { position: relative; display: flex; flex-direction: column; justify-content: center; padding: .55rem 1.1rem .5rem; border-radius: 14px; min-width: 0; transition: background .15s; }
.finder-field + .finder-field::before, .finder-swap + .finder-field::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--line); }
.finder-field:hover { background: var(--line-2); }
.finder-field:focus-within { background: var(--line-2); }
.finder-field label { font-size: var(--t-xs); font-weight: 750; color: var(--ink-2); letter-spacing: .01em; display: flex; align-items: center; gap: .35rem; cursor: pointer; }
.finder-field label .icon { width: 14px; height: 14px; color: var(--ink-3); }
.finder-field input, .finder-field select { border: 0; background: transparent; font: 650 var(--t-md)/1.3 var(--f); color: var(--ink); padding: .15rem 0 0; width: 100%; min-width: 0; outline: none; appearance: none; -webkit-appearance: none; cursor: pointer; }
.finder-field input[type=text], .finder-field input:not([type]) { cursor: text; }
.finder-field input::placeholder { color: var(--ink-3); font-weight: 500; }
.finder-field input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.finder-swap { position: relative; z-index: 2; align-self: center; width: 38px; height: 38px; margin-left: -19px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-1); transition: transform .25s var(--ease), color .15s, border-color .15s; }
.finder-swap:hover { color: var(--pine); border-color: var(--pine); transform: rotate(180deg); }
.finder-swap .icon { width: 16px; height: 16px; }
.finder-submit { min-height: 64px; border-radius: 16px; padding-inline: 1.75rem; font-size: var(--t-md); margin-left: .35rem; }
.search-dock { position: relative; z-index: 3; margin-top: -3.6rem; }
@media (max-width: 1060px) {
  .finder { grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr) minmax(0, 1fr) 140px; }
  .finder-submit { grid-column: 1 / -1; margin: .4rem 0 0; min-height: 54px; }
}
@media (max-width: 720px) {
  .finder { grid-template-columns: 1fr 1fr; padding: .4rem; border-radius: 20px; }
  .finder-from, .finder-to { grid-column: 1 / -1; }
  .finder-swap { position: absolute; right: 1.1rem; top: 3.05rem; margin: 0; transform: rotate(90deg); }
  .finder-swap:hover { transform: rotate(270deg); }
  .finder-field { padding: .6rem .9rem; }
  .finder-field + .finder-field::before, .finder-swap + .finder-field::before { left: .9rem; right: .9rem; top: 0; bottom: auto; width: auto; height: 1px; }
  .finder-seats::before { left: 0 !important; top: 22% !important; bottom: 22% !important; right: auto !important; width: 1px !important; height: auto !important; }
  .finder-date::before { right: -.4rem !important; }
  .finder-submit { grid-column: 1 / -1; }
}

/* Sections */
.section { padding: 4.5rem 0; }
.section-tight { padding: 3rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: .5rem 0 0; color: var(--ink-2); max-width: 52ch; }
.section-title { font-size: var(--t-3xl); letter-spacing: -0.035em; font-weight: 850; max-width: 22ch; }
.home-departures { padding-top: 4rem; }
.ticket-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1000px) { .ticket-grid { grid-template-columns: 1fr; } }

/* How it works: passengers on paper, drivers on the river */
.how { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.how-card { border-radius: var(--r-lg); padding: 2.25rem 2.25rem 2rem; background: var(--paper); border: 1px solid var(--line); display: flex; flex-direction: column; }
.how-card.drivers { background: var(--river); border-color: var(--river); color: #fff; }
.how-card h3 { display: flex; gap: .7rem; align-items: center; font-size: var(--t-xl); font-weight: 850; letter-spacing: -0.03em; margin-bottom: 1.25rem; }
.how-card h3 .icon { width: 30px; height: 30px; padding: 6px; border-radius: 10px; background: var(--pine-tint); color: var(--pine); }
.how-card.drivers h3 .icon { background: rgba(255,197,61,.16); color: var(--lane); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; position: relative; flex: 1; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; padding: 0 0 1.5rem; position: relative; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: counter(s); width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: grid; place-items: center; padding-top: .1em; position: relative; z-index: 1; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(1.2rem - 2px); top: 2.6rem; bottom: .2rem; width: 4px; border-radius: 2px; background: repeating-linear-gradient(to bottom, var(--lane) 0 7px, transparent 7px 13px); }
.steps strong { display: block; font-size: var(--t-md); font-weight: 750; padding-top: .35rem; }
.steps p { margin: .2rem 0 0; color: var(--ink-2); font-size: var(--t-sm); max-width: 46ch; }
.how-card.drivers .steps li::before { background: var(--lane); color: var(--ink); }
.how-card.drivers .steps p { color: var(--on-river-2); }
.how-card .btn { align-self: flex-start; margin-top: 1.75rem; }
@media (max-width: 860px) { .how { grid-template-columns: 1fr; } .how-card { padding: 1.75rem 1.5rem; } }

/* Popular routes */
.routes-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.route-chip { display: grid; grid-template-columns: minmax(0, auto) minmax(28px, 1fr) minmax(0, auto) 34px; align-items: center; gap: .8rem; padding: 1.15rem 1.15rem 1.15rem 1.35rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; font-weight: 750; font-size: var(--t-md); letter-spacing: -0.01em; transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); }
.route-chip span:not(.lane-h):not(.go) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-chip .lane-h { height: 3px; background: repeating-linear-gradient(to right, var(--lane) 0 8px, transparent 8px 14px); }
.route-chip .go { width: 34px; height: 34px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; color: var(--ink-2); transition: background .15s, color .15s; }
.route-chip .go .icon { width: 16px; height: 16px; }
.route-chip:hover { border-color: #BFD0CA; color: var(--ink); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.route-chip:hover .go { background: var(--lane); color: var(--ink); }
@media (max-width: 960px) { .routes-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .routes-list { grid-template-columns: 1fr; } }

/* Trust: the boarding pass explains it */
.trust { background: var(--paper); border-block: 1px solid var(--line); }
.trust-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 4rem; align-items: center; }
.trust-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.6rem; }
.trust-list li { display: grid; grid-template-columns: 48px 1fr; gap: 1.1rem; }
.trust-list .icon { width: 48px; height: 48px; padding: 12px; border-radius: 14px; background: var(--pine-tint); color: var(--pine); }
.trust-list h3 { margin: .2rem 0 .25rem; font-size: var(--t-md); }
.trust-list p { margin: 0; color: var(--ink-2); font-size: var(--t-sm); max-width: 48ch; }
.pass { --notch-bg: var(--paper); position: relative; max-width: 460px; margin-inline: auto; background: var(--river); color: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-3); transform: rotate(-2.5deg); display: grid; grid-template-rows: auto auto; }
.pass-top { padding: 1.75rem 1.9rem 1.5rem; }
.pass-label { font-size: var(--t-xs); font-weight: 700; color: var(--on-river-2); margin: 0 0 .25rem; }
.pass-route { display: flex; align-items: center; gap: .9rem; font-size: 1.6rem; font-weight: 850; letter-spacing: -0.03em; }
.pass-route .lane-h { flex: 1; min-width: 30px; }
.pass-meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.pass-meta strong { display: block; font-size: var(--t-md); font-weight: 750; color: #fff; }
.pass-meta span { font-size: var(--t-xs); color: var(--on-river-2); }
.pass-stub { position: relative; border-top: 2px dashed rgba(255,255,255,.22); padding: 1.4rem 1.9rem 1.6rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.pass-stub::before, .pass-stub::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--notch-bg); }
.pass-stub::before { left: -12px; } .pass-stub::after { right: -12px; }
.pass-code { font-size: 2.6rem; font-weight: 880; letter-spacing: .14em; color: var(--lane); line-height: 1; }
.pass-stub p { margin: 0; font-size: var(--t-sm); color: var(--on-river); max-width: 20ch; text-align: right; }
@media (max-width: 900px) { .trust-layout { grid-template-columns: 1fr; gap: 3rem; } .pass { transform: rotate(-1.5deg); } }

/* Route alert band: a yellow road sign */
.alert-band { background: var(--lane); color: var(--ink); }
.alert-band .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: 2.5rem; align-items: center; padding: 3.25rem 0; }
.alert-band h2 { font-size: var(--t-3xl); letter-spacing: -0.035em; font-weight: 850; margin-bottom: .4rem; }
.alert-band p { margin: 0; color: #4B3A07; max-width: 40ch; }
.alert-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: end; }
.alert-form.with-email { grid-template-columns: 1fr 1fr 1fr auto; }
.alert-form .field { margin: 0 !important; }
.alert-form label { color: var(--ink); }
.alert-form .input { border-color: transparent; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.alert-form .btn { --bg: var(--ink); --bd: var(--ink); --fg: #fff; min-height: 48px; }
.alert-form .btn:hover { --bg: var(--river); --bd: var(--river); }
@media (max-width: 960px) { .alert-band .wrap { grid-template-columns: 1fr; gap: 1.5rem; } }
@media (max-width: 640px) { .alert-form, .alert-form.with-email { grid-template-columns: 1fr; } }

/* ==========================================================================
   Search results
   ========================================================================== */
.searchbar { background: var(--river); padding: .75rem 0 2rem; }
.searchbar .finder { box-shadow: 0 10px 40px -12px rgba(0,0,0,.45); }
.searchbar .finder-submit { min-height: 58px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.results-head h1 { margin: 0; font-size: var(--t-xl); }
.results-head .count { color: var(--ink-2); font-weight: 650; }
.results-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 2.25rem; padding: 2.25rem 0 4rem; }
.filters { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.35rem; }
.filters-title { display: flex; align-items: center; gap: .5rem; font-size: var(--t-md); font-weight: 800; margin: 0 0 .25rem; }
.filters h3 { font-size: var(--t-sm); color: var(--ink); font-weight: 750; margin: 1.35rem 0 .6rem; }
.filters .checks { flex-direction: column; gap: .4rem; }
.filters .check { width: 100%; border-radius: var(--r-sm); padding: .55rem .8rem; }
.filters .check .icon { color: var(--ink-3); }
.filters .check:has(input:checked) .icon { color: var(--pine); }
.filters details > summary { display: none; }
@media (max-width: 960px) {
  .results-layout { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 1.5rem; }
  .filters { position: static; padding: 0; overflow: hidden; }
  .filters details > summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1.2rem; font-weight: 750; cursor: pointer; list-style: none; }
  .filters details > summary::-webkit-details-marker { display: none; }
  .filters details > summary .icon:last-child { transition: transform .2s; }
  .filters details[open] > summary .icon:last-child { transform: rotate(180deg); }
  .filters details > form { padding: 0 1.2rem 1.2rem; }
  .filters-title { display: none; }
}
.day-head { display: flex; align-items: center; gap: .9rem; margin: 2rem 0 .85rem; font-size: var(--t-md); font-weight: 800; letter-spacing: -0.01em; }
.day-head:first-child { margin-top: 0; }
.day-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.trip-list { display: flex; flex-direction: column; gap: .85rem; }

/* ---------- Ticket: one trip ---------- */
.ticket { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 168px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .2s, transform .2s var(--ease); }
.ticket:hover { color: var(--ink); border-color: #BCCDC7; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.ticket.is-full { opacity: .62; }
.ticket-main { padding: 1.25rem 1.4rem 1.1rem; min-width: 0; }
.ticket-when { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); margin-bottom: .7rem; }
.ticket-when .icon { color: var(--ink-3); }
.ticket-route { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(28px, .5fr) minmax(0, 1fr); align-items: start; column-gap: 1rem; }
.ticket-time { font-size: 1.7rem; font-weight: 850; letter-spacing: -0.04em; line-height: 1; padding-right: .3rem; padding-top: .05rem; }
.ticket-city { min-width: 0; }
.ticket-city strong { display: block; font-size: var(--t-md); font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; }
.ticket-city span { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-lane { margin-top: .62rem; height: 4px; position: relative; background: repeating-linear-gradient(to right, var(--lane) 0 8px, transparent 8px 13px); border-radius: 2px; }
.ticket-lane::before, .ticket-lane::after { content: ""; position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translateY(-50%); }
.ticket-lane::before { left: -7px; border: 2.5px solid var(--ink); background: var(--paper); }
.ticket-lane::after { right: -7px; background: var(--ink); }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.05rem; padding-top: .9rem; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.driver-mini { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; min-width: 0; }
.driver-mini .rating { font-weight: 650; color: var(--ink-2); font-size: var(--t-sm); display: inline-flex; align-items: center; gap: .2rem; margin-left: .3rem; }
.rating .icon { color: #D9A514; fill: var(--lane); width: 1em; height: 1em; }
.amenities { display: flex; gap: .7rem; color: var(--ink-3); }
.amenities .icon { width: 18px; height: 18px; }
.ticket-stub { position: relative; border-left: 2px dashed var(--line); padding: 1.25rem 1.3rem; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; text-align: right; gap: .75rem; }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--notch-bg); border: 1px solid var(--line); transition: border-color .15s; }
.ticket-stub::before { top: -12px; clip-path: inset(50% 0 0 0); }
.ticket-stub::after { bottom: -12px; clip-path: inset(0 0 50% 0); }
.ticket:hover .ticket-stub::before, .ticket:hover .ticket-stub::after { border-color: #BCCDC7; }
.ticket-price strong { display: block; font-size: 1.85rem; font-weight: 850; letter-spacing: -0.04em; line-height: 1; }
.ticket-price span { font-size: var(--t-xs); color: var(--ink-2); font-weight: 600; }
.seats-left { font-size: var(--t-sm); font-weight: 750; color: var(--pine); display: inline-flex; gap: .35rem; align-items: center; }
.seats-left.is-low { color: #9A6A00; }
.ticket.is-full .seats-left { color: var(--ink-2); }
@media (max-width: 640px) {
  .ticket { grid-template-columns: 1fr; }
  .ticket-main { padding: 1.1rem 1.1rem 1rem; }
  .ticket-route { grid-template-columns: minmax(0, 1fr) minmax(26px, 44px) minmax(0, 1fr); row-gap: .6rem; }
  .ticket-time { grid-column: 1 / -1; font-size: 1.5rem; }
  .ticket-stub { border-left: 0; border-top: 2px dashed var(--line); flex-direction: row; align-items: center; padding: .95rem 1.1rem; text-align: left; }
  .ticket-stub::before { top: -12px; left: -12px; clip-path: inset(0 0 0 50%); }
  .ticket-stub::after { bottom: auto; top: -12px; left: auto; right: -12px; clip-path: inset(0 50% 0 0); }
  .ticket-price { display: flex; align-items: baseline; gap: .45rem; }
  .ticket-price strong { font-size: 1.5rem; }
}

/* Compact trip rows (dashboard, bookings) */
.trip-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem 1.3rem; color: var(--ink); text-decoration: none; position: relative; transition: border-color .15s, box-shadow .2s; }
.trip-row:hover { border-color: #BCCDC7; color: var(--ink); box-shadow: var(--shadow-2); }
.trip-row.is-full { opacity: .65; }
.trip-row .when { font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); margin-bottom: .65rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.trip-row .price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: .2rem; border-left: 2px dashed var(--line); padding-left: 1.4rem; }
.trip-row .price strong { font-size: 1.6rem; font-weight: 850; letter-spacing: .08em; display: block; line-height: 1; color: var(--ink); }
.trip-row .price span:not(.btn) { font-size: var(--t-xs); color: var(--ink-2); font-weight: 650; }
.trip-row .meta { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--line-2); padding-top: .8rem; flex-wrap: wrap; }
.panel .trip-row { box-shadow: none; }
@media (max-width: 560px) {
  .trip-row { grid-template-columns: 1fr; }
  .trip-row .price { border-left: 0; border-top: 2px dashed var(--line); padding: .8rem 0 0; flex-direction: row; justify-content: space-between; align-items: center; }
}

.empty { text-align: center; padding: 3.5rem 1.5rem; background: var(--paper); border: 1px dashed #C3CFCB; border-radius: var(--r); }
.empty > .icon { width: 56px; height: 56px; margin: 0 auto 1rem; color: var(--pine); padding: 14px; border-radius: 50%; background: var(--pine-tint); }
.empty h3 { font-size: var(--t-lg); }
.empty p { max-width: 46ch; margin-inline: auto; }
.empty form { margin-top: 1.25rem; }
.empty form .input { max-width: 280px; }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); font-weight: 750; padding: 0 .7rem; }
.pagination a:hover { border-color: var(--pine); color: var(--pine); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ==========================================================================
   Trip details
   ========================================================================== */
.trip-hero { background: var(--river); color: #fff; padding: 1.25rem 0 6rem; }
.trip-hero .back { display: inline-flex; align-items: center; gap: .3rem; color: var(--on-river); text-decoration: none; font-weight: 650; font-size: var(--t-sm); }
.trip-hero .back:hover { color: #fff; }
.trip-hero .date { margin: 1.75rem 0 .6rem; color: var(--on-river); font-weight: 650; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.trip-hero h1 { font-size: var(--t-3xl); margin: 0; color: #fff; }
.trip-hero .route-h { flex-wrap: wrap; row-gap: .25rem; }
.trip-hero .status { margin-top: 1rem; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; margin-top: -4.25rem; padding-bottom: 3rem; align-items: start; position: relative; }
.detail-layout .panel { padding: 1.75rem; }
.detail-layout .panel-head h2 { font-size: var(--t-lg); }
.return-note { display: flex; gap: .5rem; align-items: center; margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line-2); color: var(--ink-2); font-size: var(--t-sm); }
.driver-card { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: center; }
.driver-card .name { font-size: var(--t-lg); font-weight: 800; letter-spacing: -0.02em; display: block; }
.driver-card .sub { color: var(--ink-2); font-size: var(--t-sm); display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; margin-top: .15rem; }
.quote { margin: 1.25rem 0 0; padding: 1rem 1.2rem; background: var(--bg); border-radius: var(--r-sm); border-left: 4px solid var(--lane); color: var(--ink); }
.quote p:last-child { margin: 0; }
.vehicle-line { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.25rem; }
.vehicle-line .icon-box { width: 52px; height: 52px; border-radius: 14px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.vehicle-line .icon-box .icon { width: 26px; height: 26px; }
.book-box { position: sticky; top: calc(var(--header-h) + 20px); }
.book-box .panel { box-shadow: var(--shadow-3); border: 0; padding: 1.75rem; }
.book-price { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.book-price strong { font-size: 2.4rem; font-weight: 880; letter-spacing: -0.045em; line-height: 1; }
.book-price span { color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; }
.book-box .note { font-size: var(--t-sm); color: var(--ink-2); margin: .6rem 0 0; }
.book-box .seats-left { margin: 1rem 0 0; padding: .5rem .8rem; border-radius: 999px; background: var(--pine-tint); }
.book-box form .row-between { margin-top: 1.25rem; }
.safety { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-2); margin: 1rem .25rem 0; }
.safety .icon { color: var(--pine); margin-top: .15rem; }
@media (max-width: 960px) {
  .detail-layout { display: flex; flex-direction: column; margin-top: -4.25rem; }
  .book-box { order: -1; position: static; width: 100%; }
  .detail-layout > div { width: 100%; }
}
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line-2); font-size: var(--t-sm); }
.lines li:last-child { border-bottom: 0; }
.lines li strong { font-weight: 800; }
.lines .total-line { font-size: var(--t-base); font-weight: 800; border-top: 2px solid var(--ink); border-bottom: 0; padding-top: .8rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.5rem; list-style: none; padding: 0; margin: 0; }
.facts li { display: flex; gap: .65rem; align-items: center; font-weight: 550; }
.facts li .icon { color: var(--pine); }
.facts li.no { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(123,140,144,.6); }
.facts li.no .icon { color: var(--ink-3); }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); padding: 2px; }
.stepper button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; font-size: 1.3rem; font-weight: 700; cursor: pointer; color: var(--ink); transition: background .15s; }
.stepper button:hover { background: var(--line-2); }
.stepper input { width: 42px; text-align: center; border: 0; font: 800 var(--t-md) var(--f); background: none; color: var(--ink); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.review { padding: 1.1rem 0; border-top: 1px solid var(--line-2); }
.review:first-of-type { border-top: 0; padding-top: 0; }
.stars { display: inline-flex; gap: 2px; vertical-align: -0.1em; }
.stars .icon, .stars svg { width: 16px; height: 16px; color: #D9A514; fill: none; }
.stars .on { fill: var(--lane); }
.code-box { font-size: 2.4rem; font-weight: 880; letter-spacing: .25em; background: var(--lane-tint); border: 2px dashed var(--lane-strong); border-radius: var(--r); padding: .6rem 1rem .4rem; text-align: center; color: var(--ink); }

/* Star rating input */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: .2rem; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; color: #C7D0CD; }
.star-input label svg { width: 34px; height: 34px; fill: none; transition: transform .12s; }
.star-input label:hover svg { transform: scale(1.1); }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #D9A514; }
.star-input input:checked ~ label svg, .star-input label:hover svg, .star-input label:hover ~ label svg { fill: var(--lane); }
.star-input input:focus-visible + label { box-shadow: var(--focus); border-radius: 4px; }

/* ==========================================================================
   App shell (dashboard, account, driver, admin)
   ========================================================================== */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.25rem; padding: 2.25rem 0 4rem; }
.side-nav { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; display: flex; flex-direction: column; gap: .15rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .75rem; }
.side-nav .group { font-size: var(--t-xs); font-weight: 750; color: var(--ink-3); margin: 1rem .75rem .35rem; }
.side-nav .group:first-child { margin-top: .35rem; }
.side-nav a { display: flex; gap: .7rem; align-items: center; padding: .6rem .75rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 600; transition: background .15s; }
.side-nav a .icon { color: var(--ink-3); }
.side-nav a:hover { background: var(--line-2); }
.side-nav a.is-active { background: var(--river); color: #fff; }
.side-nav a.is-active .icon { color: var(--lane); }
.side-nav .count { margin-left: auto; background: var(--lane); color: var(--ink); border-radius: 999px; font-size: var(--t-xs); font-weight: 800; padding: .05rem .5rem 0; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.page-title > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-title h1 { margin: 0; font-size: var(--t-2xl); letter-spacing: -0.035em; }
.page-title p { margin: .4rem 0 0; color: var(--ink-2); }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 1.25rem; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; gap: .35rem; padding: .4rem; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav .group { display: none; }
  .side-nav a { white-space: nowrap; flex: none; }
}
.tabs { display: flex; gap: .25rem; margin-bottom: 1.4rem; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .3rem; width: fit-content; max-width: 100%; }
.tabs a { padding: .45rem 1rem .4rem; color: var(--ink-2); text-decoration: none; font-weight: 700; border-radius: 999px; white-space: nowrap; font-size: var(--t-sm); }
.tabs a:hover { color: var(--ink); background: var(--line-2); }
.tabs a.is-active { color: #fff; background: var(--ink); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem 1.3rem; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 1.2rem; bottom: 1.2rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--line); }
.stat:nth-child(1)::before { background: var(--pine); }
.stat:nth-child(2)::before { background: var(--lane-strong); }
.stat:nth-child(3)::before { background: var(--info); }
.stat:nth-child(4)::before { background: var(--river); }
.stat .v { font-size: var(--t-xl); font-weight: 850; line-height: 1.1; letter-spacing: -0.03em; }
.stat .k { font-size: var(--t-sm); color: var(--ink-2); margin-top: .2rem; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th { text-align: left; font-weight: 750; color: var(--ink-2); padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: #F8FAF9; white-space: nowrap; font-size: var(--t-xs); }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #FAFCFB; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table code { font-size: .85em; background: var(--line-2); padding: .1rem .4rem; border-radius: 5px; }

/* Lists (bookings, vehicles) */
.item-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item-list > li { padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem 1rem; align-items: center; transition: background .15s; }
.item-list > li:hover { background: #FAFCFB; }
.item-list > li:last-child { border-bottom: 0; }
.item-list > li > span > .icon { color: var(--ink-3); }
.item-list a.item-link { color: var(--ink); text-decoration: none; display: block; min-width: 0; }
.item-list a.item-link:hover strong { color: var(--pine); }
.item-title { font-weight: 800; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; letter-spacing: -0.01em; }
.item-sub { display: block; font-size: var(--t-sm); color: var(--ink-2); margin-top: .1rem; }
.panel .item-list { border-radius: var(--r-sm); }

/* Checklist (driver onboarding) */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.checklist li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; display: flex; flex-direction: column; gap: .45rem; position: relative; }
.checklist li .icon { width: 26px; height: 26px; }
.checklist li.done { border-color: #B9DFCF; background: #F6FBF8; }
.checklist li.done .icon { color: var(--pine); }
.checklist li.wait .icon { color: #C99A0D; }
.checklist li.bad { border-color: #F0C3B7; }
.checklist li.bad .icon { color: var(--signal); }
.checklist li.todo .icon { color: var(--ink-3); }
@media (max-width: 860px) { .checklist { grid-template-columns: 1fr 1fr; } }

/* Wallet */
.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.balance { border-radius: var(--r-lg); padding: 1.5rem 1.6rem; background: var(--river); color: #fff; border: 0; position: relative; overflow: hidden; }
.balance::after { content: ""; position: absolute; right: -40px; bottom: 26px; width: 200px; height: 4px; background: repeating-linear-gradient(to right, var(--lane) 0 12px, transparent 12px 20px); opacity: .9; transform: rotate(-18deg); }
.balance .k, .balance > span, .balance p { color: var(--on-river); }
.balance .v { font-size: 2.6rem; font-weight: 880; letter-spacing: -0.045em; line-height: 1.1; }
.balance.promo { background: var(--lane-tint); color: var(--ink); border: 1px solid #F3DE9F; }
.balance.promo .k, .balance.promo > span, .balance.promo p { color: #6A5108; }
.balance.promo::after { background: repeating-linear-gradient(to right, var(--lane-strong) 0 12px, transparent 12px 20px); opacity: .5; }
@media (max-width: 640px) { .balances { grid-template-columns: 1fr; } }
.amount-pick { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Payment */
#payment-element { min-height: 60px; margin: 1rem 0; }
.pay-options { display: grid; gap: .75rem; }
.pay-option { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.05rem 1.2rem; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--paper); transition: border-color .15s; flex-wrap: wrap; }
.pay-option:hover { border-color: #C3CFCB; }
.pay-option.is-disabled { opacity: .6; }

/* ==========================================================================
   Sign-in pages: the form floats on the river, over the corridor map
   ========================================================================== */
.auth-page { position: relative; background: var(--river); padding: 3rem 0 5rem; overflow: hidden; isolation: isolate; flex: 1; }
.auth-page::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("../img/corridor.svg") no-repeat right -6% bottom -14% / min(980px, 125%) auto; opacity: .32; }
.auth-card { background: var(--paper); border-radius: var(--r-lg); padding: 2.4rem 2.25rem 2.1rem; box-shadow: var(--shadow-3); }
.auth-card h1 { font-size: var(--t-2xl); letter-spacing: -0.04em; margin-bottom: .3rem; }
.auth-card > p.muted { margin-bottom: 1.6rem; }
.auth-card .form-actions .btn { min-height: 52px; font-size: var(--t-md); }
.auth-alt { text-align: center; margin-top: 1.5rem; color: var(--on-river); }
.auth-alt a { color: var(--lane); font-weight: 700; }
.auth-alt a:hover { color: #fff; }
.auth-page .flash { margin-top: 0; }
@media (max-width: 560px) { .auth-page { padding: 1.5rem 0 3rem; } .auth-card { padding: 1.75rem 1.35rem 1.5rem; } }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; font-size: 1.05rem; font-weight: 750; letter-spacing: .06em; background: var(--bg); padding: 1.1rem; border-radius: var(--r-sm); border: 1px dashed #C3CFCB; }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.secret { font-weight: 800; letter-spacing: .12em; word-break: break-all; }

/* ---------- Content pages ---------- */
.page-hero { background: var(--river); color: #fff; padding: 3.5rem 0 3rem; }
.page-hero h1 { color: #fff; font-size: var(--t-3xl); margin: 0; max-width: 20ch; }
.prose { max-width: 70ch; font-size: 1.0625rem; line-height: 1.7; }
.prose h2 { font-size: var(--t-lg); margin-top: 2.25rem; }
.prose h3 { margin-top: 1.75rem; }
.prose p, .prose li { color: #2B3D42; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .35rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--river); color: var(--on-river-2); padding: 0 0 2rem; font-size: var(--t-sm); position: relative; }
.site-footer::before { content: ""; display: block; height: 5px; background: repeating-linear-gradient(to right, var(--lane) 0 28px, transparent 28px 46px); opacity: .9; }
.site-footer a { color: var(--on-river); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; padding-top: 3.5rem; }
.footer-grid h4 { color: #fff; font-size: var(--t-sm); font-weight: 750; margin-bottom: .9rem; letter-spacing: 0; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer-grid p { max-width: 36ch; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.75rem; padding-top: 1.4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer .brand { color: #fff; }
.site-footer .brand svg { color: var(--lane); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Error pages ---------- */
.error-page { text-align: center; padding: 5rem 0 6rem; }
.error-page .sign { display: inline-block; padding: 1.6rem 2.75rem 1.4rem; margin-bottom: 2rem; }
.error-page .sign strong { font-size: 4rem; font-weight: 880; display: block; line-height: 1; letter-spacing: -0.04em; color: var(--lane); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--r-lg); padding: 1.75rem; max-width: 460px; width: calc(100% - 2rem); box-shadow: var(--shadow-3); color: var(--ink); }
dialog::backdrop { background: rgba(10,54,64,.5); backdrop-filter: blur(2px); }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 1rem; }
.text-right { text-align: right; } .nowrap { white-space: nowrap; }
.inline { display: inline; }
.strong { font-weight: 800; }
.chart { width: 100%; height: 180px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; font-size: var(--t-sm); margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 650; }
.doc-thumb { width: 160px; height: 110px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--line-2); }
.sr-label > label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section.mt-0 { padding-top: 0; }
.ticket-city span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.grid-2 > .panel + .panel, .grid-3 > .panel + .panel { margin-top: 0; }
@media (max-width: 900px) {
  .hero { padding: 1rem 0 6rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { padding: 1.5rem 0 0; }
  .hero h1 { max-width: none; margin-bottom: 1rem; }
  .hero .lede { margin-bottom: 1.25rem; }
  .hero-map { margin: .5rem -1.25rem -2.5rem; }
}
@media (max-width: 560px) {
  .hero-proof { gap: .5rem 1rem; }
  .hero-map { margin: .25rem -1.75rem -2rem -1rem; }
  .corridor-map .city-label-minor { display: none; }
  .corridor-map .city-label { font-size: 17px; }
  .corridor-map .map-river-name { display: none; }
}
@media (max-width: 560px) {
  .trip-hero h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  .trip-hero .date { margin-top: 1.25rem; }
}
.ticket-lane { margin-inline: 8px; }
.ticket-city strong { overflow-wrap: anywhere; }
.ticket-grid .ticket { grid-template-columns: minmax(0, 1fr) 138px; }
.ticket-grid .ticket-stub { padding-inline: 1.1rem; }
.ticket-grid .ticket-time { font-size: 1.5rem; }
@media (max-width: 640px) { .ticket-grid .ticket { grid-template-columns: 1fr; } }
