:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --ink: #16181d;
  --muted: #5f6470;
  --line: #dcd8d0;
  --go: #0b7a47;
  --go-soft: #e3f3ea;
  --stop: #4a4f5a;
  --stop-soft: #eceae6;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --bad: #b3261e;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 48px; }
.wide { max-width: 980px; }

header.bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--ink); color: #fff;
}
header.bar .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; padding-bottom: 0; }
.brand { font-weight: 800; letter-spacing: -0.01em; font-size: 18px; flex: 1; display: flex; align-items: center; gap: 10px; }
.brand svg { width: 28px; height: 28px; flex: none; }
.who { font-size: 14px; opacity: .8; }
header.bar button.link { color: #fff; }

h1 { font-size: 24px; line-height: 1.2; margin: 24px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 12px; }
p.sub { color: var(--muted); margin: 0 0 16px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }

label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
label .hint { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; min-height: 46px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(11, 122, 71, .25); border-color: var(--go); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
@media (max-width: 420px) { .row3 { grid-template-columns: 1fr 1fr; } }

button, .btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 12px; min-height: 48px; padding: 12px 18px;
  background: var(--go); color: #fff; width: 100%; margin-top: 16px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button.link { background: none; color: var(--go); width: auto; min-height: 44px; padding: 8px 4px; margin: 0; font-weight: 600; }
button:disabled { opacity: .55; cursor: default; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; }

.seg { display: flex; gap: 6px; margin-top: 4px; }
.seg button { margin: 0; min-height: 44px; padding: 8px 0; background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.camera { position: relative; margin-top: 12px; border-radius: 12px; overflow: hidden; background: #0d0f12; aspect-ratio: 4 / 3; display: none; }
.camera.on { display: block; }
.camera video, .camera #qr-reader { width: 100%; height: 100%; object-fit: cover; }
.camera .aim { position: absolute; inset: 30% 10%; border: 3px solid rgba(255,255,255,.85); border-radius: 10px; pointer-events: none; }
.camera .cap { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 2px #000; }

.verdict { border-radius: var(--radius); padding: 20px 16px; margin-top: 16px; text-align: center; }
.verdict .big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.verdict .small { margin-top: 6px; font-size: 15px; }
.verdict.buy { background: var(--go-soft); color: var(--go); border: 2px solid var(--go); }
.verdict.pass { background: var(--stop-soft); color: var(--stop); border: 2px solid var(--stop); }
.verdict.needs { background: var(--warn-soft); color: var(--warn); border: 2px solid var(--warn); }

.cardline { font-weight: 700; }
.meta { color: var(--muted); font-size: 14px; }
.msg { margin-top: 10px; font-size: 14px; min-height: 20px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--go); }
.need { outline: 3px solid var(--warn); }

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: baseline; }
ul.list li:first-child { border-top: 0; }
ul.list .grow { flex: 1; min-width: 0; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tag.bought { background: var(--go-soft); color: var(--go); }
.tag.passed { background: var(--stop-soft); color: var(--stop); }
.tag.open { background: var(--warn-soft); color: var(--warn); }

nav.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 16px 0 0; border-bottom: 1px solid var(--line); }
nav.tabs button { width: auto; margin: 0; background: none; color: var(--muted); border-radius: 0; border-bottom: 3px solid transparent; min-height: 46px; padding: 8px 12px; white-space: nowrap; }
nav.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--go); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }

.meter { height: 8px; background: var(--stop-soft); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--go); }
.meter.full i { background: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
.evals { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.evals .yes { color: var(--go); font-weight: 600; }
.scroll { overflow-x: auto; }
.pin { font-size: 32px; font-weight: 800; letter-spacing: .2em; text-align: center; padding: 12px; background: var(--go-soft); color: var(--go); border-radius: 12px; margin-top: 12px; }
.slabpics { display: flex; gap: 10px; margin: 4px 0 4px; }
.slabpics img { width: calc(50% - 5px); max-width: 160px; aspect-ratio: 3 / 5; object-fit: contain; background: var(--stop-soft); border-radius: 8px; }
.thumb { width: 36px; height: 60px; object-fit: contain; border-radius: 4px; background: var(--stop-soft); flex: none; align-self: center; }
details.panel summary { cursor: pointer; min-height: 28px; }
.seg.modes { margin-top: 16px; }

.lotbar { position: sticky; top: 56px; z-index: 4; margin: 16px -16px 0; padding: 10px 16px; background: var(--ink); color: #fff; }
.lotname { font-weight: 700; font-size: 14px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lotnums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.lotnums b { font-size: 20px; font-variant-numeric: tabular-nums; }
.lotnums .warn b { color: #ffcf7a; }
.camera[data-flash="buy"] { box-shadow: 0 0 0 5px var(--go); }
.camera[data-flash="pass"], .camera[data-flash="passed"] { box-shadow: 0 0 0 5px var(--stop); }
.camera[data-flash="price"], .camera[data-flash="details"] { box-shadow: 0 0 0 5px var(--warn); }

ul.feed { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
ul.feed .item { background: var(--card); border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
ul.feed .item.buy { border-left-color: var(--go); }
ul.feed .item.pass { border-left-color: var(--line); opacity: .8; }
ul.feed .item.wait { border-left-color: var(--warn); }
ul.feed .grow { flex: 1; min-width: 0; }
ul.feed .side-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
ul.feed .upto { color: var(--go); font-size: 18px; font-variant-numeric: tabular-nums; }
ul.feed .side-r .link { min-height: 32px; padding: 4px 0; font-size: 14px; }
ul.feed .empty { padding: 16px; text-align: center; }
form.fix { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin-top: 6px; }
form.fix label { font-size: 13px; margin: 6px 0 2px; }
form.fix input { min-height: 42px; padding: 8px 10px; margin-top: 2px; }
form.fix button { grid-column: 1 / -1; margin-top: 10px; min-height: 44px; }
.msg.warn { color: var(--warn); }
.ch-info { margin: 8px 2px 0; }
.ch-info a { color: inherit; }
.hidden { display: none !important; }
footer.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 32px; }

/* Brand: mark A + name (public/brand/, made by make-brand.cjs; lettering outlined) */
.brand img { flex: none; }
.signin-logo { display: block; width: 210px; max-width: 70%; height: auto; margin: 28px auto 4px; }
footer.foot img { display: block; margin: 0 auto; height: 30px; width: auto; opacity: .9; }
