/* Hagane away review — one private page, built to be read on a phone in bed.
   Same material direction as the owner board (dark ink, amber action, no decoration). */

:root {
  /* Hex fallbacks first: a browser without oklch() keeps readable colours
     instead of losing the custom property and rendering black on black. */
  --bg: #14110f;
  --surface: #1d1916;
  --surface-2: #26211d;
  --line: #3a322c;
  --line-2: #4b4138;
  --ink: #ece6dc;
  --ink-dim: #b8b0a4;
  --ink-faint: #8a8074;
  --amber: #e8c47a;
  --amber-dim: #c9a45f;
  --work: #7ba7d4;
  --good: #9fb37a;
  --warn: #d9a05b;
  --bad: #d4715f;
  --focus: #f0d8a0;

  --bg: oklch(17% 0.012 260);
  --surface: oklch(21.5% 0.014 260);
  --surface-2: oklch(25.5% 0.016 260);
  --line: oklch(32% 0.015 260);
  --line-2: oklch(40% 0.018 260);
  --ink: oklch(93% 0.008 260);
  --ink-dim: oklch(76% 0.012 260);
  --ink-faint: oklch(60% 0.014 260);
  --amber: oklch(80% 0.13 78);
  --amber-dim: oklch(70% 0.10 78);
  --work: oklch(72% 0.10 235);
  --good: oklch(74% 0.11 150);
  --warn: oklch(76% 0.13 70);
  --bad: oklch(68% 0.16 25);
  --focus: oklch(88% 0.10 78);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgb(0 0 0 / 0.35);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber); text-underline-offset: 2px; }
a:hover { color: var(--focus); }
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--amber); color: #181310; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--amber); color: #181310; padding: 10px 14px;
  border-radius: 0 0 8px 0; font-weight: 700;
}
.skip:focus { left: 0; }

.sub { color: var(--ink-dim); font-size: 13px; }
.fine { color: var(--ink-faint); font-size: 12.5px; line-height: 1.5; }
.error { color: var(--bad); font-size: 14px; margin-top: 10px; }

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  border-radius: 10px; padding: 10px 14px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
  text-decoration: none;
}
.btn:hover { background: oklch(29% 0.018 260); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #181310; font-weight: 700; }
.btn.primary:hover { background: var(--focus); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 38px; padding: 7px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.danger { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, oklch(24% 0.02 60 / .55), transparent 70%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 30px 26px 22px; box-shadow: var(--shadow);
}
.brand-mark {
  width: 54px; height: 54px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 14px;
  color: var(--amber); font-size: 28px; background: #211b17;
  margin-bottom: 16px;
}
.brand-mark.small { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; margin: 0; }
.login-card h1 { font-size: 24px; letter-spacing: -.01em; }
.login-sub { color: var(--ink-dim); margin-top: 8px; font-size: 14.5px; }
.field { display: block; margin: 22px 0 14px; }
.field span { display: block; font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.field input, textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 13px; min-height: 46px;
}
.field input:focus, textarea:focus, select:focus { border-color: var(--amber-dim); }
.login .fine { margin-top: 16px; }

/* ---------- top ---------- */
.chrome {
  position: sticky; top: 0; z-index: 30;
  background: #14110f;
  background: oklch(17% 0.012 260 / .97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 4px 14px;
  padding: 10px max(16px, calc((100vw - 1180px) / 2)) 0;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text { min-width: 0; }
.brand h1 { font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.brand .sub {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: min(64vw, 720px);
}
.top-right { display: flex; align-items: center; gap: 10px; }
.save-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-dim); white-space: nowrap;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
}
.save-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }
.save-pill.saving i { background: var(--warn); }
.save-pill.bad i { background: var(--bad); }
.progressbar { grid-column: 1 / -1; height: 3px; background: #241f1b; margin-top: 8px; }
#progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #8fae62, var(--amber)); transition: width .3s ease; }

.tabs {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 6px max(16px, calc((100vw - 1180px) / 2)) 8px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 1px solid transparent; background: transparent; color: var(--ink-dim);
  padding: 9px 14px; border-radius: 999px; min-height: 42px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px;
}
.tab:hover { color: var(--ink); background: var(--surface); }
.tab[aria-current="page"] { color: #181310; background: var(--amber); }
.tab .count {
  font-size: 12px; background: rgb(0 0 0 / .22); border-radius: 999px;
  padding: 1px 7px; min-width: 20px; text-align: center;
}
.tab[aria-current="page"] .count { background: rgb(0 0 0 / .18); }

/* ---------- main ---------- */
.main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 120px; }
.page-head { margin: 6px 0 18px; }
.page-head h2 { font-size: 22px; letter-spacing: -.015em; }
.page-head p { color: var(--ink-dim); margin-top: 6px; max-width: 70ch; font-size: 14.5px; }
.section-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint); margin: 26px 0 10px;
}
.section-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* ---------- review queue ---------- */
.queue { display: grid; gap: 10px; }
.card-row {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px 14px 18px;
  position: relative; color: inherit; text-decoration: none;
  transition: border-color .12s ease, background .12s ease;
}
.card-row::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px; background: var(--line-2);
}
.card-row:hover { border-color: var(--line-2); background: var(--surface-2); }
.card-row.proj-animations::before { background: var(--work); }
.card-row.proj-early-access::before { background: var(--amber); }
.card-row.proj-battle-direction::before { background: var(--bad); }
.card-row.proj-hagane-to-shijima::before { background: var(--good); }
.card-row.done { opacity: .62; }
.card-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-row h3 { font-size: 16.5px; line-height: 1.35; margin-top: 6px; letter-spacing: -.005em; color: var(--ink); }
.card-row .preview { color: var(--ink-dim); font-size: 13.5px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-row-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  font-size: 11.5px; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink-dim); background: transparent;
  white-space: nowrap;
}
.chip.solid { background: var(--surface-2); }
.chip.open { border-color: var(--amber-dim); color: var(--amber); }
.chip.good { border-color: var(--good); color: var(--good); }
.chip.bad { border-color: var(--bad); color: var(--bad); }
.chip.muted { color: var(--ink-faint); }
.pill-count {
  font-size: 12.5px; color: #181310; background: var(--amber);
  border-radius: 999px; padding: 2px 8px; font-weight: 700;
}
.row-done {
  font-size: 12.5px; color: var(--ink-faint); margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
}

/* ---------- card detail ---------- */
.back {
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink-dim);
  text-decoration: none; font-size: 14px; padding: 8px 0; margin-bottom: 4px;
}
.back:hover { color: var(--ink); }
.card-head { margin: 4px 0 16px; }
.card-head h2 { font-size: clamp(22px, 4vw, 30px); line-height: 1.22; letter-spacing: -.02em; }
.card-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.banner {
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 12px 14px; margin: 14px 0; font-size: 14px; color: var(--ink-dim);
  background: var(--surface);
  display: flex; gap: 10px; align-items: flex-start;
}
.banner strong { color: var(--ink); }
.banner.machine { border-color: oklch(48% .06 70); }
.banner.desk { border-color: var(--line-2); }
.ask {
  border-left: 3px solid var(--amber); background: oklch(21.5% .014 260);
  padding: 14px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 14px 0 20px;
}
.ask .label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }
.ask p { font-size: 15.5px; }
.ask p + p { margin-top: 8px; }

.card-layout { display: grid; gap: 26px; align-items: start; }
@media (min-width: 920px) {
  .card-layout { grid-template-columns: minmax(0, 1.35fr) minmax(330px, .9fr); }
  .card-side { position: sticky; top: 132px; }
}

.prose { color: var(--ink); font-size: 15px; line-height: 1.6; }
.prose h2 { font-size: 18px; margin: 26px 0 8px; letter-spacing: -.01em; color: var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 15.5px; margin: 20px 0 6px; color: var(--ink); }
.prose h4 { font-size: 14px; margin: 16px 0 6px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .06em; }
.prose p { margin: 8px 0; color: oklch(86% 0.008 260); }
.prose ul, .prose ol { margin: 8px 0; padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose strong { color: var(--ink); }
.prose code {
  font-family: var(--mono); font-size: .88em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
  overflow-wrap: anywhere;
}
.prose pre {
  background: #161311; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; overflow: auto; font-size: 12.5px;
}
.prose blockquote { border-left: 2px solid var(--line-2); margin: 10px 0; padding: 4px 12px; color: var(--ink-dim); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.prose .mlink { font-family: var(--mono); font-size: .84em; padding: 1px 4px; border-radius: 5px; background: oklch(27% .04 78); text-decoration: none; }
.prose .mlink:hover { background: oklch(34% .06 78); }
code.fn { color: var(--ink-faint); background: transparent; border: 0; padding: 0; font-size: .86em; }

.disclosure { margin: 8px 0 18px; }
.disclosure > summary {
  cursor: pointer; list-style: none; color: var(--amber); font-size: 14px; font-weight: 600;
  padding: 10px 0; min-height: 44px; display: flex; align-items: center; gap: 8px;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: "▸"; color: var(--ink-faint); }
.disclosure[open] > summary::before { content: "▾"; }
.disclosure .prose { border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- media ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 20px; }
@media (min-width: 720px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.media {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #0e0c0b; padding: 0; color: inherit;
  aspect-ratio: 4 / 3; width: 100%; text-align: left;
}
.media.ar-wide { aspect-ratio: 16 / 10; }
.media.ar-tall { aspect-ratio: 4 / 5; }
.media.ar-square { aspect-ratio: 1; }
.media.pano { grid-column: 1 / -1; aspect-ratio: 21 / 8; }
.media img { width: 100%; height: 100%; object-fit: contain; background: #0e0c0b; }
.media .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 8px 6px; font-size: 11.5px; line-height: 1.25;
  color: #f2ece2; background: linear-gradient(transparent, rgb(0 0 0 / .82));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media .kind {
  position: absolute; top: 6px; left: 6px; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; background: rgb(0 0 0 / .66); border: 1px solid rgb(255 255 255 / .18);
  padding: 2px 6px; border-radius: 5px; color: #f2ece2;
}
.media:hover { border-color: var(--amber-dim); }
.media .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 30px; color: #fff; text-shadow: 0 2px 12px #000;
  background: rgb(0 0 0 / .22);
}
.pair { margin: 14px 0 20px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface); }
.pair .pair-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin: 2px 2px 8px; }
.pair .pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair figure { margin: 0; }
.pair figure figcaption { font-size: 12px; color: var(--ink-dim); padding: 5px 2px 0; }
.pair .media { aspect-ratio: 4 / 3; }
.audio-list { display: grid; gap: 8px; margin: 14px 0 20px; }
.audio-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.audio-row .name { font-size: 13px; color: var(--ink-dim); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.audio-row audio { width: min(320px, 60%); height: 38px; }

/* ---------- questions ---------- */
.qset { display: grid; gap: 14px; margin: 6px 0 18px; }
.q {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 14px;
}
.q.answered { border-color: oklch(45% .07 150); }
.q .q-prompt { font-size: 15px; line-height: 1.45; margin-bottom: 10px; }
.q .q-provenance { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; }
.opts { display: grid; gap: 6px; }
.opt {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line-2); border-radius: 9px; padding: 11px 12px;
  background: var(--bg); cursor: pointer; min-height: 46px; text-align: left;
  transition: border-color .1s ease, background .1s ease;
}
.opt:hover { border-color: var(--ink-faint); }
.opt.sel { border-color: var(--amber); background: oklch(26% .04 78); }
.opt .dot {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--ink-faint); margin-top: 1px; display: grid; place-items: center;
}
.opt.sel .dot { border-color: var(--amber); }
.opt.sel .dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.opt span.txt { font-size: 14.5px; line-height: 1.4; }
.q textarea { margin-top: 8px; min-height: 76px; resize: vertical; }
.q .q-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.q .answered-note { font-size: 13px; color: var(--good); margin-top: 8px; }

.verdict { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px; margin: 6px 0 18px; }
.verdict .v-prompt { font-size: 15px; margin-bottom: 10px; }
.vrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vbtn {
  border: 1px solid var(--line-2); background: var(--bg); border-radius: 9px;
  padding: 10px 8px; min-height: 54px; color: var(--ink-dim); font-size: 13px; line-height: 1.25;
}
.vbtn:hover { border-color: var(--ink-faint); color: var(--ink); }
.vbtn.on { border-color: var(--amber); color: var(--amber); background: oklch(26% .04 78); }
.vbtn.on[data-v="fix"] { border-color: var(--bad); color: var(--bad); background: oklch(24% .04 25); }
.vbtn.on[data-v="ok"] { border-color: var(--good); color: var(--good); background: oklch(24% .04 150); }
.vnote { margin-top: 10px; }
.vnote textarea { min-height: 80px; resize: vertical; }
.note-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; justify-content: flex-end; }

.done-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px;
}
.done-row .spacer { flex: 1; }
.toggle {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.toggle input { width: 18px; height: 18px; accent-color: var(--amber); }
.cardnav { display: flex; gap: 8px; justify-content: space-between; margin-top: 22px; }
.jumpbtn {
  position: fixed; right: 14px; bottom: calc(14px + var(--safe-b)); z-index: 22;
  display: none; align-items: center; gap: 6px;
  background: var(--amber); color: #181310; border: 0; border-radius: 999px;
  padding: 12px 16px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
  transition: opacity .15s ease, transform .15s ease;
}
.jumpbtn.hide { opacity: 0; pointer-events: none; transform: translateY(8px); }
@media (max-width: 919px) { .jumpbtn { display: inline-flex; } }

/* ---------- clips ---------- */
.clip-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: 0 0 14px; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
}
.clip-toolbar input[type="search"] {
  flex: 1 1 180px; min-width: 0; background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px; min-height: 42px;
}
.clip-toolbar select { width: auto; min-width: 150px; min-height: 42px; background: var(--bg); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-dim);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; min-height: 38px;
}
.fchip.on { background: var(--amber); border-color: var(--amber); color: #181310; font-weight: 700; }
.clip-progress {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  margin: 0 0 14px; font-size: 13px; color: var(--ink-dim);
}
.clip-progress .bar {
  order: 10; flex: 1 1 100%; height: 6px; border: 0; border-radius: 999px;
  background: var(--surface-2); overflow: hidden; appearance: none; -webkit-appearance: none;
}
.clip-progress .bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.clip-progress .bar::-webkit-progress-value { background: linear-gradient(90deg, #8fae62, var(--amber)); border-radius: 999px; }
.clip-progress .bar::-moz-progress-bar { background: var(--amber); border-radius: 999px; }

.clip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .clip-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .clip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.clip-tile {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  background: #0e0c0b; overflow: hidden; aspect-ratio: 4 / 5; width: 100%;
  padding: 0; color: #f2ece2; text-align: left;
}
.clip-tile img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.clip-tile:hover img { opacity: 1; }
.clip-tile .tile-top {
  position: absolute; top: 0; left: 0; right: 0; padding: 6px 7px;
  display: flex; gap: 5px; align-items: flex-start; justify-content: space-between;
  background: linear-gradient(rgb(0 0 0 / .66), transparent);
}
.clip-tile .tile-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 7px;
  background: linear-gradient(transparent, rgb(0 0 0 / .9));
}
.clip-tile .tile-title { font-size: 12.5px; line-height: 1.25; font-weight: 600; }
.clip-tile .tile-family { font-size: 10.5px; color: #c9c0b4; margin-top: 2px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-v {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; border: 1px solid rgb(255 255 255 / .4); background: rgb(0 0 0 / .5);
}
.badge-v.approve { background: var(--good); color: #10200f; border-color: var(--good); }
.badge-v.changes { background: var(--amber); color: #201a08; border-color: var(--amber); }
.badge-v.reject { background: var(--bad); color: #240a08; border-color: var(--bad); }
.badge-v.notes { background: #4b4138; color: #ece6dc; border-color: #8a8074; font-size: 15px; }
.badge-star { color: var(--amber); font-size: 15px; }
.clip-empty { padding: 30px; text-align: center; color: var(--ink-faint); }

.gate-list { display: grid; gap: 12px; margin: 14px 0 20px; }
.gate { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 15px; }
.gate h3 { font-size: 16px; margin-bottom: 6px; }
.gate .why { color: var(--ink-dim); font-size: 13.5px; margin-bottom: 10px; }
.gate .warn { border-left: 2px solid var(--warn); padding-left: 10px; color: var(--warn); font-size: 12.5px; margin: 10px 0; }
.gate textarea { margin-top: 9px; min-height: 64px; }
.gate .gate-status { font-size: 12.5px; color: var(--good); margin-top: 8px; }

/* ---------- sent ---------- */
.sent-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0 22px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--ink-dim); }
.note-item {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 12px 14px; margin-bottom: 8px;
}
.note-item .note-meta { font-size: 12px; color: var(--ink-faint); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.note-item p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.answer-list { display: grid; gap: 8px; }
.answer-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.answer-item .a-q { font-size: 13px; color: var(--ink-dim); }
.answer-item .a-v { font-size: 14.5px; margin-top: 3px; color: var(--amber); overflow-wrap: anywhere; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: rgb(8 7 6 / .97);
  display: flex; flex-direction: column;
}
.lb-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid rgb(255 255 255 / .1);
}
.lb-caption { font-size: 13px; color: #d8d0c4; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-actions { display: flex; gap: 6px; }
.lb-stage {
  flex: 1; overflow: auto; display: grid; place-items: center; padding: 10px;
  touch-action: pinch-zoom;
}
.lb-stage img { max-width: 100%; max-height: calc(100dvh - 90px); object-fit: contain; }
.lb-stage video { max-width: 100%; max-height: calc(100dvh - 90px); }
.lb-stage audio { width: min(560px, 90vw); }

/* ---------- clip sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgb(8 7 6 / .78); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 760px) { .sheet { align-items: center; } }
.sheet-box {
  width: min(760px, 100%); max-height: 94dvh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow);
  padding: 0 0 calc(18px + var(--safe-b));
}
@media (min-width: 760px) { .sheet-box { border-radius: 16px; } }
.sheet-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.sheet-head h2 { font-size: 18px; letter-spacing: -.01em; }
.sheet-head .btn { flex: none; margin-left: auto; }
.sheet-body { padding: 12px 16px 8px; }
.videowrap { background: #0b0a09; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.videowrap video { width: 100%; max-height: 60dvh; background: #0b0a09; }
.viewtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.viewtab { border: 1px solid var(--line-2); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; min-height: 38px; color: var(--ink-dim); }
.viewtab.on { border-color: var(--amber); color: var(--amber); }
.clip-kind { color: var(--ink-dim); font-size: 13.5px; margin: 4px 0 10px; }
.clip-desc { color: var(--ink-dim); font-size: 13px; line-height: 1.5; margin: 8px 0 12px; }
.speedrow { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--ink-faint); }
.speedrow .btn { min-height: 34px; padding: 4px 10px; font-size: 12.5px; }
.clip-note textarea { min-height: 76px; margin-top: 8px; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tag {
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-dim);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; min-height: 34px;
}
.tag-label { font-size: 12px; color: var(--ink-faint); align-self: center; margin-right: 2px; }
.tag.on { border-color: var(--work); color: var(--work); background: oklch(24% .03 235); }
.sheet-foot {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px 4px; border-top: 1px solid var(--line); margin-top: 8px;
}
.sheet-foot .spacer { flex: 1; }
.star-btn { border: 1px solid var(--line-2); background: var(--bg); border-radius: 9px; padding: 8px 12px; min-height: 40px; color: var(--ink-dim); }
.star-btn.on { border-color: var(--amber); color: var(--amber); background: oklch(26% .04 78); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translate(-50%, 20px);
  background: #2b241e; color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 9px 16px; font-size: 13.5px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease;
  z-index: 90; max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--bad); color: #ffd9d2; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--ink-faint); padding: 40px 10px; }
.loading { text-align: center; color: var(--ink-faint); padding: 40px 10px; }
.mt { margin-top: 12px; }
.hr { height: 1px; background: var(--line); margin: 20px 0; }
.noscript { padding: 20px; color: var(--bad); }

@media (max-width: 520px) {
  .main { padding: 14px 12px 100px; }
  .top { padding: 9px 12px 0; gap: 2px 8px; }
  .brand { gap: 9px; }
  .brand h1 { font-size: 16.5px; }
  .brand-mark.small { width: 34px; height: 34px; font-size: 18px; }
  .brand .sub { font-size: 11.5px; max-width: 58vw; }
  .tabs { padding: 5px 12px 7px; }
  .tab { padding: 8px 12px; font-size: 13.5px; min-height: 40px; }
  .gallery { gap: 6px; }
  .vrow { gap: 5px; }
  .vbtn { font-size: 12px; padding: 9px 5px; }
  .top-right .save-pill { display: none; }
  .top-right .btn.small { min-height: 38px; padding: 6px 11px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
