:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #14202e; --muted: #5d6b7a; --line: #dde2e8;
  --brand: #1F3A5F; --brand-ink: #ffffff; --ok: #1d7a46; --warn: #b26a00; --bad: #b3261e; --chip: #e8edf3;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1722; --card: #182231; --ink: #e8edf3; --muted: #9aa8b8; --line: #2a374a;
          --brand: #3d6aa8; --chip: #243246; --ok: #4cc283; --warn: #e5a23b; --bad: #ff8a80; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
body { padding-top: env(safe-area-inset-top); }
#bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--brand); color: var(--brand-ink); }
.brand { font-weight: 700; letter-spacing: .2px; }
.pill { border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; background: rgba(255,255,255,.18); color: inherit; }
.pill.off { background: #b26a00; }
.pill.pending { background: #1d7a46; }
main { padding: 16px 16px 110px; max-width: 640px; margin: 0 auto; }
nav#tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 6; }
nav#tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 14px 4px; font-size: 14px; font-weight: 600; }
nav#tabs button.on { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.badge { background: var(--bad); color: #fff; border-radius: 10px; padding: 1px 6px; font-size: 12px; }
h2 { margin: 4px 0 12px; font-size: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
textarea { min-height: 70px; }
button { font: inherit; }
button.primary, button.secondary, button.danger { border: 0; border-radius: 12px; padding: 14px 16px; font-weight: 700; width: 100%; margin-top: 10px; }
button.primary { background: var(--brand); color: var(--brand-ink); }
button.secondary { background: var(--chip); color: var(--ink); }
button.danger { background: var(--bad); color: #fff; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 700; margin-right: 6px; }
.chip.pulled { background: var(--warn); color: #fff; } .chip.sold { background: var(--muted); color: #fff; }
.chip.located_listed { background: var(--ok); color: #fff; } .chip.issue { background: var(--bad); color: #fff; }
.list-item { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin-bottom: 8px; color: var(--ink); }
.list-item .t { font-weight: 700; } .list-item .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.muted { color: var(--muted); } .err { color: var(--bad); } .ok { color: var(--ok); }
#video { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 3/4; object-fit: cover; }
#sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
#sheet[hidden], #login[hidden], #toast[hidden] { display: none; }
#sheet .panel { background: var(--bg); width: 100%; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
#login { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
#loginForm { width: 100%; max-width: 360px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #14202e; color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: 90vw; text-align: center; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; } .thumbs img { height: 84px; border-radius: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 15px; } .kv div:nth-child(odd) { color: var(--muted); }
.big { font-size: 22px; font-weight: 800; }
