:root {
  --pink: #ebb3df;
  --pink-soft: #f7e4f3;
  --pink-tint: #fcf6fb;
  --pink-strong: #d482c3;
  --pink-deep: #6b245e;

  --bg: #faf5f9;
  --surface: #ffffff;
  --surface-muted: #f5ebf3;
  --border: #e8d3e4;
  --border-strong: #d9b6d3;

  --ink: #261323;
  --ink-muted: #65475f;
  --ink-subtle: #82627b;

  --free-bg: #def5e9;
  --free-border: #25875c;
  --free-ink: #125437;

  --taken-bg: #ebe1e9;
  --taken-border: #c5b0c1;
  --taken-ink: #846c80;

  --wars-bg: #fff1dc;
  --wars-border: #e5b776;
  --wars-ink: #6e3700;

  --delay-bg: #fde6ea;
  --delay-ink: #8f1d34;

  --shadow-sm: 0 2px 8px rgba(43, 22, 40, 0.05);
  --shadow-md: 0 10px 28px rgba(43, 22, 40, 0.1);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --font-sans: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

::selection {
  background: var(--pink);
  color: var(--ink);
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  caret-color: var(--pink-deep);
}

/* Scrollbars themed from palette */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--pink-deep);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* App Shell */
.app-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(40px, env(safe-area-inset-bottom));
}

/* Header */
.top-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* Direction toggle */
.dir-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.dir-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.dir-tab:hover:not(.active) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.dir-tab.active {
  background: var(--pink);
  border-color: var(--pink-strong);
  color: var(--ink);
}

.dir-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.dir-tab.active .dir-sub {
  color: var(--ink);
  opacity: 0.78;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--pink);
  color: var(--ink);
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.top-header h1 {
  margin: 0;
  font-size: clamp(1.125rem, 3.6vw, 1.375rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.route-subtitle {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--pink-tint);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.icon-pill:hover {
  background: var(--pink-soft);
  border-color: var(--border-strong);
}

.icon-pill.active {
  background: var(--pink);
  border-color: var(--pink-strong);
}

.icon-pill svg {
  width: 16px;
  height: 16px;
}

/* Search / Planner bar */
.planner-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--pink-tint);
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.field input:hover {
  border-color: var(--pink-deep);
}

.planner-buttons {
  display: flex;
  gap: 8px;
}

.btn-primary,
.btn-secondary {
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 140ms ease, transform 120ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--pink);
  border-color: var(--pink-strong);
  color: var(--ink);
}

.btn-primary:hover {
  background: #e4a1d6;
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--pink-soft);
}

.btn-wide {
  width: 100%;
}

/* Active alerts banner */
.alerts-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--pink-soft);
  border: 1px solid var(--pink-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
}

.alert-item-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.alert-item-text svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--pink-deep);
}

.alert-cancel {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.alert-cancel:hover {
  background: var(--pink);
}

/* Results meta */
.results-region {
  margin-top: 18px;
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 2px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.results-meta strong {
  color: var(--ink);
}

/* Train list */
.train-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.train-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.train-item:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px rgba(43, 22, 40, 0.07);
}

/* Clickable top train section */
.train-main {
  padding: 16px;
  cursor: pointer;
}

.train-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.train-times {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.time-big {
  font-family: var(--font-mono);
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.time-arrow {
  color: var(--ink-subtle);
  font-weight: 600;
}

.time-arr {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.train-duration {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-muted);
  padding: 3px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.train-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-seat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--pink-strong);
  background: var(--pink);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.btn-seat:hover {
  background: #e29fd4;
}

.btn-seat.is-open-seating {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--ink-muted);
  font-weight: 600;
}

.btn-seat svg,
.btn-bell svg {
  width: 15px;
  height: 15px;
}

.btn-bell {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn-bell:hover {
  background: var(--pink-soft);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-bell.armed {
  background: var(--pink);
  border-color: var(--pink-strong);
  color: var(--ink);
}

/* Train identity + WARS line */
.train-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-IC {
  background: #4e1f68;
  color: #ffffff;
}

.brand-TLK {
  background: #8f2964;
  color: #ffffff;
}

.brand-REG {
  background: #4a3952;
  color: #ffffff;
}

.train-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.wars-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--wars-bg);
  border: 1px solid var(--wars-border);
  color: var(--wars-ink);
  font-size: 0.76rem;
  font-weight: 700;
}

.wars-badge svg {
  width: 13px;
  height: 13px;
}

.time-strike {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-subtle);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.time-delayed {
  color: var(--delay-ink);
}

.delay-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--delay-bg);
  color: var(--delay-ink);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ontime-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--free-bg);
  color: var(--free-ink);
  font-size: 0.74rem;
  font-weight: 700;
}

.tram-dep-strike {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-subtle);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.tram-dep.delayed {
  color: var(--delay-ink);
}

.platform-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Connecting Trams Strip (clean hairline divider, Jakdojade-inspired scannability) */
.trams-strip {
  border-top: 1px solid var(--border);
  background: var(--pink-tint);
  padding: 12px 16px 14px;
}

.trams-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.trams-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tram-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.tram-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tram-dep {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tram-line-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1.5px solid var(--pink-deep);
  background: var(--pink-soft);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.tram-line-box svg {
  width: 13px;
  height: 13px;
}

.tram-middle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.pill-gap {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pill-ug {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pill-rt {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--free-bg);
  color: var(--free-ink);
}

.pill-rt.delayed {
  background: var(--delay-bg);
  color: var(--delay-ink);
}

.tram-ride {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trams-empty {
  font-size: 0.83rem;
  color: var(--ink-muted);
  padding: 4px 0;
}

.load-more-wrap {
  margin-top: 16px;
}

/* Skeleton / Empty / Error */
.state-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
}

.state-box h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.state-box p {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.skeleton-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skel {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--pink-soft) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.skel-lg { height: 26px; width: 48%; }
.skel-md { height: 15px; width: 72%; }
.skel-sm { height: 38px; width: 100%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Seat Map Modal / Sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(38, 19, 35, 0.44);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 12px;
}

@media (min-width: 680px) {
  .sheet-backdrop {
    align-items: center;
  }
}

.sheet-panel {
  width: 100%;
  max-width: 820px;
  max-height: 90dvh;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetIn 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--pink-tint);
  border-bottom: 1px solid var(--border);
}

.sheet-header h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sheet-subtitle {
  margin: 3px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.sheet-header-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--pink-soft);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.sheet-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Train summary strip inside sheet */
.seat-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--pink-tint);
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.seat-counts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-weight: 700;
}

.seat-counts > span {
  white-space: nowrap;
}

.count-free {
  color: var(--free-ink);
}

.count-taken {
  color: var(--ink-muted);
}

.seat-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  border: 1.5px solid;
}

.swatch-free {
  background: var(--free-bg);
  border-color: var(--free-border);
}

.swatch-taken {
  background: var(--taken-bg);
  border-color: var(--taken-border);
}

.swatch-selected {
  background: var(--pink);
  border-color: var(--pink-deep);
}

/* Wagon selector rail */
.wagon-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wagon-tab {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.wagon-tab:hover:not(:disabled) {
  border-color: var(--pink-strong);
  background: var(--pink-tint);
}

.wagon-tab.active {
  border-color: var(--pink-deep);
  background: var(--pink-soft);
}

.wagon-tab:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  background: var(--surface-muted);
}

.wagon-tab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 800;
  font-size: 0.86rem;
}

.wagon-class-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.wagon-tab.active .wagon-class-tag {
  background: var(--pink);
  color: var(--ink);
}

.wagon-free-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--free-ink);
  font-variant-numeric: tabular-nums;
}

.wagon-free-meta.full {
  color: var(--delay-ink);
}

.wagon-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.wagon-mini-tag {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.wagon-mini-tag.wars {
  background: var(--wars-bg);
  color: var(--wars-ink);
}

/* Active Wagon Floorplan */
.wagon-stage {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  padding: 12px;
}

.wagon-stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.wagon-stage-head strong {
  color: var(--ink);
}

.wagon-svg-scroll {
  overflow-x: auto;
  padding: 6px 2px 10px;
  -webkit-overflow-scrolling: touch;
}

.wagon-svg {
  display: block;
  min-width: 620px;
  width: 100%;
  height: auto;
  user-select: none;
}

.seat-node {
  cursor: pointer;
  transition: opacity 120ms ease;
}

.seat-node:hover .seat-box {
  stroke-width: 2.4;
}

.seat-detail-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.seat-status-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.seat-status-pill.free {
  background: var(--free-bg);
  color: var(--free-ink);
}

.seat-status-pill.taken {
  background: var(--taken-bg);
  color: var(--taken-ink);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* Mobile responsiveness */
@media (max-width: 620px) {
  .header-row {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .brand-lockup {
    flex: 1 1 100%;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .planner-bar {
    grid-template-columns: 1fr 1fr;
  }
  .planner-buttons {
    grid-column: 1 / -1;
  }
  .planner-buttons .btn-primary {
    flex: 1;
  }
  .results-meta {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .train-top {
    flex-direction: column;
    gap: 10px;
  }
  .train-actions {
    width: 100%;
    justify-content: space-between;
  }
  .btn-seat {
    flex: 1;
    justify-content: center;
  }
  .tram-row {
    grid-template-columns: auto 1fr auto;
    gap: 7px;
    padding: 7px 9px;
  }
  .tram-dep {
    font-size: 0.94rem;
  }
  .tram-middle {
    gap: 4px;
    font-size: 0.76rem;
  }
  .tram-ride {
    font-size: 0.74rem;
  }
}
