:root {
  --bg: #f5f5f2;
  --panel: #ffffff;
  --ink: #16171a;
  --muted: #6b6e76;
  --line: #e6e5df;
  --side: #121316;
  --side-ink: #c9cad0;
  --accent: #ffe14a;
  --accent-ink: #1a1700;
  --accent-soft: #fff7c7;
  --good: #1f8a4c;
  --good-soft: #e3f5ea;
  --bad: #c2362b;
  --bad-soft: #fbe7e5;
  --warn: #a86400;
  --warn-soft: #fff0d6;
  --info: #2b5fc2;
  --info-soft: #e6eefc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 10, .04), 0 2px 8px rgba(20, 20, 10, .04);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 240px, var(--bg) 240px); }
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 18px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: #1d1f24; color: #fff; }
.nav a.on { background: #24262c; color: #fff; }
.nav a.cta { background: var(--accent); color: var(--accent-ink); font-weight: 650; margin: 4px 0 10px; }
.nav a.cta:hover { filter: brightness(.96); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; border-top: 1px solid #24262c; padding: 14px 10px 0; font-size: 13px; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot button { background: none; border: 0; color: var(--side-ink); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.topbar, .tabbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }


/* ---------- components ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: 1fr 1fr; } }
.stack > * + * { margin-top: 16px; }

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat.hl { background: var(--accent); border-color: #f0cf2a; }
.stat.hl .label, .stat.hl .sub { color: #5c5100; }

.balance { padding: 22px; background: var(--side); color: #fff; border: 0; }
.balance .label { color: #a9abb3; font-size: 13px; }
.balance .value { font-size: 40px; font-weight: 750; letter-spacing: -.03em; margin: 4px 0 14px; font-variant-numeric: tabular-nums; }
.bar { height: 10px; border-radius: 99px; background: #2a2c33; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.card .bar { background: #efeee8; }
.balance .meta { display: flex; justify-content: space-between; font-size: 13px; color: #a9abb3; margin-top: 8px; gap: 10px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 15px; border-radius: 9px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #fafaf7; }
.btn.primary { background: var(--accent); border-color: #ecc91e; color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.97); }
.btn.dark { background: var(--side); border-color: var(--side); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: #fff; border-color: #efc1bc; color: var(--bad); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #efeee8; color: #45474d; white-space: nowrap; }
.badge.accent { background: var(--accent); color: var(--accent-ink); }
.badge.good, .badge.approved, .badge.paid, .badge.active { background: var(--good-soft); color: var(--good); }
.badge.bad, .badge.rejected, .badge.banned { background: var(--bad-soft); color: var(--bad); }
.badge.warn, .badge.pending, .badge.requested, .badge.locked { background: var(--warn-soft); color: var(--warn); }
.badge.info, .badge.handed_over { background: var(--info-soft); color: var(--info); }
.badge.retired { background: #ececec; color: #777; }
.nav .badge { background: var(--accent); color: var(--accent-ink); }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.flash.success { background: var(--good-soft); color: #145c33; border-color: #c4e8d2; }
.flash.error { background: var(--bad-soft); color: #8b231b; border-color: #f2c9c4; }
.flash.info { background: var(--info-soft); color: #1d438c; border-color: #ccdaf6; }
.notice { padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); border: 1px solid #f3e39a; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #fbfbf8; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d9d8d0; border-radius: 9px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: #d6b500; }
input[type=file] { font: inherit; width: 100%; padding: 10px; border: 1px dashed #cfcdc2; border-radius: 9px; background: #fcfcf9; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 160px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--ink); }
.tabs .count { font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1000px 500px at 50% -10%, #fff6bf 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 400px; padding: 30px; }
.auth-card .brand { color: var(--ink); padding: 0 0 22px; justify-content: center; font-size: 18px; }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }

/* ---------- reviews ---------- */
.review { display: grid; grid-template-columns: 170px 1fr; gap: 18px; padding: 18px; }
.review + .review { border-top: 1px solid var(--line); }
.review .shot { width: 170px; height: 240px; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; background: #f0f0ea; }
.review .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.review .fact { background: #fafaf6; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.review .fact .k { font-size: 12px; color: var(--muted); }
.review .fact .v { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.flags { list-style: none; padding: 0; margin: 8px 0; }
.flags li { background: var(--warn-soft); color: #7a4800; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.flags li::before { content: "⚠ "; }
@media (max-width: 700px) {
  .review { grid-template-columns: 1fr; }
  .review { padding: 16px; gap: 14px; }
  .review .shot { width: 100%; height: 220px; }
  .review .inline-form { width: 100%; }
  .review .inline-form input { flex: 1; width: auto !important; }
  .review .btn-row > .btn { width: 100%; }
  .review .facts { grid-template-columns: 1fr 1fr; }
}

/* ---------- resources ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.res-img { overflow: hidden; }
.res-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: #f0f0ea; cursor: zoom-in; border-bottom: 1px solid var(--line); }
.res-img .card-body { padding: 12px 14px; }
.copy-text { white-space: pre-wrap; background: #fafaf6; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; margin: 10px 0; font-size: 14.5px; }
.cat-title { font-size: 15px; color: var(--ink); font-weight: 700; margin: 26px 2px 10px; }
.cat-title:first-child { margin-top: 0; }
.guide { padding: 0; }
.guide summary { padding: 16px 20px; cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "+"; font-size: 20px; color: var(--muted); }
.guide[open] summary::after { content: "–"; }
.guide[open] summary { border-bottom: 1px solid var(--line); }
.prose { padding: 16px 20px; }
.prose h1, .prose h2, .prose h3 { margin: 18px 0 8px; }
.prose h1:first-child, .prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 10px; }
.prose li { margin-bottom: 4px; }
.prose code { background: #f1f0ea; padding: 1px 5px; border-radius: 5px; }
.prose blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: #fffbe3; }

/* ---------- misc ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.rank { width: 24px; height: 24px; border-radius: 50%; background: #efeee8; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; margin-right: 10px; flex: none; }
.rank.r1 { background: var(--accent); }
.me { background: var(--accent-soft); }
.chart-box { position: relative; height: 240px; padding: 10px 16px 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.lightbox { position: fixed; inset: 0; background: rgba(10, 10, 10, .88); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; cursor: zoom-out; }
.lightbox.on { display: flex; }
.lightbox img { max-height: 100%; max-width: 100%; border-radius: 8px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.hide { display: none !important; }
.est { font-size: 14px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid #f3e39a; margin-bottom: 14px; }
.est b { font-size: 18px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* ---------- mobile ---------- */
.chip { background: #24262c; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.upload { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 2px dashed #d6d3c4; border-radius: 12px; background: #fcfcf8; padding: 18px; text-align: center; cursor: pointer; font-weight: 600; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload .u-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; font-size: 22px; }
.upload.has-file { border-style: solid; border-color: #e6c62a; background: var(--accent-soft); }
.upload img { max-height: 220px; border-radius: 10px; border: 1px solid var(--line); }
.install-tip { display: none; }
.install-tip.on { display: flex; }
.only-m { display: none; }

@media (max-width: 900px) {
  body { font-size: 15.5px; }
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 82%; max-width: 300px; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; height: 100%; overflow-y: auto; padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  body.nav-open { overflow: hidden; }
  .nav a { padding: 12px 10px; font-size: 16px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--side); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; position: sticky; top: 0; z-index: 40; }
  .topbar .brand { padding: 0; font-size: 17px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--side); border-top: 1px solid #24262c; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8d8f97; text-decoration: none; font-size: 11px; font-weight: 600; padding: 4px 0; -webkit-tap-highlight-color: transparent; }
  .tabbar a.on { color: #fff; }
  .tabbar .ti { position: relative; display: grid; place-items: center; width: 26px; height: 26px; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar .dot { position: absolute; top: -5px; right: -10px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; }
  .tabbar a.big .ti { width: 52px; height: 52px; margin-top: -24px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px rgba(255, 225, 74, .35), 0 0 0 5px var(--side); }
  .tabbar a.big .ti svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .tabbar a.big { color: #fff; }
  .main { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  .page-head .btn.primary { display: none; }
  .only-m { display: block; }
  h1 { font-size: 23px; }
  /* 16px inputs stop iOS from zooming in on focus */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea { font-size: 16px; padding: 12px 13px; }
  .btn { padding: 11px 16px; font-size: 15px; }
  .btn.sm { padding: 8px 12px; font-size: 13.5px; }
  .card-head, .card-body { padding-left: 16px; padding-right: 16px; }
  .list li { padding-left: 16px; padding-right: 16px; }
  .balance { padding: 20px 18px; }
  .balance .value { font-size: 36px; }
  .flash { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 30; box-shadow: var(--shadow); }
}

@media (max-width: 640px) {
  .stat { padding: 13px 14px; }
  .stat .value { font-size: 21px; }
  .stat .label, .stat .sub { font-size: 12px; }
  .g3.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .g3.mini .stat { padding: 11px 10px; }
  .g3.mini .stat .value { font-size: 17px; }
  .chart-box { height: 200px; padding: 8px 8px 10px; }
  .filters input, .filters select { min-width: 0; flex: 1 1 140px; }
  .tabs a { padding: 10px 12px; }

  /* Tables become stacked cards; labels come from the header row (set in app.js). */
  table.rt, table.rt tbody { display: block; }
  table.rt tr:has(th) { display: none; }
  table.rt tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
  table.rt tr:last-child { border-bottom: 0; }
  table.rt td { display: block; border: 0; padding: 0; text-align: left; min-width: 0; }
  table.rt td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 1px; }
  table.rt td:first-child, table.rt td:not([data-label]), table.rt td.full { grid-column: 1 / -1; }
  table.rt td:first-child::before { display: none; }
  table.rt td:first-child { font-size: 16px; }
  table.rt td:not([data-label]) .inline-form, table.rt td:not([data-label]) .btn-row { justify-content: flex-start !important; }
  table.rt td:not([data-label]):empty { display: none; }
  table.rt tr:has(td:first-child .thumb) { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); }
  table.rt td:first-child:has(.thumb) { grid-column: 1; grid-row: 1 / span 6; }
  table.rt tr:has(td:first-child .thumb) td:not([data-label]):not(:first-child) { grid-column: 2 / -1; }
  table.rt .thumb { width: 64px; height: 96px; object-position: top; }
  table.rt .inline-form input { width: 100% !important; }
  table.rt .inline-form .btn { flex: 1; }
  .table-wrap { overflow: visible; }
}

.brand-logo { width: 32px; height: 32px; border-radius: 50%; flex: none; display: block; }
.auth { background: radial-gradient(900px 500px at 50% -10%, #3a3305 0%, #121316 55%); }
.auth-logo { display: block; width: 140px; height: 140px; margin: -4px auto 14px; border-radius: 50%; box-shadow: 0 0 40px rgba(255, 225, 74, .25); }

/* ================= v2: app-style lists & sections ================= */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 2px 10px; }
.sec-head h2 { font-size: 17px; }
.sec-head a { font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.sec-head:first-child { margin-top: 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 62px; }
.rows > :last-child, .rows > :last-child .row { border-bottom: 0; }
a.row { -webkit-tap-highlight-color: transparent; }
a.row:hover { background: #fbfbf7; }
a.row:active { background: #f4f3ec; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 650; font-size: 15.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.row-side { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-side .amt { font-weight: 700; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.row .thumb { width: 44px; height: 58px; flex: none; object-position: top; }
.row-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: #6b5a00; display: grid; place-items: center; font-weight: 750; flex: none; font-size: 15px; }
.row-avatar.dark { background: var(--side); color: var(--accent); }
a.row .chev { flex: none; color: #b9b8b0; margin-left: -4px; }
.row .btn { flex: none; }
.row.is-done .row-title { color: var(--muted); }

.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.strip > div { padding: 14px 16px; }
.strip > div + div { border-left: 1px solid var(--line); }
.strip .v { font-size: 20px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.strip .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.3; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; margin: 0 -2px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; padding: 8px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; color: #45474d; }
.chips a.on { background: var(--side); border-color: var(--side); color: #fff; }
.chips .count { opacity: .6; margin-left: 4px; font-weight: 500; }

.hero-bal { background: var(--side); color: #fff; border-radius: 18px; padding: 20px; position: relative; overflow: hidden; }
.hero-bal .k { font-size: 13.5px; color: #a9abb3; }
.hero-bal .v { font-size: 42px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 4px 0 16px; font-variant-numeric: tabular-nums; }
.hero-bal .bar { height: 12px; background: #2a2c33; }
.hero-bal .msg { margin-top: 10px; font-size: 14px; color: #d8d9de; }
.hero-bal .msg b { color: var(--accent); }
.hero-bal .fine { margin-top: 4px; font-size: 12.5px; color: #8d8f97; }
.hero-bal .btn { margin-top: 14px; }
.hero-bal::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 225, 74, .16), transparent); pointer-events: none; }

.tip { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); margin-bottom: 14px; font-size: 14px; }
.tip .x { margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1; color: var(--muted); padding: 4px 6px; cursor: pointer; }

.choice { display: grid; gap: 8px; }
.choice label { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 600; font-size: 15.5px; }
.choice label .sub { display: block; font-weight: 400; color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.choice input { width: 20px; height: 20px; accent-color: #1a1700; flex: none; margin: 0; }
.choice label:has(input:checked) { border-color: #1a1700; background: var(--accent-soft); }
.big-input { font-size: 28px !important; font-weight: 750; letter-spacing: -.02em; padding: 14px 16px !important; font-variant-numeric: tabular-nums; }
.step-label { font-weight: 700; font-size: 15.5px; margin: 0 0 8px; display: block; }
.form-step + .form-step { margin-top: 22px; }
.sticky-cta { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(to top, var(--bg) 70%, rgba(245, 245, 242, 0)); margin-top: 18px; z-index: 5; }
.sticky-cta .btn { width: 100%; padding: 15px; font-size: 16.5px; border-radius: 12px; }

.copy-card .copy-text { font-size: 15.5px; line-height: 1.55; }
.copy-card .btn { width: 100%; }

.empty-state { padding: 34px 22px; text-align: center; }
.empty-state p { color: var(--muted); margin: 6px 0 14px; }

@media (max-width: 900px) {
  .tabbar { padding-top: 8px; }
  .tabbar a { font-size: 11.5px; }
  .sticky-cta { bottom: calc(70px + env(safe-area-inset-bottom)); }
  .page-head p { font-size: 14.5px; }
  .row { padding: 13px 14px; }
  .sec-head { margin-top: 24px; }
  .main > .card, .main .stack > .card { border-radius: 16px; }
}
@media (max-width: 380px) {
  .hero-bal .v { font-size: 36px; }
  .strip .v { font-size: 17px; }
  .strip > div { padding: 12px; }
}

.approve-form { margin-top: 14px; }
.approve-row { display: flex; gap: 8px; }
.approve-row input { flex: 1; min-width: 0; font-size: 18px !important; font-weight: 700; }
.approve-row .btn { flex: none; padding-left: 22px; padding-right: 22px; }
@media (max-width: 700px) { .review .shot { height: 320px; } }

.staging-bar { background: repeating-linear-gradient(-45deg, #ffe14a 0 14px, #ffd60a 14px 28px); color: #1a1700; text-align: center; font-weight: 700; font-size: 13px; padding: 6px 10px; padding-top: calc(6px + env(safe-area-inset-top)); position: relative; z-index: 70; }
.staging-bar + .topbar { padding-top: 10px; }

.snap-share { margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--side); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 200; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 901px) { .toast { bottom: 28px; } }
