:root {
  --bg: #f6f6f4; --panel: #ffffff; --ink: #1d1d1b; --muted: #6b6b66; --line: #e3e2dd;
  --accent: #b4441c; --accent-ink: #fff;
  --s-req: #2f6fb0; --s-chg: #b7791f; --s-cdone: #d9480f; --s-del: #8b3fb5; --s-ok: #2f855a; --s-hold: #7a7a74;
  --radius: 8px; --font: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --panel: #1f1f1d; --ink: #ecebe6; --muted: #9a9a93; --line: #34342f;
    --accent: #e0693d; --s-req: #6aa7e6; --s-chg: #e3a948; --s-cdone: #ff7a45; --s-del: #c084f5; --s-ok: #5fc08a; --s-hold: #8f8f88;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
header.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header.top .brand { font-weight: 700; letter-spacing: .02em; text-decoration: none; }
header.top .brand span { color: var(--accent); }
header.top .version { font-size: 11px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; margin-left: -6px; }
header.top .version:hover { color: var(--ink); }
header.top nav { display: flex; gap: 14px; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto;
  white-space: nowrap; scrollbar-width: none; }
header.top nav::-webkit-scrollbar { display: none; }
@media (max-width: 1100px) { header.top nav { order: 3; flex-basis: 100%; } header.top .scan { margin-left: auto; } }
header.top nav a { text-decoration: none; color: var(--muted); }
header.top nav a:hover { color: var(--ink); }
.scan { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.scan .err { color: #c53030; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 1280px; margin: 0 auto; padding: 20px; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 16px; margin: 0 0 10px; }
.flash { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.grow { flex: 1; min-width: 280px; }
.btn, button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover, button:hover { border-color: var(--muted); }
.btn.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ok, button.ok { background: var(--s-ok); color: #fff; border-color: var(--s-ok); }
.btn.warn, button.warn { background: var(--s-chg); color: #fff; border-color: var(--s-chg); }
.btn.small, button.small { padding: 3px 8px; font-size: 12px; }
button.link { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 9px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
label.inline { display: inline-flex; gap: 6px; align-items: center; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; color: var(--ink); }
label.inline input { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 14px 0; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); border: 1px solid transparent; }
.tabs a.on { background: var(--panel); border-color: var(--line); color: var(--ink); font-weight: 600; }
.tabs .n { font-size: 11px; background: var(--line); border-radius: 999px; padding: 1px 6px; margin-left: 4px; color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.cancelled td { opacity: .5; }
td.slug a { font-weight: 600; text-decoration: none; }
td.slug a:hover { text-decoration: underline; }
.tablewrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid currentColor; }
.st-REQUESTED { color: var(--s-req); } .st-CHANGES { color: var(--s-chg); } .st-DELIVERED { color: var(--s-del); }
.st-APPROVED { color: var(--s-ok); } .st-ON_HOLD, .st-CANCELLED { color: var(--s-hold); }
.ball { font-size: 11px; color: var(--muted); }
.ball.team { color: var(--s-del); font-weight: 700; }
.pr-HIGH { color: var(--s-chg); font-weight: 700; } .pr-URGENT { color: #c53030; font-weight: 700; } .pr-LOW { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; display: block; }
.card:hover { border-color: var(--muted); }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.stats { display: flex; gap: 14px; font-size: 13px; flex-wrap: wrap; }
.stats b { font-size: 18px; display: block; }
.copy { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px dashed var(--line); border-radius: 6px; padding: 8px 10px; }
.copy code { flex: 1; font-family: var(--mono); overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .who { font-weight: 600; } .timeline .when { color: var(--muted); font-size: 12px; margin-left: 6px; }
.timeline .k-changes { border-left: 3px solid var(--s-chg); padding-left: 10px; }
.timeline .k-approve { border-left: 3px solid var(--s-ok); padding-left: 10px; }
.timeline .k-system .body { color: var(--muted); }
.body { white-space: pre-wrap; }
.pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; background: var(--bg); padding: 10px; border-radius: 6px; border: 1px solid var(--line); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.login { max-width: 360px; margin: 12vh auto; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
details summary { cursor: pointer; color: var(--muted); }
@media (max-width: 720px) {
  main { padding: 12px; }
  .hide-sm { display: none; }
}

/* revision rounds */
.check { padding: 4px 0; }
.check-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.check-row .done { text-decoration: line-through; color: var(--muted); }
.round { border-left: 3px solid var(--line); padding: 4px 0 6px 12px; margin-bottom: 12px; }
.round.open { border-left-color: var(--s-chg); }
.round-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
ul.items { list-style: none; padding: 0; margin: 4px 0 0; }
ul.items li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; flex-wrap: wrap; }
ul.items .mark { width: 14px; text-align: center; color: var(--muted); font-weight: 700; }
ul.items .mark.ok { color: var(--s-ok); }
ul.items .mark.open { color: var(--s-chg); }
ul.items .it-fixed .txt, ul.items .it-dropped .txt { color: var(--muted); }
ul.items .it-carried .txt { color: var(--muted); text-decoration: line-through; }
.timeline .k-designer { border-left: 3px solid var(--s-req); padding-left: 10px; }

/* assets */
.assets { display: flex; flex-direction: column; gap: 10px; }
.asset { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.asset-thumb { width: 96px; height: 64px; object-fit: cover; border-radius: 4px; background: var(--bg); display: block; }
.asset-ico { width: 48px; height: 48px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.asset-meta { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.asset-act { display: flex; gap: 6px; }
.drop { margin-top: 12px; border: 2px dashed var(--line); border-radius: 8px; padding: 16px; text-align: center; }
.drop.over { border-color: var(--accent); background: var(--bg); }
.up-row { display: grid; grid-template-columns: 1fr 160px 90px; gap: 10px; align-items: center; margin-top: 8px; font-size: 13px; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.up-row.fail .up-pct { color: #c53030; }

/* player */
.player video { width: 100%; max-height: 420px; background: #000; border-radius: 6px; display: block; }
.player-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.versions { display: flex; gap: 4px; flex-wrap: wrap; }
.vbtn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* report */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.tile b { display: block; font-size: 24px; line-height: 1.1; }
.tile span { font-size: 12px; color: var(--muted); }
.bar { display: inline-block; height: 8px; background: var(--accent); border-radius: 4px; vertical-align: middle; margin-right: 6px; opacity: .8; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media print {
  header.top, .no-print, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, table, .tile { border-color: #ccc; break-inside: avoid; }
  main { max-width: none; padding: 0; }
}

.st-CHANGES_DONE { color: var(--s-cdone); }
.badge.st-CHANGES_DONE { background: var(--s-cdone); color: #fff; border-color: var(--s-cdone); }
.ball.cdone { color: var(--s-cdone); }
a.autolink { color: var(--s-req); overflow-wrap: anywhere; }
.tabs .n.cdone { background: var(--s-cdone); color: #fff; }
.tcjump { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--bg); color: var(--s-req); cursor: pointer; }
.tcjump:hover { border-color: var(--s-req); }
.rnotes { list-style: none; padding: 0; margin: 8px 0 0; }
.rnotes li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); }
.rnotes li .txt { flex: 1; overflow-wrap: anywhere; }
.rnote-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rnote-form input[name=text] { flex: 1; min-width: 200px; }
.tc-now { font-family: var(--mono); font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 104px; text-align: center; }
.archived-bar { background: var(--panel); border: 1px dashed var(--muted); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.danger { border-color: #c53030 !important; }
.danger-btn, .btn.danger-btn { color: #c53030; border-color: #c53030; }
.stats-grid { display: flex; gap: 24px; flex-wrap: wrap; }
.stats-grid table { width: auto; min-width: 200px; }
.timeline .k-designer-done { border-left: 3px solid var(--s-cdone); padding-left: 10px; }
.st-HIRES { color: var(--s-ok); }
.badge.st-HIRES { background: var(--s-ok); color: #fff; border-color: var(--s-ok); }
table.grid-brief td { vertical-align: top; padding: 4px; }
table.grid-brief textarea { min-height: 34px; resize: vertical; margin: 0; overflow: hidden; }
table.grid-brief th:nth-child(2), table.grid-brief th:nth-child(3) { width: 34%; }
.urgent-tick { padding: 8px 0; }
table.brief-view td { vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
table.brief-view td.n { color: var(--muted); width: 28px; }
.badge.urgent { color: #c53030; }
.timeline .k-to-designer { border-left: 3px solid var(--s-del); padding-left: 10px; }

/* ---- review portal ---- */
.player video { max-height: 68vh; }
.marks { position: relative; height: 12px; margin-top: 6px; background: var(--line); border-radius: 3px; }
.marks i { position: absolute; top: 0; width: 4px; margin-left: -2px; height: 12px; background: var(--s-chg); cursor: pointer; border-radius: 2px; }
.marks i.res { background: var(--s-ok); opacity: .7; }
.marks .pos { position: absolute; top: -2px; width: 2px; height: 16px; background: var(--ink); pointer-events: none; }
.cms { list-style: none; padding: 0; margin: 0; }
.cm { padding: 9px 6px; border-bottom: 1px solid var(--line); border-radius: 4px; }
.cm:last-child { border-bottom: 0; }
.cm:target, .cm.hit { background: var(--bg); }
.cm.resolved > .line .txt { color: var(--muted); }
.cm .line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cm .txt { flex: 1 1 200px; overflow-wrap: anywhere; white-space: pre-wrap; }
.cm .meta { font-size: 12px; color: var(--muted); }
.cm .who { font-weight: 600; }
.cm .replies { margin: 6px 0 0 20px; border-left: 2px solid var(--line); padding-left: 10px; }
.cm .replies .line { padding: 3px 0; }
.cm .tools { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: 12px; }
.cm .tools form { display: inline; }
.cm details { display: inline-block; }
.cm details[open] { display: block; margin-top: 6px; }
.cm details form { display: flex; gap: 6px; margin-top: 4px; }
.tcjump { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); }
.secret { border-left: 4px solid var(--s-ok); }
.secret .kv { display: grid; grid-template-columns: 90px 1fr auto; gap: 6px 10px; align-items: center; margin-top: 8px; }
.secret .kv code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.st-ready, .st-active { color: var(--s-ok); } .st-processing { color: var(--s-req); } .st-failed { color: #c53030; }
.st-removed, .st-expired, .st-revoked { color: var(--s-hold); }
.wmprev { max-width: 260px; max-height: 140px; border: 1px solid var(--line); border-radius: 6px;
  background: repeating-conic-gradient(#8884 0% 25%, transparent 0% 50%) 50% / 16px 16px; display: block; margin-top: 6px; }
.crumbs { font-size: 13px; color: var(--muted); min-height: 18px; overflow-wrap: anywhere; }
h1, .card h3 { overflow-wrap: anywhere; }
select { max-width: 100%; min-width: 0; }
.filters select { flex: 0 1 auto; }
.card.folder { border-style: dashed; }
.linkedit { margin-top: 6px; padding: 10px; background: var(--bg); border-radius: 6px; }
.share { max-width: 1100px; margin: 0 auto; }
.share video { width: 100%; max-height: 78vh; background: #000; border-radius: 6px; display: block; }
.notice { border-left: 4px solid var(--s-chg); }
