:root {
  --bg: #07090e; --panel: #11151d; --line: #222938; --text: #eef1f6; --muted: #8b93a5;
  --gold: #e9b949; --gold-ink: #1a1405; --green: #3ecf8e; --red: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
.hidden { display: none !important; }
.top { position: sticky; top: 0; z-index: 5; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgba(7,9,14,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: .12em; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.mark { background: var(--gold); color: var(--gold-ink); border-radius: 6px; padding: 3px 6px; letter-spacing: 0; }
.sub { color: var(--gold); }
.wrap { max-width: 560px; margin: 0 auto; padding: 14px 16px 40px; display: grid; gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 11px; word-break: break-word; }
.right { text-align: right; }
.label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #0b0e14; color: var(--text); border-radius: 999px;
  padding: 9px 14px; font-size: 15px; min-height: 40px; }
.chip.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn { display: flex; align-items: center; justify-content: center; border-radius: 14px; border: 1px solid var(--line);
  font-weight: 700; font-size: 16px; min-height: 48px; padding: 0 14px; cursor: pointer; color: var(--text); background: #0b0e14; }
.btn.big { min-height: 58px; font-size: 17px; }
.btn.gold { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.btn.full { width: 100%; margin-top: 12px; }
.btn:active, .chip:active { transform: scale(.98); }
.status { display: flex; align-items: center; gap: 12px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { border-color: rgba(255,107,107,.5); color: #ffc9c9; }
.card-id { display: flex; gap: 14px; align-items: flex-start; }
.card-id img { width: 92px; height: 128px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); flex-shrink: 0; background: #000; }
.id-title { font-weight: 800; font-size: 17px; }
.id-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.link { background: none; border: 0; color: var(--gold); padding: 8px 0 0; font-size: 14px; font-weight: 600; }
.edit .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.edit .span2 { grid-column: span 2; }
.edit input:not([type=checkbox]) { font-size: 16px; /* stops iOS zoom */ padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #0b0e14; color: var(--text); width: 100%; }
.edit .check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.edit .check input { width: 20px; height: 20px; }
.comp-head { display: flex; justify-content: space-between; align-items: flex-end; }
.comp-head .label { margin-top: 0; }
.big-num { font-size: 40px; font-weight: 800; letter-spacing: -.02em; color: var(--green); line-height: 1.1; }
.sales { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.sale { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #0b0e14; color: inherit; text-decoration: none; }
.sale img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #000; }
.sale-body { min-width: 0; flex: 1; }
.sale-title { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sale-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; gap: 8px; }
.price { font-size: 20px; font-weight: 800; }
.was { text-decoration: line-through; color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 400; }
.tag { font-size: 11px; border-radius: 6px; padding: 2px 6px; background: #1a2130; color: #b9c3d8; white-space: nowrap; }
.tag.bo { background: rgba(62,207,142,.15); color: var(--green); }
.when { font-size: 12px; color: var(--muted); }

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { display: grid; gap: 8px; }
.slot-img { position: relative; aspect-ratio: 5 / 7; border: 2px dashed var(--line); border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: #0b0e14; }
.slot.filled .slot-img { border-style: solid; border-color: var(--gold); }
.slot-img img { width: 100%; height: 100%; object-fit: cover; }
.slot-ph { text-align: center; font-weight: 800; letter-spacing: .12em; color: var(--muted); font-size: 14px; }
.slot-ph small { display: block; font-weight: 500; letter-spacing: 0; font-size: 11px; margin-top: 4px; }
.slot-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn.sm { min-height: 42px; font-size: 14px; padding: 0 6px; border-radius: 10px; }
.btn:disabled { opacity: .45; }
#go { margin-top: 14px; }
.id-meta .used { color: var(--green); }
.why { font-size: 11px; margin-top: 4px; color: #e9b949; }
.why.exact { color: var(--green); }
.big-num.est { color: var(--gold); }
.big-num.est::after { content: ' est.'; font-size: 16px; font-weight: 600; color: var(--muted); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct { display: flex; gap: 8px; align-items: center; }
.acct a { color: var(--gold); text-decoration: none; font-weight: 700; font-size: 14px; }
.acct a.pill { background: var(--gold); color: var(--gold-ink); border-radius: 999px; padding: 7px 12px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 12px;
  border: 1px solid rgba(233,185,73,.35); background: rgba(233,185,73,.08); border-radius: 12px; font-size: 13px; }
.banner .btn { flex-shrink: 0; text-decoration: none; }
.cta { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border-radius: 14px; border: 1px solid rgba(233,185,73,.45);
  background: linear-gradient(160deg, rgba(233,185,73,.14), rgba(233,185,73,.03)); font-size: 14px; }
.cta strong { font-size: 17px; }
.cta .btn { text-decoration: none; margin-top: 4px; }
.cta .link { text-align: center; text-decoration: none; }
a.btn { text-decoration: none; }

/* AI verification */
.verify { font-size: 13px; margin-top: 6px; font-weight: 600; }
.verify.ok { color: var(--green); }
.verify.warn { color: var(--gold); }
.review { border-color: var(--gold); background: rgba(233,185,73,.08); font-size: 14px; }
.review strong { color: var(--gold); display: block; margin-bottom: 6px; }
.review ul { margin: 6px 0 0; padding-left: 18px; }
.review li { margin: 3px 0; }
.review .fixes { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Live scanner */
.scan-cta { margin-top: 14px; font-size: 18px; }
.hint.center { text-align: center; }
.cam { position: fixed; inset: 0; z-index: 50; background: #000; overflow: hidden; touch-action: none; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(76vw, calc(62vh * 5 / 7)); aspect-ratio: 5 / 7; border: 3px solid rgba(255,255,255,.85); border-radius: 14px;
  box-shadow: 0 0 0 200vmax rgba(0,0,0,.55); transition: border-color .15s; }
.cam-frame.aligned { border-color: var(--green); }
.cam-hold { position: absolute; left: 0; bottom: -10px; height: 4px; width: 0; background: var(--green); border-radius: 4px; transition: width .1s linear; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .25s; }
.cam-flash.on { opacity: .8; transition: none; }
.cam-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top) + 14px) 18px 10px; text-align: center; }
.cam-step { color: var(--gold); font-weight: 800; letter-spacing: .08em; font-size: 15px; }
.cam-tip { color: #fff; font-size: 15px; margin-top: 4px; text-shadow: 0 1px 3px #000; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 22px calc(env(safe-area-inset-bottom) + 22px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cam-shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); }
.cam-shutter:active { background: rgba(255,255,255,.6); }
.cam-shutter.pulse { border-color: var(--gold); background: rgba(233,185,73,.45); animation: shutterPulse 1s ease-in-out infinite; }
@keyframes shutterPulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(233,185,73,.6); } 50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(233,185,73,0); } }
.cam.manual .cam-tip { color: var(--gold); font-weight: 800; font-size: 17px; }
.cam.manual .cam-frame { border-color: var(--gold); border-style: dashed; }
@media (prefers-reduced-motion: reduce) { .cam-shutter.pulse { animation: none; } }
.cam-txt { background: none; border: 0; color: #fff; font-size: 17px; font-weight: 700; justify-self: start; padding: 10px 4px; }
.cam-side { justify-self: end; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cam-thumb { width: 44px; height: 62px; object-fit: cover; border-radius: 5px; border: 2px solid #fff; }
.cam-count { position: absolute; right: 16px; top: calc(env(safe-area-inset-top) + 64px); background: rgba(0,0,0,.6);
  color: var(--gold); font-weight: 800; border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.cam-count:empty { display: none; }

/* Scan queue */
.queue h3 { margin: 0; font-size: 17px; }
.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.q-total { color: var(--gold); font-weight: 800; font-size: 18px; }
.q-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.q-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  border: 1px solid var(--line); background: #0b0e14; color: var(--text); border-radius: 12px; padding: 8px 10px; font-size: 14px; }
.q-item.current { border-color: var(--gold); }
.q-item img { width: 48px; height: 66px; object-fit: cover; border-radius: 5px; background: #1a1f2a; }
.q-item .q-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .q-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .q-val { font-weight: 800; color: var(--gold); text-align: right; }
.q-item .q-tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 7px; margin-top: 3px; }
.q-tag.pick { background: rgba(233,185,73,.15); color: var(--gold); }
.q-tag.ok { background: rgba(62,207,142,.12); color: var(--green); }
.q-tag.err { background: rgba(255,107,107,.12); color: var(--red); }
.q-spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: qspin .8s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 6px; }
@keyframes qspin { to { transform: rotate(360deg); } }

/* Which version do you have? */
.pcheck h3 { margin: 0 0 4px; font-size: 17px; }
.pcheck .q { font-size: 15px; font-weight: 600; margin: 14px 0 4px; }
.pcheck .hint { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.pcheck .answers { display: grid; gap: 8px; }
.pcheck .answers button { text-align: left; border: 1px solid var(--line); background: #0b0e14; color: var(--text); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; min-height: 44px; }
.pcheck .answers button:active { border-color: var(--gold); }
.pcheck .opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pcheck .opt { border: 1px solid var(--line); background: #0b0e14; color: var(--text); border-radius: 999px; padding: 8px 12px; font-size: 14px; min-height: 40px; }
.pcheck .opt.guess { border-color: var(--gold); }
.pcheck .opt small { color: var(--muted); margin-left: 4px; }
.pcheck .done { color: var(--green); font-weight: 700; }
.pcheck .row { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.pcheck .vlist { display: grid; gap: 8px; margin-top: 10px; }
.pcheck .vopt { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: #0b0e14; color: var(--text);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.pcheck .vopt.guess { border-color: var(--gold); }
.pcheck .vopt:active { background: #151a24; }
.pcheck .vtop { display: flex; justify-content: space-between; gap: 10px; }
.pcheck .vprice { color: var(--gold); font-weight: 700; }
.pcheck .vdesc { color: var(--muted); font-size: 13px; }
.pcheck .vguess { color: var(--gold); font-size: 12px; font-weight: 700; }
.pcheck .vbody { display: grid; gap: 3px; min-width: 0; }
.pcheck .vimg { width: 64px; height: 88px; object-fit: cover; border-radius: 6px; background: #1a1f2a; display: block; }
.pcheck .auto { display: flex; gap: 12px; align-items: center; }
.pcheck .auto img { width: 64px; height: 88px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.pcheck .auto .hint { margin: 4px 0 6px; }
.pcheck .serial { border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.pcheck .serial.warn { background: rgba(233,185,73,.12); border: 1px solid rgba(233,185,73,.5); color: var(--text); }
.pcheck .serial.ok { color: var(--green); padding: 4px 0; }

/* ===== v0.6 polish: one look across the whole platform ===== */
:root { --bg: #07090e; --panel: #121826; --line: #243044; --text: #e8edf7; --muted: #8b97ad;
  --gold: #e0b25a; --gold2: #f0d08a; --gold-grad: linear-gradient(180deg,#f0d08a,#c9922e); --green: #34d399; }
html, body { font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
a.brand { color: var(--text); text-decoration: none; }
.mark { background: linear-gradient(145deg,#e0b25a,#8a5a12); border-radius: 8px; padding: 4px 7px; }
.panel { border-radius: 18px; }
h1 { font-size: 24px; letter-spacing: -.02em; }
.btn.gold, .chip.on, .acct a.pill { background: var(--gold-grad); border-color: transparent; color: #1a1204; }
.btn { transition: filter .15s, transform .1s; }
.btn:not(:disabled):hover { filter: brightness(1.07); }
/* Disabled primary reads as "not yet", not as a broken gold button */
.btn.gold:disabled { background: transparent; border: 1px dashed var(--line); color: var(--muted); opacity: 1; }
.chip { transition: border-color .15s; }
.chip:not(.on):hover { border-color: #3b4d6b; }
.label { letter-spacing: .12em; }
.scan-cta { box-shadow: 0 10px 30px rgba(224,178,90,.18); }
/* focus rings for keyboard users */
.btn:focus-visible, .chip:focus-visible, .link:focus-visible, .tabbar a:focus-visible, .acct a:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }

/* Bottom tab bar (signed-in) — matches the vault app */
.tabbar { display: none; }
body.signed-in .tabbar { display: grid; grid-template-columns: repeat(5,1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: rgba(8,12,19,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
body.signed-in .wrap { padding-bottom: 110px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--gold2); background: #151c2b; }
@media (min-width: 921px) { body.signed-in .tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 460px;
  border: 1px solid var(--line); border-radius: 18px; padding: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.45); } }
.cam { z-index: 50; }
button, input, select, textarea { font: inherit; }
.chip { font-size: 15px; font-weight: 600; }
.chip.on { font-weight: 750; }
