/* KudiCode member app.
   Layout & interaction modelled on modern money apps (clean surfaces, bold display type,
   pill actions, icon list rows, date-grouped activity, desktop sidebar).
   Brand per CLAUDE.md §2: forest green + gold #C9A84C; Georgia for display type
   (headings, balances). Body/UI text uses the system sans for legibility at small sizes. */

/* ------------------------------------------------------------------ tokens
   bare :root = light (the primary look). Dark = data-theme="dark", or "system" + OS dark. */
:root {
  --bg: #F3F5F1;
  --bg-deep: #E8EDE7;          /* inputs, wells */
  --surface: #FFFFFF;
  --surface-2: #E9EFE9;        /* tinted fills, hovers */
  --line: #DCE3DB;
  --ink: #0E2A1E;              /* forest ink */
  --text: #0E2A1E;
  --muted: #5C6C62;
  --gold: #C9A84C;             /* primary fill */
  --gold-ink: #0E2A1E;         /* text on gold */
  --gold-text: #82661A;        /* gold used as text on light surfaces (AA) */
  --gold-soft: rgba(201,168,76,0.18);
  --forest: #0E2A1E;
  --good: #1D7A45;
  --good-soft: rgba(29,122,69,0.12);
  --bad: #B23E28;
  --bad-soft: rgba(178,62,40,0.10);
  --shadow: 0 1px 2px rgba(14,42,30,0.05), 0 4px 16px rgba(14,42,30,0.05);
  --nav-bg: rgba(255,255,255,0.94);
  --radius: 20px;
  --display: Georgia, "Times New Roman", serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1F16; --bg-deep: #0E281C; --surface: #11301F; --surface-2: #183B29;
  --line: #224834; --ink: #F3EEDF; --text: #F3EEDF; --muted: #A2B4A8;
  --gold: #C9A84C; --gold-ink: #0E2A1E; --gold-text: #E3CC86; --gold-soft: rgba(201,168,76,0.16);
  --good: #7FD1A0; --good-soft: rgba(127,209,160,0.14); --bad: #F2A08F; --bad-soft: rgba(242,160,143,0.12);
  --shadow: none; --nav-bg: rgba(10,31,22,0.94);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0A1F16; --bg-deep: #0E281C; --surface: #11301F; --surface-2: #183B29;
    --line: #224834; --ink: #F3EEDF; --text: #F3EEDF; --muted: #A2B4A8;
    --gold: #C9A84C; --gold-ink: #0E2A1E; --gold-text: #E3CC86; --gold-soft: rgba(201,168,76,0.16);
    --good: #7FD1A0; --good-soft: rgba(127,209,160,0.14); --bad: #F2A08F; --bad-soft: rgba(242,160,143,0.12);
    --shadow: none; --nav-bg: rgba(10,31,22,0.94);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-text); }
svg { flex: 0 0 auto; }
.noscript { padding: 24px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

#app {
  max-width: 520px; margin: 0 auto; min-height: 100vh;
  padding: 20px 16px calc(104px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.screen { display: flex; flex-direction: column; gap: 18px; flex: 1; animation: rise .22s ease-out; }
.screen.center { justify-content: center; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1, h2, .display { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(34px, 8vw, 48px); line-height: 1.05; margin: 4px 0 0; }
h2 { font-size: 28px; line-height: 1.15; margin: 0; }
h3 { font-size: 17px; margin: 0; font-weight: 650; color: var(--ink); }
p { margin: 0; }
.lede { color: var(--muted); font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.gold { color: var(--gold-text); }
.good { color: var(--good); }
.mono { font-family: var(--mono); }
.center { text-align: center; }

/* ------------------------------------------------------------------ brand */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; display: block; flex: 0 0 auto; object-fit: contain; }
.hero-mark { width: 88px; height: 88px; display: block; }
.brand-name { font-family: var(--display); font-size: 21px; font-weight: 700; }
.brand-name b { color: var(--gold-text); }

/* ------------------------------------------------------------------ buttons */
.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 14px 22px; min-height: 50px;
  font-size: 16px; font-weight: 650; cursor: pointer; width: 100%; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .06s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg, .notice-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover:not(:disabled) { background: #D4B55C; }
.btn-ghost { background: var(--gold-soft); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: rgba(201,168,76,0.28); }
.btn-link { background: none; border: 0; color: var(--gold-text); padding: 6px 0; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 12px; }
.back {
  align-self: flex-start; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink); display: grid; place-items: center; padding: 0;
}
.back svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.back:hover { background: var(--gold-soft); }

/* pill row (home actions) */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; cursor: pointer;
  padding: 11px 18px; font-weight: 650; font-size: 15px; background: var(--gold-soft); color: var(--ink);
}
.pill.primary { background: var(--gold); color: var(--gold-ink); }
.pill svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.pill:hover { filter: brightness(0.97); }

/* ------------------------------------------------------------------ forms */
form { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.input {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 17px; width: 100%; color: var(--text); font-weight: 400;
  transition: border-color .15s ease;
}
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input.code { font-family: var(--mono); letter-spacing: 0.5em; text-align: center; font-size: 26px; }
.input.ref { font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.4; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; padding: 10px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.error { background: var(--bad-soft); color: var(--bad); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.notice { background: var(--gold-soft); border-radius: 14px; padding: 12px 14px; font-size: 15px; color: var(--ink); border: 0; }
.notice-btn { width: 100%; text-align: left; cursor: pointer; font: inherit; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; }

.amount-input { display: flex; align-items: center; gap: 0; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding-right: 16px; }
.amount-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.amount-input .input { border: 0; box-shadow: none; background: transparent; }
.amount-input span { color: var(--ink); font-size: 17px; font-weight: 700; }
.big-num { font-size: 34px !important; font-family: var(--display); font-weight: 700; }

fieldset.source { border: 1.5px solid var(--line); border-radius: 16px; padding: 6px 14px 10px; margin: 0; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
fieldset.source legend { color: var(--muted); font-size: 13px; padding: 0 6px; font-weight: 600; }
fieldset.source .btn-link { align-self: flex-start; }
.radio { flex-direction: row; align-items: center; gap: 12px; color: var(--text); font-weight: 500; font-size: 16px; padding: 8px 0; cursor: pointer; }
.radio.disabled { color: var(--muted); cursor: default; }
.radio input { accent-color: var(--gold); width: 20px; height: 20px; flex: 0 0 20px; }
.radio span { line-height: 1.4; }

/* PIN dots */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 8px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }

/* ------------------------------------------------------------------ cards & lists */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 6px; }
.section-head h3 { font-size: 20px; font-family: var(--display); }
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.item-btn { width: calc(100% + 16px); margin: 0 -8px; padding: 12px 8px; background: none; border: 0; border-radius: 14px; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.item-btn:hover { background: var(--surface-2); }
.ico, .item .ico {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 16px; position: relative;
}
.ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.ico.in { background: var(--good-soft); color: var(--good); }
.ico.gold { background: var(--gold-soft); color: var(--gold-text); }
.item .meta { flex: 1; min-width: 0; }
.item .meta > p:first-child { font-weight: 650; }
.item .meta p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta .note { color: var(--text); opacity: 0.85; }
.item .meta p.when { white-space: normal; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.amt { font-weight: 700; font-size: 16px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.amt.in { color: var(--good); }
.amt small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 3px; }
.chev { color: var(--muted); display: grid; place-items: center; }
.chev svg, .item > svg { width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 2; }
.day { font-size: 13px; font-weight: 700; color: var(--muted); padding: 14px 0 2px; letter-spacing: 0.02em; }
.list > .day:first-child { padding-top: 0; }
.tag { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.gold-tag { background: var(--gold-soft); color: var(--gold-text); margin-left: 4px; }
.empty { color: var(--muted); text-align: center; padding: 22px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { width: 34px; height: 34px; stroke: var(--muted); fill: none; stroke-width: 1.6; opacity: .7; }
.soon { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

/* ------------------------------------------------------------------ welcome */
.hero { display: flex; flex-direction: column; gap: 16px; padding: 18px 0 4px; }
.hero h1 .gold { color: var(--gold-text); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.pillar { background: var(--surface); border-radius: 18px; padding: 16px 10px; text-align: center; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pillar .ico { background: var(--gold-soft); color: var(--gold-text); }
.welcome-points { display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------------------------------------------ home */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hello { display: flex; align-items: center; gap: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--forest); color: var(--gold);
  display: grid; place-items: center; border: 0; cursor: pointer; font-weight: 700; font-size: 16px; position: relative;
}
:root[data-theme="dark"] .avatar { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .avatar { background: var(--surface-2); } }
.avatar.icon { background: var(--surface-2); color: var(--ink); }
.avatar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.avatar .badge { position: absolute; top: -3px; right: -3px; }
.avatar.big { width: 76px; height: 76px; font-size: 26px; font-family: var(--display); }

.balance { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 2px; }
.balance-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 15px; }
.eye { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.eye svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.eye:hover { background: var(--surface-2); }
.balance .amount { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 11vw, 60px); line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); word-break: break-all; font-variant-numeric: tabular-nums; }
.balance .amount small { font-size: 0.42em; color: var(--muted); margin-left: 8px; letter-spacing: 0; font-family: var(--font); font-weight: 650; }
.balance .pills { margin-top: 14px; }
.kyc-link { align-self: flex-start; text-align: left; text-decoration: none; padding: 2px 0; font-size: 14px; }
.verified { display: inline-flex; align-items: center; gap: 6px; color: var(--good); font-weight: 600; font-size: 14px; }
.verified svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; }

.shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 600; padding: 4px 0; position: relative; }
.shortcut .ico { background: var(--surface); box-shadow: var(--shadow); }
.shortcut:hover .ico { background: var(--gold-soft); }
.shortcut .badge { position: absolute; top: -2px; right: calc(50% - 30px); }

.task { display: flex; align-items: center; gap: 14px; }
.task .meta { flex: 1; min-width: 0; }
.task .meta p:first-child { font-weight: 650; }

.home-grid { display: flex; flex-direction: column; gap: 18px; }
.home-side { display: flex; flex-direction: column; gap: 18px; }

/* invite */
.code-box { font-family: var(--mono); font-size: 28px; letter-spacing: 0.16em; text-align: center; padding: 20px; border-radius: 18px; color: var(--ink); background: var(--gold-soft); user-select: all; font-weight: 700; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }

/* ------------------------------------------------------------------ navigation */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  display: flex; justify-content: center;
}
.nav .brand, .nav .side-only { display: none; }
.nav-inner { width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(5, 1fr); }
.nav-item { background: none; border: 0; color: var(--muted); padding: 6px 2px; cursor: pointer; font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 14px; }
.nav-item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.nav-item[aria-current="page"] { color: var(--ink); }
.nav-item[aria-current="page"] svg { stroke-width: 2.4; }
.nav-item.send-btn svg { background: var(--gold); color: var(--gold-ink); border-radius: 50%; padding: 6px; width: 36px; height: 36px; margin-top: -4px; }
.nav-item.send-btn { color: var(--ink); }

/* ------------------------------------------------------------------ status & receipts */
.status { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 0 4px; }
.tick { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }
.tick svg { width: 38px; height: 38px; stroke: currentColor; fill: none; stroke-width: 2.6; }
.tick.pending { background: var(--gold-soft); color: var(--gold-text); }
.tick.bad { background: var(--bad-soft); color: var(--bad); }
.amount-lg { font-size: 40px; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.amount-lg small { font-size: 17px; color: var(--muted); font-family: var(--font); font-weight: 650; }
.summary { gap: 2px; }
.summary .row { padding: 9px 0; }
.summary .row > span:first-child { flex: 0 0 auto; }
.summary .row > span:last-child { text-align: right; overflow-wrap: anywhere; font-weight: 600; }
.summary .row .muted { font-weight: 400; }
.summary .strong { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; font-size: 17px; }
.summary .strong:first-child { border-top: 0; margin-top: 0; padding-top: 4px; }
.summary h3 { margin-bottom: 4px; }
.pay-steps .row { padding: 9px 0; }
.pay-steps .row > span:last-child { display: flex; align-items: center; gap: 8px; text-align: right; font-weight: 600; }
.pay-steps .strong { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; font-size: 17px; }

.payee { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.payee p:first-child { font-weight: 650; }
.ico.big { flex: 0 0 52px; width: 52px; height: 52px; font-size: 20px; background: var(--forest); color: var(--gold); }

.req-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.req-actions { display: flex; gap: 6px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.chip:disabled { opacity: 0.5; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface); border: 0; border-radius: 18px; cursor: pointer; color: var(--ink); font-size: 15px; font-weight: 650; box-shadow: var(--shadow); text-align: left; }
.choice svg { width: 26px; height: 26px; stroke: var(--gold-text); fill: none; stroke-width: 1.9; }
.choice:hover { background: var(--surface-2); }

.qr-frame { align-self: center; padding: 16px; border-radius: 24px; background: #FFFFFF; box-shadow: var(--shadow); border: 1px solid var(--line); }
.qr-frame img { display: block; width: 240px; height: 240px; max-width: 70vw; max-height: 70vw; }
.scanner { position: relative; border-radius: 24px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-box { position: absolute; inset: 18%; border: 3px solid var(--gold); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,0.4); }

/* ------------------------------------------------------------------ profile, security, help */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 6px 0; }
.profile-head .kyc-link, .profile-head .verified { align-self: center; }
.inline-form { flex-direction: row; align-items: flex-end; gap: 10px; }
.inline-form label { flex: 1; min-width: 0; }
.inline-form .chip { padding: 13px 18px; margin-bottom: 2px; }
.link-row .meta > p:first-child { font-weight: 650; }

.switch-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; color: var(--text); padding: 8px 0; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-label { font-size: 16px; font-weight: 600; }
.switch { appearance: none; flex: 0 0 50px; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s ease; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s ease; }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }

.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-text); font-size: 22px; line-height: 1; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 8px; font-size: 15px; }

.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 88%; border-radius: 18px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.bubble.mine { align-self: flex-end; background: var(--gold-soft); border-bottom-right-radius: 6px; }
.bubble.staff { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* identity verification */
.step { font-size: 13px; color: var(--gold-text); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.progress i.on { background: var(--gold); }
.checklist { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.checklist li { padding-left: 28px; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--good-soft); }
.checklist li::after { content: ""; position: absolute; left: 6px; top: 6px; width: 5px; height: 8px; border: solid var(--good); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.privacy { line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; }
.privacy svg { width: 20px; height: 20px; stroke: var(--good); fill: none; stroke-width: 2; margin-top: 1px; }
.photo-box { border: 2px dashed var(--line); border-radius: 20px; aspect-ratio: 1.586 / 1; overflow: hidden; display: grid; place-items: center; background: var(--surface); }
.photo-box.selfie { aspect-ratio: 1 / 1; width: 72%; align-self: center; border-radius: 50%; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-ph svg { width: 64px; height: 64px; stroke: var(--muted); fill: none; stroke-width: 1.4; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.thumb { background: var(--surface); border: 0; box-shadow: var(--shadow); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }
.thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; display: block; }

/* ramp & distributor console */
.tag.st-pending { background: var(--gold-soft); color: var(--gold-text); }
.tag.st-completed { background: var(--good-soft); color: var(--good); }
.tag.st-declined, .tag.st-failed { background: var(--bad-soft); color: var(--bad); }
.tag.st-expired, .tag.st-cancelled { background: var(--surface-2); color: var(--muted); }
.countdown { text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); margin: 0; font-weight: 600; }
.countdown.urgent { color: var(--bad); }
.stock { background: var(--forest); color: #F3EEDF; border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.stock .amount { font-family: var(--display); font-size: 40px; font-weight: 700; color: #F3EEDF; }
.stock .amount small { font-size: 16px; color: var(--gold); margin-left: 6px; font-family: var(--font); }
.stock p, .stock h3 { color: #C5D1C8; }
.restock { display: flex; flex-direction: column; gap: 8px; }
.restock .meter { position: relative; overflow: visible; }
.restock .meter i { position: absolute; left: 90%; top: -4px; bottom: -4px; width: 2px; background: var(--muted); }
.restock form { display: flex; flex-direction: column; gap: 10px; }
.alert-row.unread .meta > p:first-child::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: middle; }
.alert-row .meta p { margin: 2px 0; white-space: normal; overflow: visible; text-overflow: clip; }

/* ------------------------------------------------------------------ feedback */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: rise .2s ease-out;
}
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.sk { display: block; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-title { height: 28px; width: 45%; }
.sk-hero { height: 64px; width: 75%; }
.sk-pills { height: 44px; width: 90%; border-radius: 999px; }
.sk-row { height: 58px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ footer (logged out) */
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 13px; color: var(--muted); padding-top: 8px; }

/* ------------------------------------------------------------------ wide screens: sidebar */
@media (min-width: 960px) {
  body.with-nav #app { margin-left: 272px; margin-right: auto; max-width: 920px; padding: 36px 48px 48px; }
  body:not(.with-nav) #app { padding-top: 48px; }
  .nav {
    top: 0; bottom: 0; right: auto; width: 248px; flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 1px solid var(--line); padding: 28px 16px; gap: 28px; background: var(--surface);
    backdrop-filter: none;
  }
  .nav .brand { display: flex; padding: 0 10px; }
  .nav .side-only { display: flex; }
  .nav-inner { display: flex; flex-direction: column; gap: 4px; max-width: none; }
  .nav-item { flex-direction: row; gap: 14px; font-size: 16px; padding: 12px 14px; color: var(--ink); justify-content: flex-start; }
  .nav-item:hover { background: var(--surface-2); }
  .nav-item[aria-current="page"] { background: var(--gold-soft); }
  .nav-item.send-btn { order: -1; background: var(--gold); color: var(--gold-ink); justify-content: center; margin-bottom: 14px; }
  .nav-item.send-btn svg { background: none; padding: 0; width: 22px; height: 22px; margin: 0; color: inherit; }
  .nav-item.send-btn:hover { background: #D4B55C; }
  .toast { bottom: 32px; }
  .home-grid.wide { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
  .shortcuts { grid-template-columns: repeat(4, 1fr); }
  h2 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .toast { animation: none; }
  .sk { animation: none; }
  .spinner { animation-duration: 3s; }
  .btn, .switch, .switch::after { transition: none; }
}
