*, *::before, *::after { box-sizing: border-box; }
:root {
  /* Dark is the default theme; [data-theme="light"] on <html> switches it. */
  color-scheme: dark;
  --ink: #e5e7eb; --muted: #9ca3af; --line: #30363d; --line-hover: #6b7280; --bg: #0d1117; --surface: #161b22;
  --input-border: #3d444d; --input-off: #0d1117; --option-hl: #1f3a68; --code-bg: #0d1117;
  --chip-on-bg: #e5e7eb; --chip-on-ink: #0d1117; --chip-on-muted: #4b5563;
  --blue: #2563eb; --link: #60a5fa; --red: #dc2626; --good: #4ade80; --bad: #f87171;
  --hl: #f43f5e; --hl-ok: #16a34a;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
}
:root[data-theme="light"] {
  color-scheme: light;
  --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --line-hover: #9ca3af; --bg: #fafafa; --surface: #fff;
  --input-border: #ccc; --input-off: #f3f4f6; --option-hl: #dbeafe; --code-bg: #f3f4f6;
  --chip-on-bg: #111827; --chip-on-ink: #fff; --chip-on-muted: #9ca3af;
  --link: #2563eb; --good: #15803d; --bad: #dc2626;
}
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--link); }
.muted { color: var(--muted); }

/* ---------- app shell ---------- */
.app { max-width: 820px; margin: 0 auto; padding: 28px 16px 64px; display: flex; flex-direction: column; align-items: center; }
.intro { text-align: center; }
.intro h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 4px; letter-spacing: -.02em; }
.intro p { margin: 0; color: var(--muted); }

.filters { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.filter { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.filter small { color: var(--muted); }
.filter.on { background: var(--chip-on-bg); color: var(--chip-on-ink); border-color: var(--chip-on-bg); }
.filter.on small { color: var(--chip-on-muted); }

.scoreboard { display: flex; gap: 18px; margin-top: 14px; font-size: .9rem; color: var(--muted); flex-wrap: wrap; justify-content: center; }
.scoreboard b { color: var(--ink); }

.round, .answer-panel { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; }
.stage-wrap { margin-top: 18px; padding: 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s; max-width: 100%; overflow: hidden; }
.stage-wrap:hover { border-color: var(--line-hover); }
.stage { display: flex; justify-content: center; align-items: center; min-height: 420px; }

.controls { display: flex; flex-direction: column; align-items: center; margin-top: 16px; width: 100%; }
.combo { position: relative; width: 280px; max-width: 100%; z-index: 10; }
.combo input { width: 100%; font: inherit; padding: 9px 34px 9px 12px; border: 1px solid var(--input-border); border-radius: 6px; background: var(--surface); color: var(--ink); outline: none; }
.combo input:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.combo input:disabled { background: var(--input-off); color: var(--muted); }
.combo-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 1.2rem; color: #999; cursor: pointer; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; background: var(--surface); border-radius: 6px; box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(0,0,0,.25); max-height: 280px; overflow-y: auto; }
.combo-list.up { top: auto; bottom: calc(100% + 4px); }
.combo-list li { padding: 8px 12px; cursor: default; }
.combo-list li small { color: var(--muted); }
.combo-list li[aria-selected="true"] { background: var(--option-hl); }
.combo-list li.none { color: var(--muted); text-align: center; }

.feedback { margin: 10px 0 0; min-height: 1.5em; font-size: 1.15rem; font-weight: 600; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.buttons { display: flex; gap: 8px; margin-top: 10px; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 6px; padding: 9px 18px; background: var(--blue); color: #fff; cursor: pointer; }
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-red { background: var(--red); }

.reveal { margin-top: 20px; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; line-height: 1.5; }
.reveal h2 { margin: 0 0 4px; font-size: 1.25rem; }
.reveal p { margin: 6px 0; }
.reveal .aka { color: var(--muted); font-size: .9rem; }
.reveal .code { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; background: var(--code-bg); padding: 6px 8px; border-radius: 6px; }
.reveal .tags span { display: inline-block; font-size: .75rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-right: 4px; }

.outro { margin-top: 40px; max-width: 560px; text-align: center; font-size: .95rem; line-height: 1.5; }

/* Keep the mockup and answer visible together on wide screens. The sidebar
   stays in normal document flow, so long explanations and zoom can scroll. */
@media (min-width: 1100px) {
  .app { max-width: 1240px; padding-inline: 24px; }
  .round { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 32px; margin-top: 24px; }
  .stage-wrap { width: 100%; margin-top: 0; }
  .stage { min-height: 560px; }
  .answer-panel { align-items: stretch; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .controls { align-items: stretch; margin-top: 0; }
  .combo { width: 100%; }
  .buttons .btn { flex: 1; }
  .reveal { width: 100%; max-width: none; padding: 20px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; overflow-wrap: anywhere; }
  .outro { max-width: 760px; }
}
@media (min-width: 1100px) and (max-height: 800px) {
  .stage { min-height: 460px; }
  .stage .phone { zoom: .8; }
}
/* Site top bar: matches the lachlancurrie.xyz pages. */
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.topbar .mark img { display: block; border-radius: 7px; }
.site-crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 1.05rem; min-width: 0; }
.site-crumbs a { color: var(--muted); overflow-wrap: anywhere; }
.site-crumbs a:hover { color: var(--ink); }
.theme-toggle { margin-left: auto; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.theme-toggle:hover { border-color: var(--line-hover); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .sun, :root[data-theme="light"] .theme-toggle .moon { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }

/* ---------- target highlight ---------- */
.stage .t { outline: 3px dashed var(--hl); outline-offset: 3px; border-radius: 6px; animation: pulse 1.6s ease-in-out infinite; }
.stage .t.revealed { outline-style: solid; outline-color: var(--hl-ok); animation: none; }
@keyframes pulse { 50% { outline-offset: 7px; } }
.stage .t.edge { outline-offset: -4px; animation-name: pulse-in; }
@keyframes pulse-in { 50% { outline-offset: -8px; } }
@media (prefers-reduced-motion: reduce) { .stage .t { animation: none; } }

/* ---------- mock: frames ---------- */
/* Mockup palette. Light values here; the dark theme (the default) overrides them below.
   Android bits follow the Material 3 baseline scheme, iOS bits follow the iOS system colours. */
.stage {
  font-size: 13px;
  --m-bg: #fff; --m-surface: #fff; --m-sunken: var(--m-sunken); --m-ink: #1f2937; --m-muted: #6b7280;
  --m-line: #eee; --m-border: #d1d5db; --m-frame: #d1d5db; --m-ph: #e5e7eb; --m-ph-dark: #9ca3af; --m-ph-link: #93c5fd;
  --m-blue: #2563eb; --m-sel: #dbeafe; --m-focus: #bfdbfe; --m-ok: #16a34a; --m-scrim: rgba(0,0,0,.42);
  --m-inverse: #1f2937; --m-on-inverse: #fff; --m-cookie: #111827; --m-search: #f1f3f4; --m-search-big: #eef1f6;
  --m-car-arrow: rgba(255,255,255,.9); --m-hero-1: #eef2ff; --m-hero-2: #fff; --m-sk-1: #eee; --m-sk-2: #f7f7f7;
  --m-code-1: #dbeafe; --m-code-2: #fce7f3; --m-banner: #fef3c7; --m-on-banner: #78350f; --m-img: none; --m-carousel: linear-gradient(120deg, #6366f1, #ec4899);
  --m-paid: #dcfce7; --m-on-paid: #166534; --m-pending: #fef9c3; --m-on-pending: #854d0e; --m-overdue: #fee2e2; --m-on-overdue: #991b1b;
  --m-av-a: #fca5a5; --m-av-b: #93c5fd; --m-av-c: #86efac; --m-av-d: #fcd34d; --m-av-e: #c4b5fd; --m-av-ink: #1f2937; --m-event: #c4b5fd;
  /* Material 3 */
  --m-pri: #6750a4; --m-on-pri: #fff; --m-pri-c: #eaddff; --m-on-pri-c: #21005d; --m-sec-c: var(--m-sec-c);
  --m-sc-low: var(--m-sc-low); --m-sc: var(--m-sc); --m-sv: var(--m-sv); --m-on-sv: var(--m-on-sv); --m-outline: var(--m-outline); --m-outline-v: var(--m-outline-v);
  --m-inv-surface: #313033; --m-inv-on: #f4eff4; --m-inv-pri: #d0bcff; --m-error: #b3261e; --m-on-error: #fff;
  /* iOS */
  --ios-blue: var(--ios-blue); --ios-red: var(--ios-red); --ios-bar: #f9f9f9; --ios-group: rgba(250,250,250,.95); --ios-wheel: #eeeef0;
}
:root:not([data-theme="light"]) .stage {
  --m-bg: #15171c; --m-surface: #1f2329; --m-sunken: #23272e; --m-ink: #e3e5e8; --m-muted: #9aa1ab;
  --m-line: #2b3038; --m-border: #3d444d; --m-frame: #3d444d; --m-ph: #2c3138; --m-ph-dark: #4d5560; --m-ph-link: #24476f;
  --m-blue: #3b82f6; --m-sel: #1f3a68; --m-focus: #1e3a8a; --m-ok: #4ade80; --m-scrim: rgba(0,0,0,.6);
  --m-inverse: #3a404a; --m-on-inverse: #e3e5e8; --m-cookie: #2b3038; --m-search: #23272e; --m-search-big: #23272e;
  --m-car-arrow: rgba(21,23,28,.85); --m-hero-1: #1c1b3a; --m-hero-2: #15171c; --m-sk-1: #252a31; --m-sk-2: #30363e;
  --m-code-1: #1e3a5f; --m-code-2: #4a1d3a; --m-banner: #3a2f0d; --m-on-banner: #fcd34d; --m-img: brightness(.72) saturate(.85); --m-carousel: linear-gradient(120deg, #383c94, #8a2b5f);
  --m-paid: #14361f; --m-on-paid: #86efac; --m-pending: #3a320c; --m-on-pending: #fde68a; --m-overdue: #3f1717; --m-on-overdue: #fca5a5;
  --m-av-a: #9b4f4f; --m-av-b: #3f6ea8; --m-av-c: #3d8659; --m-av-d: #a3812e; --m-av-e: #6c5aa6; --m-av-ink: #fff; --m-event: #5b4a9e;
  --m-pri: #d0bcff; --m-on-pri: #381e72; --m-pri-c: #4f378b; --m-on-pri-c: #eaddff; --m-sec-c: #4a4458;
  --m-sc-low: #1d1b20; --m-sc: #211f26; --m-sv: var(--m-on-sv); --m-on-sv: var(--m-outline-v); --m-outline: #938f99; --m-outline-v: var(--m-on-sv);
  --m-inv-surface: #36343b; --m-inv-on: #e6e1e5; --m-inv-pri: #d0bcff; --m-error: #f2b8b5; --m-on-error: #601410;
  --ios-blue: #0a84ff; --ios-red: #ff453a; --ios-bar: #1c1c1e; --ios-group: rgba(44,44,46,.96); --ios-wheel: #2c2c2e;
}
/* Photos/illustrations: dim them in dark mode rather than recolouring. */
.stage .c0, .stage .c1, .stage .c2, .stage .c3, .stage .card-img, .stage .hero-img, .stage .hero-art, .stage .lb-img, .stage .logo { filter: var(--m-img); }
.stage .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
.stage .ic.xs { width: 14px; height: 14px; }
.stage span.xs { width: 14px; display: inline-block; }
.stage .t > .ic, .stage span.t { display: inline-flex; }

.phone { width: 290px; height: 560px; border: 10px solid #111; border-radius: 38px; background: var(--m-bg); overflow: hidden; display: flex; flex-direction: column; position: relative; color: var(--m-ink); flex: none; }
.phone .status { display: flex; justify-content: space-between; padding: 6px 16px 2px; font-size: 11px; font-weight: 600; }
.phone .status .sig { letter-spacing: -1px; }
.phone .screen { flex: 1; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.phone.dark { background: #1c1b1f; color: #e6e1e5; }
.phone.ios .appbar { background: var(--ios-bar); border-bottom: 1px solid var(--m-line); }

.browser { width: 640px; height: 420px; border: 1px solid var(--m-frame); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; background: var(--m-bg); color: var(--m-ink); flex: none; }
.browser .chrome { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--m-sunken); border-bottom: 1px solid var(--m-line); }
.browser .chrome i { width: 10px; height: 10px; border-radius: 50%; background: #f87171; }
.browser .chrome i:nth-child(2) { background: #fbbf24; }
.browser .chrome i:nth-child(3) { background: #34d399; }
.browser .url { margin-left: 10px; flex: 1; background: var(--m-bg); border-radius: 6px; padding: 3px 10px; font-size: 11px; color: var(--m-muted); }
.browser .page { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }

.tablet { width: 640px; height: 420px; border: 12px solid #111; border-radius: 22px; overflow: hidden; background: var(--m-bg); color: var(--m-ink); flex: none; }
.tablet .screen { height: 100%; }
/* Keeps the black bezels visible against the dark page. */
.phone, .tablet { box-shadow: 0 0 0 1px var(--line); }

@media (max-width: 700px) {
  .stage { min-height: 0; }
  .browser, .tablet { zoom: .52; }
  .phone { zoom: .8; }
}
@media (min-width: 701px) and (max-width: 860px) { .browser, .tablet { zoom: .85; } }

/* ---------- mock: filler ---------- */
.ph { display: block; height: 8px; border-radius: 4px; background: var(--m-ph); margin: 5px 0; }
.ph.dark { background: var(--m-ph-dark); height: 9px; }
.ph.big { height: 14px; margin-bottom: 10px; }
.ph.huge { height: 22px; margin-bottom: 10px; }
.ph.link { background: var(--m-ph-link); }
.ph.light { background: rgba(255,255,255,.85); }
.phone.dark .ph { background: #3a3940; }
.lines { margin: 10px 0; }
.av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-block; }
.av-a { background: var(--m-av-a); } .av-b { background: var(--m-av-b); } .av-c { background: var(--m-av-c); } .av-d { background: var(--m-av-d); } .av-e { background: var(--m-av-e); }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.li-txt { flex: 1; min-width: 0; }
.body { flex: 1; overflow: hidden; position: relative; }
.body.pad, .pad { padding: 12px 14px; }
.body.center { display: flex; align-items: center; justify-content: center; }
.grow { flex: 1; }
.typed { color: var(--m-ink); font-weight: 500; }
.link { color: var(--ios-blue); font-weight: 500; }
.dim { opacity: .5; }

.appbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 48px; }
.appbar.tall { padding: 14px; background: var(--m-pri-c); }
.ab-l, .ab-r { display: flex; align-items: center; gap: 14px; }
.ab-title { flex: 1; font-weight: 600; font-size: 16px; }
.phone.ios .ab-title { text-align: center; }

.webnav { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--m-line); }
.webnav .ph { width: 44px !important; margin: 0; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #6366f1, #ec4899); flex: none; display: inline-block; }
.btn-mini { display: inline-block; background: var(--m-blue); color: #fff; border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.btn-mini.ghost { background: transparent; color: var(--m-ink); box-shadow: inset 0 0 0 1px var(--m-border); }
.btn-mini.danger { background: #dc2626; }
.webnav .btn-mini { margin: 0; }
.btn-full { display: block; text-align: center; background: var(--m-pri); color: var(--m-on-pri); border-radius: 999px; padding: 10px; font-weight: 600; margin-top: 14px; }
.browser .btn-full { background: var(--m-blue); color: #fff; border-radius: 6px; }
.doc { padding: 16px 22px; }
.searchpill { display: flex; align-items: center; gap: 10px; background: var(--m-search); border-radius: 999px; padding: 7px 14px; flex: 0 1 300px; color: var(--m-muted); }
.searchpill .ph { flex: 1; margin: 0; }
.searchpill.big { padding: 10px 12px 10px 16px; background: var(--m-search-big); }
.searchpill.big .muted { flex: 1; }
.searchpill.big .av { width: 28px; height: 28px; }

/* ---------- mock: specific ---------- */
.hero-img { height: 170px; background: linear-gradient(135deg, #60a5fa, #a78bfa); }
.hero-img.tall { height: 100%; }
.body > .lines, .body > .hero-img + .lines { padding: 0 14px; }

.feed { padding: 12px 20px; display: flex; flex-direction: column; gap: 12px; }
.post { border: 1px solid var(--m-line); border-radius: 10px; padding: 12px 14px; }
.post-h { display: flex; align-items: center; gap: 10px; color: var(--m-muted); }
.results { padding: 14px 22px; }
.res { margin-bottom: 16px; max-width: 460px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px; }
.cards.sm { padding: 12px 0 0; gap: 10px; }
.card { border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.06); overflow: hidden; background: var(--m-surface); outline: 1px solid var(--m-line); }
.card-img { height: 100px; background: linear-gradient(135deg, #fda4af, #fdba74); }
.cards.sm .card-img { height: 64px; }
.c0 { background: linear-gradient(135deg, #fda4af, #fdba74); } .c1 { background: linear-gradient(135deg, #93c5fd, #a5b4fc); }
.c2 { background: linear-gradient(135deg, #86efac, #5eead4); } .c3 { background: linear-gradient(135deg, #fde68a, #fca5a5); }
.card-b { padding: 10px 12px 12px; }

.shade { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.shade-top { display: flex; align-items: center; justify-content: space-between; }
.qs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.qs-tile { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 18px; background: #2b2930; font-weight: 500; }
.qs-tile.on { background: #d0bcff; color: #381e72; }
.qs-slider { height: 34px; border-radius: 17px; background: #2b2930; overflow: hidden; }
.qs-slider span { display: block; width: 60%; height: 100%; background: #d0bcff; }
.notif { background: #2b2930; border-radius: 16px; }

.fab { position: absolute; right: 16px; bottom: 18px; width: 56px; height: 56px; border-radius: 16px; background: var(--m-pri-c); color: var(--m-on-pri-c); display: flex !important; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.fab .ic { width: 24px; height: 24px; }
.fab-ext { width: auto; padding: 0 18px; gap: 10px; }
.fab.sm { position: static; width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }

.snackbar { position: absolute; left: 10px; right: 10px; bottom: 16px; background: var(--m-inv-surface); color: var(--m-inv-on); border-radius: 6px; padding: 13px 14px; display: flex !important; justify-content: space-between; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
.snackbar b { color: var(--m-inv-pri); }
.toast { position: absolute; right: 16px; top: 60px; background: var(--m-surface); border-radius: 8px; padding: 10px 14px; display: flex !important; gap: 8px; align-items: center; box-shadow: 0 4px 16px rgba(0,0,0,.15); border: 1px solid var(--m-line); font-weight: 500; }
.toast .ic { color: var(--m-ok); }

.scrim { position: absolute; inset: 0; background: var(--m-scrim); }
.scrim.light { background: rgba(0,0,0,.25); }
.dialog { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 280px; background: var(--m-surface); border-radius: 12px; padding: 18px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.25), 0 0 0 1px var(--m-line); }
.dialog b { font-size: 15px; }
.dialog p { color: var(--m-muted); margin: 6px 0 12px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--m-sc-low); border-radius: 22px 22px 0 0; padding: 8px 0 16px; }
.handle { display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--m-outline); margin: 4px auto 10px; }
.sheet-row { display: flex; align-items: center; gap: 16px; padding: 13px 22px; }

.drawer { position: absolute; left: 0; top: 0; bottom: 0; width: 76%; background: var(--m-sc-low); border-radius: 0 16px 16px 0; padding: 14px 10px; }
.drawer-h { padding: 4px 10px 14px; border-bottom: 1px solid var(--m-line); margin-bottom: 8px; }
.drawer-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 999px; font-weight: 500; }
.drawer-row.on { background: var(--m-pri-c); }

.bnav { display: flex !important; justify-content: space-around; padding: 10px 0 14px; background: var(--m-sc); }
.bnav span { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--m-on-sv); }
.bnav span.on .ic { background: var(--m-pri-c); border-radius: 999px; padding: 2px 16px; width: 56px; box-sizing: content-box; }

.rail-layout { display: flex; height: 100%; }
.rail { display: flex !important; flex-direction: column; align-items: center; gap: 18px; padding: 16px 12px; background: var(--m-sc-low); width: 80px; }
.rail-i { padding: 4px 16px; border-radius: 999px; }
.rail-i.on { background: var(--m-pri-c); }
.rail-list { width: 220px; border-right: 1px solid var(--m-line); overflow: hidden; }
.rail-detail { flex: 1; padding: 20px; }

.tabs { display: flex !important; gap: 22px; border-bottom: 1px solid var(--m-line); margin-bottom: 14px; }
.tabs span { padding: 8px 2px; color: var(--m-muted); font-weight: 500; }
.tabs span.on { color: var(--m-blue); box-shadow: inset 0 -2px 0 var(--m-blue); }

.seg { display: flex !important; border: 1px solid var(--m-outline); border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.seg span { flex: 1; text-align: center; padding: 8px; font-weight: 500; }
.seg span + span { border-left: 1px solid var(--m-outline); }
.seg span.on { background: var(--m-sec-c); }
.body .seg { margin: 12px 14px 16px; }
.weekgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 14px; }
.weekgrid span { height: 60px; background: var(--m-sunken); border-radius: 4px; }
.weekgrid span.ev { background: var(--m-event); }

.li.set { justify-content: space-between; padding: 16px 16px; border-bottom: 1px solid var(--m-line); }
.li.set .ph { margin: 0; }
.sw { width: 50px; height: 30px; border-radius: 15px; background: var(--m-sv); border: 2px solid var(--m-outline); position: relative; flex: none; display: inline-block; }
.sw i { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--m-outline); top: 5px; left: 5px; }
.sw.on { background: var(--m-pri); border-color: var(--m-pri); }
.sw.on i { background: var(--m-on-pri); width: 22px; height: 22px; top: 2px; left: 22px; }

.login, .checkout { width: 330px; margin: 22px auto; display: flex; flex-direction: column; }
.login .logo { margin: 0 auto 12px; }
.login > .ph.big { margin: 0 auto 14px; }
.field { margin: 8px 0; position: relative; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.input { height: 36px; border: 1px solid var(--m-border); border-radius: 6px; display: flex; align-items: center; padding: 0 10px; gap: 8px; }
.input.sm { height: 30px; margin: 8px 0; }
.input.focus { border-color: var(--m-blue); box-shadow: 0 0 0 2px var(--m-focus); }
.caret { width: 1px; height: 16px; background: var(--m-ink); display: inline-block; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.check-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.cb { width: 18px; height: 18px; border: 2px solid var(--m-muted); border-radius: 4px; display: inline-flex !important; align-items: center; justify-content: center; }
.cb.on { background: var(--m-blue); border-color: var(--m-blue); color: #fff; }
.cb .ic { width: 14px; height: 14px; stroke-width: 3; }
.radios { display: block; padding: 4px; }
.radio-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--m-line); border-radius: 8px; margin: 8px 0; }
.rb { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--m-muted); flex: none; }
.rb.on { border: 5px solid var(--m-blue); }

.slider-row { margin: 18px 0; }
.slider { position: relative; height: 6px; background: var(--m-sv); border-radius: 3px; margin-top: 12px; display: block; }
.slider span { display: block; height: 100%; background: var(--m-pri); border-radius: 3px; }
.slider i { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: var(--m-pri); transform: translate(-50%, -50%); }

.chips { display: flex !important; gap: 6px; margin-top: 10px; flex-wrap: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--m-outline); border-radius: 8px; padding: 5px 8px; font-weight: 500; white-space: nowrap; font-size: 12px; }
.chip.on { background: var(--m-sec-c); border-color: var(--m-sec-c); }
.chip .ic { width: 14px; height: 14px; }

.badge-wrap { position: relative; display: inline-flex; }
.badge { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--m-error); color: var(--m-on-error); font-size: 11px; font-weight: 700; display: flex !important; align-items: center; justify-content: center; padding: 0 5px; }

.comments { padding: 16px 22px; }
.comment { display: flex; gap: 12px; margin-bottom: 18px; }
.av-txt.av-b { background: var(--m-av-b); } .av-txt.av-c { background: var(--m-av-c); } .av-txt.av-d { background: var(--m-av-d); }
.av-txt { width: 38px; height: 38px; border-radius: 50%; display: inline-flex !important; align-items: center; justify-content: center; font-weight: 700; color: var(--m-av-ink); flex: none; }
.av-txt.t { border-radius: 50%; }

.crumbs { display: inline-flex !important; gap: 8px; color: var(--m-muted); margin-bottom: 16px; padding: 2px 4px; }
.crumbs a { color: var(--m-blue); }
.crumbs span { color: var(--m-ink); font-weight: 500; }
.pdp { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.pdp .card-img { height: 220px; border-radius: 10px; }

.pager { display: inline-flex !important; gap: 6px; margin-top: 4px; }
.pager span { min-width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--m-line); border-radius: 6px; }
.pager span.on { background: var(--m-blue); color: #fff; border-color: var(--m-blue); }

.acc { display: block; border: 1px solid var(--m-line); border-radius: 8px; }
.acc-i + .acc-i { border-top: 1px solid var(--m-line); }
.acc-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-weight: 500; }
.acc-i.open .lines { padding: 0 14px 4px; margin-top: 0; }

.carousel { position: relative; height: 190px; border-radius: 12px; background: var(--m-carousel); display: flex !important; align-items: center; }
.car-slide { flex: 1; padding: 0 70px; }
.car-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: var(--m-car-arrow); display: flex; align-items: center; justify-content: center; }
.car-arrow.l { left: 12px; } .car-arrow.r { right: 12px; }
.car-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.car-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); }
.car-dots i.on { background: var(--m-surface); }

.skel { display: block; padding: 6px 14px; border-radius: 0; }
.sk { display: block; height: 10px; border-radius: 5px; margin: 8px 0; background: linear-gradient(90deg, var(--m-sk-1) 25%, var(--m-sk-2) 50%, var(--m-sk-1) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.sk-h { display: flex; align-items: center; gap: 10px; }
.sk-av { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.sk-img { height: 90px; border-radius: 8px; }
.sk-post { margin-bottom: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner { width: 46px; height: 46px; border-radius: 50% !important; border: 4px solid var(--m-pri-c); border-top-color: var(--m-pri); animation: spin .9s linear infinite, pulse 1.6s ease-in-out infinite !important; display: inline-block !important; }
.spinner.sm { width: 28px; height: 28px; border-width: 3px; animation: spin .9s linear infinite !important; }
.spinner.revealed { animation: spin .9s linear infinite !important; }
@keyframes spin { to { transform: rotate(360deg); } }

.upload { border: 1px solid var(--m-line); border-radius: 10px; padding: 14px; margin-top: 30px; }
.drop { display: flex; align-items: center; gap: 12px; }
.drop small { color: var(--m-muted); }
.pbar { display: block; height: 6px; background: var(--m-ph); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.pbar span { display: block; height: 100%; background: var(--m-blue); }

.toolbar { display: flex; gap: 6px; margin-bottom: 14px; color: var(--m-muted); }
.toolbar > .ic, .toolbar .hover { padding: 6px; border-radius: 6px; width: 32px; height: 32px; box-sizing: border-box; }
.toolbar .hover { background: var(--m-sunken); display: inline-flex; }
.tt-wrap { position: relative; display: inline-flex; }
.tooltip { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--m-inverse); color: var(--m-on-inverse); font-size: 11px; padding: 5px 8px; border-radius: 5px; white-space: nowrap; }

.pop-wrap { position: relative; display: inline-block; margin-top: 4px; }
.popover { position: absolute; top: calc(100% + 12px); left: -10px; width: 230px; background: var(--m-surface); border-radius: 10px; padding: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.16); border: 1px solid var(--m-line); display: block !important; }
.popover::before { content: ""; position: absolute; top: -7px; left: 26px; width: 12px; height: 12px; background: var(--m-surface); border-left: 1px solid var(--m-line); border-top: 1px solid var(--m-line); transform: rotate(45deg); }
.popover .li { padding: 4px 0; }
.popover .av { width: 24px; height: 24px; }

.steps { display: flex !important; align-items: center; margin-bottom: 18px; padding: 4px; }
.step { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--m-muted); font-size: 12px; }
.step i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--m-border); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; }
.step.done { color: var(--m-ink); } .step.done i { background: var(--m-blue); border-color: var(--m-blue); color: #fff; }
.step.cur { color: var(--m-blue); } .step.cur i { border-color: var(--m-blue); }
.steps b { flex: 1; height: 2px; background: var(--m-ph); margin: 0 6px; }

.li.cart { border-bottom: 1px solid var(--m-line); }
.thumb { width: 50px; height: 50px; border-radius: 8px; flex: none; }
.qty { display: inline-flex !important; align-items: center; border: 1px solid var(--m-border); border-radius: 8px; }
.qty i { padding: 5px; color: var(--ios-blue); } .qty i .ic { width: 16px; height: 16px; }
.qty b { padding: 0 6px; }

.combo-mock, .select-mock { display: block; position: relative; }
.combo-mock ul, .select-mock ul { list-style: none; margin: 4px 0 0; padding: 4px 0; border-radius: 6px; box-shadow: 0 0 0 1px var(--m-line), 0 6px 16px rgba(0,0,0,.12); background: var(--m-surface); }
.combo-mock li, .select-mock li { padding: 7px 12px; }
.combo-mock li.hl { background: var(--m-sel); }
.select-mock .input { justify-content: space-between; }
.select-mock li { padding-left: 32px; }
.select-mock li.sel { background: var(--m-sunken); padding-left: 10px; display: flex; gap: 6px; font-weight: 600; }
.select-mock li.sel .ic { width: 16px; height: 16px; }

.cal { display: block; margin-top: 6px; border-radius: 10px; box-shadow: 0 0 0 1px var(--m-line), 0 6px 16px rgba(0,0,0,.12); background: var(--m-surface); padding: 10px; width: 250px; }
.cal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-g small { color: var(--m-muted); font-size: 10px; }
.cal-g span { padding: 4px 0; font-size: 11px; border-radius: 50%; }
.cal-g span:first-of-type { grid-column-start: 7; }
.cal-g span.on { background: var(--m-blue); color: #fff; }

.wheel { position: relative; display: flex !important; justify-content: center; gap: 20px; height: 180px; align-items: center; margin-bottom: 14px; }
.wheel-band { position: absolute; left: 0; right: 0; top: 50%; height: 34px; transform: translateY(-50%); background: var(--ios-wheel); border-radius: 8px; }
.wheel-col { position: relative; display: flex; flex-direction: column; align-items: center; width: 44px; }
.wheel-col span { height: 34px; line-height: 34px; font-size: 20px; }
.wheel-col .w0, .wheel-col .w4 { opacity: .2; font-size: 15px; transform: perspective(200px) rotateX(50deg); }
.wheel-col .w1, .wheel-col .w3 { opacity: .5; font-size: 18px; transform: perspective(200px) rotateX(28deg); }
.wheel-col .w2 { font-weight: 600; font-size: 22px; }

.mtf { position: relative; border: 2px solid var(--m-pri); border-radius: 4px; height: 52px; display: flex; align-items: center; padding: 0 14px; margin: 14px 0 22px; font-size: 15px; }
.mtf label { position: absolute; top: -9px; left: 10px; background: var(--m-bg); padding: 0 4px; font-size: 12px; color: var(--m-pri); }
.mtf.idle { border: 1px solid var(--m-outline); }
.mtf.idle label { top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--m-on-sv); }

.pr { padding-top: 22px; }
.merge { display: flex; gap: 12px; align-items: center; border: 1px solid var(--m-border); border-radius: 8px; padding: 12px; margin: 16px 0 12px; }
.merge .ok { width: 34px; height: 34px; border-radius: 50%; background: #1f883d; color: #fff; display: flex; align-items: center; justify-content: center; }
.split { display: inline-flex !important; background: #1f883d; color: #fff; border-radius: 6px; font-weight: 600; overflow: hidden; }
.split span { padding: 8px 14px; }
.split i { padding: 8px 8px; border-left: 1px solid rgba(255,255,255,.35); display: flex; align-items: center; }
.split i .ic { width: 16px; height: 16px; }

.banner { display: flex !important; align-items: center; gap: 10px; padding: 10px 16px; background: var(--m-banner); color: var(--m-on-banner); }
.banner span { flex: 1; }
.banner .ic { width: 18px; height: 18px; }
.cookie { position: absolute; left: 14px; right: 14px; bottom: 14px; background: var(--m-cookie); color: #f9fafb; border-radius: 10px; padding: 12px 14px; display: flex !important; align-items: center; gap: 10px; }
.cookie > span:not(.btn-mini) { flex: 1; }
.cookie .btn-mini { margin: 0; }
.cookie .btn-mini.ghost { color: #f9fafb; box-shadow: inset 0 0 0 1px #4b5563; }

.empty { display: flex !important; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px; width: 210px; }
.empty-ill { width: 90px; height: 90px; border-radius: 50%; background: var(--m-pri-c); display: flex; align-items: center; justify-content: center; color: var(--m-pri); margin-bottom: 6px; }
.empty-ill .ic { width: 40px; height: 40px; }
.empty small { color: var(--m-muted); }

.hero { display: grid !important; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; padding: 30px 26px; margin: 10px; background: linear-gradient(180deg, var(--m-hero-1), var(--m-hero-2)); border-radius: 10px; }
.hero-art { height: 200px; border-radius: 14px; background: linear-gradient(135deg, #818cf8, #f472b6); }
.logos { display: flex; justify-content: space-around; padding: 6px 30px; }
.logos span { width: 60px; height: 14px; background: var(--m-ph); border-radius: 4px; }

.navon { display: inline-flex; align-items: center; gap: 4px; color: var(--m-blue); }
.navon .ic { width: 14px; height: 14px; }
.mega { display: grid !important; grid-template-columns: repeat(4, 1fr) 1.2fr; gap: 18px; padding: 18px 22px; background: var(--m-surface); box-shadow: 0 10px 24px rgba(0,0,0,.12), 0 1px 0 var(--m-line); border-radius: 0 0 10px 10px !important; position: relative; z-index: 1; }
.mega .card-img { height: 120px; border-radius: 8px; }

.actsheet { position: absolute; left: 8px; right: 8px; bottom: 10px; display: flex !important; flex-direction: column; gap: 8px; border-radius: 14px !important; }
.as-group { background: var(--ios-group); border-radius: 13px; overflow: hidden; display: flex; flex-direction: column; text-align: center; }
.as-group small { color: #8e8e93; padding: 12px 18px; font-size: 12px; border-bottom: 1px solid var(--m-line); }
.as-group span, .as-group b { padding: 14px; font-size: 17px; color: var(--ios-blue); }
.as-group span + span { border-top: 1px solid var(--m-line); }
.as-group .danger { color: var(--ios-red); }

.swipe { display: flex !important; overflow: hidden; }
.swipe-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; flex: none; width: 100%; margin-left: -132px; background: var(--m-bg); }
.sa { width: 66px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.sa.gray { background: #8e8e93; } .sa.red { background: var(--ios-red); }

.pulled { padding-top: 0; }
.ptr { display: flex !important; justify-content: center; padding: 14px 0; border-radius: 50% !important; width: 52px; height: 52px; margin: 8px auto; background: var(--m-surface); box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 0 0 1px var(--m-line); align-items: center; }

.onboard { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 26px 20px; height: 100%; }
.onboard .ph { margin-left: auto; margin-right: auto; }
.ob-ill { width: 170px; height: 170px; border-radius: 50%; background: var(--m-pri-c); color: var(--m-pri); display: flex; align-items: center; justify-content: center; margin-bottom: 30px; }
.ob-ill .ic { width: 70px; height: 70px; stroke-width: 1.5; }
.dots { display: flex !important; gap: 8px; margin: 26px 0 auto; padding: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--m-outline); }
.dots i.on { background: var(--m-pri); width: 22px; border-radius: 4px; }
.onboard .btn-full { width: 100%; }
.onboard .link { margin-top: 10px; color: var(--m-pri); }

.masonry { columns: 4; column-gap: 10px; padding: 12px 14px; display: block; }
.masonry span { display: block; break-inside: avoid; margin-bottom: 10px; border-radius: 10px; }
.page > .masonry.t { margin: 6px; }
.lightbox { position: absolute; inset: 0; background: rgba(0,0,0,.88); display: flex !important; align-items: center; justify-content: center; }
.lb-img { width: 300px; height: 260px; border-radius: 4px; background: linear-gradient(135deg, #f59e0b, #ef4444 60%, #7c3aed); }
.lb-x { position: absolute; top: 12px; right: 14px; color: #fff; }
.lightbox small { position: absolute; bottom: 12px; color: #d1d5db; }
.lightbox .car-arrow { background: rgba(255,255,255,.15); color: #fff; }

.stars { display: inline-flex !important; align-items: center; gap: 2px; margin: 4px 0; padding: 2px; }
.stars .ic { width: 20px; height: 20px; color: var(--m-border); fill: var(--m-ph); }
.stars span.on .ic { color: #f59e0b; fill: #fbbf24; }
.stars small { margin-left: 6px; color: var(--m-muted); }

.ide { display: flex; height: 100%; position: relative; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.tree { width: 190px; background: var(--m-sunken); border-right: 1px solid var(--m-line); padding: 8px 4px; display: block; }
.tree div { display: flex; align-items: center; gap: 4px; padding: 4px 6px; }
.tree div.sel { background: var(--m-sel); border-radius: 4px; }
.code { flex: 1; padding: 12px 16px; }
.code-l { background: var(--m-code-1); }
.code-l:nth-child(3n) { background: var(--m-code-2); }
.ctx { position: absolute; left: 150px; top: 108px; width: 180px; background: var(--m-surface); border-radius: 8px; box-shadow: 0 0 0 1px var(--m-line), 0 8px 24px rgba(0,0,0,.18); padding: 5px; font-family: ui-sans-serif, system-ui, sans-serif; display: block !important; }
.ctx span { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 5px; }
.ctx span:first-child { background: var(--m-blue); color: #fff; }
.ctx span:first-child small { color: #dbeafe; }
.ctx small { color: var(--m-muted); }
.ctx hr { border: 0; border-top: 1px solid var(--m-line); margin: 4px 0; }

.dt { width: 100%; border-collapse: collapse; font-size: 12px; }
.dt th { text-align: left; color: var(--m-muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--m-line); background: var(--m-sunken); }
.dt td { padding: 10px; border-bottom: 1px solid var(--m-line); }
.pill { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.p-paid { background: var(--m-paid); color: var(--m-on-paid); } .p-pending { background: var(--m-pending); color: var(--m-on-pending); } .p-overdue { background: var(--m-overdue); color: var(--m-on-overdue); }

.cmdk { position: absolute; left: 50%; top: 50px; transform: translateX(-50%); width: 400px; background: var(--m-surface); border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,.25), 0 0 0 1px var(--m-line); overflow: hidden; display: block !important; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--m-line); font-size: 15px; }
.cmdk-in .typed { flex: 1; }
.cmdk-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.cmdk-row span { flex: 1; }
.cmdk-row.hl { background: var(--m-sunken); }
.cmdk-row .ic { width: 16px; height: 16px; color: var(--m-muted); }
kbd { font-family: inherit; font-size: 11px; color: var(--m-muted); border: 1px solid var(--m-line); border-radius: 4px; padding: 1px 5px; }

.foot { display: flex; gap: 30px; padding: 16px 22px; background: var(--m-sunken); margin-top: auto; }
.foot .ph { margin: 0; }
.totop { position: absolute; right: 18px; bottom: 70px; width: 40px; height: 40px; border-radius: 50% !important; background: var(--m-inverse); color: var(--m-on-inverse); display: flex !important; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.totop .ic { width: 18px; height: 18px; }
