/* NAAM web app styles. Brand tokens come from tokens.css (SPEC section 7). */

:root {
  --bg: var(--naam-foam);
  --surface: var(--naam-surface);
  --surface-2: color-mix(in srgb, var(--naam-mist) 55%, var(--naam-foam));
  --text: var(--naam-ink);
  --muted: var(--naam-text-muted);
  --line: var(--naam-line);
  --accent: var(--naam-river);
  --on-accent: var(--naam-on-river);
  --accent-deep: color-mix(in srgb, var(--naam-river) 70%, #000);
  --hot: var(--naam-lotus);
  --on-hot: var(--naam-on-lotus);
  --deco: var(--naam-lotus-bright);
  --gold: var(--naam-gold);
  --ok: var(--naam-success);
  --danger: var(--naam-danger);
  --shadow: 0 10px 30px rgba(10, 31, 43, .16);
  --r: var(--naam-radius);
  --tabbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --shadow: 0 10px 30px rgba(0, 0, 0, .5); } }
:root[data-theme="dark"] { --shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* Sunset mode: gold is a fill only (tab pill, pier dots, map tint); text stays river or ink. */
:root { --accent-fill: var(--naam-river); --sun-fill: transparent; }
:root[data-sunset="1"] { --accent-fill: var(--naam-gold); --sun-fill: color-mix(in srgb, var(--naam-gold) 32%, transparent); }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--naam-font-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% -10%, color-mix(in srgb, var(--naam-river) 38%, transparent), transparent 60%),
              radial-gradient(900px 600px at 110% 110%, color-mix(in srgb, var(--naam-lotus) 26%, transparent), transparent 55%),
              var(--naam-ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
:root[data-scheme="dark"] body { background-color: #02080c; }
html[lang="zh"] body { font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
h1, h2, h3, .display { font-family: var(--naam-font-display); letter-spacing: -.02em; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--naam-focus); outline-offset: 2px; border-radius: 8px; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--gold); color: #000; padding: 8px 12px; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- phone frame ---------- */
.stage { min-height: 100dvh; display: grid; place-items: center; }
.phone {
  position: relative; width: 100%; max-width: 430px; height: 100dvh;
  background: var(--bg); overflow: hidden; display: flex; flex-direction: column;
  isolation: isolate;
}
@media (min-width: 600px) {
  .stage { padding: 16px; }
  .phone {
    height: min(880px, calc(100dvh - 32px)); border-radius: 46px;
    border: 9px solid #05121a; box-shadow: 0 40px 100px rgba(0, 0, 0, .55), 0 0 0 2px rgba(255, 255, 255, .08);
  }
}
.view { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; outline: none; }
.screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; animation: screen-in .28s var(--ease) both; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 18px 28px; -webkit-overflow-scrolling: touch; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- tab bar ---------- */
.tabbar {
  display: flex; height: var(--tabbar-h); padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); gap: 6px; z-index: 5;
}
.tab {
  flex: 1; border: 0; background: none; border-radius: 14px; display: grid; place-items: center; gap: 0;
  font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding-top: 2px;
  transition: transform .12s var(--ease), color .15s;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
:root[data-sunset="1"] .tab[aria-current="page"] { background: var(--sun-fill); color: var(--text); }
.tab:active { transform: scale(.94); }

/* ---------- buttons ---------- */
.btn {
  --b: var(--accent); --bt: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; width: 100%; border: 2px solid transparent; border-radius: var(--naam-radius-pill, 999px);
  background: var(--b); color: var(--bt); font-family: var(--naam-font-body); font-weight: 600; font-size: 16px; line-height: 1;
  box-shadow: var(--naam-shadow-2);
  transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s; text-decoration: none;
}
.btn:active { transform: scale(.98); box-shadow: var(--naam-shadow-1); }
.btn[disabled] { opacity: 1; background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; pointer-events: none; }
.btn.hot { --b: var(--hot); --bt: var(--on-hot); }
.btn.gold { --b: var(--gold); --bt: var(--naam-on-gold); }
.btn.ghost { --b: transparent; --bt: var(--accent); border-color: currentColor; box-shadow: none; }
.btn.ghost:active { box-shadow: none; transform: scale(.98); }
.btn.sm { min-height: 44px; font-size: 15px; padding: 0 18px; width: auto; box-shadow: var(--naam-shadow-1); }
.btn.sm:active { transform: scale(.98); }
.btn + .btn { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .btn + .btn { margin-top: 0; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); transition: transform .1s var(--ease);
}
.iconbtn:active { transform: scale(.9); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.sos { background: var(--hot); color: var(--on-hot); font-weight: 800; font-family: var(--naam-font-display); font-size: 12px; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 54px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface);
  padding: 0 16px; font-size: 17px; transition: border-color .15s, box-shadow .15s;
}
textarea.input { padding: 12px 16px; min-height: 90px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.code { text-align: center; letter-spacing: .5em; font-family: var(--naam-font-display); font-size: 28px; font-weight: 700; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 14px; font-weight: 600; margin: 6px 0 0; min-height: 1em; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r); }
.seg button { min-height: 44px; border: 0; background: none; border-radius: 12px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 700; line-height: 1; }
.stepper button:active { transform: scale(.9); }
.stepper output { min-width: 28px; text-align: center; font-family: var(--naam-font-display); font-weight: 800; font-size: 22px; }

/* ---------- cards, chips, pills ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; box-shadow: 0 2px 0 var(--line); }
.card + .card { margin-top: 12px; }
.chip {
  flex: none; border: 2px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; white-space: nowrap;
  min-height: 40px; padding: 0 14px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .1s var(--ease), background .15s, border-color .15s;
}
.chip svg { width: 18px; height: 18px; flex: none; }
.chip:active { transform: scale(.94); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 24px 8px 2px; margin: 0 -2px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 13px; color: var(--text);
}
.pill svg { width: 16px; height: 16px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text); }
.badge.ok { background: color-mix(in srgb, var(--ok) 22%, transparent); color: var(--ok); }
.badge.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.badge.warn { background: color-mix(in srgb, var(--gold) 28%, transparent); color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- map screens ---------- */
.map-screen { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.mapwrap { position: absolute; inset: 0; z-index: 0; background: var(--surface-2); }
.mapwrap .leaflet-container { width: 100%; height: 100%; font-family: inherit; background: var(--surface-2); }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; color: var(--muted); }
.topbar { position: absolute; z-index: 4; left: 12px; right: 12px; top: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brandmark { background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; padding: 6px 14px; display: inline-flex; align-items: center; }

.sheet {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; max-height: 82%; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .22);
  animation: sheet-up .35s var(--ease) both; transition: height .28s var(--ease); will-change: height;
}
.sheet[data-snap] { max-height: none; }
.sheet.nt, .sheet.dragging { transition: none; }
.sheet-grab {
  flex: none; display: grid; place-items: center; width: 100%; min-height: 28px; padding: 0; border: 0; background: none;
  touch-action: none; cursor: grab; border-radius: 28px 28px 0 0; color: inherit;
}
.sheet.dragging .sheet-grab { cursor: grabbing; }
.sheet-bar { display: block; width: 42px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-grab:hover .sheet-bar, .sheet-grab:focus-visible .sheet-bar { background: var(--muted); }
.sheet-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; }
[data-drag] { touch-action: none; cursor: grab; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { font-size: 22px; margin-bottom: 10px; }

.routebox { position: relative; background: var(--surface-2); border-radius: var(--r); padding: 4px 4px 4px 14px; }
.routebox::before { content: ""; position: absolute; left: 21px; top: 28px; bottom: 28px; border-left: 2px dotted var(--muted); }
.pierbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; border: 0; background: none; text-align: left; padding: 0 56px 0 6px; border-radius: 12px; position: relative; }
.pierbtn + .pierbtn { border-top: 1px solid var(--line); }
.pierbtn .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 3px solid var(--accent); background: var(--surface); position: relative; z-index: 1; }
.pierbtn.to .dot { background: var(--deco); border-color: var(--deco); border-radius: 4px; }
.pierbtn .lbl { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pierbtn .val { display: block; font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pierbtn .val.ph { color: var(--muted); font-weight: 500; }
.swapbtn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; z-index: 2; transition: transform .25s var(--ease); }
.swapbtn:active { transform: translateY(-50%) rotate(180deg) scale(.9); }
.swapbtn svg { width: 18px; height: 18px; }

.qcard { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 12px; min-height: 76px; transition: transform .1s var(--ease), border-color .15s, box-shadow .15s; }
.qcard + .qcard { margin-top: 10px; }
.qcard:active { transform: scale(.985); }
.qcard[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.qcard[aria-disabled="true"] { opacity: .5; filter: grayscale(1); pointer-events: none; }
.qcard .qi { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); }
.qcard .qi svg { width: 30px; height: 30px; }
.qcard .qt { font-family: var(--naam-font-display); font-weight: 700; font-size: 17px; }
.qcard .qs { font-size: 13px; color: var(--muted); }
.qcard .qp { text-align: right; font-family: var(--naam-font-display); font-weight: 800; font-size: 22px; }
.qcard .qp small { display: block; font-family: var(--naam-font-body); font-weight: 500; font-size: 12px; color: var(--muted); }

/* ---------- timeline ---------- */
.timeline { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 0; margin: 14px 0; }
.timeline li { position: relative; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); padding-top: 22px; }
.timeline li::before { content: ""; position: absolute; top: 5px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--line); z-index: 1; }
.timeline li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: var(--line); }
.timeline li:first-child::after { display: none; }
.timeline li.done { color: var(--text); }
.timeline li.done::before, .timeline li.done::after { background: var(--accent); }
.timeline li.now::before { background: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 35%, transparent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--gold) 5%, transparent); } }

.bigstatus { font-family: var(--naam-font-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.eta { display: inline-flex; align-items: baseline; gap: 6px; }
.eta b { font-family: var(--naam-font-display); font-size: 40px; line-height: 1; color: var(--accent); }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--naam-font-display); font-weight: 800; font-size: 20px; flex: none; }
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars svg { width: 16px; height: 16px; }
.starpick { display: flex; justify-content: center; gap: 6px; margin: 18px 0; }
.starpick button { border: 0; background: none; padding: 4px; color: var(--line); transition: transform .12s var(--ease), color .12s; }
.starpick button svg { width: 48px; height: 48px; }
.starpick button.on { color: var(--gold); }
.starpick button:active { transform: scale(1.2) rotate(-8deg); }

.radar { position: relative; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.radar::before, .radar::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid var(--accent); animation: radar 2.2s ease-out infinite; }
.radar::after { animation-delay: 1.1s; }
.radar svg { position: relative; z-index: 1; width: 20px; height: 20px; }
@keyframes radar { from { transform: scale(.7); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }

/* ---------- leaflet markers ---------- */
.pier-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent-fill); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.pier-dot.from { background: var(--accent-fill); width: 20px; height: 20px; border-width: 4px; border-color: #fff; box-shadow: 0 0 0 3px var(--accent-fill); }
.pier-dot.to { background: var(--deco); width: 20px; height: 20px; border-width: 4px; border-color: #fff; border-radius: 6px; box-shadow: 0 0 0 3px var(--deco); }
.pier-dot.on-route { border-color: var(--deco); }
.leaflet-tooltip.pier-tip { background: var(--surface); color: var(--text); border: 0; box-shadow: var(--shadow); font-weight: 600; border-radius: 8px; width: max-content; max-width: 140px; white-space: normal; line-height: 1.25; }
.leaflet-tooltip.pier-tip::before { display: none; }
.boat-wrap { transition: transform 1.6s linear; }
.boat-icon { width: 40px; height: 40px; transform: rotate(var(--rot, 0deg)); transition: transform .6s var(--ease); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); }
.leaflet-marker-icon.boat-mk { transition: transform 1.8s linear; }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 88%, transparent) !important; color: var(--muted) !important; border-radius: 8px 8px 0 0; padding: 1px 6px; }
.leaflet-control-attribution a { color: var(--accent) !important; }
.leaflet-bottom { z-index: 1000; }
.mapwrap::after { content: ""; position: absolute; inset: 0; z-index: 450; pointer-events: none; background: var(--sun-fill); mix-blend-mode: multiply; opacity: .35; }

/* ---------- onboarding ---------- */
.hero { flex: 1; min-height: 0; display: flex; flex-direction: column; background: linear-gradient(165deg, #083742, #04141B 78%); color: #fff; position: relative; overflow: hidden; }
.hero-logo { position: absolute; top: 12px; left: 16px; z-index: 3; height: 36px; }
.hero .langs { position: absolute; top: 14px; right: 14px; z-index: 3; display: flex; gap: 6px; }
.hero .langs button { min-height: 34px; padding: 0 10px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .18); color: #fff; font-weight: 700; font-size: 12px; }
.hero .langs button[aria-pressed="true"] { background: #fff; color: #05303b; }
.slides { flex: 1; min-height: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: none; width: 100%; scroll-snap-align: center; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 26px 18px; }
.slide .art { flex: 1; min-height: 0; margin: 0 -26px; display: flex; align-items: flex-end; }
.slide .art svg { width: 100%; height: auto; max-height: 100%; display: block; transform: scale(1.25); transform-origin: 50% 100%; }
.bob { animation: bob 5s ease-in-out infinite; transform-box: fill-box; }
@keyframes bob { 50% { translate: 0 -6px; } }
.slide h1 { font-size: 34px; line-height: 1.05; margin-bottom: 10px; }
.slide p { font-size: 17px; opacity: .88; margin: 0 0 6px; }
.wave { position: absolute; left: 0; right: 0; top: 0; height: 62%; background: repeating-radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .5) 0 1px, transparent 1px 34px); -webkit-mask-image: radial-gradient(circle at 50% 38%, #000, transparent 68%); mask-image: radial-gradient(circle at 50% 38%, #000, transparent 68%); opacity: .22; pointer-events: none; }
.dots { display: flex; justify-content: center; gap: 8px; padding: 10px 0 14px; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .4); transition: width .25s var(--ease), background .25s; }
.dots i.on { width: 26px; background: #fff; }
.hero .foot { padding: 0 22px calc(22px + env(safe-area-inset-bottom)); }
.hero .btn { --b: #fff; --bt: #05303b; }
.hero .btn.ghost { --b: transparent; --bt: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }

.logo-lg { font-family: var(--naam-font-display); font-weight: 800; font-size: 44px; letter-spacing: .08em; }
.langgrid { display: grid; gap: 12px; margin-top: 18px; }
.langbtn { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 18px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 700; font-family: var(--naam-font-display); }
.langbtn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.langbtn span { font-family: var(--naam-font-body); font-size: 14px; font-weight: 500; color: var(--muted); }

.banner { border-radius: var(--r); padding: 12px 14px; background: color-mix(in srgb, var(--gold) 26%, var(--surface)); font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.banner b { font-family: var(--naam-font-display); letter-spacing: .15em; font-size: 18px; }

/* ---------- modal ---------- */
.backdrop { position: absolute; inset: 0; z-index: 50; background: rgba(3, 14, 20, .6); display: flex; align-items: flex-end; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-height: 88%; overflow-y: auto; background: var(--surface); border-radius: 28px 28px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: sheet-up .3s var(--ease) both; }
.modal h2 { font-size: 22px; margin-bottom: 8px; }
.piergroup { max-height: 46vh; overflow-y: auto; margin: 10px -4px 0; }
.pieropt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 6px 10px; border: 0; background: none; text-align: left; border-radius: 12px; }
.pieropt:hover, .pieropt:focus-visible { background: var(--surface-2); }
.pieropt .ord { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.pieropt .nm { font-weight: 600; }
.pieropt .th { font-size: 13px; color: var(--muted); }
.pieropt[disabled] { opacity: .4; }
.sosnum { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--surface-2); margin-top: 10px; text-decoration: none; color: var(--text); }
.sosnum b { font-family: var(--naam-font-display); font-size: 32px; color: var(--danger); }

/* ---------- toast ---------- */
.toasts { position: absolute; z-index: 90; left: 12px; right: 12px; top: 100px; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--naam-ink); color: var(--naam-foam); border-radius: 14px; padding: 12px 16px; font-weight: 600; box-shadow: var(--shadow); animation: toast-in .3s var(--ease) both; }
:root[data-scheme="dark"] .toast { background: var(--naam-river); color: #03161d; }
.toast.err { background: var(--hot); color: var(--on-hot); }
@keyframes toast-in { from { transform: translateY(-14px); opacity: 0; } }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: 0 2px 0 var(--line); }
.tile .k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile .v { font-family: var(--naam-font-display); font-weight: 800; font-size: 30px; line-height: 1.1; margin-top: 4px; }
.tile.wide { grid-column: 1 / -1; }
.tile.accent { background: var(--accent); color: var(--on-accent); }
.tile.accent .k { color: color-mix(in srgb, var(--on-accent) 75%, transparent); }
.bars { display: grid; gap: 6px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 90px 1fr 30px; gap: 8px; align-items: center; font-size: 13px; }
.bar i { display: block; height: 10px; border-radius: 5px; background: var(--accent); min-width: 4px; }

.toggle { position: relative; width: 78px; height: 44px; border-radius: 22px; border: 0; background: var(--line); flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 4px; left: 4px; width: 36px; height: 36px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .22s var(--ease); }
.toggle[aria-checked="true"] { background: var(--ok); }
.toggle[aria-checked="true"]::after { transform: translateX(34px); }

.list { display: grid; gap: 10px; }
.ridecard { display: block; width: 100%; text-align: left; border: 0; background: var(--surface); border-radius: var(--r); padding: 14px; box-shadow: 0 2px 0 var(--line); }
.ridecard:active { transform: scale(.985); }
.ridecard .rt { font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 64px; height: 64px; opacity: .5; }

.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.setrow:last-child { border-bottom: 0; }
.setrow > :first-child { font-weight: 600; }
.footnote { text-align: center; font-size: 12px; color: var(--muted); padding: 14px 0 4px; }
.nvgs-credit { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 14px; font-size: 12px; color: var(--muted); text-align: center; }
.nvgs-credit img.nvgs-logo { height: 26px; width: auto; }
.nvgs-credit img.logo-dark { display: none; }
:root[data-scheme="dark"] .nvgs-credit img.logo-light { display: none; }
:root[data-scheme="dark"] .nvgs-credit img.logo-dark { display: block; }

.qrbox { background: #fff; border-radius: var(--r); padding: 14px; width: min(78%, 280px); margin: 0 auto; box-shadow: var(--shadow); }
.qrbox svg { display: block; width: 100%; height: auto; }
.amount { font-family: var(--naam-font-display); font-weight: 800; font-size: 48px; letter-spacing: -.03em; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.method { border: 2px solid var(--line); background: var(--surface); border-radius: var(--r); min-height: 84px; display: grid; place-items: center; gap: 2px; font-weight: 700; font-size: 13px; padding: 8px 4px; transition: transform .1s var(--ease); }
.method svg { width: 28px; height: 28px; color: var(--accent); }
.method:active { transform: scale(.95); }
.method[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.paycode { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); }

/* ---------- skeleton ---------- */
.skeleton { border-radius: 12px; background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; min-height: 20px; }
.skeleton.card-h { height: 76px; margin-bottom: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.suncorner { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(500px 280px at 90% 0%, color-mix(in srgb, var(--naam-gold) 42%, transparent), transparent 70%); opacity: 0; transition: opacity .6s; }
:root[data-sunset="1"] .suncorner { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; }
  .radar::before, .radar::after { animation: none; opacity: .3; }
}

/* ---------- demo banner (SPEC R10) ---------- */
.demobar { flex: none; height: 28px; line-height: 28px; padding: 0 10px; overflow: hidden; white-space: nowrap; z-index: 60; background: var(--gold); color: #2b1700; text-align: center; font-weight: 800; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;  }

/* ---------- logos ---------- */
.logo-img { display: block; height: 40px; width: auto; }
.logo-dark { display: none; }
:root[data-scheme="dark"] .logo-light { display: none; }
:root[data-scheme="dark"] .logo-dark { display: block; }
img.logo-small { display: block; height: 28px; width: auto; }
.logo-small.logo-dark { display: none; }
:root[data-scheme="dark"] .logo-small.logo-light { display: none; }
:root[data-scheme="dark"] .logo-small.logo-dark { display: block; }

/* Thai stacks tone marks above the line: looser leading (brand token). */
html[lang="th"] body { line-height: var(--naam-leading-thai, 1.75); }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] .display { line-height: 1.35; }

.sheet .card { background: var(--surface-2); box-shadow: none; border: 1px solid var(--line); }
.card.notify { gap: 12px; }
.sheet p { text-wrap: pretty; }
.eta-line { display: inline-flex; align-items: center; gap: 4px; }
.eta-line svg { width: 14px; height: 14px; }

.qcard { min-height: 68px; }
.qcard .qs.eta-line { margin-left: 2px; }
.slide { overflow: hidden; }

/* Pinch zoom is enough on phones; the +/- buttons crowd the map above the sheet. */
@media (max-width: 479px) { .leaflet-control-zoom { display: none; } }

/* ---------- KYC consent and state (R21, R24) ---------- */
.kyc-item { margin-bottom: 12px; }
.kyc-item b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.kyc-item p { margin: 0; }
.kyc-list { margin: 0; padding-left: 20px; }
.kyc-agree { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 12px; border-radius: var(--r); background: var(--surface-2); font-weight: 600; cursor: pointer; }
.kyc-box { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent); }
.kyc-doc { margin: 12px 0; }
.toggle[disabled] { opacity: .45; cursor: not-allowed; }
.kyc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.card.capcard { display: block; }
