:root {
  --navy: #071b49;
  --navy-2: #0c3275;
  --teal: #0f8b8d;
  --cyan: #61dce0;
  --green: #11845b;
  --orange: #ea6b14;
  --purple: #7457c5;
  --red: #c2413d;
  --ink: #122033;
  --muted: #64748b;
  --line: #d8e7f5;
  --soft-blue: #eef7ff;
  --soft-teal: #e9fbfb;
  --soft-orange: #fff3e8;
  --card: #ffffff;
  --shadow: 0 24px 80px rgba(7, 27, 73, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15,139,141,.22), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(97,220,224,.2), transparent 28rem),
    linear-gradient(135deg, #f7fbff 0%, #eaf4ff 55%, #fff 100%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.phone-shell {
  width: min(100%, 452px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
}
.app {
  min-height: 100vh;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.app-header {
  padding: 18px 18px 16px;
  color: #fff;
  background:
    linear-gradient(150deg, rgba(7,27,73,.96), rgba(12,50,117,.92)),
    radial-gradient(circle at 80% 10%, rgba(97,220,224,.45), transparent 16rem);
}
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 56px; height: 56px; border-radius: 19px; position: relative;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #0e4a8f, #13a3a5 70%, #70f4ed);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.38), 0 12px 30px rgba(0,0,0,.2);
}
.logo-mark strong { font-size: 2rem; line-height: 1; }
.logo-mark .pin { position: absolute; top: 5px; right: 8px; font-size: .88rem; opacity: .85; }
.micro { margin: 0; color: var(--teal); font-weight: 900; letter-spacing: .07em; text-transform: uppercase; font-size: .7rem; }
.micro.soft { color: #a9f8f4; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.34rem; letter-spacing: -.02em; }
.lang-toggle {
  border: 1px solid rgba(255,255,255,.38); color: #fff; background: rgba(255,255,255,.13);
  border-radius: 999px; padding: 9px 11px; font-weight: 900; font-size: .76rem;
}
.greeting-card {
  margin-top: 18px; padding: 16px; border: 1px solid rgba(255,255,255,.22); border-radius: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(255,255,255,.12); backdrop-filter: blur(18px);
}
.greeting-card h2 { margin-bottom: 5px; font-size: 1.55rem; }
.greeting-card p:last-child { margin-bottom: 0; color: #e1efff; line-height: 1.42; font-size: .92rem; }
.avatar { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); font-weight: 1000; font-size: 1.3rem; }

.journey-hero { margin: -1px 14px 14px; padding: 18px; border-radius: 0 0 30px 30px; background: linear-gradient(135deg, #fff, #f3fbff); border: 1px solid var(--line); border-top: 0; display: grid; grid-template-columns: 24px 1fr 74px; gap: 12px; align-items: center; }
.route-line { height: 128px; display: flex; flex-direction: column; align-items: center; }
.dot { width: 18px; height: 18px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 3px var(--teal); background: var(--teal); }
.dot.destination { box-shadow: 0 0 0 3px var(--red); background: var(--red); }
.path { flex: 1; width: 3px; background: linear-gradient(var(--teal), var(--red)); margin: 7px 0; border-radius: 99px; }
.status-badge { display: inline-flex; border-radius: 999px; padding: 7px 10px; font-size: .76rem; font-weight: 1000; margin-bottom: 9px; }
.status-badge.risk { background: var(--soft-orange); color: #b44a00; }
.journey-copy h2 { color: var(--navy); font-size: 1.1rem; line-height: 1.22; margin-bottom: 7px; }
.journey-copy p { color: var(--muted); font-size: .88rem; line-height: 1.42; margin-bottom: 0; }
.eta-box { border-radius: 22px; padding: 12px 8px; background: var(--navy); color: #fff; display: grid; place-items: center; text-align: center; }
.eta-box span, .eta-box small { color: #a9f8f4; font-weight: 900; font-size: .7rem; }
.eta-box strong { font-size: 1.2rem; line-height: 1.05; }

.safety-strip { margin: 0 14px 14px; padding: 14px; border-radius: 24px; border: 1px solid rgba(17,132,91,.24); background: linear-gradient(135deg, #f0fff7, #fff); display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; }
.shield-icon { width: 40px; height: 40px; border-radius: 15px; background: #dff8eb; display: grid; place-items: center; }
.safety-strip strong { color: var(--green); display: block; margin-bottom: 3px; }
.safety-strip p { color: var(--muted); margin-bottom: 0; font-size: .84rem; line-height: 1.35; }
.safety-strip > span { color: var(--green); font-size: 1.4rem; }

.tabs { display: flex; gap: 8px; padding: 0 14px 13px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: #fff; color: var(--navy); white-space: nowrap; font-weight: 900; font-size: .8rem; }
.tab.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.screen-stack { padding: 0 14px 22px; }
.screen { display: none; animation: fadeUp .2s ease both; }
.screen.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 4px 0 13px; }
.section-heading h2 { color: var(--navy); font-size: 1.2rem; letter-spacing: -.02em; margin-bottom: 0; }
.trust-chip, .updated { display: inline-flex; align-items: center; justify-content: center; padding: 7px 9px; border-radius: 999px; font-weight: 1000; white-space: nowrap; font-size: .68rem; }
.trust-chip.live { background: var(--soft-teal); color: var(--teal); }
.trust-chip.estimate { background: #fff7df; color: #996600; }
.trust-chip.sample { background: #f1ecff; color: var(--purple); }
.trust-chip.safety { background: #e7f9ef; color: var(--green); }
.trust-chip.check { background: #eaf4ff; color: var(--navy-2); }
.trust-chip.official { background: #e7f9ef; color: var(--green); }
.updated { background: var(--soft-blue); color: var(--navy-2); }

.next-action-card, .metric-card, .management-card, .planner-form, .route-card, .status-row, .route-option, .map-card, .safety-panel, .safety-actions button, .privacy-note, .notification, .trust-panel { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 10px 26px rgba(7,27,73,.06); }
.next-action-card { padding: 15px; display: grid; grid-template-columns: 48px 1fr; gap: 13px; align-items: center; background: linear-gradient(135deg, #fff, var(--soft-teal)); border-color: rgba(15,139,141,.28); }
.action-icon { width: 48px; height: 48px; border-radius: 18px; display: grid; place-items: center; background: var(--navy); font-size: 1.35rem; }
.next-action-card h3, .management-card h3, .route-card h3, .status-row h3, .route-option h3, .safety-panel h3, .notification strong, .trust-panel h3 { color: var(--navy); margin-bottom: 5px; }
.next-action-card p:last-child, .management-card p:last-child, .route-card p, .status-row p, .route-option p, .safety-panel p, .privacy-note p, .notification p, .trust-panel p { color: var(--muted); margin-bottom: 0; line-height: 1.42; font-size: .88rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 12px 0; }
.metric-card { padding: 14px 9px; text-align: center; }
.metric-card span { color: var(--navy); display: block; font-size: 1.45rem; font-weight: 1000; line-height: 1; }
.metric-card p { color: var(--muted); margin: 6px 0 0; font-size: .72rem; font-weight: 800; line-height: 1.25; }
.management-card { padding: 16px; }

.planner-form { padding: 15px; display: grid; gap: 12px; }
.planner-form label { display: grid; gap: 7px; }
.planner-form span { color: var(--navy); font-weight: 1000; font-size: .82rem; }
input, select { width: 100%; border: 1px solid var(--line); background: #f8fbff; border-radius: 15px; padding: 12px; color: var(--ink); }
.route-card, .route-option { margin-top: 12px; padding: 15px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.route-card.selected, .route-option.recommended { border-color: rgba(15,139,141,.32); background: linear-gradient(135deg, #fff, var(--soft-teal)); }
.route-card strong, .route-option strong { color: var(--teal); }
.status-list { display: grid; gap: 11px; }
.status-row { padding: 14px; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.status-row > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 15px; background: var(--soft-blue); }
.status-row b { border-radius: 999px; padding: 7px 8px; font-size: .72rem; }
.status-row.warning b { background: var(--soft-orange); color: #b44a00; }
.status-row.good b { background: #e7f9ef; color: var(--green); }
.status-row.neutral b { background: #eef2f6; color: var(--muted); }

.map-card { height: 278px; position: relative; overflow: hidden; background: linear-gradient(135deg, #fff, #edf8ff); }
.map-grid { position: absolute; inset: 0; opacity: .7; background: linear-gradient(90deg, rgba(7,27,73,.06) 1px, transparent 1px) 0 0/38px 38px, linear-gradient(rgba(7,27,73,.06) 1px, transparent 1px) 0 0/38px 38px; }
.map-route { position: absolute; left: 52px; top: 82px; width: 292px; height: 118px; border: 8px solid var(--teal); border-left: 0; border-bottom: 0; border-radius: 0 76px 0 0; transform: rotate(-8deg); }
.station, .train-marker, .safe-zone { position: absolute; z-index: 2; }
.station { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 4px solid #fff; background: var(--navy); color: #fff; font-weight: 1000; font-size: .78rem; box-shadow: 0 8px 18px rgba(7,27,73,.2); }
.station-a { left: 45px; top: 174px; } .station-b { left: 172px; top: 106px; } .station-c { right: 54px; top: 79px; }
.train-marker { left: 198px; top: 93px; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 18px; background: #fff; box-shadow: 0 12px 24px rgba(7,27,73,.2); font-size: 1.35rem; }
.safe-zone { right: 82px; bottom: 72px; width: 44px; height: 44px; border-radius: 18px; display: grid; place-items: center; background: #e7f9ef; border: 1px solid rgba(17,132,91,.25); }
.map-caption { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.9); color: var(--muted); font-size: .8rem; font-weight: 800; }
.safety-panel { padding: 15px; display: grid; grid-template-columns: 48px 1fr; gap: 13px; align-items: center; }
.safety-panel.primary { background: linear-gradient(135deg, #fff, #effff7); border-color: rgba(17,132,91,.25); }
.safety-icon { width: 48px; height: 48px; border-radius: 18px; display: grid; place-items: center; background: #dff8eb; font-size: 1.45rem; }
.safety-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.safety-actions button { padding: 13px; text-align: left; color: inherit; }
.safety-actions strong { color: var(--navy); display: block; margin-bottom: 5px; font-size: .84rem; }
.safety-actions span { color: var(--muted); font-size: .76rem; line-height: 1.35; display: block; }
.privacy-note, .notification, .trust-panel { padding: 15px; margin-top: 12px; }
.privacy-note { background: #fbfdff; }
.privacy-note strong { color: var(--green); }
.notification.urgent { border-color: rgba(234,107,20,.25); background: #fff8f2; }
.trust-panel { display: grid; gap: 12px; }
.trust-panel h3 { margin-bottom: -6px; }

@media (min-width: 760px) { body { padding: 28px; } .app { border-radius: 36px; min-height: calc(100vh - 56px); } }
@media (max-width: 370px) { .journey-hero { grid-template-columns: 20px 1fr; } .eta-box { grid-column: 2; width: 84px; } .metrics-grid { grid-template-columns: 1fr; } .safety-actions { grid-template-columns: 1fr; } }


/* v0.3 management polish */
.impact-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.impact-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(7,27,73,.06);
}
.impact-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--soft-blue);
  font-size: 1.18rem;
}
.impact-card.citizen span { background: var(--soft-teal); }
.impact-card.government span { background: #eef2ff; }
.impact-card.ecosystem span { background: #fff7df; }
.impact-card h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: .95rem;
}
.impact-card p {
  margin: 0;
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.42;
}
.app-footer {
  margin: 0 14px 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff, #f4fbff);
  color: var(--muted);
  display: grid;
  gap: 3px;
  text-align: center;
  font-size: .78rem;
}
.app-footer strong {
  color: var(--navy);
  font-size: .95rem;
}
.app-footer span {
  font-weight: 800;
}


/* v0.3.1 visual alignment fix */
.app {
  background: #ffffff;
}

.app-header {
  padding-bottom: 18px;
}

.journey-hero,
.safety-strip,
.screen-stack,
.tabs,
.app-footer {
  margin-left: 16px;
  margin-right: 16px;
}

.journey-hero {
  margin-top: 0;
  border-radius: 28px;
  border-top: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(7,27,73,.08);
}

.tabs {
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 3px;
}

.screen-stack {
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 18px;
}

.section-heading {
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.section-heading > div {
  min-width: 0;
}

.section-heading h2 {
  line-height: 1.18;
}

.trust-chip,
.updated {
  flex: 0 0 auto;
  max-width: 42%;
  white-space: normal;
  text-align: center;
  line-height: 1.12;
  padding: 7px 10px;
}

.next-action-card,
.management-card,
.impact-card,
.route-card,
.status-row,
.route-option,
.map-card,
.safety-panel,
.safety-actions button,
.privacy-note,
.notification,
.trust-panel,
.planner-form,
.metric-card {
  box-shadow: 0 8px 24px rgba(7,27,73,.055);
}

.management-card {
  margin-top: 2px;
}

.impact-grid {
  gap: 11px;
  margin-top: 13px;
}

.impact-card {
  grid-template-columns: 38px 1fr;
  padding: 14px;
  border-radius: 20px;
  align-items: flex-start;
}

.impact-card span {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  font-size: 1.05rem;
}

.impact-card h3 {
  font-size: .9rem;
  line-height: 1.25;
}

.impact-card p {
  font-size: .8rem;
  line-height: 1.38;
}

.map-caption {
  text-align: left;
  line-height: 1.35;
}

.safety-actions {
  gap: 11px;
}

.safety-actions button {
  min-height: 92px;
}

.app-footer {
  margin-top: 0;
  margin-bottom: 18px;
  padding: 14px 4px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--navy);
  font-weight: 1000;
  letter-spacing: -.01em;
}

.footer-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--soft-teal);
}

.app-footer strong {
  font-size: .92rem;
}

.app-footer p {
  margin: 0;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.25;
}

.app-footer small {
  color: #8a98aa;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.25;
}

@media (max-width: 390px) {
  .journey-hero,
  .safety-strip,
  .screen-stack,
  .tabs,
  .app-footer {
    margin-left: 14px;
    margin-right: 14px;
  }
  .section-heading {
    display: grid;
    grid-template-columns: 1fr;
  }
  .trust-chip,
  .updated {
    max-width: 100%;
    justify-self: start;
  }
  .impact-card {
    grid-template-columns: 36px 1fr;
  }
}

/* v0.4 feature integration from MyMobility Assistant */
.install-banner {
  width: min(100%, 452px);
  margin: 0 auto;
  padding: 10px 14px;
  display: none;
  align-items: center;
  gap: 10px;
  background: #071b49;
  color: #fff;
  box-shadow: 0 10px 30px rgba(7,27,73,.18);
}
.install-banner.show {
  display: flex;
}
.install-banner strong {
  display: block;
  font-size: .86rem;
}
.install-banner p {
  margin: 2px 0 0;
  color: #d7efff;
  font-size: .75rem;
  line-height: 1.25;
}
.install-banner button {
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 900;
  background: #fff;
  color: var(--navy);
}
.install-banner .ghost-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 1.1rem;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-clock {
  min-width: 48px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  color: #fff;
  border-radius: 999px;
  padding: 8px 9px;
  font-size: .78rem;
  font-weight: 1000;
}
.quick-access {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 12px 0;
}
.quick-access button {
  min-height: 76px;
  padding: 10px 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--navy);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(7,27,73,.05);
}
.quick-access span {
  font-size: 1.25rem;
}
.quick-access strong {
  font-size: .72rem;
  line-height: 1.15;
}
.journey-filters,
.filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.journey-filters::-webkit-scrollbar,
.filter-pills::-webkit-scrollbar { display: none; }
.journey-filters {
  margin-top: 12px;
}
.journey-filters button,
.filter-pills button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 8px 11px;
  font-weight: 1000;
  font-size: .76rem;
  white-space: nowrap;
}
.journey-filters button.active,
.filter-pills button.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.rail-map-card,
.service-card,
.bus-gps-card,
.fare-form,
.fare-result-card,
.keyword-watch,
.alternative-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(7,27,73,.055);
}
.rail-map-card {
  margin-top: 11px;
  padding: 14px;
  display: grid;
  gap: 10px;
  background: linear-gradient(135deg, #fff, #f4fbff);
}
.rail-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  position: relative;
}
.rail-line span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--teal);
  color: #fff;
  font-weight: 1000;
  font-size: .74rem;
}
.rail-line.warning span { background: var(--orange); }
.rail-line.erl span { background: var(--navy-2); }
.rail-line b {
  color: var(--navy);
  font-size: .92rem;
}
.rail-line small {
  color: var(--muted);
  font-weight: 800;
  font-size: .76rem;
}
.service-card-list {
  display: grid;
  gap: 11px;
  margin-top: 12px;
}
.service-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.service-card.warning {
  border-color: rgba(234,107,20,.26);
  background: #fff9f2;
}
.service-card h3,
.bus-gps-card h3,
.alternative-card h3 {
  margin: 3px 0 5px;
  color: var(--navy);
  font-size: .96rem;
}
.service-card p,
.bus-gps-card p,
.alternative-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.38;
}
.service-card strong {
  color: var(--teal);
  font-size: .86rem;
  text-align: right;
}
.time-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}
.time-badges span {
  border-radius: 999px;
  padding: 6px 7px;
  background: var(--soft-blue);
  color: var(--navy);
  font-size: .72rem;
  font-weight: 1000;
}
.bus-gps-card {
  margin-top: 11px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 68px;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #fff, var(--soft-teal));
}
.gps-dots {
  height: 68px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0e4a8f, #13a3a5);
  position: relative;
  overflow: hidden;
}
.gps-dots span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b8fff8;
  box-shadow: 0 0 0 5px rgba(184,255,248,.16);
}
.gps-dots span:nth-child(1) { left: 13px; top: 14px; }
.gps-dots span:nth-child(2) { left: 36px; top: 32px; }
.gps-dots span:nth-child(3) { left: 23px; bottom: 13px; }
.map-legend {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 4;
}
.map-legend span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  color: var(--navy);
  border-radius: 999px;
  padding: 5px 7px;
  font-size: .65rem;
  font-weight: 1000;
}
.fare-form {
  padding: 14px;
  display: grid;
  gap: 11px;
}
.fare-form label {
  display: grid;
  gap: 7px;
}
.fare-form span {
  color: var(--navy);
  font-size: .82rem;
  font-weight: 1000;
}
.fare-result-card {
  padding: 16px;
  margin-top: 12px;
  background: linear-gradient(135deg, #fff, #f4fbff);
}
.fare-result-card h3 {
  margin: 4px 0 12px;
  color: var(--navy);
  font-size: 2rem;
  letter-spacing: -.04em;
}
.fare-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fare-metrics span {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 10px 6px;
  text-align: center;
}
.fare-metrics b {
  display: block;
  color: var(--navy);
  font-size: .95rem;
}
.fare-metrics small {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.15;
  font-weight: 800;
  margin-top: 4px;
}
.saving-strip {
  margin-top: 12px;
  border-radius: 18px;
  background: #e7f9ef;
  color: var(--green);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 1000;
}
.keyword-watch {
  padding: 14px;
  margin-bottom: 12px;
}
.keyword-watch div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.keyword-watch span {
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--navy);
  padding: 6px 9px;
  font-size: .72rem;
  font-weight: 1000;
}
.notification small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
}
.alternative-card {
  padding: 15px;
  margin-top: 12px;
}
.alternative-list {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}
.alternative-list span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fff;
}
.alternative-list b {
  color: var(--navy);
  font-size: .82rem;
}
.alternative-list small {
  color: var(--teal);
  font-weight: 1000;
  white-space: nowrap;
}
@media (max-width: 390px) {
  .quick-access { grid-template-columns: 1fr 1fr; }
  .header-actions { gap: 6px; }
  .live-clock { display: none; }
  .fare-metrics { grid-template-columns: 1fr; }
  .bus-gps-card, .service-card { grid-template-columns: 1fr; }
  .time-badges { justify-content: flex-start; }
}

/* v0.4.1 alignment fix: keep rail route text aligned with route title, not under the badge */
.rail-line {
  grid-template-columns: 50px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
}
.rail-line span {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 46px;
  height: 46px;
  align-self: start;
}
.rail-line b {
  grid-column: 2;
  grid-row: 1;
  display: block;
  align-self: end;
  line-height: 1.18;
  word-break: normal;
}
.rail-line small {
  grid-column: 2;
  grid-row: 2;
  display: block;
  line-height: 1.35;
  max-width: 100%;
  word-break: normal;
}
.rail-map-card {
  gap: 16px;
  padding: 16px;
}
@media (max-width: 390px) {
  .rail-line {
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 11px;
  }
  .rail-line span {
    width: 44px;
    height: 44px;
  }
}


/* v0.4.2 urgent stable alignment fix
   Route descriptions are now inside .rail-copy, so they cannot fall under the badge column. */
.rail-map-card {
  gap: 18px !important;
  padding: 18px !important;
}
.rail-line {
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 16px !important;
  row-gap: 0 !important;
}
.rail-line span {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 52px !important;
  height: 52px !important;
  align-self: start !important;
  justify-self: start !important;
}
.rail-copy {
  grid-column: 2 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 5px !important;
}
.rail-copy b,
.rail-line b {
  display: block !important;
  grid-column: auto !important;
  grid-row: auto !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  white-space: normal !important;
}
.rail-copy small,
.rail-line small {
  display: block !important;
  grid-column: auto !important;
  grid-row: auto !important;
  line-height: 1.35 !important;
  margin: 0 !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
@media (max-width: 390px) {
  .rail-line {
    grid-template-columns: 58px minmax(0, 1fr) !important;
    column-gap: 13px !important;
  }
  .rail-line span {
    width: 48px !important;
    height: 48px !important;
  }
}
