:root {
  /* Board */
  --bg: #01157f;
  --fg: #f5f7ff;
  --accent: #fee401;
  --border: #335;
  --clock-bg: #00245f;
  --control-h: 32.5px; /* uniform height for inputs/buttons/selects */

  /* Status */
  --danger: #ff5252;

  /* SBB-ish */
  --sbb-red: #da291c;
  --sbb-blue: #204b78;

  /* Remark */
  --remark: #fee401;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #000;
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

/* ------------------------------------------------------------------ */
/* BOARD LAYOUT                                                       */
/* ------------------------------------------------------------------ */

.board {
  background: var(--bg);
  border-radius: 16px;
  padding: 16px 20px 14px;
  max-width: 900px;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-fullscreen-wrapper {
  width: 100%;
  max-width: 960px;
  padding: 16px;
}

/* Header = clock + title left / actions right (search + descendre) */

.board-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.header-left {
  display: flex;
  gap: 16px;
  align-items: center;
}

.header-right {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.language-switcher {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 80px;
}

.language-switcher--compact {
  align-items: flex-end;
  min-width: auto;
  margin-bottom: 6px;
}

.language-switcher--inline {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  min-width: auto;
}

.language-switcher--compact .language-select {
  min-width: 60px;
  padding: 2px 4px 2px 9px;
  font-size: 0.78rem;
  background-position: right 6px center;
  background-size: 9px 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.language-switcher label {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
}

.clock-block {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--clock-bg);
  flex-shrink: 0;
}

.cff-clock {
  width: 100%;
  height: 100%;
  border: none;
}

.title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.title-block h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}


.station-subtitle {
  margin-top: 2px;
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 1;
}
.digital-clock {
  margin-top: 4px;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: none;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;

  /* Align with the station title (left), not with the header's right edge */
  display: block;
  min-width: 0;
  text-align: left;
}

/* ------------------------------------------------------------------ */
/* FILTER TOGGLE "DESCENDRE"                                         */
/* ------------------------------------------------------------------ */

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.18);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.filter-toggle .filter-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.filter-toggle.is-on {
  background: #fee401;
  color: #111;
  border-color: transparent;
}

.filter-toggle.is-on .filter-indicator {
  background: #12b33d;
}

.filter-toggle.is-hidden {
  display: none;
}

/* ------------------------------------------------------------------ */
/* INFO BUTTON (inline helper)                                       */
/* ------------------------------------------------------------------ */

.info-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.18);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.info-button:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

.info-button:active {
  transform: translateY(1px);
}

.info-button__icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* TABLE                                                              */
/* ------------------------------------------------------------------ */

.departures {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.departures thead th {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.departures thead tr {
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.departures thead th.col-min {
  text-align: center;
}

.col-line {
  width: 1%;
  text-align: left;
  white-space: nowrap;

  /* Match body spacing between Ligne and Destination */
  padding-right: 14px;
}

.col-dest {
  text-align: left;
}

.col-time {
  width: 80px;
  text-align: left;
}

.col-platform {
  width: 5rem;
  text-align: center;
}

.col-min {
  width: 70px;
  text-align: center;
}

.col-remark {
  width: 160px;
  text-align: left;

  /* avoid wrapping in the remark column */
  white-space: nowrap;

  /* align numeric content nicely (e.g., "-1 min", "Retard env. 3 min") */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.departures tbody tr:nth-child(odd) {
  background: var(--bg);
}

.departures tbody tr:nth-child(even) {
  background: transparent;
}

.departures tbody tr:not(.empty-row) td {
  padding: 7px 8px;
  font-size: 1rem;
  vertical-align: middle;
}

/* ligne de séparation fine entre les lignes */
#departures-body tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#departures-body tr:last-child {
  border-bottom: none;
}

/* ------------------------------------------------------------------ */
/* PLATFORM / LINE FILTERS                                           */
/* ------------------------------------------------------------------ */

.legacy-filters {
  display: none;
}

.platform-filter-container,
.line-filter-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 2px;
  font-size: 0.9rem;
  position: relative;
}

.platform-filter-label,
.line-filter-label {
  font-weight: 600;
}

.platform-select,
.line-select,
.language-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 4px 28px 4px 10px; /* leave space for custom chevron */
  font-size: 0.85rem;
  background-color: rgba(0, 0, 0, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M2 2l4 4 4-4' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  color: var(--fg);
  cursor: pointer;
  outline: none;
  width: auto;
  min-width: 0;
}

/* Uniform control height across the station input row */
.station-input-wrapper input,
.station-input-wrapper button:not(.info-button),
.info-button,
.platform-select,
.line-select,
.language-select,
#favorites-select {
  height: var(--control-h);
  min-height: var(--control-h);
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

/* Language selector: inverse (blue on white) */
.language-select {
  min-width: 50px;
  padding: 0 18px 0 9px;
  font-size: 0.8rem;
  font-weight: 700;
  background-color: #ffffff;
  color: #01157f;
  border-color: #01157f;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M2 2l4 4 4-4' stroke='%2301157f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 6px center;
  background-size: 9px 6px;
}

/* Keep language select aligned with other controls even in compact mode */
.language-switcher--compact .language-select {
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 28px 0 10px;
  font-size: 0.82rem;
  background-position: right 8px center;
  background-size: 10px 7px;
}

/* Favorites select: add a star icon before the chevron */
#favorites-select {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fee401'%3E%3Cpath d='M12 17.3l6.18 3.7-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M2 2l4 4 4-4' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  background-repeat: no-repeat;
  background-position:
    left 10px center,   /* ⭐ */
    right 10px center;  /* ˅ */

  background-size:
    14px 14px,
    12px 8px;

  padding-left: 32px;  /* space for star */
  padding-right: 28px; /* space for chevron */
}

.platform-select::-ms-expand,
.line-select::-ms-expand,
.language-select::-ms-expand,
#favorites-select::-ms-expand {
  display: none;
}

.platform-select:focus,
.line-select:focus,
.language-select:focus {
  box-shadow: 0 0 0 1px #ffffff, 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.language-select:focus {
  box-shadow: 0 0 0 1px #01157f, 0 0 0 3px rgba(1, 21, 127, 0.25);
}

/* ------------------------------------------------------------------ */
/* CELLS                                                              */
/* ------------------------------------------------------------------ */

.col-line-cell {
  text-align: left;
  white-space: nowrap;
  width: 1%;

  /* Give a bit more breathing room before Destination */
  padding-right: 14px;
}

.col-time-cell {
  width: 80px;
}

.col-min-cell {
  width: 70px;
  text-align: center;
}

/* time & min columns: align numbers nicely */
.col-time-cell,
.col-min-cell,
.col-platform-cell {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.col-platform-cell {
  text-align: center;
  opacity: 0.9;
}

.platform-change-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  font-weight: 400;
  background: transparent;
  color: #ffffff;
}

.platform-badge--current {
  color: var(--accent);
  font-weight: 800;
}

.platform-badge--prev {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: line-through;
}

.platform-change-arrow {
  font-weight: 800;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.favorite-chip__content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}

.favorite-chip__name {
  flex: 1;
  text-align: left;
}

.favorite-chip__select {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
}

.favorites-manage-mode .favorite-chip__select {
  display: inline-flex;
}

.filter-chip.is-active .favorite-chip__select {
  background: #da291c;
  border-color: #da291c;
  color: #ffffff;
}

/* Remarque (delays / info trafic) */
.col-remark-cell {
  font-weight: 600;
  font-size: 0.9rem;

  /* keep delay/early values readable and aligned */
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.col-remark-cell.status-delay {
  color: var(--remark); /* yellow for Retard */
}

.col-remark-cell.status-early {
  color: #3ddc5a; /* green for En avance */
}

.col-remark-cell.status-cancelled {
  color: #ff4d4f; /* red for Supprimé */
}

.col-empty {
  text-align: center;
  padding: 42px 12px 32px;
  font-weight: 700;
  font-size: 1.05rem;
}

.departures tbody tr.line-separator td {
  border-top: 4px solid rgba(255, 255, 255, 0.35);
}

#departures-body tr.empty-row td.col-empty {
  border-top: none;
}

.departures tbody tr.clickable {
  cursor: pointer;
}

.departures tbody tr.clickable:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Line chips (served lines) */
.line-chips {
  display: none;
  margin: 10px 0 6px;
  font-size: 0.9rem;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.line-chips-label {
  font-weight: 600;
}

.line-chips-container {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ------------------------------------------------------------------ */
/* LINE BADGES                                                        */
/* ------------------------------------------------------------------ */

/* generic pill */
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 35px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  overflow: visible; /* allow the night stripe to extend behind */
}

.line-badge.is-clickable {
  cursor: pointer;
}

.line-badge.is-clickable:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.line-badge.is-active-filter {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* fallback: mimic onboard LED signs when no specific line color exists */
.line-badge[class*="line-generic-"],
.line-badge.line-generic {
  background: #2f2f2f;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Train badge = rectangle SBB-ish */
.line-train {
  border-radius: 4px;
  padding-inline: 10px;
}

/* ---------------- BUS LINES (TL palette approx) ------------------- */

/* TL / Lausanne core lines 1–9 (plus 5) */
.line-tl-1 { background: #e16f64; }
.line-tl-2 { background: #f1b343; }
.line-tl-3 { background: #949598; }
.line-tl-4 { background: #4aa45a; }
.line-tl-5 { background: #4aa7e6; } /* non fourni, conservé */
.line-tl-6 { background: #4eace9; }
.line-tl-7 { background: #2c307c; }
.line-tl-8 { background: #845395; }
.line-tl-9 { background: #9b2f84; }

/* TL / Lausanne extended network (13+ etc.) */
.line-tl-13 { background: #59978f; }
.line-tl-16 { background: #beb434; }
.line-tl-17 { background: #d8342d; }
.line-tl-18 { background: #74c8f4; }
.line-tl-19 { background: #3562af; }
.line-tl-20 { background: #d38139; }
.line-tl-21 { background: #b85c81; }
.line-tl-24 { background: #97b277; }
.line-tl-25 { background: #546f9f; }
.line-tl-32 { background: #968abc; }
.line-tl-33 { background: #537128; }
.line-tl-38 { background: #b38943; }
.line-tl-41 { background: #9b2f84; }
.line-tl-45 { background: #3f8a92; }
.line-tl-54 { background: #a56547; }
.line-tl-58 { background: #59b9d5; }
.line-tl-64 { background: #b64648; }

/* TL / Lausanne extra lines */
.line-tl-31 { background: #649ab4; }
.line-tl-35 { background: #f4ae4b; }
.line-tl-36 { background: #a1b3bd; }
.line-tl-42 { background: #c6999f; }
.line-tl-44 { background: #efa2b3; }
.line-tl-46 { background: #b4a030; }
.line-tl-47 { background: #cda167; }
.line-tl-48 { background: #899ed1; }
.line-tl-49 { background: #b695c0; }
.line-tl-56 { background: #1d4aa0; }
.line-tl-60 { background: #9ac04a; }
.line-tl-68 { background: #6363a5; }
.line-tl-69 { background: #9994c4; }
.line-tl-LEB,
.line-tl-BUS-LEB,
.line-tl-Bus-LEB { background: #71af48; }

/* TL / Lausanne metro */
.line-tl-M1,
.line-tl-M2 {
  background: #dd1c80;
  color: #ffffff;
}




/* -------------------------------------------------------------- */
/* Unified night-bus baseline (used by ui.js via .line-night) */
/* TL Night lines (N1..N6): black pill + yellow text + thin stripe */
/* (implemented with pseudo-elements so the stripe can sit behind) */
/* -------------------------------------------------------------- */

/* Baseline for any night line (optional helper class from UI) */
.line-night {
  background: #000000;
  color: #ffd600;
}

.line-tl-N1, .line-tl-N2, .line-tl-N3, .line-tl-N4, .line-tl-N5, .line-tl-N6 {
  color: #ffd600;

  /* IMPORTANT: keep the element itself transparent;
     we draw the black pill with ::after so ::before can sit behind it */
  background: transparent;

  position: relative;
  z-index: 0;
  overflow: visible;
}

/* Thin stripe behind the pill (visible on the sides) */
.line-tl-N1::before, .line-tl-N2::before, .line-tl-N3::before,
.line-tl-N4::before, .line-tl-N5::before, .line-tl-N6::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  /* thin stripe behind the badge */
  height: 6px;

  /* always slightly wider than the badge itself */
  width: calc(100% + 18px);

  border-radius: 999px;
  background: var(--night-stripe, #ffffff);
  z-index: -2;
  opacity: 0.9;
}

/* Black pill background (behind text, above the stripe) */
.line-tl-N1::after, .line-tl-N2::after, .line-tl-N3::after,
.line-tl-N4::after, .line-tl-N5::after, .line-tl-N6::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000000;
  border-radius: 999px;
  z-index: -1;
}

/* Stripe colors (approx) */
.line-tl-N1 { --night-stripe: #6ea8d6; }
.line-tl-N2 { --night-stripe: #d889b5; }
.line-tl-N3 { --night-stripe: #4ea06c; }
.line-tl-N4 { --night-stripe: #d86464; }
.line-tl-N5 { --night-stripe: #e3a067; }
.line-tl-N6 { --night-stripe: #7f5ea6; }

/* ---------------- MBC (Morges) BUS LINES ------------------------- */
.line-mbc-2003 { background: #9e9e9e; }      /* Funi */
.line-mbc-R56 { background: #5cb85c; }
.line-mbc-R57 { background: #2f6b2f; }
.line-mbc-701 { background: #2f5f2f; }
.line-mbc-702 { background: #e6952d; }
.line-mbc-703 { background: #6e2e8b; }
.line-mbc-704 { background: #9ac43c; color: #1b1818; }
.line-mbc-705 { background: #5a3a16; }
.line-mbc-706 { background: #d6cf4a; color: #1b1818; }
.line-mbc-724 { background: #9a5c9a; }
.line-mbc-726 { background: #4da3e3; }
.line-mbc-730 { background: #7a7a7a; }
.line-mbc-735 { background: #d62a7a; }
.line-mbc-736 { background: #7e7eb8; }
.line-mbc-740 { background: #d45a1e; }
.line-mbc-742 { background: #b52a2a; }
.line-mbc-750 { background: #1e2e7a; }
.line-mbc-752 { background: #d18bb5; color: #1b1818; }
.line-mbc-760 { background: #4fa6a0; }

/* ---------------- TPN (Nyon) BUS LINES --------------------------- */
.line-tpn-803 { background: #e63023; }
.line-tpn-804 { background: #019741; }
.line-tpn-805 { background: #f17c01; }
.line-tpn-810 { background: #c59bc5; }
.line-tpn-811 { background: #8b3f8f; }
.line-tpn-813 { background: #f0a9b0; color: #1b1818; }
.line-tpn-814 { background: #173f73; }
.line-tpn-815 { background: #9e2f2f; }
.line-tpn-818 { background: #7a4a2a; }
.line-tpn-891 { background: #f2c94c; color: #1b1818; }

/* ---------------- VMCV (Riviera) BUS LINES ---------------------- */

.line-vmcv-201 { background: #0069b4; }
.line-vmcv-202 { background: #f39c12; }
.line-vmcv-203 { background: #9b59b6; }
.line-vmcv-204 { background: #16a085; }
.line-vmcv-205 { background: #e74c3c; }
.line-vmcv-206 { background: #f1c40f; }
.line-vmcv-207 { background: #1abc9c; }
.line-vmcv-208 { background: #d35400; }
.line-vmcv-209 { background: #8e44ad; }
.line-vmcv-210 { background: #2980b9; }
.line-vmcv-211 { background: #27ae60; }
.line-vmcv-212 { background: #c0392b; }
.line-vmcv-213 { background: #7f8c8d; }
.line-vmcv-214 { background: #2c3e50; }
.line-vmcv-215 { background: #00a8e8; }

.line-vmcv-216 { background: #7cb342; }
.line-vmcv-217 { background: #ff7043; }
.line-vmcv-218 { background: #ab47bc; }

/* VMCV night lines (keep explicit backgrounds; not all UIs add `.line-night`) */
.line-vmcv-N290 { background: #000000; color: #f1c40f; }
.line-vmcv-N291 { background: #111111; color: #f1c40f; }

/* Swiss PostAuto buses */
.line-postbus {
  background: #f6d13a;
  color: #111111;
  border-radius: 6px;
  min-width: 48px;
  padding: 3px 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}



/* ------------------------------------------------------------------ */
/* ⚠️ LEGACY FALLBACK
   These generic .line-XX rules exist ONLY as fallback
   when network detection fails.
   Do not add new colors here.
*/
/* LEGACY FALLBACK (generic) */
/* TPG fallback (when a Geneva line is rendered without the `ge-` prefix)
   Goal: avoid “white on blue” badges when network detection is generic.
   NOTE: we ONLY define reveal-missing lines (mostly 20+ and letters).
   We do NOT redefine TL core lines 1–9 / 13 / 16 / 17 / 18 / 19 / 20 / 21 / 24 / 25 / 31 / 32 / 33 / 35 / 36 / 38 / 41 / 42 / 44 / 45 / 47 / 48 / 49 / 54 / 56 / 58 / 60 / 64 / 68 / 69
   because those are used in Lausanne.

   If a line is already defined above (TL), we leave it alone.
*/

/* Geneva numbers that were missing on the board (no `ge-` prefix) */
.line-10 { background: #057449; }
.line-11 { background: #7b6bbe; }

/* The ones you reported missing (23 / 28 / 53 / 57) */
.line-22 { background: #5b2b86; }
.line-23 { background: #b0428f; }
.line-28 { background: #7c4fa8; }

/* Teal family used a lot in TPG visuals */
.line-34 { background: #a8cfc6; color: #1e191a; }
.line-37 { background: #1f5b57; }
.line-38 { background: #1f5b57; }
.line-39 { background: #49b0a3; }
.line-40 { background: #a8cfc6; color: #1e191a; }

.line-41 { background: #49b0a3; }
.line-42 { background: #49b0a3; }
.line-43 { background: #a8cfc6; color: #1e191a; }
.line-44 { background: #49b0a3; }
.line-45 { background: #a8cfc6; color: #1e191a; }

.line-46 { background: #49b0a3; }
.line-47 { background: #49b0a3; }
.line-48 { background: #a8cfc6; color: #1e191a; }

.line-50 { background: #49b0a3; }
.line-51 { background: #49b0a3; }
.line-52 { background: #a8cfc6; color: #1e191a; }
.line-53 { background: #a8cfc6; color: #1e191a; }

.line-55 { background: #1f5b57; }
.line-57 { background: #a8cfc6; color: #1e191a; }
.line-59 { background: #1f5b57; }

/* Pink family */
.line-61 { background: #f68bcb; color: #1e191a; }
.line-66 { background: #f68bcb; color: #1e191a; }
.line-67 { background: #f68bcb; color: #1e191a; }

.line-70 { background: #49b0a3; }
.line-71 { background: #1f5b57; }
.line-72 { background: #a8cfc6; color: #1e191a; }
.line-73 { background: #1f5b57; }
.line-74 { background: #a8cfc6; color: #1e191a; }
.line-75 { background: #1f5b57; }
.line-78 { background: #1f5b57; }

.line-80 { background: #f3b7d6; color: #1e191a; }
.line-82 { background: #e236a4; }
.line-83 { background: #e236a4; }

.line-91 { background: #00545b; }
.line-92 { background: #6cc5b4; color: #1e191a; }
.line-97 { background: #3ca556; }

/* Geneva lettered lines (A/E/G/L) if they render without `ge-` */
.line-A { background: #f3700c; }
.line-E { background: #f3700c; }
.line-G { background: #f89ad0; color: #1b1818; }
.line-L { background: #f3700c; }

/* ------------------------------------------------------------------ */
/* TPG (Geneva) */
/* ------------------------------------------------------------------ */

.line-tpg-12 { background: #f89c0c; }
.line-tpg-13 { background: #6ab656; }
.line-tpg-14 { background: #3d3597; }
.line-tpg-15 { background: #753f23; }
.line-tpg-16 { background: #e58cb5; }
.line-tpg-17 { background: #66ccf5; }
.line-tpg-18 { background: #9e3aa3; }

.line-tpg-2  { background: #c0e23d; color: #1b1818; }
.line-tpg-3  { background: #9f37a4; }
.line-tpg-6  { background: #189fe2; }
.line-tpg-7  { background: #62ba28; }
.line-tpg-10 { background: #047449; }
.line-tpg-19 { background: #9e6200; }

.line-tpg-1  { background: #3a3298; }
.line-tpg-5  { background: #66cdf5; }
.line-tpg-8  { background: #763d1e; }
.line-tpg-9  { background: #da122a; }
.line-tpg-11 { background: #7b6bbe; }
.line-tpg-20 { background: #62ba28; }
.line-tpg-21 { background: #680c40; }
.line-tpg-22 { background: #3a3298; }
.line-tpg-23 { background: #9f37a4; }
.line-tpg-25 { background: #955621; }
.line-tpg-28 { background: #8c70d2; }
.line-tpg-29 { background: #ed0080; color: #fee5b5; }
.line-tpg-31 { background: #2fb9ad; }
.line-tpg-32 { background: #80d2b9; color: #1b1818; }
.line-tpg-33 { background: #2fb9ad; }
.line-tpg-34 { background: #80d2b9; color: #1b1818; }
.line-tpg-37 { background: #237e86; }
.line-tpg-38 { background: #237e86; }
.line-tpg-39 { background: #2fb9ad; }
.line-tpg-40 { background: #80d2b9; color: #1b1818; }
.line-tpg-41 { background: #2fb9ad; }
.line-tpg-42 { background: #2fb9ad; }
.line-tpg-43 { background: #80d2b9; color: #1b1818; }
.line-tpg-44 { background: #2fb9ad; }
.line-tpg-45 { background: #80d2b9; color: #1b1818; }
.line-tpg-46 { background: #2fb9ad; }
.line-tpg-47 { background: #2fb9ad; }
.line-tpg-48 { background: #6cc5b4; color: #1e191a; }
.line-tpg-50 { background: #2fb9ad; }
.line-tpg-51 { background: #2fb9ad; }
.line-tpg-52 { background: #80d2b9; color: #1b1818; }
.line-tpg-53 { background: #80d2b9; color: #1b1818; }
.line-tpg-54 { background: #86d5bb; color: #1b1818; }
.line-tpg-55 { background: #237e86; }
.line-tpg-57 { background: #80d2b9; color: #1b1818; }
.line-tpg-58 { background: #2fb9ad; }
.line-tpg-59 { background: #237e86; }
.line-tpg-60 { background: #e236a4; }
.line-tpg-61 { background: #f68bcb; color: #1e191a; }
.line-tpg-64 { background: #f03da9; }
.line-tpg-66 { background: #f68bcb; color: #1e191a; }
.line-tpg-67 { background: #f68bcb; color: #1e191a; }
.line-tpg-68 { background: #f03da9; }
.line-tpg-69 { background: #f68bcb; color: #1e191a; }
.line-tpg-70 { background: #2fb9ad; }
.line-tpg-71 { background: #237e86; }
.line-tpg-72 { background: #80d2b9; color: #1b1818; }
.line-tpg-73 { background: #237e86; }
.line-tpg-74 { background: #80d2b9; color: #1b1818; }
.line-tpg-75 { background: #237e86; }
.line-tpg-78 { background: #237e86; }
.line-tpg-80 { background: #f68bcb; color: #1e191a; }
.line-tpg-82 { background: #e236a4; }
.line-tpg-83 { background: #e236a4; }
.line-tpg-91 { background: #00545b; }
.line-tpg-92 { background: #6cc5b4; color: #1e191a; }
.line-tpg-97 { background: #3ca556; }

.line-tpg-A     { background: #f3700c; }
.line-tpg-E     { background: #f3700c; }
.line-tpg-Eplus { background: #171714; }
.line-tpg-EPLUS { background: #171714; }
.line-tpg-G     { background: #f89ad0; color: #1b1818; }
.line-tpg-Gplus { background: #1e191a; }
.line-tpg-GPLUS { background: #1e191a; }
.line-tpg-L     { background: #f3700c; }
.line-tpg-M     { background: #81cd23; color: #111110; }
.line-tpg-N     { background: #41a2dd; }

.line-tpg-A1 { background: #7b6bbe; }
.line-tpg-A2 { background: #057449; }
.line-tpg-A3 { background: #21b140; }
.line-tpg-A4 { background: #189fe2; }
.line-tpg-A5 { background: #f03da9; }
.line-tpg-A6 { background: #e236a4; }

.line-tpg-C1,
.line-tpg-C3,
.line-tpg-C4,
.line-tpg-C5,
.line-tpg-C6,
.line-tpg-C7,
.line-tpg-C8,
.line-tpg-C9 {
  background: #ffffff;
  color: #1e191a;
}

/* ------------------------------------------------------------------ */
/* ZVV / VBZ (Zurich) */
/* ------------------------------------------------------------------ */

.line-zvv-2  { background: #ed1c24; }
.line-zvv-3  { background: #00ac4f; }
.line-zvv-4  { background: #49479d; }
.line-zvv-5  { background: #956438; }
.line-zvv-6  { background: #d99f4f; }
.line-zvv-7  { background: #231f20; }
.line-zvv-8  { background: #a6ce39; color: #000000; }
.line-zvv-9  { background: #49479d; }
.line-zvv-10 { background: #ee3897; }
.line-zvv-11 { background: #00ac4f; }
.line-zvv-12 { background: #7ad0e2; color: #000000; }
.line-zvv-13 { background: #ffd503; color: #000000; }
.line-zvv-14 { background: #00aeef; }
.line-zvv-15 { background: #ed1c24; }
.line-zvv-17 { background: #9e1762; }
.line-zvv-20 { background: #9e1762; }

/* ---------------- TRAIN LINES (SBB-like) -------------------------- */

.train-longdistance {
  background: var(--sbb-red);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-style: italic;
  border-radius: 4px;
}

.train-rexpress {
  background: #ffffff;
  color: var(--sbb-red);
  border: 2px solid var(--sbb-red);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.train-regio {
  background: #ffffff;
  color: #000000;
  border: 2px solid #000000;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.train-pe {
  background: var(--sbb-red);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-style: italic;
  border-radius: 4px;
}

/* compact SBB rectangles */
.line-badge.train-longdistance,
.line-badge.train-rexpress,
.line-badge.train-regio,
.line-badge.train-pe {
  min-width: 60px;
  padding: 0 4px 1px;
  font-size: 0.78rem;
  border-radius: 4px;
  justify-content: flex-start;
}

.line-badge.train-longdistance-solo {
  justify-content: flex-start;
  min-width: 60px;
}

/* ------------------------------------------------------------------ */
/* ARRIVAL ICONS (0 min)                                             */
/* ------------------------------------------------------------------ */

.bus-arrival-icon,
.train-arrival-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  fill: #ffffff;
}

.pulse-bus,
.pulse-train {
  animation: pulse-zoom 1s ease-in-out infinite;
}

@keyframes pulse-zoom {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}

/* ------------------------------------------------------------------ */
/* STATION SEARCH CARD                                                */
/* ------------------------------------------------------------------ */

.station-card {
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.station-card-inline {
  padding: 6px 10px 4px;
}

.station-card label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
}

.station-input-block {
  position: relative;
}

.station-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.station-input-wrapper input {
  flex: 1;
  border-radius: 999px;
  border: none;
  padding: 6px 10px;
  font-size: 0.9rem;
  outline: none;
}

.station-input-wrapper button:not(.info-button) {
  border-radius: 999px;
  border: none;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  background: #fee401;
  color: #111;
  font-weight: 600;
}

.station-input-wrapper .info-button {
  padding: 6px 10px;
  font-size: 0.75rem;
  height: 100%;
}

.station-suggestions {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 20;
  max-height: 190px;
  padding: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}

.station-suggestion-item {
  padding: 4px 10px;
  cursor: pointer;
  background: #000d53;
}

.station-suggestion-item:hover {
  background: #202a68;
}

.loading-hint {
  display: none;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--accent);
  font-style: italic;
}

.loading-hint.is-visible {
  display: block;
}

/* Quick controls: view segmented + filters + favorites */
.quick-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.quick-controls__label {
  font-weight: 600;
  font-size: 0.8rem;
  color: #ffffff;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.segmented-btn {
  border: none;
  background: transparent;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 750;
  border-radius: 999px;
  cursor: pointer;
  min-width: 110px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.segmented-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.segmented-btn.is-active {
  background: #ffffff;
  color: #01157f;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  position: relative;
}

.filters-pill,
.fav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  font-weight: 750;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.filters-pill:hover,
.fav-pill:hover {
  background: rgba(0, 0, 0, 0.3);
}

.filters-pill:active,
.fav-pill:active {
  transform: translateY(1px);
}

.filters-pill.is-active {
  background: #fee401;
  color: #01157f;
  border-color: #fee401;
}

.filters-pill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fav-pill.is-active {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fee401;
  color: #fee401;
}

.filters-pill__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filters-pill__icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.mode-pill {
  gap: 10px;
}

.mode-pill__state {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.mode-pill.is-active .mode-pill__state {
  opacity: 1;
}

.fav-pill__icon {
  font-size: 1rem;
}

.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #01157f;
  color: #fee401;
  font-size: 0.75rem;
  font-weight: 800;
}

.pill-count.is-hidden {
  display: none;
}

.link-button {
  border: none;
  background: transparent;
  color: #fee401;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: none;
}

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

.is-hidden {
  display: none !important;
}

.fav-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #021a8f;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 10px 12px 12px;
  width: min(320px, calc(100vw - 24px));
  z-index: 35;
}

.fav-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.fav-popover__title {
  font-weight: 780;
}

.fav-popover__close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
}

.filters-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #021a8f;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  padding: 12px 12px 10px;
  width: min(520px, calc(100vw - 24px));
  z-index: 34;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filters-popover.is-hidden {
  display: none;
}

.filters-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filters-popover__title {
  font-weight: 780;
  font-size: 1rem;
}

.filters-popover__close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
}

.filters-popover__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.filters-popover__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.mode-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #021a8f;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  padding: 12px 12px 10px;
  width: min(420px, calc(100vw - 24px));
  z-index: 34;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-popover.is-hidden {
  display: none;
}

.mode-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mode-popover__title {
  font-weight: 780;
  font-size: 1rem;
}

.mode-popover__close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
}

.mode-popover__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.mode-popover__body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

.mode-popover__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* Infos + Descendre stay compact on the same row */
#info-btn,
.filter-toggle {
  flex: 0 0 auto;
}

/* Station search card goes on the next line and takes width */
.header-right .station-card {
  flex: 1 1 100%;
  max-width: 420px;
}

/* ------------------------------------------------------------------ */
/* ACCESSIBILITY FOCUS STATES                                         */
/* ------------------------------------------------------------------ */

.filter-toggle:focus-visible,
.platform-select:focus-visible,
.line-select:focus-visible,
.station-input-wrapper input:focus-visible,
.station-input-wrapper button:focus-visible {
  outline: 2px solid #fee401;
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* FOOTER                                                             */
/* ------------------------------------------------------------------ */

.board-footer {
  display: flex;
  justify-content: flex-end;
  font-size: 0.55rem;
  opacity: 0.7;
  margin-top: 4px;
}

.filters-section {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 12px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-section__title {
  font-weight: 750;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.filters-section__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 4px;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 8px;
}

.switch-row input {
  width: 18px;
  height: 18px;
}

.switch-label {
  font-weight: 650;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

.filter-chip.is-active {
  background: #fee401;
  color: #01157f;
  border-color: #fee401;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.filter-chip.is-ghost {
  border-style: dashed;
  opacity: 0.8;
}

.filters-empty {
  margin-top: 6px;
  font-size: 0.82rem;
  opacity: 0.7;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: transparent;
  color: #ffffff;
  font-weight: 750;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.ghost-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.primary-button {
  border: none;
  background: #fee401;
  color: #01157f;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.primary-button:active {
  transform: translateY(1px);
}

.danger-button {
  border: none;
  background: #da291c;
  color: #ffffff;
  font-weight: 780;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ------------------------------------------------------------------ */
/* INFO PANEL OVERLAY                                                 */
/* ------------------------------------------------------------------ */

.info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.info-overlay.is-visible {
  display: flex;
}

.info-panel {
  background: #021a8f;
  color: var(--fg);
  border-radius: 16px;
  max-width: 640px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 18px 20px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  font-size: 0.9rem;
}

.info-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.info-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.info-panel-close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 4px;
}

.info-panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-panel-section-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.info-panel-body p {
  line-height: 1.4;
}

.info-panel-body ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.info-panel-body li {
  margin-bottom: 2px;
}

.journey-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 45;
}

.journey-overlay.is-visible {
  display: flex;
}

.journey-panel {
  background: #021a8f;
  color: var(--fg);
  border-radius: 16px;
  max-width: 720px;
  width: 92%;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  font-size: 0.9rem;
  max-height: 90vh;
  overflow: auto;
}

.journey-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.journey-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.journey-dest {
  font-weight: 600;
}

.journey-close {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 4px;
}

.journey-meta {
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  opacity: 0.85;

  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.journey-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
}

.journey-stops {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.journey-stop {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;

  /* Slightly tighter + cleaner row */
  padding: 6px 10px 6px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);

  position: relative;
}

/* A tiny bit more emphasis for origin / last stop */
.journey-stop.is-origin {
  background: rgba(255, 255, 255, 0.06);
}

.journey-stop.is-last {
  background: rgba(0, 0, 0, 0.16);
}

.journey-stop-name {
  font-weight: 650;
  letter-spacing: 0.01em;
}

.journey-stop-platform {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 600;
}

.journey-stop-times {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;

  /* Keep a consistent right column, but not overly wide */
  min-width: 104px;
  position: relative;
  padding-right: 64px;
}

.journey-stop-time-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  justify-content: flex-end;
}

.journey-stop-time-label {
  font-size: 0.68rem;
  opacity: 0.6;
  letter-spacing: 0.02em;
  text-transform: none;

  /* keeps labels visually aligned even when only one row is present */
  min-width: 2.4rem;
  text-align: right;
}

.journey-stop-time-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 1.05rem;
  font-weight: 700;
}

.journey-stop-dot {
  position: relative;
  width: 9px;
  min-width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fee401;

  /* Slight depth so the dot reads better on dark rows */
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18);
}

.journey-stop::after {
  content: "";
  position: absolute;

  /* Align the vertical line with the dot center */
  left: 8px;
  top: 16px;
  bottom: -6px;

  width: 2px;
  background: rgba(255, 255, 255, 0.5);
}

.journey-stop.is-last::after {
  display: none;
}

.journey-stop-content {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.journey-stop-platform {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 6px;
}

.journey-stop-platform.small {
  position: absolute;
  right: 0;
  top: 0;

  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  min-width: 26px;
}

@media (max-width: 600px) {
  .info-panel {
    max-width: 95%;
    width: 95%;
    padding: 14px 14px 12px;
    font-size: 0.85rem;
  }

  /* On small screens, the right column should feel like “just the times” */
  .journey-stop-times {
    min-width: 72px;
    padding-right: 0;
  }

  .journey-stop-time-label {
    display: none;
  }

  .journey-stop-time-row {
    justify-content: flex-end;
    gap: 0;
  }

  .journey-stop-platform.small {
    position: static;
    margin-top: 2px;
    align-self: flex-end;
  }
}

/* ------------------------------------------------------------------ */
/* RESPONSIVE                                                         */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
  .mobile-fullscreen-wrapper {
    max-width: 100%;
    padding: 0;
  }

  body {
    background: var(--bg);
    display: block;
    min-height: 100vh;
  }

  .board {
    border-radius: 0;
    max-width: 100%;
    width: 100%;
    height: 100vh;
    margin: 0;
    box-shadow: none;
    padding: 8px 10px 10px; /* tighter inner padding on mobile */
  }

  .board-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-right {
    align-items: center;
  }

  .title-block h1 {
    font-size: 1.5rem;
  }

  .digital-clock {
    font-size: 0.85rem;
  }

  .quick-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filters-popover,
  .fav-popover {
    width: calc(100vw - 20px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .segmented-control {
    width: 100%;
    justify-content: space-between;
  }

  .segmented-control .segmented-btn {
    flex: 1;
    text-align: center;
  }

  .quick-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .departures tbody td {
    font-size: 0.9rem;
  }

  .platform-filter-container,
  .line-filter-container {
    display: inline-flex;
    flex-wrap: nowrap;
    margin-top: 6px;
    margin-right: 8px;
  }

  /* On mobile, keep spacing but a bit tighter */
  .col-line,
  .col-line-cell {
    padding-right: 10px;
  }
}

@media (max-width: 420px) {
  /* If the phone is very narrow, reduce the gap so Destination keeps priority */
  .col-line,
  .col-line-cell {
    padding-right: 6px;
  }

  .station-input-wrapper {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .station-input-wrapper input {
    flex: 1 1 0%;
    min-width: 0;
  }

  .station-input-wrapper .language-switcher--inline {
    margin-left: 0;
  }

  .station-input-wrapper button:not(.info-button) {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .station-input-wrapper .info-button {
    padding: 6px 8px;
  }

  .language-switcher--inline .language-select {
    min-width: 52px;
  }
}
