:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-alt: #eeebe3;
  --ink: #16202b;
  --muted: #4a5561;
  --line: #d9d4c7;
  --brand: #13263a;
  --brand-2: #1a3149;
  --accent: #d13b2a;        /* crossing-signal red */
  --accent-hover: #b22f20;
  --clear: #1f7a4d;
  --amber: #e2a72e;
  --focus: #2f6fd0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .07);
  /* map */
  --map-bg: #fbfaf7;
  --map-road: #d6d0c2;
  --map-road-major: #c7bfae;
  --map-road-hi: #8a93a0;
  --map-rail: #16202b;
  --map-rail-bed: #fbfaf7;
  --map-label: #16202b;
  --map-label-ctx: #7a838e;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151c;
    --surface: #17202a;
    --surface-alt: #121a22;
    --ink: #e8ecf0;
    --muted: #a9b4bf;
    --line: #2a3643;
    --brand: #0b1219;
    --brand-2: #111b25;
    --accent: #e5533f;
    --accent-hover: #f06a57;
    --clear: #3fb27a;
    --focus: #6ea3ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --map-bg: #141d26;
    --map-road: #2b3743;
    --map-road-major: #354352;
    --map-road-hi: #6f7c8a;
    --map-rail: #e8ecf0;
    --map-rail-bed: #141d26;
    --map-label: #e8ecf0;
    --map-label-ctx: #8290a0;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* Top bar */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; }
.topbar-cta {
  font-weight: 700; text-decoration: none; padding: .45rem 1.1rem; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 1rem;
}
.topbar-cta:hover { background: var(--accent-hover); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: .8rem 1.4rem; border-radius: 10px; border: 2px solid transparent; min-height: 50px;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-lg { font-size: 1.1rem; min-height: 56px; padding: .9rem 1.8rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; padding: .25rem 0; }
.btn-link:hover { color: var(--ink); }

/* Hero: headline, price, Subscribe, form and example alert in the first screen */
.hero {
  background: linear-gradient(165deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; padding: 32px 0 44px;
  border-bottom: 3px solid rgba(226, 167, 46, .45);
}
.hero-grid {
  display: grid; gap: 24px;
  grid-template-areas: "intro" "form" "example";
}
.hero-intro { grid-area: intro; }
.form-panel { grid-area: form; }
.alert-example { grid-area: example; }
@media (min-width: 920px) {
  .hero { padding: 36px 0 56px; }
  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: "intro form" "example form";
    column-gap: 48px; row-gap: 28px; align-items: start;
  }
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; font-weight: 700; color: var(--amber); margin-bottom: .6rem; }
.lede { font-size: 1.2rem; color: rgba(255, 255, 255, .9); max-width: 34em; }
.hero-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 1.25rem; }
.hero-price { margin: 0; display: flex; align-items: baseline; gap: 2px; }
.hero-price-amount { font-size: 2.6rem; font-weight: 850; letter-spacing: -.03em; line-height: 1; }
.hero-price-unit { font-size: 1.15rem; color: rgba(255, 255, 255, .85); }

/* Example alerts, styled like phone lock-screen notifications */
.alert-example {
  margin: 0; padding: 18px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .16);
}
.example-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.example-title { font-weight: 700; font-size: 1rem; color: rgba(255, 255, 255, .9); }
.example-badge {
  font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 999px; background: #fff4d9; color: #7a5200; border: 1px solid #ecd28f;
}
.notif-list { display: grid; gap: 12px; }
.msg {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start;
  background: rgba(250, 251, 252, .97); color: #16202b; border-radius: 18px; padding: 14px 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
.notif-icon { width: 44px; height: 44px; border-radius: 11px; background: #13263a; display: grid; place-items: center; }
.notif-icon svg { width: 30px; height: 30px; }
.notif-icon circle { fill: #d13b2a; }
.notif-icon rect { fill: #e2a72e; }
.notif-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.notif-app { font-weight: 700; font-size: .95rem; color: #3d4752; }
.msg time { font-size: .95rem; color: #4d5864; font-weight: 600; white-space: nowrap; }
.msg p { margin: .35rem 0 0; font-size: 1.15rem; line-height: 1.4; }
.msg-status { display: inline-block; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 2px 9px; border-radius: 999px; color: #fff; }
.msg-blocked .msg-status { background: #d13b2a; }
.msg-clear .msg-status { background: #1f7a4d; }
.alert-example figcaption { margin-top: 12px; font-size: .95rem; color: rgba(255, 255, 255, .8); }

/* Signup panel */
.form-panel { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 26px; box-shadow: 0 16px 40px rgba(0, 0, 0, .25); }
.form-panel:focus { outline: none; }
@media (min-width: 720px) { .form-panel { padding: 32px; } }
.form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.form-head h2 { margin: 0; }
.form-price { margin: 0; font-size: 1.1rem; color: var(--muted); }
.form-price strong { font-size: 1.5rem; color: var(--ink); }
.form-lede { color: var(--muted); margin: .5rem 0 0; }
.signup-form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 1.02rem; }
.field em { font-style: normal; font-weight: 500; color: var(--muted); font-size: .95rem; margin-left: .3rem; }
.field abbr { color: var(--accent); text-decoration: none; }
.field input {
  font: inherit; font-weight: 400; padding: .75rem .9rem; min-height: 52px; width: 100%;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.field input[aria-invalid=true] { border-color: var(--accent); }
.hint { font-weight: 400; color: var(--muted); font-size: .95rem; }
.field-error { color: var(--accent); font-weight: 600; font-size: .98rem; }
.field-error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 1rem; }
.form-status:empty { display: none; }
.form-status.err { color: var(--accent); font-weight: 600; }

.review h2:focus { outline: none; }
.summary { margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.summary > div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.summary > div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); font-weight: 600; font-size: .98rem; }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.summary-price { background: var(--surface-alt); }
.no-payment {
  margin: 14px 0 6px; padding: 12px 14px; border-radius: 10px; font-size: 1rem;
  background: color-mix(in srgb, var(--amber) 16%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
}

/* Sections */
.section { padding: 56px 0; }
@media (min-width: 720px) { .section { padding: 76px 0; } }
.section-alt { background: var(--surface-alt); }

.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; border-top: 5px solid var(--map-road-hi); }
.step-blocked { border-top-color: var(--accent); }
.step-clear { border-top-color: var(--clear); }
.step-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.step p { color: var(--muted); margin: 0; font-size: 1.05rem; }
@media (min-width: 820px) {
  .step:not(:last-child)::after {
    content: "→"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line);
    display: grid; place-items: center; font-size: 1rem; color: var(--muted); z-index: 1;
  }
}

.notice {
  margin-top: 24px; padding: 18px 20px; border-radius: 12px; font-size: 1.05rem;
  background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 50%, transparent);
  border-left: 5px solid var(--amber);
}
.notice strong { display: block; margin-bottom: 2px; }

/* Map */
.map-grid { display: grid; gap: 28px; align-items: start; }
@media (min-width: 920px) { .map-grid { grid-template-columns: 1.35fr 1fr; gap: 44px; } }
.map-frame { border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: var(--map-bg); box-shadow: var(--shadow); }
.crossing-map { width: 100%; height: auto; }
.map-bg { fill: var(--map-bg); }
.crossing-map path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map-i565 { stroke: var(--map-road-major); stroke-width: 7; }
.map-road-major { stroke: var(--map-road-major); stroke-width: 4; }
.map-road-minor { stroke: var(--map-road); stroke-width: 3; }
.map-road-hi { stroke: var(--map-road-hi); stroke-width: 5; }
.map-rail-bed { stroke: var(--map-rail); stroke-width: 7; }
.map-rail { stroke: var(--map-rail-bed); stroke-width: 3; stroke-dasharray: 8 6; }
.map-halo { fill: var(--accent); opacity: .22; }
.map-dot { fill: var(--accent); stroke: var(--map-bg); stroke-width: 3; }
.map-label { fill: var(--map-label); font: 800 22px system-ui, sans-serif; paint-order: stroke; stroke: var(--map-bg); stroke-width: 6px; }
.map-label-ctx { fill: var(--map-label-ctx); font: 600 15px system-ui, sans-serif; paint-order: stroke; stroke: var(--map-bg); stroke-width: 4px; }
.map-label-rail { fill: var(--map-label-ctx); font: 700 14px system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.map-dir { stroke: var(--clear) !important; stroke-width: 3; stroke-dasharray: 2 7; }
.map-arrow-head { fill: var(--clear) !important; stroke: none !important; }
.map-label-dir { fill: var(--clear); font: 700 15px system-ui, sans-serif; paint-order: stroke; stroke: var(--map-bg); stroke-width: 4px; }
.map-north { fill: var(--map-label-ctx); font: 800 15px system-ui, sans-serif; }
.map-north-arrow { fill: var(--map-label-ctx) !important; }
.map-attrib { fill: var(--map-label-ctx); font: 12px system-ui, sans-serif; }

.map-copy p { font-size: 1.08rem; }
.crossing-list { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: 12px; font-size: 1.08rem; }
.crossing-list li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; align-items: start; }
.crossing-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); margin-top: .35em; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.headsup { padding: 14px 16px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line); color: var(--muted); }
.headsup strong { color: var(--ink); }

/* Preferences */
.section-lede { color: var(--muted); max-width: 42em; font-size: 1.1rem; }
.prefs { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 640px) { .prefs { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .prefs { grid-template-columns: repeat(4, 1fr); } }
.pref { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.pref-icon { font-size: 1.7rem; display: block; margin-bottom: 8px; }
.pref p { color: var(--muted); margin: 0; font-size: 1.04rem; }

/* Alert channel checkboxes */
.channels { border: 0; padding: 0; margin: 0; min-width: 0; }
.channels legend { padding: 0; margin-bottom: 6px; }
.channel-options { display: grid; gap: 8px; }
@media (min-width: 400px) { .channel-options { grid-template-columns: 1fr 1fr; } }
.field-row { display: grid; gap: 18px 14px; }
@media (min-width: 480px) { .field-row { grid-template-columns: 1fr 1fr; } .field-row .hint { grid-column: 1 / -1; margin-top: -12px; } }
.check-option {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 600;
}
.check-option:has(input:checked) { border-color: var(--focus); }
.check-option input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-option small { display: block; font-weight: 400; color: var(--muted); font-size: .92rem; }

/* Welcome page */
.cards { display: grid; gap: 16px; margin-top: 28px; }
@media (min-width: 720px) { .cards-2 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card p { color: var(--muted); font-size: 1.05rem; }
.card p:last-child { margin-bottom: 0; }
.card-kicker { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--accent) !important; margin-bottom: .4rem; }
.card-accent { border-top: 4px solid var(--amber); }
.welcome { max-width: 900px; }
.welcome-head { text-align: center; margin-bottom: 12px; }
.welcome-head .lede { color: var(--muted); margin: 0 auto; }
.check { width: 64px; height: 64px; border-radius: 50%; background: var(--clear); display: grid; place-items: center; margin: 0 auto 20px; }
.check svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.next-steps { margin-top: 40px; padding: 24px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--line); }
.next-steps a:not(.btn) { font-weight: 700; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .98rem; }
.footer p { margin: 0; max-width: 60em; }

/* The map scales down on phones; scale its text back up to stay readable. */
@media (max-width: 700px) {
  .map-label { font-size: 40px; stroke-width: 9px; }
  .map-label-ctx, .map-label-dir { font-size: 26px; stroke-width: 6px; }
  .map-label-rail { display: none; }
  .map-attrib { font-size: 20px; }
  .map-north { font-size: 24px; }
}

/* Phone setup guides */
.guides { display: grid; gap: 16px; margin-top: 24px; }
@media (min-width: 820px) { .guides { grid-template-columns: 1fr 1fr; } }
.guide { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.guide.is-mine { border: 2px solid var(--focus); }
.guide-mine { display: inline-block; margin: 0 0 8px; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--focus); }
.guide h3 { font-size: 1.3rem; }
.guide-steps { margin: 0 0 14px; padding-left: 1.4em; display: grid; gap: 10px; font-size: 1.06rem; }
.guide-steps li::marker { font-weight: 800; color: var(--accent); }
.guide-note { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-alt); color: var(--muted); font-size: 1rem; }

/* Free-pilot offer dialog */
.offer {
  width: min(460px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  border-top: 6px solid var(--clear);
}
.offer::backdrop { background: rgba(10, 16, 24, .6); }
.offer h2 { margin-bottom: .4em; }
.offer p { font-size: 1.06rem; }
.offer-kicker { font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--clear); margin-bottom: .4rem !important; }
.offer-dismiss { display: block; margin: 12px auto 0; }

/* Legal pages */
.legal { max-width: 760px; }
.legal h2 { margin-top: 1.8em; font-size: 1.35rem; }
.legal h3 { margin-top: 1.2em; font-size: 1.08rem; }
.legal ul { padding-left: 1.3em; display: grid; gap: 6px; }
.legal-meta { color: var(--muted); }
.draft-banner { padding: 10px 14px; border-radius: 10px; font-weight: 700; background: color-mix(in srgb, var(--amber) 18%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); }
.agree { margin: -6px 0 0; font-size: .92rem; color: var(--muted); text-align: center; }
.footer-links { margin-top: 10px !important; }

/* Review-only analytics log (config debugEvents) */
#tw-debug { position: fixed; right: 12px; bottom: 12px; z-index: 20; max-width: min(360px, calc(100vw - 24px)); max-height: 40vh; overflow: auto; backdrop-filter: blur(6px); background: rgba(17, 24, 32, .92); color: #e8ecf0; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 10px 12px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
#tw-debug ol { margin: 6px 0 0; padding-left: 20px; }
