/* Philly Transit Helper (was SEPTA Next). Nov 22 2026 Helper rebrand:
   same look as Pocket Helper - navy #20368A, red #C41230, white page, navy cards,
   red main buttons, Poppins, cards ~20px / buttons ~14px corners, bottom tab bar.
   Light only (the Helper look is white pages). Old dark theme: ~/septa-app_backup_nov22_rebrand. */
:root {
  --navy: #20368A;
  --navy2: #172764;
  --red: #C41230;
  --red-h: #A50F28;
  --ink: #16224F;
  --muted: #5B6690;
  --line: #E1E6F2;
  --soft: #F4F6FB;
  --on-navy-muted: #C9D3F2;
  --live: #7FE0A6;      /* on navy cards */
  --est: #F2C230;       /* on navy cards */
  --sched: #C9D3F2;     /* on navy cards */
  --live-ink: #157A3E;  /* on white */
  --est-ink: #7A5600;   /* on white */
  --sched-ink: #4A5275; /* on white */
  --warn-bg: #FFF6D6; --warn-fg: #5C4300;
  --err-bg: #FDE7EA; --err-fg: #8F0D23;
  --focus: #F2C230;
  --radius: 14px;
  --card-r: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #FFFFFF; color: var(--ink);
  font: 18px/1.4 Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- top bar: "Transit" navy, "Helper" red, navy Contact us, red See plans ---------- */
.topbar {
  background: #FFFFFF; border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  position: sticky; top: 0; z-index: 5;
}
/* Nov 22 round 2: phone = 2 rows ([Home][Back] ... [Log in] / name ... Contact us, See plans); 700px+ = 1 row */
.topin { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "nav login" "brand btns"; align-items: center; gap: 8px; }
.hnav { grid-area: nav; display: flex; gap: 6px; align-items: center; }
.hlogin { grid-area: login; justify-self: end; border-color: var(--navy) !important; }
.brand { grid-area: brand; }
.topbtns { grid-area: btns; }
.hnb { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 11px; border-radius: 999px; border: 1.5px solid var(--line); background: #FFFFFF; color: var(--navy); font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.hnb:hover { background: #EEF1FB; }
.hnb[aria-current="page"] { background: #EEF1FB; }
@media (min-width: 700px) {
  .topin { max-width: 1000px; grid-template-columns: auto minmax(0,1fr) auto auto; grid-template-areas: "nav brand login btns"; gap: 10px; }
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.brand-ico { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-name { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -.3px; white-space: nowrap; }
.brand-name .r { color: var(--red); }
.brand-sub { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.topbtns { display: flex; gap: 6px; flex: none; }
.pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; color: #FFFFFF;
  text-decoration: none; white-space: nowrap; border: 0; cursor: pointer;
}
.pill.navy { background: var(--navy); }
.pill.red { background: var(--red); }
.pill[aria-current="page"] { box-shadow: 0 0 0 3px rgba(32,54,138,.22); }
@media (max-width: 459px) {
  .brand-ico { display: none; }
  .brand-name { font-size: 19px; }
  .pill { padding: 6px 10px; }
}
@media (max-width: 359px) {
  .brand-name { font-size: 17px; }
  .pill { padding: 5px 8px; font-size: 11px; }
}

main { max-width: 600px; margin: 0 auto; padding: 16px; }
main:focus, main:focus-visible { outline: none; }
.pad { padding: 16px; }
h1 { font-size: 24px; font-weight: 700; color: var(--navy); margin: 4px 0 10px; line-height: 1.2; }
h2 { font-size: 19px; font-weight: 700; color: var(--navy); margin: 22px 0 10px; }
.sub { color: var(--muted); margin: -4px 0 14px; font-size: 16px; }
.says { background: #EEF1FB; color: var(--navy); font-size: 15px; font-weight: 600; border-radius: 14px; padding: 10px 12px; margin: 0 0 14px; line-height: 1.4; }
.loading { color: var(--muted); }
.disclaimer { color: var(--muted); font-size: 13px; text-align: center; margin: 28px 0 8px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 10px 14px; margin: 0 0 10px;
  border: 2px solid transparent; border-radius: var(--radius);
  background: var(--red); color: #FFFFFF;
  font: inherit; font-size: 17px; font-weight: 700; text-align: center; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--red-h); }
.btn:active { transform: scale(.985); }
.btn.secondary { background: #FFFFFF; color: var(--navy); border-color: var(--navy); }
.btn.secondary:hover { background: #EEF1FB; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn.ghost:hover { background: #EEF1FB; }
.btn.white { background: #FFFFFF; color: var(--navy); }
.btn.white:hover { background: #EEF1FB; }
.btn.small { min-height: 48px; font-size: 16px; padding: 10px 14px; width: auto; margin: 0; }
.btn.danger { background: #FFFFFF; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #FDE7EA; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .big { font-size: 30px; font-weight: 800; }
.btn-stack { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.btn-col { flex-direction: column; gap: 2px; }
.btn-col small { font-size: 15px; font-weight: 500; opacity: .95; }
.btn.lockbtn { justify-content: space-between; }
.btn.lockbtn small { font-weight: 600; font-size: 13px; color: var(--muted); }

/* ---------- bottom tab bar (Trolleys / Trains / Buses / Plan a trip) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: #FFFFFF; border-top: 1px solid var(--line);
  padding: 8px 8px calc(10px + env(safe-area-inset-bottom));
}
.tabin { max-width: 600px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.tab {
  min-height: 48px; padding: 4px 4px; border-radius: 12px; border: 0;
  background: transparent; color: var(--navy); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.15;
}
.tab:hover { background: #EEF1FB; }
.tab[aria-selected="true"] { background: var(--red); color: #FFFFFF; font-weight: 700; }
@media (max-width: 380px) { .tab { font-size: 13px; padding: 4px 2px; } }

/* ---------- route tiles: navy cards, a color stripe keeps SEPTA's line colors ---------- */
.trolley-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 560px) { .trolley-grid { grid-template-columns: repeat(3, 1fr); } }
.trolley-btn {
  min-height: 64px; border-radius: 16px; border: 0; cursor: pointer;
  background: var(--navy); color: #FFFFFF; font: inherit; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 6px 8px 12px;
  box-shadow: inset 6px 0 0 #5FA52A, 0 4px 14px rgba(32,54,138,.18);
}
.trolley-btn:hover { background: var(--navy2); }
.trolley-btn .num { font-size: 21px; font-weight: 800; line-height: 1; }
.trolley-btn .old { font-size: 12px; font-weight: 600; margin-top: 3px; color: var(--on-navy-muted); }
.trolley-btn .to { font-size: 11px; margin-top: 1px; opacity: .95; text-align: center; }
.trolley-btn.train-btn.el { box-shadow: inset 6px 0 0 #4DA3E0, 0 4px 14px rgba(32,54,138,.18); }
.trolley-btn.train-btn.bsl { box-shadow: inset 6px 0 0 #F2873A, 0 4px 14px rgba(32,54,138,.18); }
.trolley-btn.train-btn .old { text-align: center; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-weight: 600; font-size: 15px; color: var(--navy); margin-bottom: 6px; }
input[type="text"], input[type="search"], input[type="time"], input[type="email"], input[type="password"], textarea {
  width: 100%; min-height: 56px; padding: 10px 14px; font: inherit; font-size: 20px;
  border: 1px solid #C9D1E6; border-radius: 12px; background: #FFFFFF; color: var(--ink);
}
textarea { font-size: 17px; min-height: 130px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--navy); outline: 2px solid rgba(32,54,138,.25); outline-offset: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }

.list { list-style: none; padding: 0; margin: 0; }
.stop-item {
  display: block; width: 100%; text-align: left; min-height: 56px; padding: 12px 14px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: 18px; cursor: pointer; text-decoration: none;
}
.stop-item:hover, .stop-item:active { background: var(--soft); }
.stop-item b { color: var(--navy); }
.stop-item small { display: block; color: var(--muted); font-size: 14px; }

/* ---------- saved stops: navy cards ---------- */
.saved-card {
  background: var(--navy); color: #FFFFFF; border-radius: var(--card-r);
  margin-bottom: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(32,54,138,.18);
}
.saved-main { display: block; padding: 14px 16px; color: #FFFFFF; text-decoration: none; min-height: 64px; }
.saved-main .r { font-weight: 800; font-size: 21px; }
.saved-main .s { font-size: 17px; font-weight: 600; }
.saved-main .d { color: var(--on-navy-muted); font-size: 15px; }
.saved-next { margin-top: 6px; font-size: 18px; font-weight: 700; color: var(--live); min-height: 1.4em; }
.saved-actions { display: flex; border-top: 1px solid rgba(255,255,255,.14); }
.saved-actions button {
  flex: 1; min-height: 50px; background: transparent; border: 0; color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.saved-actions button:hover { background: rgba(255,255,255,.08); }
.saved-actions button + button { border-left: 1px solid rgba(255,255,255,.14); }
.saved-actions .on { color: var(--live); }

.route-pill {
  display: inline-block; min-width: 44px; padding: 2px 10px; border-radius: 8px; text-align: center;
  font-weight: 800; margin-right: 6px;
}

/* ---------- arrivals: navy cards, the next one ringed in red ---------- */
.arrivals { list-style: none; padding: 0; margin: 0 0 12px; }
.arrival {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; margin-bottom: 10px; border-radius: var(--card-r);
  background: var(--navy); color: #FFFFFF; border: 0; box-shadow: 0 4px 14px rgba(32,54,138,.18);
}
.arrival:first-child { box-shadow: 0 0 0 3px var(--red), 0 4px 14px rgba(32,54,138,.18); }
.arrival .mins { font-size: 34px; font-weight: 800; line-height: 1.05; white-space: nowrap; }
.arrival .mins small { font-size: 19px; font-weight: 700; }
.arrival .clock { font-size: 21px; font-weight: 700; text-align: right; white-space: nowrap; }
.arrival .meta { font-size: 14px; color: var(--on-navy-muted); text-align: right; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 6px; border: 2px solid currentColor; vertical-align: middle;
}
.badge.live { color: var(--live-ink); }
.badge.estimated { color: var(--est-ink); }
.badge.scheduled { color: var(--sched-ink); }
.arrival .badge.live { color: var(--live); }
.arrival .badge.estimated { color: var(--est); }
.arrival .badge.scheduled { color: var(--sched); }

.notice { padding: 12px 14px; border-radius: var(--radius); margin: 0 0 12px; font-size: 16px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice.err { background: var(--err-bg); color: var(--err-fg); }
.notice.info { background: #EEF1FB; color: var(--navy); }
.notice.ok { background: #E3F5EA; color: #145C33; font-weight: 600; }
.status { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.legend { color: var(--muted); font-size: 14px; margin-top: 18px; }
.legend p { margin: 4px 0; }
.back { display: inline-block; margin: 0 0 8px; font-size: 17px; font-weight: 700; text-decoration: none; padding: 8px 0; color: var(--navy); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  min-width: 52px; min-height: 48px; border-radius: 24px; border: 2px solid var(--navy);
  background: #FFFFFF; color: var(--navy); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #FFFFFF; }

/* ---------- plans page (copy from pocket_buddy/plans_mockup.html) ---------- */
.plan { border: 2px solid var(--line); border-radius: var(--card-r); padding: 16px; margin-bottom: 14px; position: relative; background: #FFFFFF; }
.plan.mine { background: var(--navy); color: #FFFFFF; border-color: var(--navy); box-shadow: 0 4px 14px rgba(32,54,138,.18); }
.plan.best { border-color: var(--red); box-shadow: 0 4px 14px rgba(196,18,48,.15); }
.plan .tag { position: absolute; top: -11px; right: 14px; background: var(--red); color: #FFFFFF; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; letter-spacing: .4px; }
.plan .pname { font-size: 16px; font-weight: 700; }
.plan .price { font-size: 30px; font-weight: 800; margin: 2px 0 8px; }
.plan .price small { font-size: 14px; font-weight: 600; opacity: .8; }
.plan ul { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.5; }
.plan li { padding-left: 22px; position: relative; margin: 2px 0; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: #1E8E4E; font-weight: 800; }
.plan.mine li::before { color: var(--live); }
.plan .unl { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.plan .btn { margin: 12px 0 0; }
.plan .btn.ghostplan { background: var(--soft); color: var(--muted); cursor: default; border-color: transparent; }
.plan .fine { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0 0; }
.taxnote { font-size: 13px; color: var(--muted); text-align: center; margin: 4px 0 0; }

/* ---------- contact page ---------- */
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.kinds button {
  min-height: 48px; border-radius: var(--radius); border: 2px solid var(--navy); background: #FFFFFF;
  color: var(--navy); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.kinds button[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #FFFFFF; }
.hp { position: absolute; left: -9999px; }

/* ---------- pop-up sheets ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8,14,40,.6); z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #FFFFFF; color: var(--ink); width: 100%; max-width: 560px;
  border-radius: 24px 24px 0 0; padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 700px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: 24px; }
}
.modal h2 { margin-top: 0; font-size: 22px; color: var(--navy); }
.modal p { margin-top: 0; color: #33437F; }
.modal .or { text-align: center; font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.modal ol { padding-left: 22px; margin: 0 0 14px; color: #33437F; }
.modal ol li { margin: 4px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Nov 22 round 2: Log in screen */
.linkbtn { display: block; margin: 4px auto 0; background: none; border: 0; color: var(--navy); font: inherit; font-size: 15px; font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 44px; }
