:root {
  --bg: #080b13;
  --surface: #111725;
  --line: #263147;
  --text: #f7f8fb;
  --muted: #929db1;
  --soft: #c9d0dd;
  --green: #3ddc97;
  --amber: #ffbd59;
  --red: #ff6b74;
  --rer-a: #e43d30;
  --rer-h: #8d5aa7;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 15% -10%, #1b2947 0, transparent 35rem), var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
.shell {
  width: min(1480px, 100%);
  margin: auto;
  padding: 22px 26px 32px;
}
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #6d9aff, #426fd5);
  box-shadow: 0 8px 25px #386bc455;
  font-weight: 800;
}
.brand h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.35px;
}
.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.now {
  text-align: center;
}
.now time {
  display: block;
  font-size: 31px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -1.3px;
}
.now span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}
.sync-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.sync-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.sync-status.live {
  color: var(--green);
}
.sync-status.cached {
  color: var(--soft);
}
.sync-status.stale,
.sync-status.unavailable {
  color: var(--amber);
}
.journey-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 14px;
}
.journey-card,
.rer-card {
  background: linear-gradient(145deg, #151c2b, #101621);
  border: 1px solid #222d41;
  border-radius: 18px;
  box-shadow: 0 12px 40px #0004;
}
.journey-card {
  padding: 18px;
  min-height: 245px;
}
.journey-card-primary {
  background: linear-gradient(145deg, #17243a, #101723);
  border-color: #304362;
}
.journey-heading,
.best-lead,
.section-heading,
.rer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.eyebrow,
.best-label,
.alternatives-title {
  display: block;
  color: #8290a7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.3px;
}
.journey-heading h2,
.section-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: -0.55px;
}
.best-trip {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #080d178c;
  border: 1px solid #ffffff0d;
}
.leave-time {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  letter-spacing: -0.6px;
}
.connection {
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 750;
}
.connection.comfortable {
  background: #173b31;
  color: #69e7b2;
}
.connection.tight {
  background: #48361b;
  color: #ffd080;
}
.connection.impossible {
  background: #482128;
  color: #ff9a9f;
}
.trip-path {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  align-items: center;
  margin-top: 14px;
}
.trip-step {
  display: grid;
  grid-template-columns: 25px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  min-width: 0;
}
.step-icon {
  grid-row: 1/3;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: #263650;
  color: #cfe0ff;
  font-size: 11px;
  font-weight: 900;
}
.trip-step.bus .step-icon {
  background: #194b45;
  color: #69e7d7;
}
.trip-step.train .step-icon {
  background: #552a2a;
  color: #ffaaa4;
}
.trip-step.home .step-icon {
  background: #403153;
  color: #ddb9f3;
}
.step-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.step-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.step-detail {
  grid-column: 2;
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.path-connector {
  text-align: center;
  color: #526078;
}
.alternatives {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
}
.alternative-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: #ffffff08;
  min-width: 0;
  font-size: 11px;
}
.bus-badge {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #1b554e;
  color: #82ecd9;
  font-weight: 850;
}
.alternative-time,
.departure-time {
  font-variant-numeric: tabular-nums;
}
.alternative-arrow {
  color: #536079;
}
.alternative-main {
  white-space: nowrap;
}
.connection.compact {
  margin-left: auto;
  padding: 4px 6px;
}
.journey-card.is-compact {
  min-height: 0;
  padding-top: 15px;
  padding-bottom: 15px;
}
.journey-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ffffff0b;
}
.fallback-message {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.fallback-rer {
  display: grid;
  grid-template-columns: 24px auto auto;
  align-items: center;
  gap: 4px 8px;
  min-width: 245px;
}
.fallback-icon {
  grid-row: 1/3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--rer-a);
  font-size: 11px;
  font-weight: 900;
}
.fallback-label {
  grid-column: 2/4;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.fallback-time {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.fallback-minutes {
  color: var(--soft);
  font-size: 11px;
}
.fallback-unavailable {
  grid-column: 2/4;
  color: var(--muted);
  font-size: 11px;
}
.section-heading {
  margin: 18px 2px 10px;
}
.section-heading h2 {
  font-size: 18px;
}
.refresh-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #ffffff12;
  border-radius: 9px;
  background: #ffffff08;
  color: var(--soft);
  font-size: 15px;
  cursor: pointer;
}
.refresh-button:hover {
  background: #182136;
}
.refresh-button:focus-visible,
.segment button:focus-visible {
  outline: 3px solid #83a9ff;
  outline-offset: 2px;
}
.refresh-button.is-loading span {
  display: block;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.rer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.rer-card {
  padding: 15px;
  min-width: 0;
}
.rer-header {
  justify-content: flex-start;
}
.rer-header h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-badge {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.line-badge.rer-a {
  background: var(--rer-a);
}
.line-badge.rer-h {
  background: var(--rer-h);
}
.segment {
  display: none;
  margin: 13px 0 8px;
  padding: 3px;
  border-radius: 10px;
  background: #090e18;
}
.segment button {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.segment button.active {
  background: #273248;
  color: #fff;
  box-shadow: 0 2px 8px #0005;
}
.direction-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
}
.direction-panel {
  min-width: 0;
}
.direction-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.departure {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid #ffffff0b;
}
.departure-time {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.3px;
}
.departure-minutes {
  color: var(--soft);
  font-size: 11px;
  font-weight: 650;
}
.departure.due .departure-minutes {
  color: var(--amber);
  font-weight: 850;
}
.empty,
.skeleton {
  color: var(--muted);
  font-size: 11px;
  padding: 12px 0;
}
.skeleton {
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}
@media (max-width: 1100px) {
  .shell {
    padding: 18px;
  }
  .rer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .rer-card:last-child {
    grid-column: 1/-1;
  }
  .journey-grid {
    grid-template-columns: 1fr 1fr;
  }
  .trip-path {
    grid-template-columns: 1fr 16px 1fr 16px 1fr;
  }
  .alternatives {
    grid-template-columns: 1fr;
  }
  .alternatives-title {
    margin-top: 3px;
  }
}
@media (max-width: 720px) {
  .shell {
    padding: 14px 12px 24px;
  }
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 14px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .brand p {
    display: none;
  }
  .now {
    text-align: right;
  }
  .now time {
    font-size: 25px;
  }
  .now span {
    font-size: 10px;
  }
  .sync-status {
    font-size: 11px;
  }
  .sync-actions {
    grid-column: 1/-1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: space-between;
    margin-top: -2px;
  }
  .journey-grid {
    grid-template-columns: 1fr;
  }
  .journey-card {
    min-height: 0;
    padding: 15px;
  }
  .journey-card.is-compact {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .journey-fallback {
    align-items: flex-end;
    margin-top: 9px;
    padding-top: 9px;
  }
  .fallback-rer {
    min-width: 0;
  }
  .journey-heading h2 {
    font-size: 19px;
  }
  .best-trip {
    padding: 12px;
  }
  .leave-time {
    font-size: 21px;
  }
  .trip-path {
    grid-template-columns: 1fr 14px 1fr 14px 1fr;
  }
  .step-detail {
    display: none;
  }
  .alternatives {
    grid-template-columns: 1fr;
  }
  .rer-grid {
    grid-template-columns: 1fr;
  }
  .rer-card:last-child {
    grid-column: auto;
  }
  .rer-card {
    padding: 14px;
  }
  .segment {
    display: flex;
  }
  .direction-columns {
    display: block;
    margin-top: 4px;
  }
  .direction-panel {
    display: none;
  }
  .rer-card[data-selected="sgl"] [data-feed="sgl"],
  .rer-card[data-selected="auber"] [data-feed="auber"],
  .rer-card[data-selected="gdn"] [data-feed="gdn"],
  .rer-card[data-selected="stleu"] [data-feed="stleu"],
  .rer-card[data-selected="sgl-chatelet-aller"]
    [data-feed="sgl-chatelet-aller"],
  .rer-card[data-selected="chatelet-sgl-retour"]
    [data-feed="chatelet-sgl-retour"] {
    display: block;
  }
  .direction-title {
    display: none;
  }
  .departure {
    padding: 8px 2px;
  }
  .departure-time {
    font-size: 19px;
  }
  .section-heading {
    margin-top: 20px;
  }
}
@media (max-width: 390px) {
  .journey-fallback {
    display: grid;
    gap: 10px;
  }
  .trip-step {
    grid-template-columns: 22px 1fr;
    column-gap: 6px;
  }
  .step-icon {
    width: 22px;
    height: 22px;
  }
  .step-value {
    font-size: 12px;
  }
  .connection {
    font-size: 9px;
  }
  .alternative-row {
    gap: 6px;
  }
}

.journey-grid { grid-template-columns: minmax(0, 1fr); }
.journey-card { min-height: 0; }
.direction-switch { background: #273248; color: var(--text); border: 1px solid #526078; border-radius: 9px; padding: 9px 12px; cursor: pointer; flex-shrink: 0; }
.direction-switch:focus-visible { outline: 3px solid #83a9ff; }
.personal-path { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 16px 0; font-size: 14px; }
.final-arrival { display: block; font-size: 19px; }
.disruption { color: var(--amber); overflow-wrap: anywhere; }
.alternative-row { flex-wrap: wrap; }
@media (max-width: 720px) {
  .personal-path { display: grid; gap: 10px; }
  .best-lead { flex-wrap: wrap; }
  .journey-heading h2 { font-size: 18px; }
  .direction-switch { padding: 8px; font-size: 12px; }
}

.next-buses { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.next-buses h2 { margin: 0 0 10px; }
.bus-directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.bus-directions section { min-width: 0; }
.bus-directions h3 { margin: 0 0 7px; font-size: 12px; color: var(--soft); }
.bus-passage { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 5px 0; border-top: 1px solid #ffffff0b; font-size: 12px; }
.bus-passage .departure-time { font-size: 16px; }
.next-buses .empty { margin: 0; padding: 5px 0; }
.journey-grid { margin-top: 18px; }
@media (max-width: 720px) {
  .next-buses { padding: 12px; }
  .bus-directions { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .bus-directions h3 { font-size: 11px; }
}

/* Discreet link to the mini-city: fixed, so it never shifts the dashboard layout. */
.ville-link {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111725e6;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
