/* RadTemplate Hub — design tokens */
:root {
  --paper: #F7F8F6;
  --card: #FFFFFF;
  --ink: #1B2A38;
  --ink-soft: #51616F;
  --line: #DCE2E5;
  --accent: #175E73;        /* deep imaging teal */
  --accent-soft: #E4EFF2;
  --film: #0F1B24;          /* reading-room dark panel */
  --film-line: #24394A;
  --glow: #64D8E8;          /* DICOM-annotation cyan, used only on film */
  --ok: #2E7D53;
  --ok-soft: #E3F1E9;
  --warn: #B4690E;
  --warn-soft: #F7EDDD;
  --danger: #A33B3B;
  --radius: 10px;
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--ink); }
a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- app shell ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.wordmark { display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.wordmark b { font-size: 17px; letter-spacing: -0.01em; }
.wordmark .tag { font-family: var(--font-mono); font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 1px 6px; }
.topbar .user { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-soft); }
.topbar .user b { color: var(--ink); }

.container { max-width: 1120px; margin: 0 auto; padding: 28px 24px 80px; }

.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--radius); padding: 8px 16px; font-weight: 500;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: var(--ink-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #124B5C; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn.danger { color: var(--danger); border-color: var(--danger); background: #fff; }
.btn:disabled { opacity: .5; cursor: default; }

.error-box { background: #F9E9E9; border: 1px solid #E4BDBD; color: var(--danger); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin: 10px 0; }
.note { color: var(--ink-soft); font-size: 13px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- validation stamp (three slots motif) ---------- */
.stamp { display: inline-flex; align-items: center; gap: 6px; }
.stamp .slots { display: inline-flex; gap: 3px; }
.stamp .slot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--ink-soft); background: transparent;
}
.stamp .slot.filled { background: var(--ok); border-color: var(--ok); }
.stamp .slot.extra { border-style: dashed; }
.stamp .label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .02em; }
.stamp.validated .label { color: var(--ok); }
.stamp.under_review .label { color: var(--warn); }
.stamp.draft .label { color: var(--ink-soft); }
.badge { font-family: var(--font-mono); font-size: 11px; border-radius: 5px; padding: 2px 7px; letter-spacing: .03em; }
.badge.validated { background: var(--ok-soft); color: var(--ok); }
.badge.under_review { background: var(--warn-soft); color: var(--warn); }
.badge.draft { background: #EEF1F2; color: var(--ink-soft); }

/* ---------- landing / auth ---------- */
.landing { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; min-height: calc(100vh - 56px); max-width: 1120px; margin: 0 auto; padding: 24px; }
.landing h1 { font-size: 42px; line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 18px; font-weight: 650; }
.landing h1 em { font-style: normal; color: var(--accent); }
.landing p.lede { font-size: 17px; color: var(--ink-soft); max-width: 46ch; }
.landing .how { margin-top: 28px; display: grid; gap: 10px; }
.landing .how div { display: flex; gap: 12px; align-items: baseline; font-size: 14.5px; color: var(--ink-soft); }
.landing .how .k { font-family: var(--font-mono); font-size: 12px; color: var(--accent); white-space: nowrap; }

.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 8px 30px rgba(27,42,56,.06); }
.auth-tabs { display: flex; gap: 4px; background: var(--paper); border-radius: 9px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 7px 0; font-weight: 500; color: var(--ink-soft); }
.auth-tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- onboarding ---------- */
.onboard { max-width: 620px; margin: 48px auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; }
.onboard h2 { margin-top: 0; letter-spacing: -0.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: #fff;
  font-size: 13.5px; color: var(--ink-soft);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tutorial-steps, .onboard .panel-body ol { margin: 10px 0 0; padding-left: 20px; }
.tutorial-steps li, .onboard .panel-body ol li { margin-bottom: 10px; line-height: 1.5; font-size: 14.5px; color: var(--ink-soft); }
.tutorial-steps li b, .onboard .panel-body ol li b { color: var(--ink); }
.onboard .panel { margin: 18px 0; }

/* ---------- navigator ---------- */
.navigator { display: grid; grid-template-columns: 420px 1fr; gap: 28px; align-items: start; }
.film-panel {
  background: var(--film); border-radius: 16px; padding: 20px 16px 10px; position: relative;
  border: 1px solid var(--film-line);
}
.film-panel .corner { position: absolute; font-family: var(--font-mono); font-size: 10.5px; color: var(--glow); opacity: .75; letter-spacing: .05em; }
.film-panel .corner.tl { top: 12px; left: 16px; }
.film-panel .corner.tr { top: 12px; right: 16px; }
.film-panel .corner.bl { bottom: 10px; left: 16px; }
.body-svg { width: 100%; height: auto; display: block; }
.body-svg .silhouette { fill: none; stroke: #3E566B; stroke-width: 1.6; }
.body-svg .zone { fill: rgba(100,216,232,.06); stroke: rgba(100,216,232,.35); stroke-width: 1.2; cursor: pointer; transition: fill .15s ease, stroke .15s ease; }
.body-svg .zone:hover, .body-svg .zone.hover { fill: rgba(100,216,232,.22); stroke: var(--glow); }
.body-svg .zone-label { font-family: var(--font-mono); font-size: 9.5px; fill: var(--glow); pointer-events: none; opacity: 0; transition: opacity .15s ease; }
.body-svg .zone:hover + .zone-label, .body-svg .zone.hover + .zone-label { opacity: 1; }

.region-list { display: grid; gap: 10px; }
.region-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
  cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; text-align: left;
}
.region-row:hover, .region-row.hover { border-color: var(--accent); box-shadow: 0 3px 14px rgba(23,94,115,.10); }
.region-row .name { font-weight: 600; letter-spacing: -0.01em; }
.region-row .sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.variant-cell { display: grid; gap: 4px; justify-items: start; }
.variant-cell .vlabel { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft); letter-spacing: .05em; }

/* ---------- workspace ---------- */
.workspace-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 6px; }
.workspace-head h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.crumb { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 6px; }
.crumb a { cursor: pointer; text-decoration: none; }
.variant-tabs { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.variant-tabs button { border: 0; background: transparent; padding: 6px 16px; border-radius: 6px; font-weight: 500; color: var(--ink-soft); }
.variant-tabs button.active { background: var(--accent); color: #fff; }

.workspace { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; margin-top: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-body { padding: 18px; }

/* ---------- nesting: super-group (base exam / module) › family › subfamily ----------
   One solid banner gives the super-group its colour and tints everything under it; each
   level below is a smaller banner on a box inset left and right, so the depth is visible
   as a box within a box — with the insets kept tight so no width is wasted. */
.section-block, .kind-base, .kind-question, .kind-entity { --sg: var(--accent); --sg-mid: #3E7D91; --sg-soft: var(--accent-soft); }
.section-block {
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow: hidden;
  background: var(--sg-soft);
}
/* the three super-group colours are the ones the kind tags already use */
.kind-base { --sg: #2E5A8F; --sg-mid: #5B82B3; --sg-soft: #EDF2F9; }
.kind-question { --sg: #7A3E8F; --sg-mid: #A06FB2; --sg-soft: #F5EEF7; }
.kind-entity { --sg: #2E7D53; --sg-mid: #5DA57F; --sg-soft: #EBF4EF; }
/* a module panel on the Modules page is a super-group too — same banner, same tint */
.panel.kind-base > .panel-head, .panel.kind-question > .panel-head, .panel.kind-entity > .panel-head { background: var(--sg); border-bottom: 0; }
.panel.kind-base > .panel-head h3, .panel.kind-question > .panel-head h3, .panel.kind-entity > .panel-head h3 { color: #fff; }
.panel.kind-base > .panel-head .kind-tag, .panel.kind-question > .panel-head .kind-tag, .panel.kind-entity > .panel-head .kind-tag { background: rgba(255,255,255,.18); color: #fff; }
.panel.kind-base > .panel-head .btn, .panel.kind-question > .panel-head .btn, .panel.kind-entity > .panel-head .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); color: #fff; }
.panel.kind-base > .panel-body, .panel.kind-question > .panel-body, .panel.kind-entity > .panel-body { background: var(--sg-soft); }
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--sg); color: #fff; padding: 8px 13px; font-weight: 600; font-size: 14px;
}
.section-title .kind-tag, .section-title .type-badge { background: rgba(255,255,255,.18); color: #fff; }
.section-title .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); color: #fff; }
.section-title .btn:hover { background: rgba(255,255,255,.26); border-color: #fff; }
.section-title input { font-weight: 600; border: 1px dashed var(--line); background: #fff; color: var(--ink); border-radius: 6px; padding: 4px 8px; width: 60%; }

/* family: an inset box under a smaller band of the super-group's colour */
.group-block { margin: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.family-heading { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #fff; background: var(--sg-mid, var(--ink)); padding: 5px 12px; }
/* label over a run of super-groups ("Modules", "Pending") — a divider, not a banner, so it
   never competes with the coloured banner of the sections underneath it */
.supergroup-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-soft); padding: 4px 2px; margin: 16px 0 6px; border-bottom: 1px solid var(--line); }
.supergroup-divider.with-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 6px; }
/* attaching a module is one choice, so it is one control */
.add-module-row { display: flex; justify-content: center; padding: 6px 0 2px; }


.add-module { border: 1px dashed var(--accent); color: var(--accent); background: #fff; border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.add-module:disabled { border-color: var(--line); color: var(--ink-soft); }
.band-btn.warn { background: var(--danger); border-color: #fff; color: #fff; }
/* subfamily: one box further in, its band the palest step of the same colour */
.subgroup-block { margin: 6px 8px 8px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.subfamily-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--sg, var(--accent)); background: var(--sg-soft, var(--accent-soft)); padding: 4px 10px; }
.groups .field-row { padding: 8px 12px; }
.subgroup-body .field-row { padding: 7px 11px; }
.add-row { background: #FCFDFD; }
/* the band owns its add button: same object, right-aligned, never a separate row */
.family-heading, .subfamily-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.band-btn { border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.16); color: #fff; border-radius: 6px; padding: 1px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; line-height: 1.6; }
.band-btn:hover { background: rgba(255,255,255,.32); border-color: #fff; }
.band-actions { display: flex; align-items: center; gap: 6px; }
.history-item.on { background: var(--accent-soft); border-radius: 6px; }
.section-title .band-btn { font-size: 12px; padding: 2px 10px; }
.subfamily-heading .band-btn { border-color: var(--sg, var(--accent)); background: rgba(255,255,255,.75); color: var(--sg, var(--accent)); }
.subfamily-heading .band-btn:hover { background: #fff; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,27,36,.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60; }
.modal { background: var(--card); border-radius: 12px; width: min(540px, 100%); max-height: 88vh; overflow: auto; box-shadow: 0 18px 50px rgba(15,27,36,.3); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--paper); }
.form-row { display: grid; gap: 5px; }
.form-row > label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.form-row input, .form-row select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dtype-picker { display: flex; flex-wrap: wrap; gap: 6px; }
/* per-row edit: quiet until the row is hovered, so it never competes with the field itself */
.row-edit { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 6px; padding: 1px 8px; font-size: 11.5px; opacity: .5; }
.field-row:hover .row-edit { opacity: 1; border-color: var(--accent); color: var(--accent); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.add-row .btn { padding: 2px 9px; font-size: 12.5px; }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #EEF1F2; align-items: start; }
.field-row:last-child { border-bottom: 0; }
.field-row .flabel { font-weight: 500; }
.field-row .fmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.type-badge { font-family: var(--font-mono); font-size: 10.5px; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 1px 6px; }
.suggest-banner { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.suggest-banner .sg-title { font-weight: 600; color: var(--warn); font-size: 13.5px; margin-bottom: 6px; }
.suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.suggest-row .note { margin: 0; }
.opt-pill { font-size: 12px; background: #EEF1F2; border-radius: 999px; padding: 1px 9px; color: var(--ink-soft); }

.edit-grid { display: grid; grid-template-columns: 1.2fr .55fr 1.2fr auto; gap: 8px; align-items: center; width: 100%; }
.edit-grid input, .edit-grid select { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; width: 100%; background: #fff; }
.icon-btn { border: 0; background: transparent; color: var(--ink-soft); border-radius: 6px; padding: 3px 7px; font-size: 15px; line-height: 1; }
/* the group path a field belongs to, shown in the editor instead of being retyped */
.prefix-chip { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.group-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--paper); }
.group-add input { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; background: #fff; min-width: 210px; }
/* group headings read lighter inside the report mock-up than on the editable exam page */
.icon-btn:hover { background: var(--paper); color: var(--ink); }

.validate-panel { padding: 18px; display: grid; gap: 12px; }
/* sign-off: the chain of people, not a paragraph about it */
.signoff { display: flex; align-items: flex-start; gap: 0; }
.signoff .slot { flex: 1; display: grid; justify-items: center; gap: 5px; position: relative; text-align: center; }
.signoff .slot + .slot::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.signoff .slot.done + .slot::before, .signoff .slot.done::after { background: var(--ok); }
.signoff .mark { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px dashed var(--line); color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.signoff .slot.done .mark { border: 2px solid var(--ok); background: var(--ok-soft); color: var(--ok); }
.signoff .slot.returned .mark { border: 2px solid var(--danger); background: #FBF3F3; color: var(--danger); }
.signoff .who { font-size: 12.5px; font-weight: 600; }
.signoff .slot:not(.done):not(.returned) .who { color: var(--ink-soft); font-weight: 500; }
.signoff .slot-note { font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; }
.validators { display: grid; gap: 6px; }
.validator { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.validator .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.validator .who b { font-weight: 600; }
.validator .who span { color: var(--ink-soft); }

.comment { padding: 10px 0; border-bottom: 1px solid #EEF1F2; }
.comment:last-child { border-bottom: 0; }
.comment .meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.comment .meta b { color: var(--ink); font-weight: 600; }
.comment .body { font-size: 14px; white-space: pre-wrap; }

.history-item { display: grid; gap: 1px; padding: 9px 0; border-bottom: 1px solid #EEF1F2; font-size: 13px; }
.history-item:last-child { border-bottom: 0; }
.history-item .v { font-family: var(--font-mono); color: var(--accent); }
.history-item .note-t { color: var(--ink); }
.history-item .meta { color: var(--ink-soft); font-size: 12px; }

.json-view { background: var(--film); color: #C8E4EC; border-radius: 10px; padding: 16px; font-family: var(--font-mono); font-size: 12px; overflow: auto; max-height: 480px; white-space: pre; }

.savebar {
  position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 18px; display: flex; gap: 10px; align-items: center; border-radius: 0 0 12px 12px;
}
.savebar input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; }

/* ---------- admin & pending ---------- */
.pending-screen { max-width: 520px; margin: 72px auto; text-align: center; }
.pending-screen .stamp { justify-content: center; margin-bottom: 16px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid #EEF1F2; font-size: 14px; }

@media (max-width: 960px) {
  .landing { grid-template-columns: 1fr; min-height: unset; padding-top: 40px; }
  .navigator { grid-template-columns: 1fr; }
  .film-panel { max-width: 420px; margin: 0 auto; }
  .workspace { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- CLARITY additions ---------- */
.stamp .slot.sq { border-radius: 2px; }             /* curator slot */
.badge.imported, .badge.normalized { background: #EEF1F2; color: var(--ink-soft); }
.badge.translated { background: var(--accent-soft); color: var(--accent); }
.badge.curator_review { background: #EFE4F3; color: #7A3E8F; }
.badge.approved_reference { background: var(--ok-soft); color: var(--ok); }
.badge.localized_variant { background: #E4ECF7; color: #2E5A8F; }
.badge.superseded, .badge.returned { background: #F3E9E9; color: var(--danger); }
.badge.expert_review { background: var(--warn-soft); color: var(--warn); }
.badge.approved { background: var(--ok-soft); color: var(--ok); }

.kind-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; border-radius: 4px; padding: 2px 7px; }
.kind-tag.base { background: #E4ECF7; color: #2E5A8F; }
.kind-tag.question { background: #EFE4F3; color: #7A3E8F; }
.kind-tag.entity { background: #E6F2EC; color: var(--ok); }

.task-card { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; cursor: pointer; text-align: left; }
.task-card:hover { border-color: var(--accent); box-shadow: 0 3px 14px rgba(23,94,115,.10); }
.task-card .tname { font-weight: 600; }
.task-card .tmeta { font-size: 12.5px; color: var(--ink-soft); font-family: var(--font-mono); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 18px; }
.filter-bar input, .filter-bar select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; background: #fff; }
.tpl-list { display: grid; gap: 10px; }
.tpl-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.tpl-card:hover { background: var(--accent-soft); }
.tpl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; }
.tpl-card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
.tpl-card-modules { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tpl-card-modules .note { margin: 0; }

.src-states { display: inline-flex; gap: 3px; }
.src-states span { font-family: var(--font-mono); font-size: 9px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }

.diff-row { border-left: 3px solid transparent; }
.diff-row.added { border-left-color: var(--ok); background: #F4FAF6; }
.diff-row.removed { border-left-color: var(--danger); background: #FBF3F3; text-decoration: line-through; }
.diff-row.changed { border-left-color: var(--warn); background: #FCF7EE; }
.diff-row .delta { font-family: var(--font-mono); font-size: 11.5px; color: var(--warn); }
.review-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.review-actions .btn.small.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.decided { font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 4px; }
.decided.accept { background: var(--ok-soft); color: var(--ok); }
.decided.edit { background: var(--accent-soft); color: var(--accent); }
.decided.remove { background: #F9E9E9; color: var(--danger); }
.decided.cannot_assess { background: #EEF1F2; color: var(--ink-soft); }

.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 10px 0 22px; }
.cov-cell { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.cov-cell b { font-size: 20px; }
.cov-cell .mono { color: var(--ink-soft); }

.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }
.unchanged-toggle { color: var(--ink-soft); font-size: 13px; cursor: pointer; padding: 8px 14px; display: block; background: none; border: none; text-align: left; width: 100%; }

/* review blocks: variable + its actions grouped */
.review-block { border: 1px solid var(--line); border-radius: 10px; margin: 8px 14px; overflow: hidden; background: #fff; }
.review-block .field-row { border-bottom: 0; margin: 0; }
.review-block .review-actions { padding: 8px 12px 10px; border-top: 1px dashed var(--line); background: var(--paper); margin-top: 0; }
.review-block .decisions { padding: 4px 12px 10px; border-top: 1px dashed var(--line); background: var(--paper); }
.review-items .group-block { background: rgba(255,255,255,.5); }
.review-items .subgroup-block { background: rgba(255,255,255,.5); }
.review-items .review-block { margin: 6px; }
.review-items .groups .field-row { padding: 9px 12px; }

/* report preview: what the structured report looks like */

/* ---------- queue: head-to-toe, with the body map following the scroll ---------- */
body { transition: background-color .35s ease; }
.queue-layout { display: grid; grid-template-columns: 1fr 200px; gap: 28px; align-items: start; }
/* the composition, read before the items it produces */
.composition { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.comp-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--sg-soft, var(--accent-soft)); color: var(--sg, var(--accent)); border: 1px solid currentColor; }

.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.region-group { margin-bottom: 20px; }
.region-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; }
.region-label span { font-family: var(--font-mono); font-weight: 400; color: var(--ink-soft); font-size: 10.5px; }
.task-card { border-left: 3px solid transparent; transition: border-color .25s ease, box-shadow .25s ease; }
.task-card.lit { border-left: 3px solid var(--rg); }
.bodymap-rail { position: sticky; top: 78px; display: grid; justify-items: center; gap: 6px; }
.bodymap { width: 150px; height: auto; }
.bodymap path, .bodymap rect { transition: opacity .32s ease; }
.bodymap-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; margin: 0; min-height: 16px; transition: color .3s ease; }
@media (max-width: 900px) { .queue-layout { grid-template-columns: 1fr; } .bodymap-rail { display: none; } }
