/* NexZero — "Liquid Glass" design system, Spectail palette.
   Structure follows the NexSeal design brief; the gold accents are replaced by
   the blues of the Spectail orb. Tokens first, then base, glass, controls, screens. */

@property --aurora-a { syntax: '<color>'; inherits: true; initial-value: #9fd4ff; }
@property --aurora-b { syntax: '<color>'; inherits: true; initial-value: #b9c4ff; }
@property --aurora-c { syntax: '<color>'; inherits: true; initial-value: #8fe2f2; }
@property --aurora-d { syntax: '<color>'; inherits: true; initial-value: #e2dcff; }

:root {
  color-scheme: light;

  /* Ink (text) */
  --ink: #1d1d1f;
  --ink-2: #3a3a3d;
  --ink-3: #6e6e73;
  --ink-4: #8e8e93;
  --hair: rgba(10, 20, 45, .09);
  --hair-2: rgba(10, 20, 45, .14);

  /* Canvas: cool ice instead of cream */
  --bg: #eef3f9;
  --bg-2: #e3ebf5;

  /* Brand: abyss (near-black navy) and Spectail blue */
  --abyss: #070d1e;
  --btn-primary: linear-gradient(180deg, #1c2c52, #070d1e);
  --sig-1: #0b46b4;   /* blue text: eyebrows, links, figures */
  --sig-2: #2f7bf0;   /* focus rings, active outlines */
  --sig-3: #5cc8f6;   /* icons on dark */
  --sig-4: #d6f1ff;   /* text on dark cards */
  --sig-grad: linear-gradient(120deg, #0a2bb8 0%, #2f74f0 26%, #8fdcfb 46%, #e8f8ff 52%, #3fb2f2 64%, #0f3fc9 100%);

  /* Status (Apple system colours, AA on light glass) */
  --ok: #1a8f4a;   --ok-fill: #34c759;
  --warn: #b25f00; --warn-fill: #ff9f0a;
  --bad: #c4001a;  --bad-fill: #ff3b30;
  --blue: #0071e3;
  --mock: #5856d6;

  /* Dark weighty surfaces */
  --dark-card: radial-gradient(120% 90% at 0% 0%, rgba(110, 200, 255, .24), transparent 55%),
               linear-gradient(135deg, #15264f 0%, #070d1e 60%, #102049 100%);
  --on-dark: #eaf7ff;

  /* Glass */
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .75);
  --glass-shadow: 0 1px 1px rgba(10, 20, 45, .04), 0 8px 28px rgba(10, 30, 70, .08);

  /* Geometry */
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-full: 999px;
  --gutter: 16px;

  /* Motion */
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Surface tokens that change between themes */
  --glass-highlight: rgba(255, 255, 255, .8);
  --field-bg: rgba(255, 255, 255, .72);
  --tabbar-bg: rgba(255, 255, 255, .8);
  --sheet-bg: rgba(246, 249, 253, .92);
  --toast-bg: rgba(255, 255, 255, .86);
  --seg-on: #fff;
  --grey-fill: rgba(118, 118, 128, .13);
  --track: rgba(10, 30, 70, .08);
  --press: rgba(10, 30, 70, .04);
  --skel-a: rgba(255, 255, 255, .4);
  --skel-b: rgba(255, 255, 255, .85);
  --brand-word: linear-gradient(180deg, #0f1c3d, #1c3f86);
  --blob-opacity: .72;
  --grain-blend: multiply;

  --app-h: 100dvh;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body { background: transparent; }
body {
  font-family: var(--font);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--sig-1); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--sig-2); outline-offset: 2px; border-radius: 8px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Aurora + grain ---------- */
.aurora {
  position: fixed; inset: -10%; z-index: -2; overflow: hidden; pointer-events: none;
  transition: --aurora-a 1.4s ease, --aurora-b 1.4s ease, --aurora-c 1.4s ease, --aurora-d 1.4s ease;
}
.blob { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(64px); opacity: var(--blob-opacity); }
.blob.a { background: var(--aurora-a); top: -25%; left: -20%; animation: drift-a 28s ease-in-out infinite alternate; }
.blob.b { background: var(--aurora-b); top: -10%; right: -30%; animation: drift-b 32s ease-in-out infinite alternate; }
.blob.c { background: var(--aurora-c); bottom: -30%; left: -15%; animation: drift-c 26s ease-in-out infinite alternate; }
.blob.d { background: var(--aurora-d); bottom: -20%; right: -25%; animation: drift-d 34s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(14vw, 10vh) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-12vw, 14vh) scale(.92); } }
@keyframes drift-c { to { transform: translate(10vw, -12vh) scale(1.05); } }
@keyframes drift-d { to { transform: translate(-14vw, -8vh) scale(1.12); } }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05; mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body[data-mood="calm"]   { --aurora-a: #a8e6d2; --aurora-b: #a6d6ff; --aurora-c: #cfeff0; --aurora-d: #dbe6ff; }
body[data-mood="focus"]  { --aurora-a: #7fc4ff; --aurora-b: #8fa4ff; --aurora-c: #7fe0f0; --aurora-d: #d6d0ff; }
body[data-mood="alert"]  { --aurora-a: #ffc9b3; --aurora-b: #a9c8ff; --aurora-c: #ffc0cb; --aurora-d: #e0dbff; }
body[data-mood="sealed"] { --aurora-a: #b8ecc4; --aurora-b: #9fd8ff; --aurora-c: #d7f2c8; --aurora-d: #d6e4ff; }

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  border-radius: var(--r-lg);
}
.dark {
  background: var(--dark-card);
  color: var(--on-dark);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 18px 40px rgba(7, 13, 30, .28);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-full);
  font-weight: 600; font-size: 16px; letter-spacing: -.01em;
  transition: transform .35s var(--spring), opacity .2s, background .2s, box-shadow .2s;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--btn-primary); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 18px rgba(7, 13, 30, .25); }
.btn-secondary { background: var(--glass-strong); color: var(--ink); border: .5px solid var(--hair-2); }
.btn-light { background: rgba(255, 255, 255, .92); color: var(--abyss); }
.btn-ghost-dark { background: rgba(255, 255, 255, .1); color: var(--on-dark); border: .5px solid rgba(255, 255, 255, .2); }
.btn-danger { background: rgba(255, 59, 48, .1); color: var(--bad); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-link { color: var(--sig-1); font-weight: 600; min-height: 44px; padding: 0 4px; font-size: 15px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glass-strong); border: .5px solid var(--hair); color: var(--ink);
  transition: transform .35s var(--spring);
}
.icon-btn:active { transform: scale(.9); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-top: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-3); padding-left: 4px; }
.field input, .field select, .field textarea, .search input {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px;
  background: var(--field-bg); border: .5px solid var(--hair-2); color: var(--ink);
  font-size: 17px; outline: none; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search input:focus { border-color: var(--sig-2); box-shadow: 0 0 0 4px rgba(47, 123, 240, .15); }
::placeholder { color: var(--ink-4); }
.form-error { color: var(--bad); font-size: 14px; min-height: 0; margin-top: 8px; }
.form-error:empty { display: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(120% 70% at 50% 0%, #1d3f86, #0a1430 55%, #04070f);
  color: var(--on-dark); transition: opacity .6s ease, visibility .6s;
}
.splash.leaving { opacity: 0; visibility: hidden; }
.splash-halo { position: absolute; width: 340px; height: 340px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -62%);
  background: radial-gradient(circle, rgba(47, 182, 255, .45), transparent 65%); animation: halo 2.4s ease-in-out infinite alternate; }
.splash-orb { width: 112px; height: 112px; position: relative; animation: orb-in 1.1s var(--spring) both, orb-spin 9s linear 1.1s infinite;
  filter: drop-shadow(0 10px 30px rgba(47, 160, 255, .55)); }
.splash-word { font-size: 34px; font-weight: 700; letter-spacing: -.03em; position: relative; animation: rise .8s .35s var(--ease) both; }
.splash-by { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--sig-3); position: relative; animation: rise .8s .55s var(--ease) both; }
@keyframes orb-in { from { transform: scale(.4) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes halo { from { opacity: .6; transform: translate(-50%, -62%) scale(.92); } to { opacity: 1; transform: translate(-50%, -62%) scale(1.06); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Auth ---------- */
.auth-view {
  min-height: var(--app-h); display: flex; flex-direction: column; justify-content: center;
  padding: calc(32px + var(--safe-t)) var(--gutter) calc(24px + var(--safe-b)); max-width: 460px; margin: 0 auto; gap: 26px;
}
.auth-brand { text-align: center; display: grid; justify-items: center; gap: 8px; }
.auth-orb { width: 76px; height: 76px; filter: drop-shadow(0 10px 24px rgba(30, 110, 230, .35)); }
.brand-word {
  font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1;
  background: var(--brand-word); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sig-1); }
.auth-card { padding: 26px 22px 22px; animation: rise .5s var(--ease) both; }
.auth-card h1 { font-size: 26px; letter-spacing: -.02em; }
.auth-card .sub { color: var(--ink-3); margin-top: 6px; font-size: 15px; }
.auth-card .btn-block { margin-top: 18px; }
.footnote { margin-top: 14px; text-align: center; font-size: 13px; color: var(--ink-4); }
.auth-links { display: flex; justify-content: space-between; margin-top: 8px; }
.otp-input { font-family: var(--mono) !important; font-size: 30px !important; letter-spacing: .5em; text-align: center; padding-left: calc(16px + .5em) !important; }
.auth-status { text-align: center; color: var(--ink-3); display: grid; justify-items: center; gap: 12px; }
.auth-status h1 { font-size: 22px; color: var(--ink); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--hair-2); border-top-color: var(--sig-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Onboarding */
.onboard { padding: 24px 22px 20px; text-align: center; display: grid; gap: 14px; }
.onboard-art { height: 190px; position: relative; display: grid; place-items: center; }
.onboard h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.onboard p { color: var(--ink-3); }
.dots { display: flex; justify-content: center; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--hair-2); transition: width .35s var(--spring), background .3s; }
.dots i.on { width: 22px; background: var(--abyss); }
.onboard-actions { display: flex; gap: 10px; }
.onboard-actions .btn { flex: 1; }
.art-orb { width: 96px; height: 96px; animation: orb-spin 14s linear infinite; filter: drop-shadow(0 12px 28px rgba(30, 110, 230, .4)); }
.art-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(47, 123, 240, .3); }
.art-ring.r1 { width: 150px; height: 150px; } .art-ring.r2 { width: 190px; height: 190px; opacity: .6; }
.art-chip { position: absolute; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: var(--r-full); background: var(--glass-strong); box-shadow: var(--glass-shadow); display: flex; gap: 6px; align-items: center; }
.art-chip svg { width: 14px; height: 14px; }

/* ---------- Workspace shell ---------- */
.workspace { min-height: var(--app-h); }
.page {
  max-width: 560px; margin: 0 auto;
  padding: calc(14px + var(--safe-t)) var(--gutter) calc(var(--tabbar-h) + 40px + var(--safe-b));
}
.page.enter { animation: page-in .45s var(--ease) both; }
.page.push { animation: page-push .45s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes page-push { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); z-index: 20;
  width: min(calc(100% - 24px), 440px); height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  border-radius: 32px; padding: 0 6px; background: var(--tabbar-bg);
}
.tabbar button { display: grid; justify-items: center; gap: 2px; color: var(--ink-4); font-size: 10.5px; font-weight: 600; min-height: 52px; align-content: center; border-radius: 22px; transition: color .2s, transform .35s var(--spring); }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button:active { transform: scale(.9); }
.tabbar button.active { color: var(--sig-1); }
.tabbar button.active:not(.tab-visit) { background: rgba(47, 123, 240, .1); }
.visit-orb { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; margin-top: -18px; color: #fff;
  background: var(--btn-primary); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px rgba(7, 13, 30, .3); transition: transform .35s var(--spring); }
.tab-visit.active .visit-orb { background: linear-gradient(160deg, #2f74f0, #0a2bb8); box-shadow: 0 8px 22px rgba(30, 100, 230, .45); }
.tab-visit.active { color: var(--sig-1); }

/* Page header (iOS large title) */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.head .sub { color: var(--ink-3); font-size: 15px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.navbar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 4px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--sig-1); font-weight: 600; font-size: 17px; min-height: 44px; padding-right: 8px; }
.back svg { width: 22px; height: 22px; }

.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 10px; }
.section-h h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.section-h .btn-link { min-height: 32px; }

.live-chip, .chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.live-chip { background: var(--glass-strong); border: .5px solid var(--hair); color: var(--ok); }
.live-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-fill); box-shadow: 0 0 0 3px rgba(52, 199, 89, .2); animation: pulse 2s ease-in-out infinite; }
.live-chip.demo { color: var(--mock); } .live-chip.demo i { background: var(--mock); box-shadow: 0 0 0 3px rgba(88, 86, 214, .2); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(52, 199, 89, 0); } }

/* Status tags — always icon + word */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: var(--r-full); white-space: nowrap; }
.tag svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tag.ok { color: var(--ok); background: rgba(52, 199, 89, .13); }
.tag.warn { color: var(--warn); background: rgba(255, 159, 10, .14); }
.tag.bad { color: var(--bad); background: rgba(255, 59, 48, .11); }
.tag.muted { color: var(--ink-3); background: var(--grey-fill); }
.tag.mock { color: var(--mock); background: rgba(88, 86, 214, .12); }
.tag.info { color: var(--sig-1); background: rgba(47, 123, 240, .12); }
.dark .tag.ok { color: #7ee89a; background: rgba(52, 199, 89, .18); }
.dark .tag.warn { color: #ffc46b; background: rgba(255, 159, 10, .18); }
.dark .tag.bad { color: #ff8d86; background: rgba(255, 59, 48, .2); }
.dark .tag.muted { color: #c7d3e6; background: rgba(255, 255, 255, .1); }

.mono { font-family: var(--mono); font-size: 12px; color: var(--ink-4); letter-spacing: .02em; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.metal { background: var(--sig-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Cards ---------- */
.card { padding: 18px; margin-bottom: 12px; }
.card.tight { padding: 14px 16px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-3); font-size: 14px; margin-top: 8px; }
.meta-line span { display: inline-flex; align-items: center; gap: 5px; }
.meta-line svg { width: 15px; height: 15px; }
.dark .meta-line { color: rgba(234, 247, 255, .72); }
.rule { height: .5px; background: var(--hair-2); margin: 14px 0; }

/* Pulse card (Today) */
.pulse { display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: center; }
.ring { position: relative; width: 116px; height: 116px; }
.ring svg { width: 116px; height: 116px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--track); }
.ring .fill { stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.ring-label small { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.dark .ring .track { stroke: rgba(255, 255, 255, .12); }
.dark .ring-label small { color: rgba(234, 247, 255, .7); }
.kv { display: grid; gap: 10px; }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; color: var(--ink-2); }
.kv strong { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.kv .bad strong { color: var(--bad); }

/* Next-up hero */
.hero { padding: 20px; margin-bottom: 12px; position: relative; overflow: hidden; }
.hero .eyebrow { color: var(--sig-3); }
.hero h2 { font-size: 24px; letter-spacing: -.02em; margin-top: 8px; line-height: 1.2; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; }
.hero-actions .btn { flex: 1; }
.hero-orb { position: absolute; right: -36px; top: -36px; width: 150px; opacity: .22; animation: orb-spin 30s linear infinite; pointer-events: none; }

/* Store list */
.store {
  display: block; width: 100%; text-align: left; padding: 16px; margin-bottom: 10px;
  transition: transform .35s var(--spring);
}
.store:active { transform: scale(.985); }
.store-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.store h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin-top: 2px; }
.meter { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2f74f0, #5cc8f6); transition: width 1s var(--ease); }
.meter.bad i { background: linear-gradient(90deg, #ff3b30, #ff7a6b); }
.meter.warn i { background: linear-gradient(90deg, #ff9f0a, #ffc46b); }
.store-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: var(--ink-3); }
.store-foot .chev { color: var(--ink-4); display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.store.is-mock { opacity: .78; }
.mock-note { margin-top: 12px; font-size: 13px; color: var(--mock); background: rgba(88, 86, 214, .08); border-radius: 12px; padding: 8px 12px; }

/* List rows (compact, inset-grouped) */
.list { padding: 4px 0; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 56px; padding: 10px 16px; position: relative; }
.list-row + .list-row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--hair); }
.list-row:active { background: var(--press); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row small { color: var(--ink-3); font-size: 13px; }
.list-row .chev { color: var(--ink-4); }
.list-row.danger { color: var(--bad); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok-fill); } .dot.warn { background: var(--warn-fill); } .dot.bad { background: var(--bad-fill); } .dot.muted { background: var(--ink-4); } .dot.mock { background: var(--mock); }

/* Search + chips */
.search { position: relative; margin-bottom: 12px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-4); width: 18px; height: 18px; }
.search input { padding-left: 42px; min-height: 44px; border-radius: 12px; font-size: 16px; background: var(--field-bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) 14px; padding: 2px var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; min-height: 36px; padding: 0 14px; border-radius: var(--r-full); font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: var(--glass); border: .5px solid var(--glass-edge); transition: transform .35s var(--spring), background .2s, color .2s; }
.chips button.on { background: var(--btn-primary); color: #fff; border-color: transparent; }
.chips button:active { transform: scale(.94); }
.chips .count { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* Segmented control */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 12px; background: var(--grey-fill); margin-bottom: 14px; }
.segmented button { min-height: 36px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .25s, box-shadow .25s; }
.segmented button.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .04); }

/* Tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.tile { padding: 14px; border-radius: var(--r-md); }
.tile .eyebrow { font-size: 11px; color: var(--ink-3); }
.tile strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; text-transform: capitalize; }
.tile small { color: var(--ink-3); font-size: 12.5px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 8px; margin-top: 12px; }
.metrics div { display: grid; }
.metrics strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.metrics span { font-size: 12px; color: var(--ink-3); }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; margin-top: 12px; }
.slots.big { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.slots.big.forty { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.slot { min-width: 0; aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slots.big .slot { border-radius: 10px; font-size: 13px; }
.slot.s-correct { background: rgba(47, 123, 240, .16); color: var(--sig-1); }
.slot.s-empty { background: rgba(255, 159, 10, .18); color: var(--warn); }
.slot.s-oos { background: var(--bad-fill); color: #fff; }
.slot.s-unknown { background: var(--grey-fill); color: var(--ink-4); border: 1px dashed rgba(120, 120, 128, .35); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.slot { width: 12px; height: 12px; aspect-ratio: auto; border-radius: 4px; }

/* Freshness strip */
.fresh { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: var(--r-md); margin-bottom: 12px; font-size: 13px; }
.fresh .grow { flex: 1; min-width: 0; }
.fresh strong { display: block; font-size: 14px; }
.fresh small { color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fresh.stale strong { color: var(--warn); }
.fresh.unknown strong { color: var(--ink-3); }
.fresh .icon-btn { width: 36px; height: 36px; }
.fresh .icon-btn svg { width: 18px; height: 18px; }
.fresh .icon-btn.spinning svg { animation: spin 1s linear infinite; }

/* Visit */
.stepper { display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 8px 0; position: relative; }
.step + .step::before { content: ''; position: absolute; left: 14px; top: -10px; height: 18px; width: 2px; background: var(--hair-2); }
.step b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--grey-fill); color: var(--ink-3); }
.step.current b { background: var(--btn-primary); color: #fff; }
.step.done b { background: var(--ok-fill); color: #fff; }
.step.done b svg { width: 16px; height: 16px; stroke-width: 3; }
.step strong { display: block; font-size: 15.5px; }
.step small { color: var(--ink-3); font-size: 13px; }
.slot-task { padding: 16px; margin-bottom: 10px; animation: rise .4s var(--ease) both; }
.slot-task .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.slot-num { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 59, 48, .1); color: var(--bad); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; flex: none; }
.proof { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 10px; border-radius: 14px; background: var(--field-bg); border: .5px solid var(--hair); }
.proof img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.proof .grow { flex: 1; min-width: 0; display: grid; gap: 8px; }
.proof input[type="text"] { width: 100%; min-height: 40px; border-radius: 10px; border: .5px solid var(--hair-2); padding: 8px 10px; background: var(--field-bg); color: var(--ink); font-size: 15px; }
.proof-add { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--sig-1); font-weight: 600; font-size: 14px; min-height: 44px; }
.proof-add svg { width: 18px; height: 18px; }
.file-input { display: none; }
.celebrate { text-align: center; padding: 28px 20px; }
.celebrate .check { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-fill); color: #fff; animation: pop .6s var(--spring) both; box-shadow: 0 10px 26px rgba(52, 199, 89, .4); }
.celebrate .check svg { width: 32px; height: 32px; stroke-width: 3; }
.celebrate h2 { font-size: 22px; }
.celebrate p { color: var(--ink-3); margin-top: 4px; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

.dock { position: sticky; bottom: calc(var(--tabbar-h) + 18px + var(--safe-b)); z-index: 5; margin-top: 14px; display: flex; gap: 10px; }
.dock .btn { flex: 1; min-height: 52px; }

/* Tickets */
.ticket { padding: 16px; margin-bottom: 10px; }
.ticket h3 { font-size: 16.5px; font-weight: 650; margin-top: 4px; }
.ticket p { color: var(--ink-2); font-size: 14.5px; margin-top: 6px; }
.ticket-track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 14px; }
.ticket-track i { height: 4px; border-radius: 2px; background: var(--grey-fill); }
.ticket-track i.on { background: var(--sig-2); }
.track-labels { display: grid; grid-template-columns: repeat(3, 1fr); font-size: 11.5px; color: var(--ink-4); margin-top: 6px; font-weight: 600; }
.track-labels span.on { color: var(--sig-1); }
.ai-note { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--mock); }
.ai-note svg { width: 14px; height: 14px; }

/* Shift */
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.summary-grid div { display: grid; }
.summary-grid strong { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.summary-grid span { font-size: 12.5px; color: rgba(234, 247, 255, .7); }
.report { padding: 16px; margin-bottom: 10px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.report-kpis div { display: grid; }
.report-kpis strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.report-kpis span { font-size: 11.5px; color: var(--ink-3); }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--grey-fill); transition: background .25s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15); transition: transform .35s var(--spring); }
.switch input:checked + i { background: var(--ok-fill); }
.switch input:checked + i::after { transform: translateX(20px); }
.settings-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.settings-icon svg { width: 18px; height: 18px; }

/* Empty / skeleton / error */
.empty { text-align: center; padding: 30px 20px; color: var(--ink-3); }
.empty .em-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: rgba(47, 123, 240, .1); color: var(--sig-1); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.skeleton { border-radius: var(--r-lg); height: 96px; margin-bottom: 10px; background: linear-gradient(100deg, var(--skel-a) 30%, var(--skel-b) 50%, var(--skel-a) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.tall { height: 150px; }
@keyframes shimmer { to { background-position: -150% 0; } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; margin-bottom: 12px; }
.notice svg { width: 18px; height: 18px; margin-top: 1px; }
.notice.warn { background: rgba(255, 159, 10, .12); color: var(--warn); }
.notice.bad { background: rgba(255, 59, 48, .1); color: var(--bad); }

/* Disclosure */
details.disclose summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
details.disclose summary::-webkit-details-marker { display: none; }
details.disclose summary .chev { transition: transform .3s var(--spring); color: var(--ink-4); }
details.disclose[open] summary .chev { transform: rotate(90deg); }

/* ---------- Sheet ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(7, 13, 30, .32); animation: fade .3s ease both; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(var(--app-h) - 40px); overflow-y: auto;
  margin: 0 auto; max-width: 560px; border-radius: 28px 28px 0 0; padding: 8px 20px calc(24px + var(--safe-b));
  background: var(--sheet-bg); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 -10px 40px rgba(7, 13, 30, .18); animation: sheet-up .5s var(--spring) both; overscroll-behavior: contain;
}
.sheet-root.closing .sheet { animation: sheet-down .28s ease-in both; }
.sheet-root.closing .sheet-scrim { animation: fade .28s ease reverse both; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--hair-2); margin: 0 auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.sheet-head h2 { font-size: 22px; letter-spacing: -.02em; }
.avatar-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, #5cc8f6, #2f74f0 55%, #0a2bb8); color: #fff;
  font-size: 15px; font-weight: 700; letter-spacing: .02em; border: .5px solid var(--hair);
  box-shadow: 0 4px 14px rgba(47, 116, 240, .3); transition: transform .35s var(--spring);
}
.avatar-btn:active { transform: scale(.9); }
.profile-hero { display: grid; justify-items: center; gap: 6px; text-align: center; margin: 8px 0 20px; }
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  background: linear-gradient(160deg, #5cc8f6, #2f74f0 55%, #0a2bb8); color: #fff;
  font-size: 30px; font-weight: 700; box-shadow: 0 10px 30px rgba(47, 116, 240, .35);
}
.profile-hero strong { font-size: 22px; letter-spacing: -.02em; }
.profile-hero > span:not(.live-chip) { color: var(--ink-3); font-size: 15px; }
.list-row .grow small + strong { margin-top: 2px; }
.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.choice span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r-full); font-size: 14.5px; font-weight: 600;
  background: var(--field-bg); border: .5px solid var(--hair-2); transition: all .2s; }
.choice input:checked + span { background: var(--btn-primary); color: #fff; border-color: transparent; }
.choice input:focus-visible + span { outline: 2px solid var(--sig-2); outline-offset: 2px; }
.choice .p-critical::before, .choice .p-high::before, .choice .p-medium::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.choice .p-critical::before { background: var(--bad-fill); } .choice .p-high::before { background: var(--warn-fill); } .choice .p-medium::before { background: var(--sig-2); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(12px + var(--safe-t)); z-index: 90; transform: translate(-50%, -140%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 12px 18px 12px 14px; border-radius: var(--r-full);
  background: var(--toast-bg); color: var(--ink); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 10px 30px rgba(7, 13, 30, .16); font-weight: 600; font-size: 15px; opacity: 0; visibility: hidden;
  transition: transform .5s var(--spring), opacity .25s, visibility .25s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast svg { width: 20px; height: 20px; stroke-width: 2.4; }
.toast.ok svg { color: var(--ok-fill); } .toast.bad svg { color: var(--bad-fill); } .toast.info svg { color: var(--sig-2); }


/* ---------- Dark theme ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f7fc;
  --ink-2: #d5ddea;
  --ink-3: #9aa7bc;
  --ink-4: #6d7a90;
  --hair: rgba(200, 220, 255, .1);
  --hair-2: rgba(200, 220, 255, .17);
  --bg: #03060e;
  --bg-2: #08101f;
  --btn-primary: linear-gradient(180deg, #3a86ff, #0f45d0);
  --sig-1: #6cc4ff;
  --sig-2: #4c9dff;
  --ok: #4cd964;  --ok-fill: #30d158;
  --warn: #ffb340; --warn-fill: #ff9f0a;
  --bad: #ff6b61; --bad-fill: #ff453a;
  --mock: #9d9bff;
  --dark-card: radial-gradient(120% 90% at 0% 0%, rgba(92, 200, 246, .22), transparent 55%),
               linear-gradient(135deg, #142a5c 0%, #0a1430 60%, #13285a 100%);
  --glass: rgba(22, 32, 54, .55);
  --glass-strong: rgba(34, 46, 72, .72);
  --glass-edge: rgba(160, 200, 255, .14);
  --glass-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --glass-highlight: rgba(255, 255, 255, .07);
  --field-bg: rgba(8, 14, 28, .6);
  --tabbar-bg: rgba(14, 22, 40, .82);
  --sheet-bg: rgba(12, 19, 36, .94);
  --toast-bg: rgba(30, 42, 66, .92);
  --seg-on: rgba(80, 100, 140, .55);
  --grey-fill: rgba(140, 160, 200, .14);
  --track: rgba(160, 190, 255, .12);
  --press: rgba(160, 190, 255, .06);
  --skel-a: rgba(40, 56, 88, .35);
  --skel-b: rgba(70, 92, 135, .55);
  --brand-word: linear-gradient(180deg, #ffffff, #8fd3ff);
  --blob-opacity: .38;
  --grain-blend: screen;
  --aurora-a: #1d4fd6; --aurora-b: #3a2a9e; --aurora-c: #0b7fb8; --aurora-d: #1a1f6e;
}

:root[data-theme="dark"] body[data-mood="calm"]   { --aurora-a: #0d7a6a; --aurora-b: #1d4fd6; --aurora-c: #0b6f8a; --aurora-d: #1b2a74; }
:root[data-theme="dark"] body[data-mood="focus"]  { --aurora-a: #1f5cff; --aurora-b: #4a2bc4; --aurora-c: #0a8fd0; --aurora-d: #20208a; }
:root[data-theme="dark"] body[data-mood="alert"]  { --aurora-a: #a8322a; --aurora-b: #1d3fb0; --aurora-c: #8a2450; --aurora-d: #2a1f74; }
:root[data-theme="dark"] body[data-mood="sealed"] { --aurora-a: #157a3e; --aurora-b: #1a56c4; --aurora-c: #2f7a3a; --aurora-d: #1a2a74; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --ink: #f4f7fc;
    --ink-2: #d5ddea;
    --ink-3: #9aa7bc;
    --ink-4: #6d7a90;
    --hair: rgba(200, 220, 255, .1);
    --hair-2: rgba(200, 220, 255, .17);
    --bg: #03060e;
    --bg-2: #08101f;
    --btn-primary: linear-gradient(180deg, #3a86ff, #0f45d0);
    --sig-1: #6cc4ff;
    --sig-2: #4c9dff;
    --ok: #4cd964;  --ok-fill: #30d158;
    --warn: #ffb340; --warn-fill: #ff9f0a;
    --bad: #ff6b61; --bad-fill: #ff453a;
    --mock: #9d9bff;
    --dark-card: radial-gradient(120% 90% at 0% 0%, rgba(92, 200, 246, .22), transparent 55%),
                 linear-gradient(135deg, #142a5c 0%, #0a1430 60%, #13285a 100%);
    --glass: rgba(22, 32, 54, .55);
    --glass-strong: rgba(34, 46, 72, .72);
    --glass-edge: rgba(160, 200, 255, .14);
    --glass-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --glass-highlight: rgba(255, 255, 255, .07);
    --field-bg: rgba(8, 14, 28, .6);
    --tabbar-bg: rgba(14, 22, 40, .82);
    --sheet-bg: rgba(12, 19, 36, .94);
    --toast-bg: rgba(30, 42, 66, .92);
    --seg-on: rgba(80, 100, 140, .55);
    --grey-fill: rgba(140, 160, 200, .14);
    --track: rgba(160, 190, 255, .12);
    --press: rgba(160, 190, 255, .06);
    --skel-a: rgba(40, 56, 88, .35);
    --skel-b: rgba(70, 92, 135, .55);
    --brand-word: linear-gradient(180deg, #ffffff, #8fd3ff);
    --blob-opacity: .38;
    --grain-blend: screen;
    --aurora-a: #1d4fd6; --aurora-b: #3a2a9e; --aurora-c: #0b7fb8; --aurora-d: #1a1f6e;
  }

  :root[data-theme="system"] body[data-mood="calm"]   { --aurora-a: #0d7a6a; --aurora-b: #1d4fd6; --aurora-c: #0b6f8a; --aurora-d: #1b2a74; }
  :root[data-theme="system"] body[data-mood="focus"]  { --aurora-a: #1f5cff; --aurora-b: #4a2bc4; --aurora-c: #0a8fd0; --aurora-d: #20208a; }
  :root[data-theme="system"] body[data-mood="alert"]  { --aurora-a: #a8322a; --aurora-b: #1d3fb0; --aurora-c: #8a2450; --aurora-d: #2a1f74; }
  :root[data-theme="system"] body[data-mood="sealed"] { --aurora-a: #157a3e; --aurora-b: #1a56c4; --aurora-c: #2f7a3a; --aurora-d: #1a2a74; }
}

/* Dark-theme touches that tokens alone don't cover */
:root[data-theme="dark"] .dots i.on { background: var(--sig-2); }
:root[data-theme="dark"] .btn-light { background: rgba(255, 255, 255, .94); }
:root[data-theme="dark"] .dark { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(140, 190, 255, .16), 0 18px 40px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .slot.s-correct { background: rgba(76, 157, 255, .2); }
:root[data-theme="dark"] .sheet-scrim { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] .auth-orb, :root[data-theme="dark"] .art-orb { filter: drop-shadow(0 10px 30px rgba(47, 160, 255, .5)); }
:root[data-theme="dark"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa7bc' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
@media (prefers-color-scheme: dark) {

/* Dark-theme touches that tokens alone don't cover */
:root[data-theme="system"] .dots i.on { background: var(--sig-2); }
:root[data-theme="system"] .btn-light { background: rgba(255, 255, 255, .94); }
:root[data-theme="system"] .dark { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(140, 190, 255, .16), 0 18px 40px rgba(0, 0, 0, .5); }
:root[data-theme="system"] .slot.s-correct { background: rgba(76, 157, 255, .2); }
:root[data-theme="system"] .sheet-scrim { background: rgba(0, 0, 0, .55); }
:root[data-theme="system"] .auth-orb, :root[data-theme="system"] .art-orb { filter: drop-shadow(0 10px 30px rgba(47, 160, 255, .5)); }
:root[data-theme="system"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa7bc' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
:root[data-theme="system"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .blob { animation: none !important; }
}

@media (min-width: 700px) {
  .page { padding-top: 32px; }
}

/* ---------- Field evidence, missions ---------- */
.evidence { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.evidence-col { display: grid; gap: 6px; padding: 10px; border-radius: 14px; background: var(--field-bg); border: .5px solid var(--hair); min-width: 0; }
.evidence-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; margin: 0; width: 64px; }
.thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; display: block; background: var(--grey-fill); }
.thumb figcaption { margin-top: 3px; font-size: 10px; line-height: 1.25; color: var(--ink-3); }
.thumb.gps figcaption { color: var(--ok); }
.thumb-add { width: 64px; height: 64px; border-radius: 10px; display: grid; place-items: center; color: var(--sig-1); border: 1.5px dashed var(--hair-2); background: transparent; }
.thumb-add svg { width: 22px; height: 22px; }
.thumb-add:disabled { opacity: .7; }
.thumb-wrap { position: relative; }
.thumb-remove { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bad-fill); color: #fff; }
.thumb-remove svg { width: 14px; height: 14px; }
.spinner.sm { width: 12px; height: 12px; border-width: 2px; }
.row-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; }
.task { padding: 16px; animation: rise .4s var(--ease) both; }
.task-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.task-head strong { display: block; font-size: 16px; font-weight: 650; line-height: 1.3; }
.task-head small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 13px; }
.task-optional { font-weight: 500; font-size: 13px; }
.task-check { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--hair-2); color: #fff; transition: background .25s, border-color .25s; }
.task-check svg { width: 14px; height: 14px; stroke-width: 3; }
.task.done .task-check { background: var(--ok-fill); border-color: transparent; }
.task .segmented { margin-bottom: 0; }
.task .field { margin-top: 0; }
.task-section { margin-top: 22px; }
.task-section-help { margin: -4px 4px 10px; }
.counter { display: flex; align-items: center; gap: 10px; }
.counter input { flex: 1; min-height: 48px; text-align: center; font-size: 20px; font-weight: 700; border-radius: 12px; border: .5px solid var(--hair-2); background: var(--field-bg); color: var(--ink); font-variant-numeric: tabular-nums; }
.price-field { position: relative; }
.price-field input { padding-left: 34px; font-size: 18px; font-weight: 600; }
.price-field i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 700; color: var(--ink-3); }
.scale input[type="range"] { width: 100%; accent-color: var(--sig-1); }
.scale-labels { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.scale-labels strong { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.signature-pad { width: 100%; height: 180px; border-radius: 14px; background: #fff; border: .5px solid var(--hair-2); touch-action: none; display: block; }
.signature-done { display: flex; align-items: center; gap: 12px; }
.signature-done img { height: 64px; flex: 1; object-fit: contain; background: #fff; border-radius: 10px; border: .5px solid var(--hair); }
.hero-note { margin-top: 12px; font-size: 14px; line-height: 1.45; color: rgba(234, 247, 255, .78); }
.flag-list { display: grid; gap: 8px; margin-top: 14px; text-align: left; }
.notice { background: var(--grey-fill); }


/* =====================================================================
   FIELD CALM (light, from the Stitch design) + SPECTAIL (dark, the
   spectailintelligence.com look). Same layouts, two skins. White or
   black cards, black/white primary buttons, Inter, one priority code:
   red = do now, orange = today, grey = later, green = done.
   ===================================================================== */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --bg: #faf9fe; --bg-2: #faf9fe; --card: #ffffff; --card-2: #f4f3f8; --card-3: #eeedf3;
  --ink: #1a1b1f; --ink-2: #46464a; --ink-3: #77767b; --ink-4: #c7c6ca;
  --hair: #e9e7ed; --hair-2: #dad9df; --line: #e9e7ed;
  --primary: #030304; --on-primary: #ffffff;
  --now: #d92d20; --now-soft: #ffe4e1; --now-ink: #b42318;
  --today: #f79009; --today-soft: #fff3dc; --today-ink: #b54708;
  --later: #98989d; --later-soft: #eeedf3; --later-ink: #5d5e63;
  --done: #12b76a; --done-soft: #dcfae6; --done-ink: #067647;
  --link: #030304; --sig-1: #030304; --sig-2: #030304; --sig-3: #46464a;
  --ok: #12b76a; --ok-fill: #12b76a; --warn: #f79009; --warn-fill: #f79009; --bad: #d92d20; --bad-fill: #d92d20;
  --btn-primary: #030304; --grey-fill: #eeedf3; --seg-on: #ffffff; --track: #e9e7ed; --press: rgba(0,0,0,.04);
  --field-bg: #f4f3f8; --sheet-bg: #ffffff; --toast-bg: #1a1b1f; --toast-ink: #fff;
  --skel-a: #eeedf3; --skel-b: #f8f7fb; --brand-word: linear-gradient(180deg, #030304, #46464a);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --rail-bg: rgba(255,255,255,.9);
  --r-card: 20px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  --bg: #000; --bg-2: #000; --card: #0b0b0d; --card-2: #161617; --card-3: #1d1d1f;
  --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #6e6e73; --ink-4: #3a3a3c;
  --hair: rgba(255,255,255,.1); --hair-2: rgba(255,255,255,.16); --line: rgba(255,255,255,.1);
  --primary: #f5f5f7; --on-primary: #000;
  --now: #ff453a; --now-soft: rgba(255,69,58,.16); --now-ink: #ff6961;
  --today: #ff9f0a; --today-soft: rgba(255,159,10,.16); --today-ink: #ffb340;
  --later: #6e6e73; --later-soft: rgba(255,255,255,.08); --later-ink: #a1a1a6;
  --done: #30d158; --done-soft: rgba(48,209,88,.15); --done-ink: #4ade80;
  --link: #2997ff; --sig-1: #2997ff; --sig-2: #2997ff; --sig-3: #3ad1f0;
  --ok: #30d158; --ok-fill: #30d158; --warn: #ff9f0a; --warn-fill: #ff9f0a; --bad: #ff453a; --bad-fill: #ff453a;
  --btn-primary: #f5f5f7; --grey-fill: rgba(118,118,128,.24); --seg-on: #3a3a3c; --track: rgba(255,255,255,.1); --press: rgba(255,255,255,.06);
  --field-bg: #1d1d1f; --sheet-bg: #161617; --toast-bg: #f5f5f7; --toast-ink: #000;
  --skel-a: #111113; --skel-b: #1d1d1f; --brand-word: linear-gradient(180deg, #fff, #a1a1a6);
  --shadow: inset 0 0 0 .5px rgba(255,255,255,.1);
  --rail-bg: rgba(22,22,23,.86);
}
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { color-scheme: dark; --bg: #000; --card: #0b0b0d; --card-2: #161617; --card-3: #1d1d1f; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #6e6e73; --hair: rgba(255,255,255,.1); --line: rgba(255,255,255,.1); --primary: #f5f5f7; --on-primary: #000; --now-soft: rgba(255,69,58,.16); --today-soft: rgba(255,159,10,.16); --later-soft: rgba(255,255,255,.08); --done-soft: rgba(48,209,88,.15); --field-bg: #1d1d1f; --sheet-bg: #161617; --shadow: inset 0 0 0 .5px rgba(255,255,255,.1); --rail-bg: rgba(22,22,23,.86); --grey-fill: rgba(118,118,128,.24); --seg-on: #3a3a3c; } }

html, body { background: var(--bg); }
body { font-size: 15px; letter-spacing: -0.011em; color: var(--ink); }
.aurora, .grain { display: none; }
svg { stroke-width: 1.7; }
a, .btn-link { color: var(--link); }

/* Generic surfaces follow the theme */
.glass, .card, .dark, .list, .store, .ticket, .slot-task, .task, .queue {
  background: var(--card) !important; color: var(--ink) !important; border: 0 !important;
  box-shadow: var(--shadow) !important; border-radius: var(--r-card) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.dark .meta-line, .meta-line, .hero-note { color: var(--ink-3) !important; }
.hero .eyebrow, .dark .eyebrow, .eyebrow { color: var(--ink-3) !important; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.hero-orb { display: none; }
.dark .ring .track, .ring .track { stroke: var(--track); }
.dark .ring-label, .dark .ring-label small { color: var(--ink-2) !important; }
.head { margin: 4px 0 16px; }
.head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.head .sub { font-size: 14px; color: var(--ink-3); }
.section-h { margin: 26px 4px 10px; }
.section-h h2 { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.small, .muted, small { color: var(--ink-3); }
.list-row + .list-row::before { background: var(--hair); }
.btn { border-radius: 14px; font-weight: 600; letter-spacing: -.01em; }
.btn-primary, .btn-light, .btn-white { background: var(--primary) !important; color: var(--on-primary) !important; box-shadow: none !important; }
.btn-secondary, .btn-ghost-dark, .btn-clear { background: var(--card-2) !important; color: var(--ink) !important; border: 0 !important; }
.icon-btn { background: var(--card-2); color: var(--ink); border: 0; }
.avatar-btn { background: var(--primary) !important; color: var(--on-primary) !important; }
.tag.ok, .dark .tag.ok { color: var(--done-ink); background: var(--done-soft); }
.tag.warn, .dark .tag.warn { color: var(--today-ink); background: var(--today-soft); }
.tag.bad, .dark .tag.bad { color: var(--now-ink); background: var(--now-soft); }
.tag.muted, .tag.info, .dark .tag.muted { color: var(--ink-2); background: var(--later-soft); }
.chips button { background: var(--card-2); color: var(--ink-2); border: 0; }
.chips button.on { background: var(--primary); color: var(--on-primary); }
.segmented { background: var(--card-2); }
.segmented button.on { background: var(--seg-on); color: var(--ink); }
.field input, .field select, .field textarea, .search input, .counter input, .proof input[type="text"] { background-color: var(--field-bg); border: 0; color: var(--ink); box-shadow: none; }
.field select { background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 18px !important; }
.choice label span { background: var(--card-2); color: var(--ink); border: 0; }
.choice input:checked + span { background: var(--primary); color: var(--on-primary); }
.notice { background: var(--card-2); color: var(--ink); }
.notice.warn { background: var(--today-soft); color: var(--today-ink); }
.notice.bad { background: var(--now-soft); color: var(--now-ink); }
.sheet { background: var(--sheet-bg); color: var(--ink); }
.toast { background: var(--toast-bg); color: var(--toast-ink); }
.meter { background: var(--track); }
.page { padding-left: 16px !important; padding-right: 16px !important; padding-bottom: calc(40px + var(--safe-b)) !important; padding-top: calc(8px + var(--safe-t)) !important; }
.dock { bottom: calc(16px + var(--safe-b)) !important; }

/* ---------- Collapsible side rail (iPhone Duo) ----------
   Collapsed: a small handle on the right edge, taking no space.
   Tap the handle (or swipe in from the edge) and the rail slides over
   the page; picking a destination slides it away again. */
.tabbar { position: fixed !important; left: auto !important; bottom: auto !important; top: 50% !important; right: calc(10px + env(safe-area-inset-right, 0px)) !important;
  transform: translate(calc(100% + 24px), -50%) !important; width: 70px !important; height: auto !important;
  display: grid !important; grid-template-columns: 1fr !important; grid-auto-rows: 58px; gap: 2px; padding: 8px 6px !important; border-radius: 26px !important;
  background: var(--rail-bg) !important; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 12px 40px rgba(0,0,0,.18), inset 0 0 0 .5px var(--hair) !important; border: 0 !important; z-index: 41;
  transition: transform .45s var(--spring); }
body.rail-open .tabbar { transform: translate(0, -50%) !important; }
.tabbar button { min-height: 54px; border-radius: 18px; font-size: 10px; font-weight: 600; gap: 3px; color: var(--ink-3); position: relative; }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button.active { color: var(--ink); background: var(--card-2) !important; }
.tabbar .visit-orb { width: 42px; height: 42px; margin: 0 !important; background: var(--primary) !important; color: var(--on-primary); box-shadow: none !important; }
.tabbar .tab-visit.active { background: transparent !important; }
.tabbar .rail-badge { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--now); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.rail-handle { position: fixed; z-index: 40; right: 0; top: 50%; transform: translateY(-50%); width: 22px; height: 92px; border-radius: 14px 0 0 14px;
  background: var(--rail-bg); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 6px 24px rgba(0,0,0,.14), inset 0 0 0 .5px var(--hair);
  display: grid; place-items: center; color: var(--ink-3); transition: opacity .3s, transform .4s var(--spring); }
.rail-handle i { display: block; width: 4px; height: 34px; border-radius: 2px; background: var(--ink-4); }
.rail-handle b { position: absolute; top: 6px; left: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--now); }
body.rail-open .rail-handle { opacity: 0; transform: translate(10px, -50%); pointer-events: none; }
.rail-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .3s; }
body.rail-open .rail-scrim { opacity: 1; pointer-events: auto; }
body.reel-open .rail-handle { display: none; }

/* ---------- App bar ---------- */
.appbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; min-height: 48px; }
.appbar .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: -.04em; flex: none; }
.appbar .brand { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.appbar .title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.appbar .back { width: 36px; height: 36px; display: grid; place-items: center; margin-left: -8px; color: var(--ink); }
.appbar .me { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.hello h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12; }
.hello p { margin-top: 4px; color: var(--ink-2); font-size: 15px; }

/* ---------- Priority pieces ---------- */
.lv-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.lv-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lv-pill.now { color: var(--now-ink); background: var(--now-soft); } .lv-pill.today { color: var(--today-ink); background: var(--today-soft); }
.lv-pill.later { color: var(--later-ink); background: var(--later-soft); } .lv-pill.done { color: var(--done-ink); background: var(--done-soft); }
.tag-soft { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.tag-soft.now { color: var(--now-ink); background: var(--now-soft); } .tag-soft.today { color: var(--today-ink); background: var(--today-soft); }
.tag-soft.later { color: var(--later-ink); background: var(--later-soft); } .tag-soft.done { color: var(--done-ink); background: var(--done-soft); }
.dot-lv { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.dot-lv.now { background: var(--now); } .dot-lv.today { background: var(--today); } .dot-lv.later { background: var(--ink-4); } .dot-lv.done { background: var(--done); }
.chip-soft { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); padding: 5px 11px; border-radius: 999px; background: var(--card-2); white-space: nowrap; }
.chip-soft svg { width: 15px; height: 15px; }
.btn-big { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; border-radius: 16px; background: var(--primary); color: var(--on-primary); font-size: 17px; font-weight: 600; }
.btn-big svg { width: 20px; height: 20px; }
.btn-big.light { background: var(--card-2); color: var(--ink); }
.btn-text { display: block; width: 100%; text-align: center; padding: 14px; color: var(--ink-3); font-size: 16px; font-weight: 500; }

/* Do now card */
.now-card { position: relative; background: var(--card); border-radius: 22px; padding: 18px 18px 18px 22px; box-shadow: var(--shadow); overflow: hidden; margin-top: 18px; }
.now-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--now); }
.now-card.today::before { background: var(--today); } .now-card.later::before { background: var(--ink-4); } .now-card.done::before { background: var(--done); }
.now-card .top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.now-card .top .meta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); }
.now-card .top .meta svg { width: 15px; height: 15px; }
.now-card h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin-top: 14px; display: flex; justify-content: space-between; gap: 8px; }
.now-card h2 svg { width: 22px; height: 22px; color: var(--ink-3); flex: none; }
.now-card .task-line { display: block; font-size: 17px; font-weight: 500; margin-top: 4px; color: var(--ink); }
.now-card .why { font-size: 14px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }
.product-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 10px; border-radius: 16px; background: var(--card-2); }
.product-row .pic { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--card-3); display: grid; place-items: center; color: var(--ink-3); overflow: hidden; }
.product-row .pic img { width: 100%; height: 100%; object-fit: cover; }
.product-row .grow { flex: 1; min-width: 0; }
.product-row strong { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-row small { font-size: 12.5px; color: var(--ink-3); }
.product-row .units { font-size: 13px; font-weight: 600; color: var(--now-ink); white-space: nowrap; }
.shelf-photo { position: relative; margin: 16px 0; border-radius: 18px; overflow: hidden; background: var(--card-3); aspect-ratio: 16 / 7; }
.shelf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-photo .cap { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; justify-content: space-between; gap: 8px; }
.shelf-photo .cap span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.shelf-photo .cap svg { width: 14px; height: 14px; }
.shelf-photo.empty { display: grid; place-items: center; color: var(--ink-3); font-size: 13px; aspect-ratio: 16 / 6; }

/* Numbered list */
.list-h { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 6px 10px; }
.list-h h3 { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.list-h span { font-size: 13px; color: var(--ink-3); }
.rows { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.row-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 15px 16px; position: relative; }
.row-item + .row-item::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--hair); }
.row-item:active { background: var(--press); }
.row-item .n { width: 30px; height: 30px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); flex: none; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item strong { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item small { display: block; font-size: 14px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .chev { color: var(--ink-4); }
.row-item.is-done strong { text-decoration: line-through; color: var(--ink-3); }
.due.now { color: var(--now-ink); } .due.today { color: var(--today-ink); }
.summary-strip { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 18px; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.summary-strip span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.summary-strip b { color: var(--ink); }
.summary-strip i.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }

/* Search + filter chips */
.search-bar { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 46px; border-radius: 14px; background: var(--card-3); color: var(--ink-3); }
.search-bar input { flex: 1; border: 0; background: transparent; color: var(--ink); font-size: 16px; outline: none; min-width: 0; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 4px; padding: 2px 16px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 999px; background: var(--card-3); color: var(--ink); font-size: 14px; font-weight: 500; }
.filter-chips button.on { background: var(--primary); color: var(--on-primary); }
.group-h { display: flex; align-items: center; gap: 8px; margin: 22px 6px 10px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.group-h small { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.group-h.now { color: var(--now-ink); } .group-h.today { color: var(--today-ink); } .group-h.later { color: var(--ink-2); } .group-h.done { color: var(--done-ink); }
.pace { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 16px; border-radius: 20px; background: var(--card-2); }
.pace .ic { width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: grid; place-items: center; flex: none; }
.pace .grow { flex: 1; } .pace strong { font-size: 16px; } .pace small { display: block; font-size: 13px; color: var(--ink-3); }

/* ---------- Reels (Up next, missions, visit) ---------- */
body.reel-open .tabbar, body.reel-open .rail-scrim { display: none !important; }
.reel { position: fixed; inset: 0; height: var(--app-h); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; z-index: 30; background: var(--bg); scrollbar-width: none; }
.reel::-webkit-scrollbar { display: none; }
.slide { height: var(--app-h); scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; justify-content: center;
  padding: calc(70px + var(--safe-t)) 16px calc(52px + var(--safe-b)); max-width: 560px; margin: 0 auto; position: relative; }
.reel-top { position: fixed; top: 0; left: 0; right: 0; z-index: 31; padding: calc(10px + var(--safe-t)) 14px 12px; display: flex; align-items: center; gap: 12px; background: linear-gradient(var(--bg) 55%, transparent); }
.reel-close { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--ink); flex: none; }
.reel-title { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-progress { position: fixed; z-index: 32; left: 16px; right: 16px; top: calc(58px + var(--safe-t)); display: flex; gap: 4px; }
.reel-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--track); transition: background .3s; }
.reel-progress i.on { background: var(--primary); }
.reel-count { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.slide-card { position: relative; background: var(--card); border-radius: 28px; padding: 22px 20px; box-shadow: var(--shadow); overflow: hidden; animation: slide-rise .55s var(--ease) both; }
@keyframes slide-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.slide-card .head-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.slide-card .live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.slide-card .store-name { font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin-top: 16px; line-height: 1.15; }
.slide-card .chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.slide-card .label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 20px; }
.slide-card .action { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12; margin-top: 6px; }
.alert-box { display: flex; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 18px; background: var(--card-2); font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.alert-box .ic { width: 34px; height: 34px; border-radius: 50%; background: var(--now-soft); color: var(--now); display: grid; place-items: center; flex: none; }
.alert-box .ic svg { width: 18px; height: 18px; }
.alert-box b { color: var(--now-ink); }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.slot-chips span { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--now-soft); color: var(--now-ink); font-variant-numeric: tabular-nums; }
.peek { margin: 12px 18px 0; padding: 14px 18px; border-radius: 18px; background: var(--card-2); display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.peek span { display: inline-flex; align-items: center; gap: 8px; }
.swipe-hint { position: absolute; left: 0; right: 0; bottom: calc(16px + var(--safe-b)); display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); animation: hint 2s var(--ease) infinite; }
.swipe-hint svg { transform: rotate(90deg); width: 18px; height: 18px; }
@keyframes hint { 0%, 100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(-6px); opacity: 1; } }

/* Mission questions */
.q-store { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 4px 12px; }
.q-store svg { width: 18px; height: 18px; }
.task-slide .slide-card .label { margin-top: 0; }
.task-slide h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 8px 0 10px; }
.task-slide .help { font-size: 16px; color: var(--ink-3); margin: 0 0 16px; line-height: 1.4; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; border-radius: 20px; background: var(--card-2); }
.yn button { min-height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 19px; font-weight: 600; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.yn button.on { background: var(--primary); color: var(--on-primary); }
.yn button svg { width: 22px; height: 22px; }
.auto-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.auto-hint svg { width: 14px; height: 14px; }
.task-slide .counter { background: var(--card-2); border-radius: 20px; padding: 8px; }
.task-slide .counter .icon-btn { width: 52px; height: 52px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); }
.task-slide .counter input { background: transparent !important; font-size: 30px; font-weight: 700; min-height: 56px; }
.task-slide .price-field input { min-height: 64px; font-size: 26px; font-weight: 700; border-radius: 18px; }
.task-slide .choice label span { min-height: 52px; font-size: 16px; border-radius: 14px; }
.task-slide .thumbs { gap: 10px; }
.task-slide .thumb-add { width: 100%; height: 160px; border-radius: 20px; border: 2px dashed var(--hair-2); color: var(--ink-2); flex-direction: column; gap: 6px; font-weight: 600; }
.task-slide .thumb img { width: 96px; height: 96px; border-radius: 16px; }
.task-slide .thumb { width: 96px; }
.q-nav { position: fixed; z-index: 32; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b)); display: flex; align-items: center; gap: 12px; background: linear-gradient(transparent, var(--bg) 35%); }
.q-nav .prev { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 16px; font-weight: 500; padding: 0 10px; min-height: 52px; }
.q-nav .prev svg { transform: rotate(180deg); }
.q-nav .btn-big { flex: 1; }
.has-qnav .slide { padding-bottom: calc(96px + var(--safe-b)); }

/* Visit steps */
.steps-card { background: var(--card-2); border-radius: 20px; padding: 14px 16px; margin-bottom: 14px; }
.steps-card .row1 { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.steps-card .row1 span:last-child { color: var(--ink-3); font-weight: 500; }
.steps-card .bar { height: 6px; border-radius: 3px; background: var(--track); margin: 10px 0 12px; overflow: hidden; }
.steps-card .bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .4s var(--ease); }
.step-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.step-chips::-webkit-scrollbar { display: none; }
.step-chips span { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--card-3); color: var(--ink-3); }
.step-chips span.done { background: var(--done-soft); color: var(--done-ink); }
.step-chips span.cur { background: var(--primary); color: var(--on-primary); }
.step-chips svg { width: 14px; height: 14px; stroke-width: 2.4; }
.cam-tile { display: grid; place-items: center; gap: 8px; width: 100%; aspect-ratio: 4 / 3; border-radius: 22px; border: 2px dashed var(--hair-2); color: var(--ink-2); font-weight: 600; font-size: 16px; margin-top: 14px; background: var(--card-2); }
.cam-tile svg { width: 42px; height: 42px; }
.cam-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.visit-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--ink-3); padding: 0 4px; }

/* Photos */
.seg-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: var(--card-2); margin-bottom: 14px; }
.seg-tabs button { min-height: 38px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg-tabs button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.retake-card { border-radius: 22px; padding: 18px; background: var(--now-soft); margin-bottom: 18px; }
.retake-card .t { display: flex; gap: 12px; align-items: flex-start; }
.retake-card .t .ic { width: 38px; height: 38px; border-radius: 50%; background: rgba(217,45,32,.15); color: var(--now); display: grid; place-items: center; flex: none; font-weight: 800; }
.retake-card h3 { font-size: 18px; font-weight: 700; color: var(--now-ink); flex: 1; }
.retake-card p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.retake-card blockquote { margin: 14px 0; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.5); font-style: italic; font-size: 15px; color: var(--ink); }
:root[data-theme="dark"] .retake-card blockquote { background: rgba(255,255,255,.06); }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-tile { border-radius: 18px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.photo-tile .img { position: relative; aspect-ratio: 4 / 5; background: var(--card-3); }
.photo-tile .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .badge-v { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.92); color: #1a1b1f; }
.photo-tile .badge-v i { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; }
.photo-tile .badge-v.flag i { background: #d92d20; }
.photo-tile .ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 13px; }
.photo-tile .ov strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-tile .gps { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 12px; font-size: 12px; color: var(--ink-2); }
.photo-tile .gps span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-tile .gps svg { width: 14px; height: 14px; color: var(--done); flex: none; }
.photo-tile .gps.none svg { color: var(--now); }

/* Theme chooser */
.theme-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.theme-opt { border-radius: 22px; padding: 10px; border: 2px solid var(--hair-2); text-align: left; background: transparent; }
.theme-opt.on { border-color: var(--primary); }
.theme-opt .pv { border-radius: 14px; aspect-ratio: 3 / 4; padding: 10px; display: grid; gap: 7px; align-content: start; }
.theme-opt .pv i { display: block; height: 10px; border-radius: 5px; }
.theme-opt .pv b { display: block; height: 48px; border-radius: 10px; position: relative; overflow: hidden; }
.theme-opt .pv b::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #d92d20; }
.theme-opt .pv u { display: block; height: 18px; border-radius: 6px; }
.theme-opt.light .pv { background: #faf9fe; } .theme-opt.light .pv i { background: #1a1b1f; width: 60%; } .theme-opt.light .pv b { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); } .theme-opt.light .pv u { background: #030304; }
.theme-opt.dark .pv { background: #000; } .theme-opt.dark .pv i { background: #f5f5f7; width: 60%; } .theme-opt.dark .pv b { background: #161617; } .theme-opt.dark .pv u { background: #f5f5f7; }
.theme-opt .nm { display: block; margin: 10px 4px 2px; font-weight: 700; font-size: 16px; color: var(--ink); }
.theme-opt .ds { display: block; margin: 0 4px 4px; font-size: 13px; color: var(--ink-3); }
.img-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--ink-4); background: var(--card-3); } .img-fallback svg { width: 26px; height: 26px; } .summary-strip { font-size: 12.5px; }
.now-card .yn button { font-size: 16px; white-space: nowrap; gap: 8px; padding: 0 8px; }
.page.enter { animation: page-in .45s var(--ease) backwards; }
.page.push { animation: page-push .45s var(--ease) backwards; }
.page.reel-in { animation: reel-fade .3s ease backwards; }
@keyframes reel-fade { from { opacity: 0; } to { opacity: 1; } }
.chip-soft { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
