/* ForeDrive — mobile-first styles */

/* App tokens mapped onto the Sunrise design system (css/foredrive-sunrise.css).
   Severity is one cream → plum heat scale: lv0 Favorable … lv3 Severe. No green "good" state. */
:root {
  --bg: var(--fd-surface);
  --surface: var(--fd-bg);
  --surface-2: var(--fd-surface);
  --surface-3: var(--fd-surface-2);
  --text: var(--fd-ink);
  --muted: var(--fd-ink-muted);
  --faint: var(--fd-ink-muted);
  --line: var(--fd-hairline);
  --accent: var(--fd-primary);
  --accent-ink: var(--fd-ink-inverse);
  --accent-soft: rgba(196, 74, 52, .12);
  --lv0: var(--fd-sev-1);
  --lv1: var(--fd-sev-2);
  --lv2: var(--fd-sev-3);
  --lv3: var(--fd-sev-4);
  --lvx: var(--fd-hairline);
  --lv-ink: var(--fd-ink);         /* text on a severity fill */
  --temp: var(--fd-ink);
  --feels: var(--fd-ink-muted);
  --pop: var(--fd-sev-3);
  --terrain: #d9c6b0;
  --casing: var(--fd-bg);
  --verdict-bg: var(--fd-ink);
  --verdict-ink: var(--fd-ink-inverse);
  --shadow: var(--fd-shadow-md);
  --shadow-sm: var(--fd-shadow-sm);
  --radius: var(--fd-r-md);
  --radius-sm: var(--fd-r-sm);
  --font: var(--fd-font);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* Dark: a night variant of Sunrise — plum ground, same heat ramp. */
/* Dark palette never applies to print: paper is always the light theme. */
@media not print {
:root[data-resolved-theme="dark"] {
  --bg: #1a1024;
  --surface: #221630;
  --surface-2: #2c1e3d;
  --surface-3: #39294d;
  --text: #fffaf3;
  --muted: #cbbccb;
  --faint: #b3a3b5;
  --line: #3f2e55;
  --accent: #e2664f;
  --accent-ink: #1a1024;
  --accent-soft: rgba(226, 102, 79, .16);
  --lvx: #4a3a5e;
  --temp: #fffaf3;
  --feels: #b3a3b5;
  --terrain: #3f2e55;
  --casing: #1a1024;
  --verdict-bg: #fffaf3;
  --verdict-ink: #2b1b3d;
  --shadow: 0 4px 18px rgba(0, 0, 0, .45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { flex: none; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ───────── Map ───────── */
#map { position: fixed; inset: 0; background: var(--bg); z-index: 0; }
.maplibregl-map { font-family: var(--font); }
/* Compact attribution sits under the top bar so the bottom sheet never covers it. */
.maplibregl-ctrl-top-left { top: calc(var(--safe-t) + 60px); }
.maplibregl-ctrl-attrib.maplibregl-compact { background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); font-size: 10.5px; }
.maplibregl-ctrl-attrib a { color: var(--muted); }
:root[data-resolved-theme="dark"] .maplibregl-ctrl-attrib-button { filter: invert(1); }
@media (min-width: 900px), (orientation: landscape) and (max-height: 540px) and (min-width: 560px) { .maplibregl-ctrl-top-left { top: auto; bottom: 8px; left: auto; right: 8px; } }
.mk-wrap { background: none; border: 0; cursor: pointer; }
.mk {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: 0 0 0 2.5px var(--lvc, var(--lvx)), var(--shadow-sm);
}
.mk.lv0 { --lvc: var(--lv0); } .mk.lv1 { --lvc: var(--lv1); } .mk.lv2 { --lvc: var(--lv2); } .mk.lv3 { --lvc: var(--lv3); }
.pin { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-sm); }
.pin span { width: 12px; height: 12px; border-radius: 50%; }
.pin-start span { background: var(--text); }
.pin-end span { background: var(--accent); border-radius: 3px; }
.me { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px var(--accent-soft), var(--shadow-sm); }

/* ───────── Top bar ───────── */
.topbar {
  position: fixed; top: var(--vv-top, 0px); left: var(--vv-left, 0px); right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 10px) calc(12px + env(safe-area-inset-right, 0px)) 10px calc(14px + env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  font-size: 17px; letter-spacing: -.01em; font-weight: 500;
}
.brand svg { border-radius: 8px; }
.brand b { font-weight: 750; }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm); color: var(--text);
  transition: background .15s, color .15s, transform .1s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.icon-btn.sm { width: 36px; height: 36px; box-shadow: none; background: var(--surface-2); backdrop-filter: none; }
.icon-btn.sm svg { width: 19px; height: 19px; }

/* ───────── Sheet ───────── */
.sheet {
  --y: 50vh;
  contain: layout style;
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  height: var(--app-h, 100dvh);
  transform: translate(var(--vv-left, 0px), calc(var(--y) + var(--vv-top, 0px)));
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  will-change: transform;
}
.sheet.dragging, :root.kb .sheet { transition: none; }
.sheet-grip {
  flex: none; height: 26px; display: grid; place-items: center;
  cursor: grab; touch-action: none;
}
.sheet-grip span { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); }
.sheet-body {
  position: relative;
  /* Sized from the settled snap (--ys), not the live drag position, so dragging only moves the sheet (GPU transform) and never re-lays out its content. */
  height: calc(var(--app-h, 100dvh) - var(--ys, var(--y)) - 26px);
  overflow-y: auto; overscroll-behavior-y: contain; touch-action: pan-y;
  padding: 2px 16px calc(var(--safe-b) + 28px);
  -webkit-overflow-scrolling: touch;
}
.sheet.dragging .sheet-body { overflow: hidden; }

/* SIDE_PANEL layout: desktops, large tablets in landscape, and phones held sideways. */
@media (min-width: 900px), (orientation: landscape) and (max-height: 540px) and (min-width: 560px) {
  .sheet {
    left: calc(16px + env(safe-area-inset-left, 0px)); right: auto;
    top: calc(var(--safe-t) + 70px + var(--vv-top, 0px)); width: min(420px, 46vw);
    height: calc(var(--app-h, 100dvh) - var(--safe-t) - 70px - 16px - var(--safe-b));
    transform: none; border-radius: var(--radius);
  }
  .sheet-grip { display: none; }
  .sheet-body { height: 100%; padding-top: 16px; }
  /* The top bar already carries the brand in this layout. */
  .q-brand { display: none; }
  .q-h1 { margin-top: 4px; font-size: 28px; }
  .q-back { margin-top: 0; }
}

.view { display: flex; flex-direction: column; gap: 14px; }

/* ───────── Segmented controls ───────── */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px;
}
.seg button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; border-radius: 10px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg button svg { width: 21px; height: 21px; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
:root[data-resolved-theme="dark"] .seg button[aria-checked="true"] { background: var(--surface-3); }
.seg-sm { border-radius: 11px; padding: 3px; }
.seg-sm button { height: 32px; font-size: 13px; border-radius: 8px; padding: 0 10px; }

/* ───────── Route card ───────── */
.route-card { position: relative; background: var(--surface-2); border-radius: var(--radius); padding: 6px 6px 4px; }
.places { position: relative; }
.places::before {
  content: ""; position: absolute; left: 19px; top: 26px; bottom: 26px;
  border-left: 2px dotted var(--faint); opacity: .7;
}
.place { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; min-height: 50px; }
.place + .place, #stops .place, #stops + .place { border-top: 1px solid var(--line); }
.place input {
  flex: 1; min-width: 0; height: 48px; border: 0; background: none; outline: none;
  font-size: 16px; padding: 0 4px;
}
.place input::placeholder { color: var(--faint); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; position: relative; z-index: 1; }
.dot-start { background: var(--surface); border: 3px solid var(--text); }
.dot-end { background: var(--accent); border-radius: 3px; }
.dot-stop { width: 10px; height: 10px; margin: 0 1px; background: var(--surface); border: 2.5px solid var(--muted); }
.field-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; }
.field-btn svg { width: 19px; height: 19px; }
.field-btn:hover, .field-btn:active { background: var(--surface-3); color: var(--text); }
.stay {
  flex: none; height: 30px; border-radius: 8px; border: 0; padding: 0 6px;
  background: var(--surface-3); color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.text-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 10px;
}
.text-btn svg { width: 17px; height: 17px; }
.suggest {
  position: absolute; left: 6px; right: 6px; z-index: 5;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 290px; overflow-y: auto;
}
.suggest li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest small { color: var(--muted); font-size: 13px; }

.imported { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 12px; }
.imported .imp-ico { width: 24px; height: 24px; color: var(--accent); }
.imported div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.imported b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imported small { color: var(--muted); }

.when-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.when-row .seg { justify-self: start; }
#in-when {
  grid-column: 1 / -1; width: 100%; min-width: 0; height: 44px; -webkit-appearance: none; appearance: none; text-align: left; border-radius: 11px; border: 0;
  background: var(--surface-2); padding: 0 10px; font-size: 15px; font-weight: 600;
}
.hint { color: var(--faint); font-size: 12px; margin-top: -8px; padding-left: 2px; }
.chip { text-decoration: none; display: inline-flex; align-items: center; }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 650; font-size: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.pace-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border-radius: 12px; padding: 4px 6px 4px 14px; font-weight: 600; }
.pace-row select { border: 0; background: var(--surface); height: 34px; border-radius: 9px; padding: 0 10px; font-weight: 600; }

.primary {
  height: 54px; border-radius: 16px; background: var(--accent); color: var(--accent-ink);
  font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .1s, filter .15s;
}
.primary:active { transform: scale(.985); filter: brightness(.95); }

.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.import-grid { display: grid; gap: 10px; }
.tile {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0;
}
.tile > svg { width: 24px; height: 24px; color: var(--accent); }
.tile span { display: flex; flex-direction: column; min-width: 0; }
.tile small { color: var(--muted); font-size: 13px; }
.tile .grow { flex: 1; }
.link-row { display: flex !important; flex-direction: row !important; gap: 6px; margin-top: 6px; }
.link-row input { flex: 1; min-width: 0; height: 36px; border: 0; border-radius: 9px; background: var(--surface); padding: 0 10px; font-size: 16px; }
.fine { color: var(--faint); font-size: 12px; text-align: center; }

/* ───────── Loading ───────── */
.loading {
  position: absolute; inset: 0; z-index: 4;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px;
  padding-top: 60px; text-align: center; color: var(--muted); font-weight: 600;
}
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3.5px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Briefing ───────── */
.brief-bar { display: flex; align-items: center; justify-content: space-between; margin: 0 -6px; }
.brief-tools { display: flex; gap: 6px; }
.brief-head { display: flex; flex-direction: column; gap: 4px; }
.eyebrow { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.eyebrow svg { width: 17px; height: 17px; }
.brief-title { font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 750; }
.times { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.times > div:not(.times-line) { display: flex; flex-direction: column; }
.times small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.times b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.times span { color: var(--muted); font-size: 13px; }
.times .tz { display: inline; text-transform: none; letter-spacing: 0; margin-left: 4px; font-size: 12px; }
.times-line { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--faint) 0 6px, transparent 6px 11px); opacity: .6; }

.verdict {
  --lvc: var(--lv0);
  border-radius: var(--radius); padding: 14px 16px;
  background: color-mix(in srgb, var(--lvc) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--lvc) 35%, transparent);
  display: flex; flex-direction: column; gap: 8px;
}
.verdict.lv1 { --lvc: var(--lv1); } .verdict.lv2 { --lvc: var(--lv2); } .verdict.lv3 { --lvc: var(--lv3); }
.verdict-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge { background: var(--lvc); color: #fff; font-weight: 750; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; }
:root[data-resolved-theme="dark"] .badge { color: #0a0f1b; }
.conf { font-size: 12.5px; font-weight: 650; color: var(--muted); }
.verdict p { font-size: 15.5px; font-weight: 550; }
.verdict .warn { color: var(--lv1); font-size: 13.5px; }
.conf-note { color: var(--muted); font-size: 12px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile-stat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.tile-stat small { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tile-stat b { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.tile-stat span { color: var(--faint); font-size: 12px; }
@media (min-width: 520px) and (max-width: 899px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--surface-2); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
:root[data-resolved-theme="dark"] .card { background: color-mix(in srgb, var(--surface-2) 80%, var(--surface)); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.card-head h2 svg { width: 18px; height: 18px; color: var(--lv2); }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.count:not(:empty) { background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 2px 8px; }
.empty { color: var(--muted); font-size: 14px; }

.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend span::before { content: ""; width: 12px; height: 3px; border-radius: 2px; }
.lg-temp::before { background: var(--temp); }
.lg-feels::before { background: repeating-linear-gradient(90deg, var(--feels) 0 3px, transparent 3px 5px); }
.lg-pop::before { background: var(--pop); height: 8px !important; width: 6px !important; }
.lg-terrain::before { background: var(--terrain); height: 8px !important; }
.profile-wrap { width: 100%; overflow: hidden; }
.profile { display: block; }
.profile .grid { stroke: var(--line); stroke-width: 1; }
.profile .tick { fill: var(--muted); font-size: 10.5px; font-weight: 600; }
.profile .terrain { fill: var(--terrain); opacity: .35; }
.profile .temp { fill: none; stroke: var(--temp); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.profile .feels { fill: none; stroke: var(--feels); stroke-width: 1.6; stroke-dasharray: 3 3; }
.profile .pop { fill: var(--pop); }
.profile .stopline { stroke: var(--faint); stroke-dasharray: 2 3; }
.lvfill-0 { fill: var(--lv0); } .lvfill-1 { fill: var(--lv1); } .lvfill-2 { fill: var(--lv2); } .lvfill-3 { fill: var(--lv3); } .lvfill-x { fill: var(--lvx); }

.lvdot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--lvx); }
.lvdot.lv0, .lvbg-0 { background: var(--lv0); }
.lvdot.lv1, .lvbg-1 { background: var(--lv1); }
.lvdot.lv2, .lvbg-2 { background: var(--lv2); }
.lvdot.lv3, .lvbg-3 { background: var(--lv3); }
.lvbg-x { background: var(--lvx); }

.hz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hz { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.hz .lvdot { margin-top: 5px; }
.hz span { display: flex; flex-direction: column; }
.hz b { font-weight: 650; }
.hz small { color: var(--muted); font-size: 13px; }

.alerts { border: 1px solid color-mix(in srgb, var(--lv2) 40%, transparent); }
.alert { background: var(--surface); border-radius: 12px; padding: 10px 12px; border-left: 4px solid var(--lv1); }
.alert.sev-severe, .alert.sev-extreme { border-left-color: var(--lv3); }
.alert summary { cursor: pointer; display: flex; flex-direction: column; list-style: none; }
.alert summary::-webkit-details-marker { display: none; }
.alert summary small { color: var(--muted); font-size: 12.5px; }
.alert p { font-size: 13.5px; margin-top: 8px; white-space: pre-line; }
.alert .instr { font-weight: 600; }
.alert .src { color: var(--faint); font-size: 11.5px; display: block; margin-top: 8px; }

.advice { font-size: 14px; color: var(--muted); }
.advice b { color: var(--text); }
.dep-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.dep { display: grid; grid-template-columns: 82px 1fr 58px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; text-align: left; }
.dep:hover { background: var(--surface); }
.dep.current { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dep-time { font-weight: 650; font-size: 14px; white-space: nowrap; }
.dep-time small { color: var(--muted); font-weight: 600; margin-left: 4px; font-size: 11.5px; }
.dep-strip { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 1px; }
.dep-strip i { flex: 1; }
.dep-tag { text-align: right; }
.dep-tag em { font-style: normal; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dep-tag em.best { color: var(--lv0); }

.navlog { list-style: none; margin: 0 -4px; padding: 0; }
.cp {
  --lvc: var(--lvx);
  width: 100%; display: grid; grid-template-columns: 62px 16px 1fr auto; gap: 8px;
  text-align: left; padding: 8px 6px; border-radius: 12px; align-items: stretch;
}
.cp.lv0 { --lvc: var(--lv0); } .cp.lv1 { --lvc: var(--lv1); } .cp.lv2 { --lvc: var(--lv2); } .cp.lv3 { --lvc: var(--lv3); }
.cp:hover { background: var(--surface); }
.cp.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); } 100% { background: transparent; } }
.cp-time { font-weight: 650; font-size: 13.5px; padding-top: 1px; white-space: nowrap; display: flex; flex-direction: column; }
.cp-time .tz { color: var(--faint); font-size: 11px; font-weight: 600; }
.cp-rail { position: relative; display: flex; justify-content: center; }
.cp-rail::before { content: ""; position: absolute; top: -8px; bottom: -8px; width: 3px; background: var(--lvc); opacity: .55; }
.navlog li:first-child .cp-rail::before { top: 8px; }
.navlog li:last-child .cp-rail::before { bottom: calc(100% - 8px); }
.cp-rail i { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 3px solid var(--lvc); margin-top: 3px; }
.cp-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cp-main b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-main small { color: var(--muted); font-size: 12.5px; }
.note { font-style: normal; font-size: 12px; font-weight: 650; color: var(--lvn); }
.note.lv1 { --lvn: var(--lv1); } .note.lv2 { --lvn: var(--lv2); } .note.lv3 { --lvn: var(--lv3); }
.cp-wx { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 4px; align-items: center; justify-items: end; }
.cp-wx svg { grid-row: span 2; }
.cp-wx b { font-size: 16px; font-weight: 700; }
.cp-wx small { color: var(--pop); font-size: 11.5px; font-weight: 700; }

.nav-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-out {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px;
  border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 650;
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-out svg { width: 18px; height: 18px; color: var(--accent); }
.disclaimer { color: var(--faint); font-size: 12px; text-align: center; padding: 4px 12px; }

/* ───────── Dialogs ───────── */
.dlg {
  width: min(460px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 48px));
  border: 0; border-radius: 20px; padding: 16px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow);
}
.dlg::backdrop { background: rgba(5, 10, 20, .45); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dlg-head h2 { font-size: 19px; font-weight: 750; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.about { padding-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); }
.about h3 { font-size: 15px; color: var(--text); }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-list li { display: grid; grid-template-columns: 14px 86px 1fr; gap: 6px; align-items: baseline; }
.legend-list b { color: var(--text); }
.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.saved-list li { display: flex; align-items: center; gap: 6px; }
.saved-list li.empty { color: var(--muted); padding: 8px 2px; }
.saved-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); text-align: left; }
.saved-open svg { width: 22px; height: 22px; color: var(--accent); }
.saved-open span { display: flex; flex-direction: column; min-width: 0; }
.saved-open b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-open small { color: var(--muted); font-size: 12.5px; }

/* ───────── Toast ───────── */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 66px + var(--vv-top, 0px)); z-index: 50;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ───────── Sunrise component styling ───────── */
body { font-size: 14px; }
.sheet { border-radius: var(--fd-r-xl) var(--fd-r-xl) 0 0; box-shadow: var(--fd-shadow-sheet); }
.sheet-grip span { width: 38px; height: 4px; background: var(--line); }
@media (min-width: 900px), (orientation: landscape) and (max-height: 540px) and (min-width: 560px) { .sheet { border-radius: var(--fd-r-xl); box-shadow: var(--shadow); } }

.brand { gap: 7px; padding: 6px 14px 6px 8px; font-size: 18px; font-weight: 900; letter-spacing: -.03em; }
.brand b { font-weight: 900; color: var(--accent); }
.brand-mark { width: 26px; height: 26px; color: var(--text); }

.seg button[aria-checked="true"] { font-weight: 800; }
.primary { font-weight: 800; font-size: 16px; letter-spacing: 0; border-radius: var(--fd-r-md); box-shadow: none; }
.primary:hover { background: var(--fd-primary-hover); }
.primary:active { background: var(--fd-primary-press); transform: none; filter: none; }
:root[data-resolved-theme="dark"] .primary:hover { background: #ec7a64; }
.chip { font-weight: 800; }
.brief-title, .dlg-head h2 { font-weight: 800; letter-spacing: -.02em; }
.times b, .tile-stat b { font-weight: 900; }

/* Verdict banner: plum ground; severity shown as a chip on the ramp. */
.verdict { background: var(--verdict-bg); color: var(--verdict-ink); border: 0; box-shadow: var(--shadow-sm); }
.verdict p { font-weight: 600; }
.verdict .conf, .verdict .conf-note { color: color-mix(in srgb, var(--verdict-ink) 72%, transparent); }
.verdict .warn { color: var(--fd-sev-1); }
:root[data-resolved-theme="dark"] .verdict .warn { color: var(--fd-primary); }
.badge { color: var(--lv-ink); font-weight: 900; }
.verdict.lv3 .badge { color: var(--fd-ink-inverse); }

.dep-tag em.best { color: var(--accent); }
.dep.current { box-shadow: inset 0 0 0 2px var(--text); }
.hz .lvdot, .lvdot { box-shadow: inset 0 0 0 1px rgba(43, 27, 61, .12); }
.cp-rail::before { opacity: .9; }
.cp-wx small { color: var(--fd-primary); }
:root[data-resolved-theme="dark"] .cp-wx small { color: var(--fd-sev-2); }
.alert { border-left-color: var(--lv2); }
.alert.sev-severe, .alert.sev-extreme { border-left-color: var(--lv3); }
.alerts { border-color: color-mix(in srgb, var(--lv3) 40%, transparent); }
.card-head h2 svg { color: var(--lv3); }

/* Map markers */
.mk { box-shadow: 0 0 0 3px var(--lvc, var(--lvx)), 0 0 0 4px rgba(43, 27, 61, .18), var(--shadow-sm); }
.pin-start span { background: var(--text); }
.pin-end span { background: var(--accent); }
.me { border-color: var(--fd-bg); }

/* ───────── Small phones & short viewports ───────── */
/* iOS Safari zooms the page when a focused field's text is under 16px and never zooms back out.
   Keep every form control at 16px so the layout stays locked to the screen width. */
input, select, textarea, #in-when, .stay, .pace-row select { font-size: 16px; }
.stay { height: 32px; padding: 0 4px; font-weight: 600; max-width: 124px; }

/* The main action stays reachable without scrolling, whatever the screen height. */
.brief-cta {
  position: sticky; bottom: 0; z-index: 3;
  margin: 0 -16px; padding: 12px 16px 14px;
  background: linear-gradient(to bottom, transparent, var(--surface) 12px);
}
.brief-cta .primary { width: 100%; }

@media (max-width: 899px) and (max-height: 780px) {
  .view { gap: 10px; }
  .seg button { height: 38px; }
  .seg-sm button { height: 30px; }
  .place { min-height: 44px; }
  .place input { height: 44px; }
  #in-when { height: 40px; }
  .primary { height: 48px; }
  .hint { margin-top: -4px; }
  .brief-title { font-size: 20px; }
  .times b { font-size: 18px; }
  .verdict { padding: 12px 14px; gap: 6px; }
}
@media (max-width: 380px) {
  .topbar { padding-left: calc(10px + env(safe-area-inset-left, 0px)); padding-right: calc(8px + env(safe-area-inset-right, 0px)); }
  .top-actions { gap: 4px; }
  .icon-btn { width: 38px; height: 38px; }
  .brand { font-size: 16px; padding-right: 12px; }
  .brand-mark { width: 24px; height: 24px; }
  .seg button { gap: 5px; }
}

/* Netlify injects a floating "Powered by Netlify" badge into every page; it covers app controls. */
#nl-badge-frame { display: none !important; }

/* Tablets in portrait: keep the bottom sheet a comfortable reading width, centered. */
@media (min-width: 640px) and (max-width: 899px) and (orientation: portrait) {
  .sheet { left: 0; right: 0; margin: 0 auto; max-width: 620px; }
}

/* ───────── Favorites (home screen) ───────── */
.favs { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.favs-head { display: flex; align-items: center; justify-content: space-between; }
.favs-head h2 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.favs-head .text-btn { padding: 4px 6px; font-size: 13px; }
.fav-row {
  touch-action: pan-x pan-y;
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.fav-row::-webkit-scrollbar { display: none; }
.fav-card {
  flex: 0 0 auto; width: 150px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .1s, background .15s;
}
.fav-card:active { transform: scale(.97); }
.fav-card:hover { background: var(--surface-3); }
.fav-ico { width: 20px; height: 20px; color: var(--accent); margin-bottom: 4px; }
.fav-card b { font-weight: 750; font-size: 14px; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-card small { color: var(--muted); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-toggle[aria-pressed="true"] { --star-fill: var(--accent); color: var(--accent); }
.fav-form { display: flex; flex-direction: column; gap: 12px; }
.fav-field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.fav-field input { height: 46px; border: 0; border-radius: 12px; background: var(--surface-2); padding: 0 12px; color: var(--text); font-weight: 600; }
.fav-route { color: var(--muted); font-size: 13.5px; }
.fav-check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.fav-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.fav-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.fav-actions .primary { height: 46px; font-size: 15px; }

/* ───────── Departure calendar ───────── */
.cal { display: flex; flex-direction: column; gap: 3px; }
.cal-row { display: grid; grid-template-columns: 46px repeat(9, 1fr); gap: 3px; align-items: center; }
.cal-head span { font-size: 10px; font-weight: 700; color: var(--faint); text-align: center; }
.cal-day { font-size: 12px; font-weight: 700; display: flex; flex-direction: column; line-height: 1.1; }
.cal-day small { font-size: 10px; color: var(--faint); font-weight: 600; }
.cal-today .cal-day { color: var(--accent); }
.cal-cell {
  aspect-ratio: 1; min-height: 22px; border-radius: 6px; position: relative;
  background: color-mix(in srgb, var(--fd-sev-4) calc(var(--heat, 0) * 100%), var(--fd-sev-1));
  transition: transform .1s;
}
.cal-cell:hover { transform: scale(1.12); z-index: 1; }
.cal-cell[data-best]::after, .cal-cell[data-planned]::after {
  content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--fd-ink);
}
.cal-cell[data-planned]::after { content: "◎"; font-size: 14px; }
.cal-cell[data-best][data-planned]::after { content: "★"; }
.cal-cell[data-planned] { box-shadow: 0 0 0 2px var(--text); }
:root[data-resolved-theme="dark"] .cal-cell[data-best]::after, :root[data-resolved-theme="dark"] .cal-cell[data-planned]::after { color: #1a1024; }
.cal-na { background: repeating-linear-gradient(45deg, var(--surface-3) 0 3px, transparent 3px 7px); opacity: .6; }
.cal-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 600; }
.cal-legend i { width: 60px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--fd-sev-1), var(--fd-sev-4)); }
.cal-legend em { font-style: normal; margin-left: auto; }
.cal-legend em + em { margin-left: 8px; }
.fine summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--accent); padding: 4px 0; list-style: none; }
.fine summary::-webkit-details-marker { display: none; }
.fine summary::before { content: "▸ "; }
.fine[open] summary::before { content: "▾ "; }
.fine .dep-list { margin-top: 6px; }

/* Primary CTA with the wordmark and mark inline */
#btn-brief { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
#btn-brief b { font-weight: 900; margin-left: -6px; }
#btn-brief .btn-mark { width: 22px; height: 22px; color: var(--accent-ink); margin: 0 2px; }
@media (max-width: 380px) { #btn-brief { font-size: 15px; gap: 5px; } #btn-brief .btn-mark { width: 20px; height: 20px; } }

/* While the keyboard is up the sheet is short; let the main button scroll with the form instead of covering it. */
:root.kb .brief-cta { position: static; background: none; padding-top: 4px; }
:root.kb .favs { display: none; }

/* Hover effects only on devices that can hover (touch screens otherwise keep the last tap "lit"). */
@media (hover: none) {
  .cp:hover, .dep:hover, .fav-card:hover, .trip:hover, .suggest li:hover { background: inherit; box-shadow: inherit; }
  .cal-cell:hover { transform: none; }
}

/* Inline, persistent error under the planner form (toasts vanish too fast for some people). */
.form-error {
  display: flex; align-items: flex-start; gap: 10px;
  background: color-mix(in srgb, var(--fd-sev-3) 14%, var(--surface)); color: var(--text);
  border-left: 4px solid var(--fd-sev-3); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600;
}
.form-error svg { width: 20px; height: 20px; flex: none; color: var(--fd-sev-3); }
.form-error span { flex: 1; }
.form-error button { color: var(--muted); }

/* Map attribution: plain small text, not a button that looks like Help. */
.maplibregl-ctrl-attrib.maplibregl-compact { padding: 2px 8px; border-radius: 8px; }
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button { display: none; }
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner { display: block; font-size: 9.5px; opacity: .8; }
.maplibregl-ctrl-top-left { top: calc(var(--safe-t) + 60px + var(--vv-top, 0px)); }

/* Precip chance in checkpoint rows */
.cp-wx small { display: inline-flex; align-items: center; gap: 2px; }
.cp-wx small svg { width: 10px; height: 10px; }

/* Text size setting: scales the sheet, dialogs and briefing without touching the map. */
/* Scale the content, not the scroll container, so the sheet keeps its real height and the pinned button stays on screen. */
:root[data-text="large"] { --z: 1.18; }
:root[data-text="xlarge"] { --z: 1.34; }
:root[data-text="large"] .sheet-body > .view, :root[data-text="large"] .dlg,
:root[data-text="xlarge"] .sheet-body > .view, :root[data-text="xlarge"] .dlg { zoom: var(--z); }
/* Edge-to-edge pieces use negative margins equal to the sheet padding; divide by the zoom so they still line up. */
:root[data-text] .brief-cta { margin-left: calc(-16px / var(--z, 1)); margin-right: calc(-16px / var(--z, 1)); padding-left: calc(16px / var(--z, 1)); padding-right: calc(16px / var(--z, 1)); }
:root[data-text] .fav-row { margin-left: calc(-16px / var(--z, 1)); margin-right: calc(-16px / var(--z, 1)); }
/* Departure calendar: let the nine columns shrink instead of forcing a minimum square size. */
.cal-row { grid-template-columns: 44px repeat(9, minmax(0, 1fr)); }
.cal-cell { min-height: 0; }
:root[data-text="large"] .cal-row, :root[data-text="xlarge"] .cal-row { grid-template-columns: 34px repeat(9, minmax(0, 1fr)); gap: 2px; }
:root[data-text="xlarge"] .cal-head span { font-size: 9px; }
.cp-main b { overflow-wrap: anywhere; }
@media (max-width: 480px) {
  :root[data-text="large"] .when-boxes, :root[data-text="xlarge"] .when-boxes { grid-template-columns: 1fr; }
  :root[data-text="xlarge"] .wchip { padding: 0 12px; }
}

.place-tip { color: var(--muted); font-size: 13px; line-height: 1.4; padding: 4px 12px 8px; }
.place-tip b { color: var(--text); font-weight: 700; }

/* Labeled top-bar buttons */
.icon-btn.labeled { width: 56px; height: 48px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.icon-btn.labeled svg { width: 19px; height: 19px; }
.icon-btn.labeled span { font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.top-actions { gap: 5px; }
@media (max-width: 380px) {
  .icon-btn.labeled { width: 50px; height: 46px; }
  .brand { padding-right: 10px; font-size: 15px; }
}

/* Welcome card (first launch) */
.welcome { background: var(--verdict-bg); color: var(--verdict-ink); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.welcome h2 { font-size: 19px; font-weight: 800; }
.welcome p { font-size: 14px; opacity: .92; }
.welcome ol { margin: 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.welcome em { font-style: normal; font-weight: 700; }
.welcome .primary { height: 44px; font-size: 15px; margin-top: 4px; }

/* ───────── Planner fields (labeled white boxes) ───────── */
.route-card { background: none; padding: 0; }
.places { display: flex; flex-direction: column; }
.places::before { display: none; }
.fld-label { display: block; font-size: 15px; font-weight: 750; color: var(--text); margin: 12px 2px 6px; }
.places > .fld-label:first-child, .when > .fld-label { margin-top: 2px; }
.place.fld, .fld {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 6px 0 14px; border-top: 0 !important;
  background: #fff; border-radius: 14px; box-shadow: inset 0 0 0 1.5px #cdb9a6, 0 1px 2px rgba(43, 27, 61, .06);
  transition: box-shadow .15s;
}
:root[data-resolved-theme="dark"] .place.fld, :root[data-resolved-theme="dark"] .fld { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.fld:focus-within { box-shadow: inset 0 0 0 2.5px var(--accent), 0 0 0 4px var(--accent-soft); }
.fld-ico { width: 22px; height: 22px; color: var(--accent); flex: none; }
.place.fld input { height: 52px; font-size: 17px; font-weight: 600; padding: 0; }
.place.fld input::placeholder { color: #8a7a80; font-weight: 500; }
.place.fld.is-me input { color: var(--accent); }
.stop-wrap .fld-label { display: flex; justify-content: space-between; align-items: baseline; }
.fld-foot { display: flex; justify-content: flex-start; margin: 6px -4px 0; }
.fld-foot .text-btn { font-size: 15px; padding: 8px 6px; }
.place-tip { padding: 4px 2px 0; font-size: 13.5px; }

.when { display: flex; flex-direction: column; gap: 10px; }
.when-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.wchip {
  height: 42px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 700;
  background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line);
}
.wchip[aria-pressed="true"] { background: var(--fd-ink); color: var(--fd-ink-inverse); box-shadow: none; }
:root[data-resolved-theme="dark"] .wchip[aria-pressed="true"] { background: var(--fd-bg); color: var(--fd-ink); }
.when-boxes { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; }
.when-box { cursor: pointer; padding-right: 10px; }
.when-text { display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.when-text small { font-size: 12px; font-weight: 700; color: var(--muted); }
.when-text b { font-size: 16.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fld-chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
/* The native picker sits invisibly over the whole box so any tap opens it. */
.when-box input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; margin: 0; cursor: pointer; font-size: 16px; }
.when .hint { margin-top: -2px; }
.when-mode { align-self: flex-start; margin: -4px -4px 0; font-size: 14.5px; }
#in-when { display: none; }

/* Bottom breathing room lives inside the content (not as scroll padding) so the pinned button sits flush. */
.sheet-body { padding-bottom: 0; }
.view::after { content: ""; flex: none; height: calc(var(--safe-b) + 20px); }
@media (min-width: 900px), (orientation: landscape) and (max-height: 540px) and (min-width: 560px) { .view::after { height: 16px; } }

/* ───────── Narrow-screen fixes from the layout audit ───────── */
/* Smallest phones (320–359px): logo mark only, slimmer labeled buttons, so all four fit. */
@media (max-width: 359px) {
  .brand > span { display: none; }
  .brand { padding: 6px; }
  .icon-btn.labeled { width: 46px; height: 46px; }
  .icon-btn.labeled span { font-size: 9.5px; }
  .top-actions { gap: 4px; }
  .when-boxes { grid-template-columns: 1fr; }
  .wchip { padding: 0 12px; font-size: 14px; }
}
/* Anything inside the sheet may shrink rather than push past its edge. */
.tile, .tile span, .link-row, .when-boxes > *, .fld { min-width: 0; }
.link-row input { width: 100%; }
/* Phones held sideways: the side panel is narrow, so stack date and time. */
@media (orientation: landscape) and (max-height: 540px) and (min-width: 560px) and (max-width: 899px) {
  .sheet { width: min(400px, 52vw); }
  .when-boxes { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .view { gap: 10px; }
  .fld-label { margin-top: 8px; }
}

/* Let checkpoint names wrap rather than truncate, so full town names are always readable. */
.cp-main b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
/* 360–419px phones (iPhone 13/14/15/16, SE): trim the top bar so logo and four buttons fit with margin. */
@media (min-width: 360px) and (max-width: 419px) {
  .icon-btn.labeled { width: 51px; }
  .top-actions { gap: 4px; }
  .brand { font-size: 16px; padding: 6px 10px 6px 7px; gap: 6px; }
  .brand-mark { width: 24px; height: 24px; }
}

/* ───────── Numbered steps + trip-summary button ───────── */
.step { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 4px 2px 2px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--fd-ink); color: var(--fd-ink-inverse); font-size: 15px; font-weight: 800; }
:root[data-resolved-theme="dark"] .step-num { background: var(--fd-bg); color: var(--fd-ink); }
.route-card > .step { margin-bottom: 0; }
.when > .step { margin: 2px 2px 0; }
.places > .fld-label:first-child { margin-top: 10px; }
.step-cta { margin: 6px 2px -8px; }
#btn-brief { flex-direction: column; gap: 2px; height: auto; min-height: 60px; padding: 8px 14px; white-space: normal; }
#btn-brief .cta-main { font-size: 17px; font-weight: 800; }
#btn-brief .cta-sub { font-size: 13px; font-weight: 600; opacity: .92; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root.kb .step-cta { display: none; }

/* ───────── Sheet gesture fixes ─────────
   Content only scrolls once the sheet is fully open; at half height a swipe always moves the sheet.
   This removes the fight between our drag and Safari's native scroll. */
.sheet.no-scroll .sheet-body { overflow-y: hidden; }
.sheet.no-scroll .sheet-body .fav-row { overflow-x: auto; }
.sheet-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ───────── End-of-briefing actions ───────── */
.end-card { gap: 8px; }
.end-card .btn-out { height: 48px; font-size: 15px; }
.end-card .primary { height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.end-card .btn-mark { width: 20px; height: 20px; }
.print-head { display: none; }

/* ───────── Print: the briefing as a clean document ───────── */
@media print {
  @page { margin: 14mm; }
  html, body { overflow: visible !important; height: auto !important; background: #fff !important; color: #000; }
  #map, .topbar, .sheet-grip, #view-plan, .brief-bar, .nav-card, .end-card, .disclaimer, .toast, dialog, .maplibregl-ctrl,
  .form-error, .fine, .cal-legend, .dep-list, #loading, .cp-rail { display: none !important; }
  .sheet { position: static !important; transform: none !important; height: auto !important; width: auto !important;
    box-shadow: none !important; border-radius: 0 !important; contain: none !important; }
  .sheet-body { height: auto !important; overflow: visible !important; padding: 0 !important; }
  .view::after { display: none; }
  .print-head { display: block; border-bottom: 2px solid #2b1b3d; padding-bottom: 8px; margin-bottom: 14px; }
  .print-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
  .print-brand .brand-mark { width: 26px; height: 26px; }
  .print-brand b { color: #c44a34; }
  .print-meta { font-size: 12px; color: #555; margin-top: 4px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card, .verdict, .tiles, .tile-stat, .cp, .hz, .alert { break-inside: avoid; }
  .card { box-shadow: none !important; border: 1px solid #ddd; background: #fff !important; }
  .verdict { border: 2px solid #2b1b3d; }
  .cp { grid-template-columns: 64px 1fr auto; }
  .cp-main b { white-space: normal; }
  .cal-cell[data-ms] { border: 1px solid #fff; }
  a[href]::after { content: none; }
  /* Flex columns fragment badly in WebKit (every item lands on its own page); flow the briefing as blocks. */
  .view, #brief { display: block !important; }
  .view > *, #brief > * { margin-bottom: 12px; }
  .tiles { grid-template-columns: repeat(4, 1fr) !important; }
  .brief-head .times { break-after: avoid; }
  .card { padding: 10px 12px; }
}

/* ───────── Polish ───────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#view-brief.rise > * { animation: rise .32s cubic-bezier(.32, .72, 0, 1) both; }
#view-brief.rise > :nth-child(2) { animation-delay: .04s; }
.cp-main b.named { animation: rise .25s ease both; }
.wchip, .when-box, .fav-card, .btn-out, .tile, .cp, .hz, .dep { transition: transform .12s ease, background .15s ease; }
.wchip:active, .when-box:active, .btn-out:active, .tile:active, .cp:active, .hz:active, .dep:active { transform: scale(.98); }
.icon-btn.labeled:active { transform: scale(.94); }
.loading .spinner { animation-duration: .7s; }
@media (prefers-reduced-motion: reduce) { #view-brief.rise > *, .cp-main b.named { animation: none; } }

/* ───────── Print: everything on one page ───────── */
@media print {
  @page { size: letter; margin: 9mm 10mm; }
  body { font-size: 10.5px; line-height: 1.25; }
  .print-head { padding-bottom: 4px; margin-bottom: 8px; }
  .print-brand { font-size: 15px; }
  .print-meta { font-size: 9.5px; margin-top: 2px; }
  .view > *, #brief > * { margin-bottom: 6px; }
  .card { padding: 6px 8px; border-radius: 8px; break-inside: auto; }
  .card-head h2 { font-size: 11.5px; }
  .card-head .sub, .count { font-size: 9px; }
  .brief-head .eyebrow { font-size: 10px; }
  .brief-title { font-size: 17px; line-height: 1.1; }
  .times { margin-top: 2px; }
  .times b { font-size: 14px; }
  .times small, .times span { font-size: 9px; }
  .verdict { padding: 7px 10px; gap: 3px; border-radius: 8px; }
  .verdict p { font-size: 11px; }
  .verdict .warn, .conf-note, .conf { font-size: 9px; }
  .badge { font-size: 9.5px; padding: 2px 8px; }
  .tiles { gap: 6px; }
  .tile-stat { padding: 5px 8px; border-radius: 8px; }
  .tile-stat small { font-size: 8.5px; }
  .tile-stat b { font-size: 13px; }
  .tile-stat span { font-size: 8.5px; }
  /* Chart and departure list are for the screen; hazards + calendar + checkpoints carry the story on paper. */
  #profile, .legend, .card:has(#profile) { display: none !important; }
  .hz-list { gap: 3px; }
  .hz { padding: 4px 8px; border-radius: 6px; }
  .hz b { font-size: 10.5px; }
  .hz small { font-size: 9px; }
  .advice { font-size: 10px; }
  .cal { gap: 2px; }
  .cal-row { gap: 2px; grid-template-columns: 36px repeat(9, minmax(0, 1fr)); }
  .cal-cell { aspect-ratio: auto; height: 11px; min-height: 0; border-radius: 3px; }
  .cal-cell[data-best]::after, .cal-cell[data-planned]::after { font-size: 9px; }
  .cal-head span { font-size: 8px; }
  .cal-day { font-size: 9px; line-height: 1; }
  .cal-day small { font-size: 7.5px; }
  .alerts .alert p, .alerts .alert .src { display: none; }
  .alert { padding: 4px 8px; }
  .alert summary b { font-size: 10.5px; }
  .alert summary small { font-size: 9px; }
  /* Checkpoints: two compact columns, one line each. */
  .navlog { columns: 2; column-gap: 14px; margin: 0; }
  .navlog li { break-inside: avoid; }
  .cp { display: grid; grid-template-columns: 46px 1fr auto; gap: 6px; padding: 2px 0; align-items: baseline; }
  .cp-time { font-size: 9.5px; }
  .cp-time .tz { display: none; }
  .cp-main b { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cp-main small { font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cp-main .note { display: none; }
  .cp-wx { column-gap: 2px; }
  .cp-wx svg.wx { width: 12px; height: 12px; }
  .cp-wx b { font-size: 10px; }
  .cp-wx small { font-size: 8px; }
  .cp-wx small svg { width: 7px; height: 7px; }
}
@media print {
  * { animation: none !important; transition: none !important; }
  .card, .cp-main { display: block; }
  .cp-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cp-main b, .cp-main small { display: inline; overflow: visible; }
  .cp-main small::before { content: " · "; color: #888; }
  .card-head { display: flex; }
}
@media print {
  #view-brief { zoom: .9; }
  .navlog { columns: auto; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 0; }
  .navlog li { min-width: 0; }
  .cp { padding: 1px 0; }
  .cal-cell { height: 9px; }
  .print-head { margin-bottom: 6px; }
  .view > *, #brief > * { margin-bottom: 5px; }
}

/* ───────── Route options ───────── */
.route-list { display: flex; flex-direction: column; gap: 8px; }
.route-opt {
  --lvc: var(--lv0);
  display: flex; flex-direction: column; gap: 5px; text-align: left; width: 100%;
  background: var(--surface); border-radius: 12px; padding: 10px 12px;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s, transform .12s;
}
.route-opt.lv1 { --lvc: var(--lv1); } .route-opt.lv2 { --lvc: var(--lv2); } .route-opt.lv3 { --lvc: var(--lv3); }
.route-opt.selected { box-shadow: inset 0 0 0 2.5px var(--accent); }
.route-opt:active { transform: scale(.985); }
.ro-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ro-name { font-size: 16px; font-weight: 800; }
.ro-head .tag { font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.ro-head .tag.best { background: var(--fd-ink); color: var(--fd-ink-inverse); }
:root[data-resolved-theme="dark"] .ro-head .tag.best { background: var(--fd-bg); color: var(--fd-ink); }
.ro-meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.route-opt .dep-strip { height: 8px; }
.ro-wx { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--text); }
.route-opt.selected::after { content: "Showing this route"; font-size: 11px; font-weight: 800; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
@media print {
  .routes .advice { font-size: 10px; }
  .route-opt { padding: 4px 8px; gap: 2px; border-radius: 6px; }
  .ro-name { font-size: 10.5px; } .ro-meta, .ro-wx { font-size: 9px; } .ro-head .tag { font-size: 8px; padding: 1px 5px; }
  .route-opt .dep-strip, .route-opt.selected::after { display: none; }
  .route-opt.selected { box-shadow: inset 0 0 0 1.5px #000; }
  .route-list { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .card-head .sub { display: none; }
}

/* ───────── Plus gate, "since you checked" ───────── */
.plus-pill { display: inline-block; font-size: 10.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; vertical-align: middle; }
.plus-lock { align-items: flex-start; border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.plus-lock p { margin: 8px 0 10px; font-size: 15px; line-height: 1.4; }
.plus-lock p small { color: var(--muted); font-size: 13px; font-weight: 500; }
.plus-lock .row, .set-row .row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text); }
.plus-row { align-items: flex-start; flex-wrap: wrap; }
.plus-row > span:first-child { line-height: 1.35; }
.plus-status { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.plus-status.unlocked { color: var(--lv0-ink, var(--text)); }
.plus-form { display: flex; gap: 6px; margin-left: auto; }
.plus-form input { width: 130px; font-size: 16px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); text-transform: uppercase; }
.delta .delta-list { margin: 0; padding: 0 0 0 18px; font-size: 14.5px; line-height: 1.45; }
.delta .delta-list li { margin: 3px 0; }
.delta-worse { box-shadow: inset 0 0 0 2px var(--lv2); }
.delta li.d-better, .delta li.d-cleared { color: var(--muted); }
@media print { .plus-lock, .delta { display: none; } }

/* ───────── Traffic (Plus) ───────── */
.traffic-line { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 13.5px; font-weight: 650; color: var(--muted); }
.traffic-line svg { width: 18px; height: 18px; flex: none; }
.traffic-line.lv1 { color: var(--text); }
.traffic-line.lv2 { color: var(--lv2); }
.traffic-line.locked { font-weight: 600; }
.traffic-line .link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.hz.lvt1 .lvdot, .hz.lvt0 .lvdot { background: var(--lv1); }
.hz.lvt2 .lvdot, .hz.lvt3 .lvdot { background: var(--lv2); }
.note.tr { background: color-mix(in srgb, var(--lv2) 14%, transparent); color: var(--text); }
@media print { .traffic-line.locked { display: none; } }

/* ───────── Reminders (Plus) ───────── */
.rem-form { display: flex; flex-direction: column; gap: 10px; }
.rem-form .seg { align-self: flex-start; }
.rem-check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; }
.rem-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.rem-set { align-self: flex-start; }
.rem-state { display: flex; align-items: flex-start; gap: 10px; }
.rem-state svg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 2px; }
.rem-state p { margin: 0; font-size: 15px; line-height: 1.4; }
.rem-state small { color: var(--muted); font-weight: 500; }
.rem-note { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.45; }
.rem-note b { color: var(--text); }
@media print { .card.rem { display: none; } }

/* ───────── Native app wrapper ───────── */
html.native-ios .topbar { padding-top: max(10px, env(safe-area-inset-top)); }

/* ═══════════ "Question first" home: one question per screen ═══════════ */
.qstep { position: relative; display: flex; flex-direction: column; min-height: 100%; }
.q-brand { display: flex; align-items: center; gap: 10px; margin-top: 12px; font: 900 22px/1 var(--fd-font); letter-spacing: -.03em; }
.q-brand .brand-mark { width: 28px; height: 28px; }
.q-brand b { color: var(--fd-primary); }
.q-h1 { font: 800 32px/1.12 var(--fd-font); letter-spacing: -.015em; margin: 36px 0 0; text-wrap: pretty; }
.q-p { font: 400 17px/1.5 var(--fd-font); color: var(--muted); margin: 14px 0 0; }
.q-lbl { display: block; font: 700 15px/1 var(--fd-font); color: var(--muted); letter-spacing: .02em; margin: 30px 0 8px; text-transform: uppercase; }
.q-recent .q-lbl { margin-top: 34px; }
.qstep .fld { min-height: 56px; border-radius: 14px; background: var(--surface-2); font: 500 19px var(--fd-font); }
.qstep .place input { font-size: 19px; min-height: 56px; }
.qstep .place-tip { margin-top: 8px; }
.q-from { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; }
.q-from-text { flex: 1; font: 500 19px var(--fd-font); min-height: 56px; display: flex; align-items: center; }
.q-from .q-change { font: 700 17px var(--fd-font); color: var(--fd-primary); min-height: 48px; padding: 0 10px; flex: none; }
.q-from .q-change svg { width: 18px; height: 18px; }
.q-from.editing input { flex: 1 1 120px; min-width: 0; }
.q-from.editing #btn-myloc { flex: none; padding-right: 6px; }
.q-from.editing #btn-myloc svg { width: 18px; height: 18px; }
.q-note { font: 500 15px/1.4 var(--fd-font); color: var(--muted); margin: 12px 0 0; }
.q-more { margin-top: 28px; border-top: 1px solid var(--line); }
.q-more summary { list-style: none; cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; font: 700 17px var(--fd-font); color: var(--fd-primary); }
.q-more summary::-webkit-details-marker { display: none; }
.q-more summary::after { content: "+"; font-size: 24px; font-weight: 800; }
.q-more[open] summary::after { content: "–"; }
.q-more-body { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; animation: rise .28s cubic-bezier(.32,.72,0,1) both; }
.q-more-body .q-lbl { margin-top: 4px; }
.q-more-body .fld-foot { flex-wrap: wrap; gap: 6px 16px; }
.q-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.q-links .text-btn { min-height: 48px; font-size: 17px; font-weight: 700; }
.q-center { justify-content: center; }
.q-foot { margin-top: auto; padding: 28px 0 calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.q-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 0 22px;
  border: 0; border-radius: 16px; background: var(--fd-primary); color: var(--fd-ink-inverse); font: 800 18px/1.2 var(--fd-font); text-align: left; }
.q-btn span { font-size: 24px; flex: none; }
.q-btn:hover { background: var(--fd-primary-hover); }
.q-btn:active { background: var(--fd-primary-press); }
.q-step { text-align: center; font: 500 15px var(--fd-font); color: var(--muted); margin: 0; }
.q-back { font: 700 17px var(--fd-font); color: var(--fd-primary); min-height: 48px; margin-top: 12px; align-self: flex-start; padding: 0; }
.q-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.q-opts .wchip { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 0 18px; border: 0; border-radius: 14px;
  background: var(--surface-2); color: var(--text); font: 600 19px var(--fd-font); text-align: left; width: 100%; }
.q-opts .wchip[hidden] { display: none; }
.q-opts .wchip::before { content: ""; width: 26px; height: 26px; border-radius: 50%; box-sizing: border-box; border: 3px solid var(--text); flex: none; }
.q-opts .wchip[aria-checked="true"] { background: var(--surface); box-shadow: inset 0 0 0 3px var(--text); }
.q-opts .wchip[aria-checked="true"]::before { border-width: 8px; }
.q-opts .wchip span { margin-left: auto; font-size: 24px; color: var(--muted); }
#when-custom { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
#when-custom .hint { margin-top: 0; }
.recent-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 16px 18px;
  border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); margin-top: 10px; text-align: left; }
.recent-card .rc-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.recent-card b { font: 800 19px/1.2 var(--fd-font); }
.recent-card small { font: 500 15px/1.3 var(--fd-font); color: var(--muted); }
.rating { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font: 800 15px var(--fd-font); color: var(--text); white-space: nowrap; flex: none; }
.rating[data-level="checking"] { background: var(--surface-2); color: var(--muted); font-weight: 600; }
.rating[data-level="good"] { background: var(--lv0); }
.rating[data-level="caution"] { background: var(--lv1); }
.rating[data-level="poor"] { background: var(--lv2); color: #fff; }
.rating[data-level="danger"] { background: var(--lv3); color: #fff; }
#view-plan .form-error { margin-top: 10px; }

/* Phones (portrait, and anything too small for the side panel): no sheet, no top bar, no map until the answer. */
@media (max-width: 899px) and (orientation: portrait), (max-width: 559px), (max-width: 899px) and (min-height: 541px) {
  .topbar, .sheet-grip { display: none; }
  #map { display: none; }
  /* Pinned above the briefing while you scroll (like the old half-sheet), with a Hide map toggle. */
  .map-wrap { position: sticky; top: 0; z-index: 6; margin: 0 -22px 8px; background: var(--surface); }
  .map-wrap #map { display: block; position: relative; inset: auto; height: 44vh; min-height: 280px; transition: height .3s cubic-bezier(.32,.72,0,1), min-height .3s; }
  .map-wrap.collapsed #map { height: 0; min-height: 0; overflow: hidden; }
  .map-wrap.collapsed .map-tools { position: static; justify-content: flex-end; padding: 8px 12px 6px; }
  .map-wrap.collapsed .map-tools #btn-radar-2 { display: none; }
  .map-wrap .maplibregl-ctrl-top-left { top: 8px; }
  .map-tools { position: absolute; right: 12px; bottom: 12px; z-index: 5; display: flex; gap: 8px; }
  .map-tools .chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; font: 700 15px var(--fd-font);
    background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text); box-shadow: var(--shadow-sm); backdrop-filter: blur(10px); }
  .map-tools .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
  .sheet { position: static; transform: none !important; height: var(--app-h, 100dvh); border-radius: 0; box-shadow: none; contain: none; }
  .sheet-body { height: 100%; overflow-y: auto; padding: 0 22px calc(var(--safe-b) + 8px); display: flex; flex-direction: column; }
  .sheet-body > .view { flex: 1; }
  .q-brand { margin-top: calc(22px + env(safe-area-inset-top)); }
  .q-h1 { margin-top: 44px; }
  .q-back { margin-top: calc(22px + env(safe-area-inset-top)); }
  #view-brief { padding-top: 0; }
}
@media print { .map-wrap, .qstep { display: none; } }

/* ───────── Feedback dialog ───────── */
.fb-form { display: flex; flex-direction: column; gap: 12px; }
.fb-lead { font-size: 15px; line-height: 1.45; color: var(--muted); margin: 0; }
.fb-form textarea, .fb-form input[type="email"] { font: 500 16px/1.4 var(--font); padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text); width: 100%; }
.fb-form textarea:focus, .fb-form input:focus { outline: none; border-color: var(--accent); }
.fb-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); line-height: 1.4; }
.fb-check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin-top: 1px; }
.fb-mood button[aria-checked="null"] { background: transparent; }
.end-card .text-btn { align-self: center; min-height: 44px; }

/* ───────── Paywall ───────── */
.pw-lead { font-size: 15.5px; line-height: 1.45; color: var(--muted); margin: 0 0 6px; }
.pw-list { margin: 0 0 12px; padding: 0 0 0 20px; font-size: 15px; line-height: 1.5; }
.pw-offers { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.pw-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); text-align: left; position: relative; }
.pw-offer b { font-size: 17px; } .pw-offer span { font-size: 14px; color: var(--muted); }
.pw-offer.best { box-shadow: inset 0 0 0 2px var(--accent); }
.pw-offer em { position: absolute; right: 12px; top: 12px; font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.pw-buy { display: block; text-align: center; text-decoration: none; padding: 14px; }
.pw-note, .pw-fine { font-size: 13px; line-height: 1.45; color: var(--muted); margin: 0; }
.pw-fine a { color: var(--accent); }
.pw-links { margin-top: 10px; justify-content: space-between; }
.link-row .chip { min-height: 44px; }
