/* =========================================================================
   Quai — design system
   ========================================================================= */
:root {
  color-scheme: light;
  --bg: #f3f2ee;
  --bg-tint: #ebe9e3;
  --surface: #ffffff;
  --surface-2: #f6f5f2;
  --surface-3: #ecebe6;
  --line: rgba(20, 20, 24, 0.075);
  --line-strong: rgba(20, 20, 24, 0.14);
  --text: #121317;
  --text-2: #5b5f67;
  --text-3: #8d9098;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 91, 234, 0.1);
  --live: #0f9d58;
  --live-soft: rgba(15, 157, 88, 0.12);
  --warn: #b86e00;
  --warn-soft: rgba(230, 150, 20, 0.14);
  --danger: #d23b3b;
  --danger-soft: rgba(210, 59, 59, 0.1);
  --shadow-1: 0 1px 1px rgba(16, 17, 20, 0.03), 0 2px 10px rgba(16, 17, 20, 0.04);
  --shadow-2: 0 2px 4px rgba(16, 17, 20, 0.04), 0 18px 48px rgba(16, 17, 20, 0.12);
  --glass: rgba(243, 242, 238, 0.78);
  --skeleton: rgba(20, 20, 24, 0.06);
  --seg-on: #ffffff;
  --radius-lg: 22px;
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0b0d;
    --bg-tint: #101215;
    --surface: #15171b;
    --surface-2: #1b1e23;
    --surface-3: #242830;
    --line: rgba(255, 255, 255, 0.065);
    --line-strong: rgba(255, 255, 255, 0.12);
    --text: #f2f3f5;
    --text-2: #a2a7b0;
    --text-3: #6c717b;
    --accent: #8aa6ff;
    --accent-ink: #0a0b0d;
    --accent-soft: rgba(138, 166, 255, 0.14);
    --live: #3ddc84;
    --live-soft: rgba(61, 220, 132, 0.12);
    --warn: #f5b041;
    --warn-soft: rgba(245, 176, 65, 0.13);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.12);
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-2: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 64px rgba(0, 0, 0, 0.55);
    --glass: rgba(10, 11, 13, 0.72);
    --skeleton: rgba(255, 255, 255, 0.06);
    --seg-on: #333842;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0b0d;
  --bg-tint: #101215;
  --surface: #15171b;
  --surface-2: #1b1e23;
  --surface-3: #242830;
  --line: rgba(255, 255, 255, 0.065);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f2f3f5;
  --text-2: #a2a7b0;
  --text-3: #6c717b;
  --accent: #8aa6ff;
  --accent-ink: #0a0b0d;
  --accent-soft: rgba(138, 166, 255, 0.14);
  --live: #3ddc84;
  --live-soft: rgba(61, 220, 132, 0.12);
  --warn: #f5b041;
  --warn-soft: rgba(245, 176, 65, 0.13);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 64px rgba(0, 0, 0, 0.55);
  --glass: rgba(10, 11, 13, 0.72);
  --skeleton: rgba(255, 255, 255, 0.06);
  --seg-on: #333842;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
svg.i {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================================
   Layout
   ========================================================================= */
.app {
  min-height: 100dvh;
}
.pane {
  min-height: 100dvh;
}
.pane-home {
  padding-bottom: calc(40px + var(--safe-bottom));
}
.pane-detail {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.42s var(--ease), box-shadow 0.42s var(--ease);
  visibility: hidden;
  padding-bottom: calc(48px + var(--safe-bottom));
}
.app.has-detail .pane-detail {
  transform: none;
  visibility: visible;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.18);
}
.app.has-detail .pane-home {
  transform: translate3d(-24%, 0, 0);
  opacity: 0.6;
}
.pane-home {
  transition: transform 0.42s var(--ease), opacity 0.42s var(--ease);
}
.inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 1024px) {
  .app {
    display: grid;
    grid-template-columns: minmax(400px, 460px) 1fr;
    height: 100dvh;
    overflow: hidden;
  }
  .pane {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .pane-home {
    border-right: 1px solid var(--line);
    background: var(--bg);
  }
  .pane-detail,
  .app.has-detail .pane-detail {
    position: relative;
    inset: auto;
    z-index: auto;
    transform: none;
    visibility: visible;
    box-shadow: none;
    background: var(--bg-tint);
    transition: none;
  }
  .app.has-detail .pane-home {
    transform: none;
    opacity: 1;
  }
  .pane-detail .inner {
    max-width: 760px;
    padding: 0 40px;
  }
  .back-btn {
    display: none !important;
  }
}

/* =========================================================================
   Top bar & brand
   ========================================================================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + var(--safe-top)) var(--gutter) 6px;
  max-width: 640px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.03em;
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(74, 92, 246, 0.35);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.045em;
}
.brand-by {
  margin-top: 3px;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.01em;
  color: var(--text-3);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.clock {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text-2);
  padding: 0 8px;
  letter-spacing: -0.01em;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn.on {
  color: var(--accent);
}

.hero {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px var(--gutter) 14px;
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.01em;
}
.greeting {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 8vw, 38px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.greeting span {
  color: var(--text-3);
}

/* =========================================================================
   Search
   ========================================================================= */
.search-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 0 12px;
  padding-top: calc(10px + var(--safe-top) * 0.6);
  background: linear-gradient(var(--bg) 70%, transparent);
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 8px 0 16px;
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-1);
}
.search .i {
  color: var(--text-3);
  width: 20px;
  height: 20px;
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.search input::placeholder {
  color: var(--text-3);
}
.search input::-webkit-search-cancel-button {
  display: none;
}
.kbd {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 2px 7px;
  margin-right: 6px;
}
.search-clear {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: none;
  place-items: center;
  color: var(--text-3);
}
.search.has-value .search-clear {
  display: grid;
}
.search.has-value .kbd {
  display: none;
}
@media (hover: none) {
  .kbd {
    display: none;
  }
}

/* =========================================================================
   Sections
   ========================================================================= */
.section {
  margin-top: 22px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}
.section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
}
.section-action {
  font-size: 14px;
  font-weight: 550;
  color: var(--accent);
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
  overflow: hidden;
}
.list > * + * {
  border-top: 1px solid var(--line);
}

/* =========================================================================
   Line badges
   ========================================================================= */
.badge {
  --c: #888;
  --t: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 50%;
  background: var(--c);
  color: var(--t);
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 14px;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge sup {
  font-size: 0.46em;
  margin-left: 0.5px;
  letter-spacing: -0.02em;
  position: relative;
  top: -0.5em;
  line-height: 1;
}
.badge.m-metro {
  width: 26px;
  padding: 0;
  border-radius: 50%;
}
.badge.m-metro.wide {
  width: auto;
  padding: 0 6px;
  border-radius: 13px;
}
.badge.m-rer,
.badge.m-train {
  border-radius: 8px;
  width: 26px;
  padding: 0;
}
.badge.m-train {
  border-radius: 50% 50% 8px 8px / 40% 40% 8px 8px;
}
.badge.m-tram {
  border-radius: 6px;
  box-shadow: inset 0 2.5px 0 rgba(255, 255, 255, 0.35), inset 0 -2.5px 0 rgba(0, 0, 0, 0.12);
}
.badge.m-bus {
  border-radius: 6px;
  font-size: 13px;
  min-width: 34px;
}
.badge.m-cable,
.badge.m-funicular,
.badge.m-shuttle {
  border-radius: 7px;
  font-size: 12px;
}
.badge.lg {
  min-width: 44px;
  height: 44px;
  font-size: 22px;
}
.badge.lg.m-metro,
.badge.lg.m-rer,
.badge.lg.m-train {
  width: 44px;
}
.badge.lg.m-rer,
.badge.lg.m-train {
  border-radius: 12px;
}
.badge.lg.m-bus,
.badge.lg.m-tram {
  border-radius: 10px;
  padding: 0 10px;
  font-size: 20px;
}
.badge.xl {
  min-width: 64px;
  height: 64px;
  font-size: 32px;
}
.badge.xl.m-metro,
.badge.xl.m-rer,
.badge.xl.m-train {
  width: 64px;
}
.badge.xl.m-rer,
.badge.xl.m-train {
  border-radius: 17px;
}
.badge.xl.m-bus,
.badge.xl.m-tram,
.badge.xl.m-shuttle,
.badge.xl.m-cable,
.badge.xl.m-funicular {
  border-radius: 14px;
  padding: 0 14px;
  font-size: 28px;
}
.badge.sm {
  min-width: 20px;
  height: 20px;
  font-size: 11px;
}
.badge.sm.m-metro,
.badge.sm.m-rer,
.badge.sm.m-train {
  width: 20px;
}
.badge.sm.m-rer,
.badge.sm.m-train {
  border-radius: 6px;
}
.badge.sm.m-bus,
.badge.sm.m-tram {
  min-width: 26px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 10.5px;
}
.badge.sm.m-metro.wide {
  width: auto;
  padding: 0 4px;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.more-bus {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  padding: 0 4px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: var(--surface-3);
}

/* =========================================================================
   Rows (stations, résultats)
   ========================================================================= */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 64px;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.row:hover,
.row.active {
  background: var(--surface-2);
}
.row:active {
  background: var(--surface-3);
}
.row-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-2);
}
.row-body {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-title mark {
  background: none;
  color: var(--accent);
}
.row-sub {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--text-3);
}
.row-sub .town {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
  max-width: 45%;
}
.row-meta {
  text-align: right;
  font-size: 13px;
  color: var(--text-3);
  flex: none;
}
.row-meta strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.chev {
  color: var(--text-3);
  width: 16px;
  height: 16px;
}

/* lignes trouvées */
.line-results {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.line-results::-webkit-scrollbar {
  display: none;
}
.line-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 8px 14px 8px 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform 0.15s, background 0.15s;
}
.line-chip:hover,
.line-chip.active {
  background: var(--surface-2);
}
.line-chip:active {
  transform: scale(0.97);
}
.line-chip .lc-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.line-chip .lc-sub {
  font-size: 12px;
  color: var(--text-3);
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 4px;
}

/* =========================================================================
   Favoris
   ========================================================================= */
.fav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 72px;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}
.fav:hover {
  background: var(--surface-2);
}
.fav-station {
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-dir {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-times {
  text-align: right;
}
.fav-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  color: var(--text-2);
  font-size: 14px;
}
.fav-empty .star-tile {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
}

/* =========================================================================
   Temps d'attente
   ========================================================================= */
.wait {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wait .n {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.wait .u {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.wait.soon .n,
.wait.soon .u {
  color: var(--live);
}
.wait .rt {
  align-self: flex-start;
  margin-right: 2px;
  color: var(--live);
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
  animation: rt 2.2s ease-in-out infinite;
}
@keyframes rt {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.pill-now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  color: var(--live);
  background: var(--live-soft);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.pill-now::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s ease-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 9px transparent;
  }
}
.next {
  margin-top: 5px;
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.next b {
  font-weight: 600;
  color: var(--text-2);
}
.late {
  color: var(--warn);
  font-weight: 600;
}
.cancel {
  color: var(--danger);
  font-weight: 600;
}

/* =========================================================================
   Vue détail (station / ligne)
   ========================================================================= */
.detail-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + var(--safe-top)) 12px 10px;
  background: var(--glass);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.detail-bar.scrolled {
  border-bottom-color: var(--line);
}
.detail-bar .bar-title {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
}
.detail-bar.scrolled .bar-title {
  opacity: 1;
  transform: none;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 38px;
  padding: 0 12px 0 6px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--accent);
}
.back-btn:hover {
  background: var(--surface-3);
}
@media (min-width: 1024px) {
  .detail-bar {
    padding: 14px 28px;
    background: color-mix(in srgb, var(--bg-tint) 80%, transparent);
  }
}

.detail-head {
  padding: 6px 0 18px;
}
.detail-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 7.5vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 750;
  text-wrap: balance;
}
.detail-sub {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  color: var(--text-2);
  font-size: 14px;
}
.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
}
.detail-badges {
  margin-top: 14px;
}

.walk-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.walk-label {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-right: 2px;
}
.walk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background 0.15s;
}
.walk:hover {
  background: var(--surface-2);
}
.walk-min {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
}
.approx {
  margin: 0 4px 10px;
  font-size: 13px;
  color: var(--text-3);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-3);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 550;
}
.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 var(--live);
  animation: pulse 2s ease-out infinite;
  color: var(--live);
}
.status.demo .dot {
  background: var(--warn);
  color: var(--warn);
}
.status.error .dot {
  background: var(--danger);
  color: var(--danger);
  animation: none;
}
.refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
}
.refresh:hover {
  color: var(--text);
}
.refresh.spin .i {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.progress {
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 16px;
}
.progress > i {
  display: block;
  height: 100%;
  width: 100%;
  background: color-mix(in srgb, var(--text-3) 70%, transparent);
  transform-origin: left;
  transform: scaleX(0);
}

.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 14px;
  padding: 0 var(--gutter);
}
.filters::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all 0.2s var(--ease);
}
.chip:hover {
  color: var(--text);
}
.chip.on {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.chip .count {
  opacity: 0.55;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* Carte d'une ligne dans une station */
.line-card {
  margin-bottom: 12px;
  scroll-margin-top: 80px;
}
.line-card.highlight {
  box-shadow: 0 0 0 2px var(--lc, var(--accent)), var(--shadow-1);
}
.lc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  width: 100%;
  text-align: left;
}
.lc-head:hover .lc-name {
  color: var(--accent);
}
.lc-name {
  flex: 1;
  min-width: 0;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-name small {
  display: block;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  flex: none;
}
.tag.alert {
  color: var(--warn);
  background: var(--warn-soft);
}
.tag.ok {
  color: var(--live);
  background: var(--live-soft);
}
.tag.info {
  color: var(--accent);
  background: var(--accent-soft);
}
.dir {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 12px 16px;
  border-top: 1px solid var(--line);
}
.dir-label {
  min-width: 0;
}
.dir-to {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.015em;
}
.dir-to span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.dir-to .i {
  align-self: flex-start;
  margin-top: 2px;
}
.dir-to .i {
  width: 15px;
  height: 15px;
  color: var(--text-3);
  stroke-width: 2.2;
}
.dir-alt {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 21px;
}
.dir-times {
  text-align: right;
  min-width: 70px;
}
.pin {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.pin:hover {
  background: var(--surface-3);
  color: var(--text-2);
}
.pin.on {
  color: var(--accent);
}
.pin.on .i {
  fill: currentColor;
}
.pin.pop {
  animation: pop 0.35s var(--ease);
}
@keyframes pop {
  40% {
    transform: scale(1.25);
  }
}

/* Départs détaillés (RER / Transilien) */
.deps {
  border-top: 1px solid var(--line);
  padding: 4px 0;
}
.deps-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 4px 16px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.deps-head span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dep {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
}
.dep-dest {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dep-meta {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.mission {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
}
.dep .wait .n {
  font-size: 22px;
}
.dep.cancelled .dep-dest {
  text-decoration: line-through;
  color: var(--text-3);
}
.no-dep {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-3);
}

/* Messages trafic */
.alert-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--text);
  margin: 0 12px 12px;
  font-size: 14px;
  line-height: 1.45;
}
.alert-card.info {
  background: var(--accent-soft);
}
.alert-card .i {
  color: var(--warn);
  margin-top: 1px;
}
.alert-card.info .i {
  color: var(--accent);
}
.alert-card .t {
  font-weight: 650;
  margin-bottom: 2px;
}
.alert-card .b {
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.alert-card.open .b {
  -webkit-line-clamp: unset;
  display: block;
}
.alert-card button {
  margin-top: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
}

.more-alerts {
  display: block;
  margin: -4px 16px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Bannière mode démo */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--warn-soft);
  font-size: 13.5px;
  color: var(--text);
  margin-top: 4px;
}
.banner .i {
  color: var(--warn);
}
.banner b {
  font-weight: 650;
}
.banner button {
  margin-left: auto;
  flex: none;
  font-weight: 650;
  color: var(--accent);
  padding: 6px 4px;
}

/* =========================================================================
   Vue ligne : schéma vertical
   ========================================================================= */
.line-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0 18px;
}
.line-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 38px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 750;
}
.line-hero p {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 14px;
  text-wrap: balance;
}
.termini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-2);
}
.termini .i {
  color: var(--text-3);
}
.termini b {
  color: var(--text);
  font-weight: 600;
}
.filter-input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.filter-input .i {
  color: var(--text-3);
}
.filter-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font-size: 15px;
}
.diagram {
  --lc: #888;
  padding: 10px 0;
}
.stop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 14px 8px 52px;
  text-align: left;
  transition: background 0.15s;
}
.stop:hover {
  background: var(--surface-2);
}
.stop::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 0;
  bottom: 0;
  width: 5px;
  margin-left: -2.5px;
  background: var(--lc);
}
.stop.first::before {
  top: 50%;
}
.stop.last::before {
  bottom: 50%;
}
.stop::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--lc);
  box-sizing: border-box;
}
.stop.hub::after {
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border-width: 3px;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--surface);
}
.stop.terminus::after {
  width: 17px;
  height: 17px;
  margin: -8.5px 0 0 -8.5px;
  background: var(--lc);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2.5px var(--lc);
}
.stop-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.01em;
}
.stop.terminus .stop-name,
.stop.hub .stop-name {
  font-weight: 700;
}
.stop-name small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 1px;
}
.stop .badges {
  justify-content: flex-end;
  max-width: 48%;
}
.stop.hidden {
  display: none;
}
.branch {
  position: relative;
  margin-left: 26px;
}
.branch-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px 4px 46px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
/* raccord : part du point d'ancrage sur le tronc, s'incurve vers la branche */
.branch-head::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: -1px;
  top: -28.5px;
  width: 28.5px;
  height: 62.5px;
  border-top: 5px solid var(--lc);
  border-right: 5px solid var(--lc);
  border-top-right-radius: 18px;
}
.stop::after {
  z-index: 2;
}
.branch .stop {
  padding-left: 52px;
}
.branch .stop::before,
.branch .stop::after {
  left: 25px;
}
.branch-head + .stop::before {
  top: 0;
}
.branch-wrap {
  position: relative;
}
.branch-wrap::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 0;
  bottom: 0;
  width: 5px;
  margin-left: -2.5px;
  background: var(--lc);
}
.branch-wrap.tail::before {
  display: none;
}

/* =========================================================================
   Explorer les lignes
   ========================================================================= */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-3);
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg button {
  flex: 1 0 auto;
  height: 34px;
  padding: 0 9px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.seg button.on {
  background: var(--seg-on);
  color: var(--text);
  box-shadow: var(--shadow-1);
}
.line-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  padding: 14px;
}
.line-grid a {
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 14px;
  transition: background 0.15s, transform 0.15s;
}
.line-grid a:hover {
  background: var(--surface-2);
}
.line-grid a:active {
  transform: scale(0.94);
}
.bus-group + .bus-group {
  border-top: 1px solid var(--line);
}
.bus-group h4 {
  margin: 0;
  padding: 14px 16px 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bus-grid {
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
}
.bus-grid a {
  height: 46px;
}
.bus-filter {
  margin: 12px 14px 0;
}

/* Proximité */
.geo-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  width: 100%;
  text-align: left;
}
.geo-cta .row-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.geo-cta strong {
  display: block;
  font-weight: 600;
  font-size: 15px;
}
.geo-cta span {
  font-size: 13px;
  color: var(--text-3);
}

/* Récents */
.recents {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.recents::-webkit-scrollbar {
  display: none;
}
.recent {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.recent .i {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.foot {
  margin: 36px auto 0;
  max-width: 640px;
  padding: 0 var(--gutter);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}
.foot a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================================================
   Écran vide (desktop)
   ========================================================================= */
.blank {
  height: 100%;
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px;
}
.blank-clock {
  font-family: var(--font-display);
  font-size: clamp(72px, 10vw, 132px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.blank-clock span {
  color: var(--text-3);
  animation: blink 2s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.blank p {
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: 16px;
}
.blank .hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-3);
}
.blank-lines {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
  max-width: 520px;
  opacity: 0.9;
}

/* =========================================================================
   Skeleton & transitions
   ========================================================================= */
.sk {
  background: var(--skeleton);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}
.fade-in {
  animation: fadeIn 0.45s var(--ease) both;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.tick {
  animation: tick 0.5s var(--ease);
}
@keyframes tick {
  from {
    opacity: 0.2;
    transform: translateY(-4px);
  }
}

/* =========================================================================
   Feuille (réglages)
   ========================================================================= */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.3s;
}
.sheet-backdrop.open {
  opacity: 1;
}
.sheet {
  position: fixed;
  z-index: 61;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-2);
  padding: 10px 22px calc(26px + var(--safe-bottom));
  transform: translateY(105%);
  transition: transform 0.42s var(--ease);
}
.sheet.open {
  transform: none;
}
@media (min-width: 720px) {
  .sheet {
    left: 50%;
    bottom: auto;
    top: 50%;
    width: 520px;
    border-radius: 26px;
    transform: translate(-50%, -46%) scale(0.98);
    opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.25s;
    padding-bottom: 26px;
  }
  .sheet.open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}
.grabber {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-strong);
  margin: 0 auto 14px;
}
@media (min-width: 720px) {
  .grabber {
    display: none;
  }
}
.sheet h2 {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.03em;
}
.sheet .lead {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 14px;
}
.field {
  margin-bottom: 18px;
}
.field label,
.field .label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  margin-bottom: 8px;
}
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  outline: 0;
  font-size: 15px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field .help {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}
.field .help a {
  color: var(--accent);
  font-weight: 600;
}
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  height: 46px;
  padding: 0 18px;
  border-radius: 13px;
  font-weight: 650;
  font-size: 15px;
  background: var(--surface-3);
  color: var(--text);
  transition: transform 0.15s, opacity 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--text);
  color: var(--bg);
}
.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}
.mode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-2);
  margin-bottom: 18px;
  font-size: 14px;
}
.mode-card .status {
  color: var(--text);
}
.mode-card small {
  display: block;
  color: var(--text-3);
  font-weight: 500;
  margin-top: 2px;
}
.note {
  font-size: 13px;
  margin-top: 10px;
}
.note.ok {
  color: var(--live);
}
.note.err {
  color: var(--danger);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 80;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-2);
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Splash */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.4s;
}
.splash.gone {
  opacity: 0;
  pointer-events: none;
}
.splash .brand {
  gap: 14px;
}
.splash .brand-name {
  font-size: 34px;
}
.splash .brand-by {
  font-size: 12.5px;
  margin-top: 5px;
}
.splash .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    transform: scale(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
