:root {
  --ink: #1d1d1b; --quiet: #6b6a66; --line: #d9d7d0; --bg: #f7f6f2; --card: #fff;
  --brand: #c8102e; --ok: #1e7a3c; --warn: #b26b00; --bad: #b3261e; --blue: #1f5fa8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.4; }
header { background: var(--ink); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 5; }
header a { color: #fff; text-decoration: none; font-size: 22px; }
header h1 { font-size: 18px; margin: 0; flex: 1; }
main { padding: 16px; max-width: 720px; margin: 0 auto; }
h2 { font-size: 17px; margin: 24px 0 8px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
textarea { min-height: 96px; }
input.big { font-size: 28px; letter-spacing: 2px; text-align: center; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > * { flex: 1; }
.row > .narrow { flex: 0 0 auto; }
button, .button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 14px 16px; background: var(--brand); color: #fff; cursor: pointer; text-align: center; text-decoration: none; display: inline-block; }
button.secondary, .button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.ok { background: var(--ok); } button.warn { background: var(--warn); } button.bad { background: var(--bad); }
button:disabled { opacity: .5; }
button.full { width: 100%; margin-top: 16px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; text-decoration: none; color: var(--ink); min-height: 110px; }
.tile b { display: block; font-size: 18px; margin-bottom: 4px; }
.tile span { color: var(--quiet); font-size: 14px; }
.badge { display: block; padding: 10px 12px; border-radius: 8px; font-size: 15px; margin-bottom: 12px; }
.badge.ok { background: #e5f4e4; color: var(--ok); } .badge.wait { background: #f9eeda; color: var(--warn); } .badge.bad { background: #fbebeb; color: var(--bad); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumb { position: relative; width: 92px; height: 92px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb button { position: absolute; top: -6px; right: -6px; padding: 2px 8px; border-radius: 50%; font-size: 13px; background: var(--ink); }
.hint { color: var(--quiet); font-size: 14px; margin: 4px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; gap: 12px; text-decoration: none; color: var(--ink); }
.card img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--bg); }
.card .body { flex: 1; min-width: 0; }
.card .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.card .meta { color: var(--quiet); font-size: 14px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-right: 4px; }
.pill.high { background: #e5f4e4; color: var(--ok); } .pill.medium { background: #f9eeda; color: var(--warn); } .pill.low, .pill.blocked, .pill.draft_failed { background: #fbebeb; color: var(--bad); }
.pill.drafted, .pill.photographed { background: #e7f1fb; color: var(--blue); } .pill.approved { background: #e5f4e4; color: var(--ok); }
.banner { padding: 12px; border-radius: 8px; margin: 12px 0; font-weight: 600; }
.banner.bad { background: #fbebeb; color: var(--bad); } .banner.warn { background: #f9eeda; color: var(--warn); }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.gallery img { height: 240px; border-radius: 8px; scroll-snap-align: start; cursor: zoom-in; }
.zoom { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; z-index: 20; }
.zoom img { max-width: 100%; max-height: 100%; }
.actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); }
.actions .wide { grid-column: span 2; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs button { padding: 8px 12px; font-size: 14px; background: #fff; color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.tabs button.on { background: var(--ink); color: #fff; }
.count { color: var(--quiet); font-size: 13px; font-weight: 400; }
.scan-overlay { position: fixed; inset: 0; background: #000; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #fff; }
.scan-overlay video { width: 100%; max-height: 70vh; object-fit: cover; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 24px; padding: 14px; border-radius: 10px; color: #fff; font-weight: 600; z-index: 40; text-align: center; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
