/* Slate Review — one token system, dark, phone-first.
   Brand accents live ONLY on rails/dots/chips; the page background is always
   the shared canvas token, never per-brand. */

:root {
  --canvas: #101413;
  --panel: #181e1c;
  --panel-2: #1f2624;
  --line: #2a332f;
  --ink: #e9edeb;
  --muted: #93a09a;
  --accent: #2ea36b;      /* felt green */
  --accent-ink: #0c1410;
  --approve: #2ea36b;
  --fix: #d9a13c;
  --deny: #d15b52;
  --radius: 14px;
  --radius-s: 9px;
}

* { box-sizing: border-box; }
/* The topbar/overlay/stickybar rules set display:flex, which silently beats
   the HTML hidden attribute — this keeps hidden meaning hidden. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
video { display: block; background: #000; }

/* ---------- topbar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.wordmark { font-weight: 800; letter-spacing: .12em; font-size: 15px; }
.wordmark .dot { color: var(--accent); }
.topbar-spacer { flex: 1; }
.top-chip {
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
button.top-chip:hover { color: var(--ink); }

.viewas-banner {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: #33290f; color: #ecd9a0; border-bottom: 1px solid #4d3d14;
  padding: 7px 12px; font-size: 13.5px;
}
.viewas-banner button {
  background: none; border: 1px solid #6b5620; color: inherit;
  border-radius: 999px; padding: 2px 10px; font-size: 12.5px;
}

/* ---------- layout ---------- */
#view { max-width: 780px; margin: 0 auto; padding: 16px 14px 120px; }
.page-title { font-size: 21px; font-weight: 750; margin: 8px 0 2px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.backrow { margin: 2px 0 10px; }
.backrow button {
  background: none; border: none; color: var(--muted); font-size: 14px; padding: 4px 0;
}
.backrow button:hover { color: var(--ink); }

/* ---------- cards & tiles ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 0 0 14px;
}
.tile {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 12px;
  border-left: 4px solid var(--accent);
}
.tile:hover { background: var(--panel-2); }
.tile h3 { margin: 0 0 4px; font-size: 17px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile.disabled { opacity: .45; border-left-color: var(--line); pointer-events: none; }
.tile-row { display: flex; align-items: center; gap: 12px; }
.tile-row .grow { flex: 1; }
.count-pill {
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
  border-radius: 999px; padding: 3px 12px; font-size: 14px; min-width: 24px; text-align: center;
}
.count-pill.zero { background: var(--panel-2); color: var(--muted); font-weight: 600; }

/* ---------- chips ---------- */
.chip {
  display: inline-block; border-radius: 999px; padding: 3px 10px;
  font-size: 12.5px; font-weight: 650; border: 1px solid var(--line);
  color: var(--muted); background: var(--panel-2);
}
.chip.ok { color: #7fd6ab; border-color: #23573f; background: #14261d; }
.chip.warn { color: #ecd9a0; border-color: #4d3d14; background: #241d0c; }
.chip.bad { color: #eda49d; border-color: #58231e; background: #271311; }
.chip.accent { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none; border: none; color: var(--muted); white-space: nowrap;
  padding: 10px 12px; font-size: 14.5px; font-weight: 650;
  border-bottom: 2.5px solid transparent;
}
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab .n { color: var(--accent); font-weight: 800; margin-left: 4px; }

/* ---------- the feed ---------- */
.feed-card { padding: 0; overflow: hidden; }
.feed-card.ring { outline: 2px solid var(--deny); outline-offset: 2px; }
.vid-wrap { display: flex; justify-content: center; background: #000; }
.vid-wrap video { width: 100%; max-width: 390px; max-height: 64vh; aspect-ratio: 9/16; object-fit: contain; }
.feed-body { padding: 14px 14px 16px; }
.feed-title { font-weight: 750; font-size: 16px; margin-bottom: 2px; }
.feed-key { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.feed-status-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

.verdict-rail { display: flex; gap: 8px; margin-bottom: 10px; }
.vbtn {
  flex: 1; padding: 11px 8px; border-radius: var(--radius-s);
  border: 1.5px solid var(--line); background: var(--panel-2);
  color: var(--ink); font-weight: 750; font-size: 14.5px;
  transition: transform .06s ease;
}
.vbtn:active { transform: scale(.97); }
.vbtn.approve.on { background: var(--approve); border-color: var(--approve); color: var(--accent-ink); }
.vbtn.fix.on { background: var(--fix); border-color: var(--fix); color: #221703; }
.vbtn.deny.on { background: var(--deny); border-color: var(--deny); color: #2b0d0a; }
.vbtn.ghost { opacity: .55; }

.reason-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.reason-chip {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font-size: 12.5px;
}
.reason-chip.on { background: var(--deny); border-color: var(--deny); color: #2b0d0a; font-weight: 700; }

textarea.note {
  width: 100%; min-height: 44px; resize: vertical;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  color: var(--ink); padding: 10px 12px; font: inherit; font-size: 14.5px;
}
textarea.note:focus { outline: 1.5px solid var(--accent); }
textarea.note.need { outline: 1.5px solid var(--deny); }

.save-state { font-size: 12.5px; color: var(--muted); margin-top: 6px; min-height: 16px; }
.save-state.saved { color: #7fd6ab; }
.save-state.queued { color: #ecd9a0; }

.note-quote {
  border-left: 3px solid var(--fix); padding: 6px 10px; margin: 10px 0 0;
  color: var(--ink); background: var(--panel-2); border-radius: 6px; font-size: 14.5px;
  white-space: pre-wrap;
}

/* ---------- sticky submit bar ---------- */
#stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  display: flex; justify-content: center;
}
#stickybar button {
  width: 100%; max-width: 500px; padding: 14px;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--radius-s); font-weight: 800; font-size: 16px;
}
#stickybar button:disabled { opacity: .5; }

/* ---------- drawer ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.62);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 700px) { #overlay { align-items: center; } }
.drawer {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; width: 100%; max-width: 560px;
  max-height: 86dvh; overflow-y: auto; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .drawer { border-radius: 18px; } }
.drawer h2 { margin: 0 0 12px; font-size: 18px; }
.drawer-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  flex: 1; padding: 12px; border-radius: var(--radius-s); font-weight: 750; font-size: 15px;
  border: 1.5px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--deny); border-color: var(--deny); color: #2b0d0a; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { flex: 0 0 auto; padding: 7px 14px; font-size: 13.5px; }

.code-display {
  font: 800 30px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em;
  text-align: center; background: var(--panel-2); border: 1.5px dashed var(--accent);
  border-radius: var(--radius-s); padding: 18px 10px; margin: 12px 0;
  user-select: all;
}

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 5px; font-weight: 650; }
.field input, .field select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); color: var(--ink); padding: 11px 12px; font: inherit;
}
.field input:focus, .field select:focus { outline: 1.5px solid var(--accent); }

/* ---------- login ---------- */
.login-wrap { min-height: 78dvh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 360px; text-align: center; padding: 34px 24px; }
.login-card .mark { font-size: 40px; margin-bottom: 6px; }
.login-card h1 { font-size: 22px; letter-spacing: .1em; margin: 0 0 2px; }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.login-card input {
  width: 100%; text-align: center; font: 700 19px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  background: var(--panel-2); border: 1.5px solid var(--line); border-radius: var(--radius-s);
  color: var(--ink); padding: 14px; margin-bottom: 12px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card .btn { width: 100%; }
.login-err { color: #eda49d; font-size: 13.5px; min-height: 18px; margin-top: 10px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.grid th, table.grid td {
  border: 1px solid var(--line); padding: 8px 10px; text-align: left; white-space: nowrap;
}
table.grid th { background: var(--panel-2); color: var(--muted); font-weight: 700; }
.cell-mark { font-weight: 800; }
.cell-mark.post { color: #7fd6ab; }
.cell-mark.cut { color: #eda49d; }
.cell-mark.tweak { color: #ecd9a0; }
.cell-mark.none { color: var(--muted); font-weight: 400; }
.note-dot { color: var(--fix); }

/* ---------- toast ---------- */
#toasts {
  position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 60; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px;
  background: #0c0f0e; border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 11px 18px; font-size: 14.5px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5); max-width: 92vw;
}
.toast button {
  background: none; border: none; color: var(--accent); font-weight: 800; font-size: 14.5px; padding: 0;
}

/* ---------- misc ---------- */
.empty {
  text-align: center; color: var(--muted); padding: 44px 16px; font-size: 14.5px;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
}
.section-h { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; font-weight: 750; }
details.foldout summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 8px 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row .grow { flex: 1; }
.mut { color: var(--muted); font-size: 13.5px; }
.list-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.list-item:last-child { border-bottom: none; }

/* viewer overlay */
.viewer {
  background: var(--canvas); width: 100%; height: 100dvh; max-width: none;
  display: flex; flex-direction: column; padding: 0;
}
.viewer-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.viewer-top .grow { flex: 1; font-weight: 750; }
.viewer video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
.viewer-actions { display: flex; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
