/* ============================================================================
   Sheet Music — design system
   Identity: a well-kept orchestra library. Score-ink navy + brass on warm paper.
   Type roles: Fraunces (expressive), Inter (UI), JetBrains Mono (library data).
   ========================================================================== */

:root {
  --paper:       #F6F4ED;
  --surface:     #FFFFFF;
  --surface-2:   #FBFAF4;
  --ink:         #1B1D24;
  --ink-soft:    #3C404B;
  --muted:       #74777F;
  --line:        #E7E2D6;
  --line-strong: #D9D3C4;
  --navy:        #1F2C49;
  --navy-700:    #16203A;
  --brass:       #A8791F;
  --brass-600:   #8C6515;
  --brass-tint:  #F2E9D2;

  --ok:#356B4F;  --ok-bg:#E6F0EA;
  --warn:#8A6212; --warn-bg:#F4EAD3;
  --danger:#A6362F; --danger-bg:#F5E4E1;
  --info:#2C4778; --info-bg:#E7EDF7;

  --r-sm: 7px;
  --r:    11px;
  --r-lg: 18px;
  --shadow-1: 0 1px 2px rgba(27,29,36,.05), 0 1px 1px rgba(27,29,36,.04);
  --shadow-2: 0 6px 22px -10px rgba(27,29,36,.20), 0 2px 6px -2px rgba(27,29,36,.08);
  --shadow-3: 0 18px 50px -22px rgba(22,32,58,.42);

  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --maxw: 1120px;
}

* { box-sizing: border-box; }

/* the hidden attribute must win over component display rules (.rowpanel, .lightbox, …) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 380px at 80% -120px, #FFFDF7 0%, rgba(255,253,247,0) 70%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--brass-600); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 560; color: var(--ink);
  letter-spacing: -.01em; line-height: 1.12; margin: 0; font-optical-sizing: auto; }

.mono { font-family: var(--font-mono); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.main { padding: 34px 0 80px; }

.pagehead { display:flex; align-items:flex-end; justify-content:space-between;
  gap:18px; margin-bottom: 22px; flex-wrap: wrap; }
.pagehead .eyebrow { font-family: var(--font-mono); font-size:11px; letter-spacing:.16em;
  text-transform:uppercase; color: var(--brass-600); margin-bottom:7px; }
.pagehead h1 { font-size: clamp(26px, 3vw, 34px); }
.pagehead p.sub { color: var(--muted); margin:.4rem 0 0; }
.pagehead .actions { display:flex; gap:10px; align-items:center; }

/* ---------- top bar ---------- */
.topbar { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #EBE9E2; position: sticky; top:0; z-index: 40;
  border-bottom: 1px solid rgba(255,255,255,.06); }
.topbar .wrap { display:flex; align-items:center; gap: 20px; height: 60px; }
.brand { display:flex; align-items:center; gap:11px; color:#fff; font-family:var(--font-display);
  font-size: 19px; font-weight: 600; letter-spacing:-.01em; }
.brand:hover { color:#fff; }
.brand .clef { width:26px; height:26px; display:grid; place-items:center; color: var(--brass);
  border:1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.04); }
.brand .clef svg { width:15px; height:15px; }
.topnav { display:flex; gap:4px; margin-left: 6px; }
.topnav a { color: rgba(235,233,226,.78); padding:7px 12px; border-radius: 8px; font-size:14px;
  font-weight: 500; }
.topnav a:hover { color:#fff; background: rgba(255,255,255,.07); }
.topnav a.active { color:#fff; background: rgba(255,255,255,.10); }
.topbar .spacer { flex:1; }
.topbar-right { display:flex; align-items:center; gap:14px; }
.userchip { color: rgba(235,233,226,.72); font-size: 13.5px; }

/* org switcher + generic dropdown */
.dropdown { position: relative; }
.dropdown__toggle { display:inline-flex; align-items:center; gap:8px; cursor:pointer;
  background: rgba(255,255,255,.06); color:#F1EFE8; border:1px solid rgba(255,255,255,.14);
  padding:7px 12px; border-radius: 9px; font: inherit; font-size:13.5px; font-weight:500; }
.dropdown__toggle:hover { background: rgba(255,255,255,.12); }
.dropdown__toggle .caret { width:8px; height:8px; border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor; transform: rotate(45deg); margin-top:-3px; opacity:.7; }
.dropdown__menu { position:absolute; right:0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); border:1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-2); padding:6px; display:none; z-index: 50; }
.dropdown.open .dropdown__menu { display:block; animation: pop .12s ease-out; }
.dropdown__menu form { margin:0; }
.dropdown__item { display:flex; align-items:center; justify-content:space-between; gap:10px;
  width:100%; text-align:left; background:none; border:0; cursor:pointer; font: inherit;
  color: var(--ink); padding:9px 11px; border-radius: 8px; }
.dropdown__item:hover { background: var(--surface-2); }
.dropdown__item.active { color: var(--brass-600); font-weight:600; }
.dropdown__item.active::after { content:"●"; font-size:9px; color: var(--brass); }
@keyframes pop { from{opacity:0; transform: translateY(-4px);} to{opacity:1; transform:none;} }

/* ---------- buttons ---------- */
.btn { --bg:var(--surface); --fg:var(--ink); --bd:var(--line-strong);
  display:inline-flex; align-items:center; gap:8px; justify-content:center;
  font:inherit; font-weight:560; font-size:14px; line-height:1; cursor:pointer;
  padding:10px 16px; border-radius: 10px; border:1px solid var(--bd);
  background: var(--bg); color: var(--fg); transition: transform .04s ease, box-shadow .15s, background .15s;
  white-space: nowrap; }
.btn:hover { box-shadow: var(--shadow-1); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn--primary { --bg: var(--navy); --fg:#fff; --bd: var(--navy); }
.btn--primary:hover { --bg: var(--navy-700); color:#fff; }
.btn--brass { --bg: var(--brass); --fg:#fff; --bd: var(--brass); }
.btn--brass:hover { --bg: var(--brass-600); color:#fff; }
.btn--ghost { --bg: transparent; --fg: var(--ink-soft); --bd: var(--line-strong); }
.btn--ghost:hover { --bg: var(--surface); }
.btn--danger { --bg: transparent; --fg: var(--danger); --bd: #E3C7C2; }
.btn--danger:hover { --bg: var(--danger-bg); color: var(--danger); }
.btn--ok { --bg: var(--ok); --fg:#fff; --bd: var(--ok); }
.btn--ok:hover { --bg:#2C5A42; color:#fff; }
.btn--ok-out { --bg: var(--ok-bg); --fg: var(--ok); --bd:#BBD6C5; }
.btn--ok-out:hover { --bg:#DCEBE2; color: var(--ok); }
.btn--lg { padding:13px 20px; font-size:15px; border-radius: 12px; }
.btn--sm { padding:7px 11px; font-size:13px; border-radius: 8px; }
.btn--block { width:100%; }
.btn[disabled] { opacity:.55; pointer-events:none; }

/* ---------- cards ---------- */
.card { background: var(--surface); border:1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); }
.card__body { padding: 20px 22px; }
.card + .card { margin-top: 16px; }

.panel { background: var(--surface); border:1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: 22px 24px; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field > label { display:block; font-size: 12.5px; font-weight:600; color: var(--ink-soft);
  letter-spacing:.01em; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top:5px; }
.field-status { display:block; font-size: 12px; margin-top:5px; color: var(--muted); }
.field-status.is-ok { color: var(--ok); }
.field-status.is-bad { color: var(--danger); }
/* bare <input> (no type attr) defaults to text but doesn't match input[type=text],
   so include input:not([type]) — this is what was leaving fields like "voice" unstyled. */
.input, input:not([type]), input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=search], select, textarea {
  width:100%; font:inherit; font-size: 14.5px; color: var(--ink); background: var(--surface);
  border:1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s; }
select { -webkit-appearance:none; appearance:none; cursor:pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) center, calc(100% - 12px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { resize: vertical; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none;
  border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,44,73,.12); }
input[type=file] { padding: 9px 12px; background: var(--surface-2); }
.check { display:flex; align-items:center; gap:9px; font-size:14px; color: var(--ink-soft); }
.check input { width:16px; height:16px; accent-color: var(--navy); }
.form-narrow { max-width: 30rem; }
.form-row { display:flex; gap: 14px; flex-wrap: wrap; }
.form-row > * { flex:1; min-width: 0; }
.inline-form { display:inline; }

/* ---------- tables ---------- */
.table { width:100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align:left; font-family: var(--font-mono); font-weight:500; font-size:11px;
  letter-spacing:.08em; text-transform: uppercase; color: var(--muted);
  padding: 8px 12px; border-bottom:1px solid var(--line); }
.table td { padding: 12px; border-bottom:1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { font-family: var(--font-mono); color: var(--ink-soft); }
.table.tight td { padding: 9px 12px; }

/* ---------- pills / badges ---------- */
.pill { display:inline-flex; align-items:center; gap:6px; font-family: var(--font-mono);
  font-size: 11.5px; font-weight:500; letter-spacing:.02em; padding: 3px 9px; border-radius: 999px;
  border:1px solid var(--line-strong); color: var(--ink-soft); background: var(--surface-2); }
.pill--brass { color: var(--brass-600); background: var(--brass-tint); border-color:#E7D6A8; }
.pill--ok { color: var(--ok); background: var(--ok-bg); border-color:#CDE0D3; }
.pill--warn { color: var(--warn); background: var(--warn-bg); border-color:#E7D6A8; }
.pill--danger { color: var(--danger); background: var(--danger-bg); border-color:#E7C9C3; }
.pill--muted { color: var(--muted); }

.catnum { font-family: var(--font-mono); font-size: 12px; font-weight:600; letter-spacing:.03em;
  color: var(--navy); background: #EDF0F6; border:1px solid #DCE2EE; padding: 3px 8px;
  border-radius: 6px; display:inline-block; }

/* ---------- flash ---------- */
.flashes { margin-bottom: 20px; display:flex; flex-direction:column; gap:10px; }
.flash { display:flex; align-items:flex-start; gap:11px; padding: 12px 14px; border-radius: 12px;
  border:1px solid; font-size: 14px; }
.flash button { margin-left:auto; background:none; border:0; cursor:pointer; color: inherit;
  opacity:.55; font-size:18px; line-height:1; padding:0 2px; }
.flash button:hover { opacity:1; }
.flash::before { content:""; width:18px; height:18px; flex:none; margin-top:1px;
  background: currentColor; -webkit-mask: var(--ico) center/contain no-repeat; mask: var(--ico) center/contain no-repeat; }
.flash--success, .flash--info { color: var(--ok); background: var(--ok-bg); border-color:#CDE0D3; }
.flash--info { color: var(--info); background: var(--info-bg); border-color:#D3DEF0; }
.flash--danger { color: var(--danger); background: var(--danger-bg); border-color:#E7C9C3; }
.flash--warning { color: var(--warn); background: var(--warn-bg); border-color:#E7D6A8; }

/* ---------- segmented view toggle ---------- */
.seg { display:inline-flex; background: var(--surface-2); border:1px solid var(--line-strong);
  border-radius: 10px; padding: 3px; gap:2px; }
.seg__btn { display:inline-flex; align-items:center; gap:7px; border:0; background:none; cursor:pointer;
  font:inherit; font-size: 13px; font-weight:560; color: var(--muted); padding: 6px 12px; border-radius: 8px; }
.seg__btn svg { width:15px; height:15px; }
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-1); }

/* ---------- collection: rows <-> cards ---------- */
.collection.is-cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.collection.is-rows  { display:flex; flex-direction:column; border:1px solid var(--line);
  border-radius: var(--r-lg); overflow:hidden; background: var(--surface); box-shadow: var(--shadow-1); }

/* card mode item */
.is-cards .item { background: var(--surface); border:1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); overflow:hidden; display:flex; flex-direction:column;
  transition: transform .12s ease, box-shadow .18s ease; }
.is-cards .item:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.is-cards .item__cover { aspect-ratio: 3/4; background: var(--surface-2) center/cover no-repeat;
  border-bottom:1px solid var(--line); position:relative; }
.is-cards .item__cover .catnum { position:absolute; top:10px; left:10px; box-shadow: var(--shadow-1); }
.is-cards .item__body { padding: 13px 14px 15px; display:flex; flex-direction:column; gap:4px; flex:1; }
.is-cards .item__title { font-family: var(--font-display); font-size: 17px; font-weight:560; line-height:1.18; }
.is-cards .item__meta { color: var(--muted); font-size: 13px; margin-top:auto; padding-top:8px;
  display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.is-cards .item__rowcat { display:none; }

/* row mode item */
.is-rows .item { display:flex; align-items:center; gap:16px; padding: 13px 18px;
  border-bottom:1px solid var(--line); }
.is-rows .item:last-child { border-bottom:0; }
.is-rows .item:hover { background: var(--surface-2); }
.is-rows .item__cover { display:none; }
.is-rows .item__rowcat { display:block; flex:none; width: 86px; }
.is-rows .item__body { display:flex; align-items:center; gap:16px; flex:1; padding:0; }
.is-rows .item__title { font-family: var(--font-display); font-size: 16px; }
.is-rows .item__meta { margin-left:auto; color: var(--muted); font-size: 13px; display:flex; gap:16px; align-items:center; }

/* ---------- empty state ---------- */
.empty { text-align:center; padding: 56px 20px; color: var(--muted); }
.empty .empty__mark { width:46px; height:46px; margin:0 auto 14px; color: var(--line-strong); }
.empty h3 { font-size: 19px; color: var(--ink-soft); margin-bottom:6px; }

/* ---------- stat tiles (admin dashboard / home) ---------- */
.tiles { display:grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.tile { background: var(--surface); border:1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-1); display:flex; flex-direction:column; gap:6px;
  transition: transform .12s, box-shadow .18s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tile .tile__n { font-family: var(--font-display); font-size: 30px; line-height:1; }
.tile .tile__label { color: var(--muted); font-size: 13.5px; }
.tile a.tile__link { font-size: 13.5px; font-weight:600; margin-top: 4px; }

/* ---------- job stepper ---------- */
.steps { display:flex; align-items:flex-start; gap:0; margin: 6px 0 26px; }
.step { flex:1; display:flex; flex-direction:column; align-items:center; text-align:center;
  position:relative; gap:9px; }
.step::before { content:""; position:absolute; top:13px; left:-50%; width:100%; height:2px;
  background: var(--line-strong); z-index:0; }
.step:first-child::before { display:none; }
.step__dot { width:28px; height:28px; border-radius:50%; background: var(--surface);
  border:2px solid var(--line-strong); display:grid; place-items:center; z-index:1;
  font-size:12px; color: var(--muted); font-family:var(--font-mono); transition: all .2s; }
.step__label { font-size: 12.5px; color: var(--muted); font-weight:560; }
.step.done .step__dot { background: var(--navy); border-color: var(--navy); color:#fff; }
.step.done::before { background: var(--navy); }
.step.active .step__dot { border-color: var(--brass); color: var(--brass-600); background: var(--brass-tint);
  box-shadow: 0 0 0 4px rgba(168,121,31,.14); }
.step.active .step__label { color: var(--ink); }
.step.failed .step__dot { background: var(--danger); border-color: var(--danger); color:#fff; }

/* ---------- meter ---------- */
.meter { height: 10px; background: var(--surface-2); border:1px solid var(--line);
  border-radius: 999px; overflow:hidden; }
.meter__bar { height:100%; width:0; border-radius: 999px;
  background: linear-gradient(90deg, var(--navy), #2C3F66); transition: width .5s ease; }
.meter__bar.is-failed { background: var(--danger); }
.stage-line { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:9px; }
.stage-line .stage { font-weight:600; }
.stage-line .pct { font-family: var(--font-mono); color: var(--muted); font-size: 13px; }

/* ---------- review: per-page coverage strip ---------- */
.cover-legend { display:flex; gap:14px; font-size:11.5px; color: var(--muted); }
.cover-legend .dot { display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:5px; vertical-align:middle; }
.dot--ok { background:#9DB3C9; } .dot--gap { background: var(--danger); } .dot--col { background: var(--brass); }
.cover-strip { display:flex; gap:1px; height: 26px; margin: 12px 0 10px; border-radius:6px; overflow:hidden;
  background: var(--surface-2); border:1px solid var(--line); }
.cover-cell { flex:1 1 0; min-width:1px; transition: background .12s; }
.cover-cell.is-ok { background:#9DB3C9; } .cover-cell.is-gap { background: var(--danger); }
.cover-cell.is-col { background: var(--brass); }
.coverage-summary { font-size: 13px; display:flex; flex-wrap:wrap; gap:14px; }
.coverage-summary .cov-ok { color: var(--ok); }
.coverage-summary .cov-warn { color: var(--danger); }
.coverage-summary .cov-col { color: var(--brass-600); }

/* ---------- review: full-viewport, no-scroll layout ---------- */
.page-review .main { padding: 0; }
.page-review .main .wrap { max-width: none; padding: 0; }
.review-shell { height: calc(100vh - 60px); display:flex; flex-direction:column;
  padding: 12px 22px 14px; gap: 10px; overflow: hidden; }
.review-head { flex:none; display:grid; grid-template-columns: auto minmax(0,1fr) auto; align-items:center; gap: 22px; }
.review-head__title h1 { font-size: clamp(19px, 1.7vw, 25px); }
.review-head__title .eyebrow { margin-bottom: 3px; }
.review-head__cov { min-width:0; }
.review-head__cov .cover-strip { margin: 0 0 5px; height: 18px; }
.review-head__cov .coverage-summary { font-size: 12px; gap: 12px; }
.review-head__actions { justify-self:end; }
#review-form { flex:1; min-height:0; display:flex; }

.reviewer { flex:1; min-height:0; display:grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; width:100%; }
/* coverflow page viewer: one big page centered, prev/next peeking small on the sides */
.reviewer__pages { min-height:0; height:100%; display:flex; flex-direction:column; gap: 8px; }
.reviewer__empty { color: var(--muted); padding: 40px; text-align:center; border:1px dashed var(--line-strong);
  border-radius: var(--r-lg); margin:auto; }
.filmstrip { flex:1; min-height:0; display:flex; align-items:stretch; justify-content:center; gap: 16px; }
.film-center { position:relative; flex:0 1 auto; min-width:0; margin:0; background: var(--surface);
  border:1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); overflow:hidden; }
.film-center img { display:block; height:100%; width:auto; max-width:100%; margin:0 auto;
  object-fit:contain; background:#fff; cursor: zoom-in; }
.film-side { flex:none; align-self:center; width: clamp(110px, 15vw, 250px); border:0; background:none;
  cursor:pointer; padding:0; opacity:.5; transition: opacity .15s, transform .15s;
  display:flex; flex-direction:column; align-items:center; gap:6px; }
.film-side:hover { opacity:1; transform: scale(1.03); }
.film-side img { width:100%; height:auto; max-height: calc(100vh - 240px); object-fit:contain;
  border:1px solid var(--line-strong); border-radius:8px; box-shadow: var(--shadow-1); background:#fff; }
.film-side__cap { font-family:var(--font-mono); font-size:11px; color: var(--muted); }
.film-side.is-empty { visibility:hidden; }
/* end-of-part card: sits where the next page would be, on the last page */
.film-end { flex:none; align-self:center; width: clamp(150px, 17vw, 245px); display:flex; flex-direction:column;
  gap:10px; padding: 20px 15px; background: var(--surface); border:1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1); text-align:center; }
.film-end__label { font-family:var(--font-mono); font-size:11px; letter-spacing:.06em; text-transform:uppercase; color: var(--muted); }
.film-end__hint { font-size:11.5px; color: var(--muted); line-height:1.35; }
.film-end__removed { font-size:11.5px; line-height:1.35; color: var(--danger, #b4232a);
  background: color-mix(in srgb, var(--danger, #b4232a) 9%, transparent);
  border:1px solid color-mix(in srgb, var(--danger, #b4232a) 28%, transparent);
  border-radius: var(--r-md, 8px); padding:7px 9px; }
.film-nav { flex:none; display:flex; align-items:center; justify-content:center; gap:16px; }
.film-count { font-family:var(--font-mono); font-size:12.5px; color: var(--ink-soft); min-width: 160px; text-align:center; }
.pf-badge { position:absolute; top:10px; left:10px; z-index:2; font-family:var(--font-mono); font-size:10px;
  font-weight:600; letter-spacing:.05em; text-transform:uppercase; padding:4px 9px; border-radius:999px;
  color:#fff; box-shadow: var(--shadow-1); }
.pf-first { background: var(--navy); } .pf-last { background: var(--brass-600); }

.reviewer__side { height:100%; overflow-y:auto; background: var(--surface); border:1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 15px; display:flex; flex-direction:column; gap: 10px; }
/* keep natural heights — let the sidebar scroll instead of squishing its contents */
.reviewer__side > * { flex: none; }
/* compact controls so the whole panel fits without scrolling */
.reviewer__side input, .reviewer__side select { padding: 8px 11px; font-size: 14px; }
.reviewer__side .rp-label { margin-bottom: 2px; }
.reviewer__side .rp-two { gap: 9px; }
.stepper-bar { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.stepper-pos { font-size:13px; font-weight:600; color: var(--ink-soft); }
.stepper-pos span { font-family: var(--font-mono); }
.instr-list { display:flex; flex-direction:column; gap:3px; max-height: 124px; overflow-y:auto;
  border:1px solid var(--line); border-radius: var(--r); padding:5px; background: var(--surface-2); }
.instr-chip { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%;
  border:0; background:none; cursor:pointer; font:inherit; text-align:left; padding:7px 9px; border-radius:7px;
  color: var(--ink-soft); }
.instr-chip:hover { background: var(--surface); }
.instr-chip.is-active { background: var(--navy); color:#fff; }
.instr-chip.is-active .instr-chip__pages { color: rgba(255,255,255,.7); }
.instr-chip__name { font-weight:560; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  display:flex; align-items:center; gap:6px; }
.instr-chip__name::before { content:""; width:7px; height:7px; border-radius:50%; background: var(--line-strong); flex:none; }
.instr-chip.is-checked .instr-chip__name::before { background: var(--ok); }
.instr-chip.is-checked:not(.is-active) { background: var(--ok-bg); }
.instr-chip.is-active.is-checked .instr-chip__name::before { background:#8FE0B4; }
.instr-chip__pages { font-size:11px; color: var(--muted); flex:none; }
.instr-chip.is-removed .instr-chip__name { text-decoration: line-through; opacity:.55; }
.instr-chip.is-removed .instr-chip__name::before { background: var(--danger); }

.rowpanel { display:flex; flex-direction:column; gap:9px; }
.rp-label { font-size:11px; color: var(--muted); font-family: var(--font-mono); letter-spacing:.04em;
  text-transform:uppercase; }
.rp-two { display:grid; grid-template-columns: 1fr 1fr; gap:10px; }
.rp-name { font-family: var(--font-display); font-size:17px; }
.boundary { display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:2px; }
.boundary__fig { margin:0; border:1px solid var(--line); border-radius:8px; overflow:hidden; background: var(--surface-2); }
.boundary__fig img { display:block; width:100%; height: 96px; object-fit: cover; object-position: top center; background:#fff; }
.boundary__fig figcaption { font-family: var(--font-mono); font-size:10.5px; color: var(--muted); padding:4px 7px; }
.rp-warn { font-size:12.5px; color: var(--brass-600); background: var(--brass-tint); border:1px solid #E7D6A8;
  border-radius:8px; padding:8px 10px; line-height:1.4; }
.rp-actions { display:flex; gap:8px; margin-top:4px; }
.rp-actions .btn { flex:1; }
.rowpanel.is-removed { opacity:.6; }
.reviewer__actions { position:sticky; bottom:0; z-index:1; display:flex; flex-direction:column; gap:8px;
  background: var(--surface); border-top:1px solid var(--line); margin: 4px -16px -16px; padding: 13px 16px 16px;
  box-shadow: 0 -8px 14px -10px rgba(27,29,36,.2); }
.check-progress { font-size:13px; font-weight:560; color: var(--ink-soft); display:flex; align-items:center; gap:8px;
  padding:9px 12px; background: var(--surface-2); border:1px solid var(--line); border-radius:10px; }
.check-progress.is-done { color: var(--ok); background: var(--ok-bg); border-color:#BBD6C5; }
.check-progress .cp-bar { flex:1; height:6px; border-radius:99px; background: var(--line); overflow:hidden; }
.check-progress .cp-bar i { display:block; height:100%; background: var(--ok); width:0; transition: width .25s; }
.newflag { color: var(--brass-600); }

.lightbox { position:fixed; inset:0; z-index:100; background: rgba(20,25,40,.86); display:grid; place-items:center;
  padding: 28px; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92vh; box-shadow: var(--shadow-3); background:#fff; border-radius:4px; }
.lightbox__close { position:fixed; top:16px; right:22px; background:none; border:0; color:#fff; font-size:34px;
  cursor:pointer; line-height:1; }

@media (max-width: 900px) {
  /* on small screens fall back to normal page scrolling */
  .page-review .main { padding: 0; }
  .review-shell { height: auto; overflow: visible; }
  .review-head { grid-template-columns: 1fr; gap: 10px; }
  #review-form { display: block; }
  .reviewer { display:flex; flex-direction:column; gap: 16px; }
  .reviewer__side { height:auto; overflow: visible; order:-1; }
  .filmstrip { min-height: 60vh; }
  .film-side { width: clamp(64px, 14vw, 110px); }
}

/* ---------- misc ---------- */
.stack > * + * { margin-top: 18px; }
.muted { color: var(--muted); }
.dl { display:grid; grid-template-columns: 130px 1fr; gap: 8px 18px; font-size: 14.5px; }
.dl dt { color: var(--muted); font-size:12.5px; font-family:var(--font-mono); letter-spacing:.03em;
  text-transform:uppercase; padding-top:2px; }
.dl dd { margin:0; color: var(--ink-soft); }
.toolbar { display:flex; align-items:center; gap:12px; margin-bottom: 18px; flex-wrap:wrap; }
.toolbar .search { flex:1; min-width: 200px; max-width: 420px; position:relative; }
.toolbar .search input { padding-left: 36px; }
.toolbar .search svg { position:absolute; left:12px; top:50%; transform:translateY(-50%);
  width:16px; height:16px; color: var(--muted); }
.divider-staff { height: 0; border:0; border-top: 1px solid var(--line); position:relative; margin: 26px 0; }

@media (max-width: 720px) {
  .topnav { display:none; }
  .pagehead { align-items:flex-start; }
  .dl { grid-template-columns: 1fr; gap:2px 0; }
  .dl dt { padding-top:10px; }
}

*:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

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