/* LoRA Dataset Builder: a dense, neutral review workstation.
   Colour carries status only; one accent marks primary actions and the current place. */

:root {
  --bg:#f5f6f8; --surface:#fff; --surface-2:#f9fafb; --surface-3:#f2f4f7;
  --line:#e3e6eb; --line-strong:#cfd4dc;
  --ink:#1c2230; --ink-2:#3d4757; --muted:#667085;
  --accent:#3451c6; --accent-hover:#2a43a8; --accent-soft:#eef1fc; --accent-line:#c7d0f2;
  --success:#1d6f47; --success-bg:#eaf6ef; --success-line:#bfe2cd;
  --info:#2b5797; --info-bg:#edf3fb; --info-line:#c9d9ef;
  --warning:#87580a; --warning-bg:#fdf5e4; --warning-line:#efd9a8;
  --danger:#a8291e; --danger-bg:#fdf0ee; --danger-line:#f1c9c4;
  --neutral:#4b5565; --neutral-bg:#eef0f3;
  --radius-s:4px; --radius:6px; --radius-l:8px;
  --font:"Segoe UI", system-ui, -apple-system, sans-serif;
  --mono:Consolas, "Cascadia Mono", ui-monospace, monospace;
  --shadow:0 1px 2px rgb(16 24 40 / 6%);
  --sidebar:212px; --topbar:44px;
  /* Legacy aliases kept for inline styles and older selectors. */
  --paper:var(--surface); --accentsoft:var(--accent-soft);
  --warn:var(--warning); --warnbg:var(--warning-bg); --dangerbg:var(--danger-bg);
}

/* Base */
* { box-sizing:border-box; }
html { font-family:var(--font); color:var(--ink); background:var(--bg); -webkit-text-size-adjust:100%; }
body { margin:0; font-size:14px; line-height:1.5; background:var(--bg); }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
[hidden] { display:none !important; }
h1, h2, h3, h4 { color:var(--ink); line-height:1.25; }
h1 { font-size:22px; font-weight:650; letter-spacing:-.01em; margin:4px 0 6px; }
h2 { font-size:15px; font-weight:650; margin:0 0 10px; }
h3 { font-size:13px; font-weight:650; margin:14px 0 6px; }
h4 { font-size:12px; margin:10px 0 4px; }
p { margin:6px 0; }
code { font-family:var(--mono); font-size:12.5px; background:var(--surface-3); border-radius:var(--radius-s); padding:1px 4px; overflow-wrap:anywhere; }
.small { font-size:12px; }
.muted, .empty { color:var(--muted); }
.empty { padding:10px 0; }
.error { color:var(--danger); font-weight:600; }
.numeric { font-variant-numeric:tabular-nums; }
.full-width { width:100%; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.skip-link { position:absolute; left:12px; top:-100px; z-index:10; background:var(--surface); padding:10px; border-radius:var(--radius); }
.skip-link:focus { top:10px; }
.path, .code-path { font:12px var(--mono); overflow-wrap:anywhere; }
.path { padding:8px 10px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--radius); }
.code-path { font-size:11px; }
.endpoint-text { overflow-wrap:anywhere; }
.divider { border:0; border-top:1px solid var(--line); margin:14px 0; }
.dragging { outline:2px dashed var(--accent); outline-offset:4px; }

/* Shell */
.shell { display:flex; min-height:100vh; }
.sidebar { width:var(--sidebar); flex:none; position:sticky; top:0; height:100dvh; overflow-y:auto; background:var(--surface); border-right:1px solid var(--line); padding:16px 12px; display:flex; flex-direction:column; }
.brand { display:flex; gap:10px; align-items:center; color:var(--ink); font-size:14px; font-weight:650; line-height:1.25; margin:0 6px 14px; }
.brand:hover { text-decoration:none; }
.brand small { font-weight:400; color:var(--muted); font-size:12px; }
.brand-mark { display:grid; place-items:center; width:28px; height:28px; flex:none; border-radius:var(--radius); background:var(--accent); color:#fff; font-size:15px; font-weight:700; }
.nav-caption { font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:650; margin:16px 8px 6px; }
.sidebar nav { display:grid; gap:2px; }
.sidebar nav a { display:flex; align-items:center; gap:10px; color:var(--ink-2); padding:7px 8px; border-radius:var(--radius); font-size:13px; font-weight:500; }
.sidebar nav a:hover { background:var(--surface-3); color:var(--ink); text-decoration:none; }
.sidebar nav a.active { background:var(--accent-soft); color:var(--accent); font-weight:650; }
.nav-number { width:18px; flex:none; font:11px var(--mono); color:var(--muted); text-align:center; }
.sidebar nav a.active .nav-number { color:var(--accent); }
.sidebar .disclosure { margin:12px 0 0; padding:10px 8px 0; border-top:1px solid var(--line); }
.sidebar .disclosure nav { margin-top:6px; }
.sidebar .disclosure summary { font-size:12px; color:var(--muted); }
.sidebar-foot { margin-top:auto; padding:14px 8px 0; font-size:12px; color:var(--muted); }
.local-dot { display:inline-block; width:7px; height:7px; background:var(--success); border-radius:50%; margin-right:6px; }
.main-area { min-width:0; flex:1; }
.topbar { height:var(--topbar); display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0 24px; background:var(--surface); border-bottom:1px solid var(--line); color:var(--muted); font-size:12px; }
.topbar strong { color:var(--ink-2); font-weight:600; }
.topbar-tag { display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; }
.content { max-width:1560px; margin:0 auto; padding:16px 24px 32px; overflow-wrap:break-word; }

/* Page structure */
.page-heading, .panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.page-heading { margin-bottom:14px; }
.page-heading > div { min-width:0; }
.page-heading p { margin:0; color:var(--muted); max-width:820px; }
.page-heading .actions { margin-top:0; }
.page-heading > .button, .page-heading > .actions { flex:none; white-space:nowrap; }
.eyebrow { font-size:12px; color:var(--muted) !important; font-weight:600; margin:0 0 2px !important; letter-spacing:0; text-transform:none; }
.eyebrow a { color:var(--muted); }
.eyebrow a:hover { color:var(--accent); }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-l); padding:14px 16px; min-width:0; }
.content > .panel + .panel, .content > .notice + .panel, .content > .panel-grid + .panel, .content > .panel + .panel-grid, .content > .metric-row + .panel { margin-top:12px; }
.panel-heading { align-items:baseline; margin-bottom:8px; }
.panel-heading h2 { margin:0; }
.panel-heading a { font-size:12px; font-weight:600; }
.panel-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:12px 0; }
.document-panel > h2 { border-top:1px solid var(--line); margin:18px -16px 10px; padding:14px 16px 0; }
.document-panel > form:not(.grid) { display:flex; gap:8px; align-items:end; flex-wrap:wrap; }
.document-panel > form:not(.grid) > label { margin:0; }
.section-heading { display:flex; align-items:center; border-top:1px solid var(--line); padding-top:14px; }
.section-heading h2 { margin:0; }
.step-number { display:inline-grid; place-items:center; width:22px; height:22px; margin-right:8px; border-radius:50%; background:var(--accent-soft); color:var(--accent); font-size:12px; font-weight:650; }
.stack { min-width:0; }
.stack > * + * { margin-top:12px; }
.scroll-panel { max-height:650px; overflow:auto; }
.quick-actions, .actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; align-items:center; }
.actions form { margin:0; }

/* Buttons */
.button, button { display:inline-flex; align-items:center; justify-content:center; gap:6px; max-width:100%; padding:6px 12px; border:1px solid var(--line-strong); border-radius:var(--radius); background:var(--surface); color:var(--ink); font:inherit; font-size:13px; font-weight:600; line-height:1.35; cursor:pointer; text-align:center; box-shadow:var(--shadow); }
.button:hover, button:hover { background:var(--surface-2); border-color:#b8bfca; text-decoration:none; }
.button.primary, button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.button.primary:hover, button.primary:hover { background:var(--accent-hover); border-color:var(--accent-hover); }
.button.danger, button.danger { color:var(--danger); border-color:var(--danger-line); }
.button.danger:hover, button.danger:hover { background:var(--danger-bg); }
button:disabled, .button[aria-disabled=true] { cursor:not-allowed; opacity:.55; }

/* Forms */
input, select, textarea { font:inherit; font-size:13.5px; color:var(--ink); background:var(--surface); border:1px solid var(--line-strong); border-radius:var(--radius); padding:6px 9px; max-width:100%; min-width:0; }
input:focus, select:focus, textarea:focus { border-color:var(--accent); outline:2px solid var(--accent-soft); outline-offset:0; }
input[type=checkbox], input[type=radio] { width:auto; padding:0; accent-color:var(--accent); }
input[type=file] { width:100%; padding:5px; background:var(--surface-2); }
textarea { width:100%; min-height:64px; resize:vertical; line-height:1.55; }
label { display:inline-grid; gap:4px; font-size:12px; font-weight:600; color:var(--ink-2); margin:0 8px 8px 0; vertical-align:top; max-width:100%; min-width:0; }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { display:inline-flex !important; align-items:center; gap:8px; font-weight:500; font-size:13px; }
label > .badge { justify-self:start; }
form { margin:8px 0 12px; }
form.inline { display:inline; margin:0; }
form.grid, .assistance-fields.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; align-items:start; }
form.grid label { display:grid; margin:0; }
form.grid .full { grid-column:1 / -1; }
form.grid input:not([type=checkbox]), form.grid select { width:100%; }
.toolbar { display:flex; gap:8px; align-items:end; flex-wrap:wrap; margin:10px 0; }
.toolbar form, .toolbar label { margin:0; }
.form-stack { display:grid; gap:12px; margin:0; }
.form-stack > label { display:grid; margin:0; width:100%; }
.form-stack input:not([type=checkbox]), .form-stack select { width:100%; }
.form-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.form-actions form { margin:0; }
.field-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.field-grid label { display:grid; margin:0; }
.field-grid input { width:100%; }
.field-grid .full { grid-column:1 / -1; }
.field-label { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:5px; }
.assistance-fields { border:1px solid var(--line); padding:12px; border-radius:var(--radius); background:var(--surface-2); }
.json-editor { font-family:var(--mono); font-size:12px; tab-size:2; }

/* Tables */
.table-scroll { max-width:100%; overflow:auto; margin:8px 0; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; color:var(--muted); font-weight:600; font-size:12px; background:var(--surface-2); white-space:nowrap; }
th a { color:var(--muted); }
th[aria-sort=ascending] a, th[aria-sort=descending] a { color:var(--ink); }
th, td { padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
td { max-width:460px; overflow-wrap:break-word; }
td code, td .path { overflow-wrap:anywhere; }
.nowrap { white-space:nowrap; }
.truncate { display:block; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
tbody tr:hover td, table tr:hover td { background:#fafbfc; }
.row-title { font-weight:600; }
.row-detail { display:block; margin-top:3px; }
.row-actions { text-align:right; white-space:nowrap; width:1%; }
.selection-column { width:34px; padding-right:4px; }
.requirement-excerpt { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; line-height:1.4; color:var(--ink-2); }

/* Badges: colour carries status only. */
.badge { display:inline-flex; align-items:center; gap:4px; padding:2px 7px; border-radius:999px; font-size:11.5px; font-weight:600; line-height:1.5; white-space:nowrap; background:var(--neutral-bg); color:var(--neutral); border:1px solid transparent; }
.badge.source, .badge.exact, .badge.alias, .badge.export_ready, .badge.approved, .badge.completed, .badge.active, .badge.processed, .badge.status-ready, .badge.success { background:var(--success-bg); color:var(--success); border-color:var(--success-line); }
.badge.deterministic, .badge.accepted, .badge.running, .badge.queued, .badge.available_for_review, .badge.status-partial, .badge.info { background:var(--info-bg); color:var(--info); border-color:var(--info-line); }
.badge.human, .badge.status-opened { background:var(--accent-soft); color:var(--accent); border-color:var(--accent-line); }
.badge.warning, .badge.llm, .badge.needs_review, .badge.cancelling, .badge.stale, .badge.staged, .badge.status-review { background:var(--warning-bg); color:var(--warning); border-color:var(--warning-line); }
.badge.blocker, .badge.rejected, .badge.failed, .badge.conflict, .badge.quarantined, .badge.danger { background:var(--danger-bg); color:var(--danger); border-color:var(--danger-line); }
.badge.draft, .badge.cancelled, .badge.interrupted, .badge.superseded, .badge.retired, .badge.unchanged, .badge.status-not_started { background:var(--neutral-bg); color:var(--neutral); }

/* Notices */
.notice { padding:10px 12px; border-radius:var(--radius); background:var(--info-bg); color:var(--ink-2); border:1px solid var(--info-line); margin:10px 0; }
.notice.warning { background:var(--warning-bg); border-color:var(--warning-line); color:var(--warning); }
.notice.danger { background:var(--danger-bg); border-color:var(--danger-line); color:var(--danger); }
.error-summary { border-left:3px solid var(--danger); background:var(--danger-bg); border-color:var(--danger-line); }
.error-summary h2 { color:var(--danger); margin-bottom:4px; }
.section-note { border-top:1px solid var(--line); padding-top:12px; margin-top:14px; font-size:12px; color:var(--muted); font-weight:400; }
.section-note strong { color:var(--ink); font-weight:600; }

/* Disclosure */
details summary { cursor:pointer; color:var(--ink-2); font-weight:600; font-size:12.5px; }
details[open] > summary { margin-bottom:10px; }
.disclosure:not(.panel) { border-top:1px solid var(--line); margin-top:12px; padding-top:10px; }
.pill-list { display:flex; gap:6px; flex-wrap:wrap; }

/* Records, code and JSON */
.record-text { white-space:pre-wrap; overflow-wrap:anywhere; max-height:350px; overflow:auto; }
.requirement-excerpt, .rail-excerpt, .inline-preview summary, h1 { overflow-wrap:anywhere; }
.code, pre { white-space:pre-wrap; overflow-wrap:anywhere; font-family:var(--mono); font-size:12.5px; line-height:1.6; background:var(--surface-2); padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius); max-width:100%; }
.json-tools { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:10px 0 4px; }
.json-value { max-height:440px; overflow:auto; white-space:pre; color:var(--ink-2); tab-size:2; }
.json-key { color:#5b3a9a; } .json-string { color:var(--success); } .json-number { color:#9b3f13; } .json-boolean, .json-null { color:var(--info); } .json-punctuation { color:var(--muted); }
.payload-preview { max-height:520px; overflow:auto; }
.public-json-preview .json-value { white-space:pre-wrap; overflow-wrap:anywhere; }
.inline-preview { min-width:220px; max-width:640px; }
.inline-preview summary { color:var(--accent); font-size:13px; font-weight:500; }
.inline-preview-content { max-height:240px; overflow:auto; border:1px solid var(--line); border-radius:var(--radius); margin-top:6px; padding:10px; background:var(--surface-2); }
.inline-preview-content .record-text { margin:0; font-size:13px; }
.inline-preview-content pre { max-height:none; font-size:12px; }
dl { display:grid; grid-template-columns:140px minmax(0,1fr); gap:5px 14px; }
dt { color:var(--muted); }
dd { margin:0; }

/* Pagination */
.pagination { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:8px 0; padding:8px 0; border-top:1px solid var(--line); font-size:12px; color:var(--muted); }
.pagination-count { margin-right:auto; font-variant-numeric:tabular-nums; }
.pagination-links { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.pagination .button, .pagination button { padding:3px 8px; min-width:28px; font-size:12px; box-shadow:none; }
.pagination .current { color:var(--accent); background:var(--accent-soft); border-color:var(--accent-line); }
.pagination-jump, .pagination-jump label { display:flex; align-items:center; gap:6px; margin:0; font-weight:500; }
.pagination-jump input { width:64px; padding:3px 6px; font-size:12px; }

/* Workflow navigation */
.wizard-content { max-width:1180px; margin:0 auto; }
.wizard-content h1, .wizard-content td { overflow-wrap:anywhere; }
.wizard-steps ol { display:flex; gap:6px; padding:0; margin:0 0 14px; list-style:none; flex-wrap:wrap; }
.wizard-steps li { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12.5px; padding:4px 10px 4px 4px; border-radius:999px; border:1px solid var(--line); background:var(--surface); }
.wizard-steps li span { display:grid; place-items:center; width:22px; height:22px; border-radius:50%; background:var(--surface-3); font-size:12px; }
.wizard-steps .current { color:var(--accent); border-color:var(--accent-line); background:var(--accent-soft); font-weight:600; }
.wizard-steps .current span { background:var(--accent); color:#fff; }
.wizard-steps .complete { color:var(--success); }
.wizard-steps .complete span { background:var(--success-bg); color:var(--success); }
.wizard-actions { border-top:1px solid var(--line); padding-top:14px; margin-top:16px; display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.wizard-actions form { margin:0; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.workflow-steps { list-style:none; padding:0; margin:0 0 14px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.workflow-step a { display:flex; gap:10px; align-items:flex-start; height:100%; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-l); background:var(--surface); color:var(--ink); }
.workflow-step a:hover { text-decoration:none; border-color:var(--accent-line); }
.workflow-step .step-index { flex:none; display:grid; place-items:center; width:24px; height:24px; border-radius:50%; background:var(--surface-3); font-size:12px; color:var(--muted); font-weight:650; }
.workflow-step .step-body { display:flex; flex-direction:column; gap:2px; min-width:0; font-size:12px; color:var(--muted); }
.workflow-step .step-body strong { font-size:13px; color:var(--ink); }
.workflow-step.done .step-index { background:var(--success-bg); color:var(--success); }
.workflow-step.current a { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
.workflow-step.current .step-index { background:var(--accent); color:#fff; }
.metric-row { display:flex; flex-wrap:wrap; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:var(--radius-l); overflow:hidden; margin:0 0 12px; }
.metric { flex:1 1 150px; background:var(--surface); padding:10px 14px; display:flex; flex-direction:column; gap:1px; min-width:0; }
.metric span { font-size:12px; color:var(--muted); }
.metric strong { font-size:22px; font-weight:600; font-variant-numeric:tabular-nums; line-height:1.3; }
.metric small { font-size:12px; color:var(--muted); }
.filter-chips { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 10px; }
.filter-chips a { border:1px solid var(--line); border-radius:999px; padding:3px 10px; font-size:12.5px; color:var(--ink-2); background:var(--surface); }
.filter-chips a span { color:var(--muted); margin-left:4px; font-variant-numeric:tabular-nums; }
.filter-chips a.active { border-color:var(--accent-line); color:var(--accent); background:var(--accent-soft); font-weight:600; }
.filter-chips a:hover { text-decoration:none; border-color:var(--accent-line); }
.activity-list { list-style:none; margin:0; padding:0; }
.activity-list li { display:flex; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--line); font-size:13px; }
.activity-list li:last-child { border-bottom:0; }
.activity-list li a { margin-right:auto; min-width:0; }
.empty-state { max-width:640px; }
.board-filters { display:flex; flex-wrap:wrap; align-items:end; gap:8px; margin:0 0 6px; }
.board-filters select { max-width:380px; }
.board-filters input { width:240px; }

/* Queue pages: filters, batch controls, rows */
.queue-panel > * + * { margin-top:8px; }
.queue-controls { display:flex; flex-direction:column; gap:8px; }
.queue-filter-line { display:flex; align-items:end; gap:16px; flex-wrap:wrap; }
.queue-filter-line .queue-filters { flex:1; }
.queue-filters { margin:0; }
.queue-filters input { width:260px; }
.queue-filters select { min-width:160px; }
.queue-report { flex:none; }
.queue-context { display:flex; align-items:center; flex-wrap:wrap; gap:6px 16px; font-size:12.5px; padding:8px 10px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--radius); }
.queue-context > .muted { margin-left:auto; }
.queue-summary { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:13px; flex-wrap:wrap; }
.queue-alternative { font-size:12.5px; }
.queue-alternative .toolbar { margin:8px 0 0; }
.queue-alternative .toolbar > .muted { max-width:420px; }
.selection-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; margin:0; padding:8px 12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-2); font-size:12.5px; }
.selection-summary { display:flex; flex-direction:column; gap:1px; min-width:220px; margin-right:auto; }
.selection-presets { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.selection-save { display:flex; align-items:center; gap:10px; }
.selection-save [data-selection-notice] { max-width:200px; font-size:12px; color:var(--warning); }
[data-selection-notice]:empty { display:none; }
.selection-toolbar button, .review-selection-tools button { padding:4px 10px; font-size:12.5px; }
.binding-scope { margin:0; padding:2px 0; border:0; font-size:12.5px; }
.binding-scope p { margin:4px 0; }
.review-controls { padding-bottom:12px; border-bottom:1px solid var(--line); }
.review-filters { display:grid; grid-template-columns:minmax(120px,.6fr) minmax(180px,1.4fr) minmax(150px,1fr) auto; align-items:end; gap:12px; margin:0; }
.review-filters label { display:flex; flex-direction:column; gap:4px; margin:0; min-width:0; }
.review-filters input, .review-filters select { width:100%; }
.review-filter-actions, .review-selection-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.review-filter-summary { display:flex; justify-content:space-between; flex-wrap:wrap; gap:6px 16px; margin-top:10px; font-size:12.5px; }
.review-selection { margin:0 0 12px; }
.review-selection-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; padding:8px 0; }
.review-bulk-actions { border:1px solid var(--line); background:var(--surface-2); padding:8px 12px; border-radius:var(--radius); }
.review-bulk-actions > span { font-size:12.5px; }
.review-selection-tools .review-delete { margin-left:12px; }
.review-rows td:nth-child(2) { min-width:280px; }
.export-filters { display:grid; grid-template-columns:minmax(200px,1.2fr) minmax(160px,1fr) minmax(120px,.7fr) minmax(120px,.7fr) auto auto; align-items:end; gap:8px; margin:0; }
.export-filters label { margin:0; }
.export-filters input, .export-filters select { width:100%; }
.export-filters > a { padding-bottom:7px; white-space:nowrap; }
.export-queue #export-selection { display:none; }
.export-selection-bar { display:flex; gap:12px 16px; align-items:center; flex-wrap:wrap; font-size:12.5px; padding:6px 0; }
.export-selection-bar > :last-child { margin-left:auto; }
.export-selection-bar label { margin:0; }
.export-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.export-actions > .actions { margin-left:auto; margin-top:0; }
.export-actions > label { display:flex; gap:8px; align-items:center; margin:0; }
.export-queue .row-detail { font-size:11.5px; }
.export-scope { display:flex; flex-wrap:wrap; align-items:center; gap:6px 18px; margin:4px 0; padding:8px 12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-2); }
.export-scope legend { float:left; padding:0; margin-right:6px; font-size:12px; font-weight:650; color:var(--ink-2); }
.export-scope label { margin:0; }
.export-rows.scope-all td.selection-column input { opacity:.45; }
.approval-rows th:first-child { width:35%; }

/* Workbench: requirement, example and reference detail */
.requirement-workbench { height:calc(100dvh - var(--topbar) - 28px); min-height:540px; display:flex; flex-direction:column; min-width:0; }
.requirement-header { display:flex; justify-content:space-between; align-items:center; gap:16px; flex:none; }
.requirement-header > div { min-width:0; }
.requirement-header h1 { margin:2px 0; }
.requirement-header form { flex:none; margin:0; }
.requirement-header .small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:860px; margin:0; }
.record-pager { flex:none; margin-top:0; }
.requirement-status { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; padding:8px 0; font-size:12.5px; flex:none; }
.requirement-tabs { display:flex; gap:2px; flex:none; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; border-bottom:1px solid var(--line); scrollbar-width:thin; }
.requirement-tabs a { padding:8px 12px; color:var(--ink-2); font-size:13px; font-weight:500; white-space:nowrap; border-bottom:2px solid transparent; margin-bottom:-1px; }
.requirement-tabs a:hover { color:var(--ink); text-decoration:none; background:var(--surface-2); }
.requirement-tabs a.active { color:var(--accent); border-bottom-color:var(--accent); font-weight:650; }
.requirement-tabs a span { font-size:11px; color:var(--muted); margin-left:2px; background:var(--surface-3); border-radius:999px; padding:0 6px; }
.requirement-workbench > .notice { flex:none; margin:8px 0 0; }
.requirement-body { flex:1; min-height:0; display:flex; flex-direction:column; border:1px solid var(--line); border-top:0; background:var(--surface); overflow:hidden; border-radius:0 0 var(--radius-l) var(--radius-l); }
.requirement-body > .pagination { padding:8px 12px; margin:0; flex:none; }
.requirement-scroll { flex:1; min-height:0; overflow:auto; }
.requirement-scroll thead { position:sticky; top:0; z-index:1; }
.requirement-scroll .record-text, .requirement-scroll .table-scroll { max-height:none; overflow:visible; }
.requirement-scroll :is(.inline-preview-content, .json-value, pre) { max-height:none; overflow:visible; }
.requirement-tools { padding:8px 14px; display:flex; align-items:center; justify-content:space-between; gap:16px; font-size:12.5px; border-bottom:1px solid var(--line); flex:none; background:var(--surface-2); }
.requirement-tools p { max-width:880px; margin:0; }
.requirement-tools a { flex:none; }
.requirement-source-layout { display:grid; grid-template-columns:260px minmax(0,1fr); min-height:0; height:100%; }
.requirement-source-list { display:block; overflow:auto; border-right:1px solid var(--line); background:var(--surface-2); }
.requirement-source-list a { display:flex; flex-direction:column; gap:2px; padding:8px 12px; border-bottom:1px solid var(--line); font-size:12.5px; color:var(--ink); }
.requirement-source-list a:hover { background:var(--surface); text-decoration:none; }
.requirement-source-list a.active { background:var(--accent-soft); box-shadow:inset 3px 0 var(--accent); }
.requirement-source-list a span { color:var(--muted); }
.requirement-reader { overflow:auto; padding:16px 22px; min-width:0; }
.requirement-reader header { padding-bottom:10px; border-bottom:1px solid var(--line); margin-bottom:12px; }
.requirement-reader .record-text { line-height:1.7; max-height:none; overflow:visible; }
.requirement-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:10px; flex:none; flex-wrap:wrap; }
.requirement-footer form { margin:0; }
.requirement-issues { table-layout:fixed; }
.requirement-issues th:first-child { width:22%; }
.requirement-issues th:last-child { width:30%; }
.requirement-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:end; margin:0; }
.requirement-actions button { padding:4px 10px; font-size:12.5px; }
.requirement-actions label { margin:0; font-size:12px; }
.requirement-actions input { width:200px; min-width:120px; padding:4px 8px; }
.issue-origin + .issue-origin { margin-top:10px; padding-top:10px; border-top:1px dashed var(--line); }
.typo-action { margin-top:6px; }
.manual-name-action { flex-basis:100%; margin-top:6px; padding-top:8px; border-top:1px solid var(--line); }
.manual-name-action summary { color:var(--accent); font-weight:500; }
.manual-name-action p { margin:6px 0; }
.manual-name-fields { display:flex; flex-wrap:wrap; align-items:end; gap:8px; }
.manual-name-fields label { display:flex; flex-direction:column; gap:4px; margin:0; }
.example-comparison { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; padding:14px 16px; }
.example-comparison > article { min-width:0; }
.example-comparison h2 { margin:0 0 10px; font-size:15px; }
.example-comparison .record-text { font-size:13px; line-height:1.6; }
.example-comparison textarea { min-height:0; }
.supporting-link { margin:10px 0; }
.supporting-rows td { padding:6px 10px; }
.supporting-rows th:first-child { width:15%; }
.supporting-rows th:nth-child(2) { width:18%; }
.supporting-rows .inline-preview { max-width:none; min-width:0; }
.check-source { margin-top:6px; }
.review-pane { padding:16px; }
.reference-editor { flex:1; min-height:0; overflow:auto; padding:10px; }
.example-workbench .requirement-scroll > .panel { border:0; margin:0; }
.approval-summary { display:flex; flex-wrap:wrap; gap:4px 16px; align-items:center; color:var(--ink-2); }
.example-footer { gap:12px; }
.review-split { display:grid; grid-template-columns:260px minmax(0,1fr); gap:14px; align-items:start; }
.review-rail { position:sticky; top:12px; height:calc(100dvh - var(--topbar) - 28px); overflow:auto; border:1px solid var(--line); border-radius:var(--radius-l); background:var(--surface); }
.review-rail-head { position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:center; gap:8px; padding:9px 12px; background:var(--surface); border-bottom:1px solid var(--line); font-size:12.5px; font-weight:600; }
.review-rail > a { display:flex; flex-direction:column; gap:3px; padding:8px 12px; border-bottom:1px solid var(--line); color:var(--ink); font-size:12.5px; }
.review-rail > a:hover { background:var(--surface-2); text-decoration:none; }
.review-rail > a.active { background:var(--accent-soft); box-shadow:inset 3px 0 var(--accent); }
.rail-title { display:flex; justify-content:space-between; align-items:center; gap:6px; }
.rail-excerpt { color:var(--muted); display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; line-height:1.35; }

/* Opt-in section tabs (data-workspace) */
.operational-workspace { display:flex; flex-direction:column; gap:8px; min-width:0; }
.operational-workspace > *, .operational-workspace .workspace-panel, .workspace-tabs, .requirement-tabs { min-width:0; }
.operational-workspace .workspace-container { display:contents; }
.operational-workspace .workspace-panel { margin:0; }
.workspace-tabs { display:flex; flex:none; gap:2px; border-bottom:1px solid var(--line); overflow-x:auto; overflow-y:hidden; }
.workspace-tabs button { flex:none; border:0; border-bottom:2px solid transparent; border-radius:0; background:transparent; box-shadow:none; padding:8px 12px; margin-bottom:-1px; color:var(--ink-2); font-weight:500; }
.workspace-tabs button:hover { background:var(--surface-2); }
.workspace-tabs button[aria-selected=true] { color:var(--accent); border-bottom-color:var(--accent); font-weight:650; background:transparent; }
.workspace-panel > summary { pointer-events:none; list-style:none; font-weight:600; margin-bottom:12px; }
.reference-editor.operational-workspace { height:auto; min-height:0; min-width:0; padding:8px; overflow:visible; }

/* Jobs */
.job-panel { border-top:3px solid var(--accent-line); }
.job-progress-row { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:10px 0; }
progress { width:min(100%,520px); height:10px; accent-color:var(--accent); display:block; margin:12px 0; }
.job-progress-row progress { margin:0; flex:1; min-width:160px; max-width:600px; }
.job-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; border-top:1px solid var(--line); margin-top:12px; padding-top:10px; font-size:12px; color:var(--muted); }
.workflow-message { max-width:760px; }
.workflow-message .disclosure { margin-top:16px; color:var(--muted); font-size:12px; }
.review-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; padding:10px 14px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-l); }
.review-actions p, .review-actions .form-actions, .review-actions form { margin:0; }

/* Configuration, catalogue and references */
.configuration-layout { display:grid; grid-template-columns:minmax(0,2fr) minmax(270px,1fr); gap:12px; align-items:start; }
.configuration-aside { border-top:3px solid var(--accent-line); }
.provider-editor { margin:0 0 12px; }
.provider-settings { margin:0; align-items:start; }
.provider-settings > section { height:100%; }
.provider-save { padding:12px 0 0; }
.provider-table td:last-child { text-align:right; width:1%; white-space:nowrap; }
.operation-options { display:grid; gap:0; margin-top:8px; }
.operation-options label.operation-option { display:flex !important; align-items:flex-start; gap:10px; margin:0; padding:9px 0; width:100%; border-bottom:1px solid var(--line); }
label.operation-option:last-child { border-bottom:0; padding-bottom:0; }
.operation-option input { flex:none; margin-top:3px; }
.operation-option strong { font-size:13px; color:var(--ink); font-weight:600; }
.option-description { display:block; font-weight:400; color:var(--muted); font-size:12px; margin-top:2px; }
.credential-form { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:12px 0 0; }
.credential-form > label { margin:0; }
.credential-form > label:first-of-type { flex:1; min-width:200px; }
.credential-form .check-line { align-self:center; font-weight:400; }
.reset-option { display:flex; flex-direction:column; border-top:3px solid var(--success-line); }
.reset-all { border-top-color:var(--danger-line); }
.reset-option h2 { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:6px; }
.reset-option form { margin-top:auto; padding-top:12px; }
.reset-option label { display:block; }
.reset-option input { display:block; width:100%; margin:6px 0 9px; }
.catalogue-evidence { padding:12px 0; border-top:1px solid var(--line); }
.catalogue-evidence:first-of-type { border-top:0; }
.catalogue-evidence .record-text { margin:8px 0; }
.privacy-compare .record-text { max-height:430px; min-height:120px; }
.local-reference-details { margin:10px 0; padding:10px 12px; border:1px solid var(--warning-line); border-radius:var(--radius); background:var(--warning-bg); }
.local-reference-details h3 { margin:0 0 5px; font-size:13px; }
.local-reference-details ul { margin:8px 0; padding-left:20px; }
.local-reference-details li + li { margin-top:5px; }
.local-reference-row { display:flex; flex-wrap:wrap; gap:6px 10px; padding:8px 0; border-bottom:1px solid var(--line); }
.local-reference-row .small, .local-reference-row .inline-preview { flex-basis:100%; }
.validation-issue + .validation-issue { border-top:1px solid var(--line); padding-top:10px; margin-top:10px; }
.report-rows .inline-preview { min-width:0; }

/* Export delivery */
.export-delivery { display:flex; align-items:flex-start; gap:22px; }
.export-file-icon { flex:none; background:var(--accent-soft); color:var(--accent); font:600 26px var(--mono); padding:18px; border-radius:var(--radius-l); }
.export-file-details { min-width:0; }
.export-file-details h2 { margin:0 0 6px; overflow-wrap:anywhere; }
.export-file-facts { display:flex; flex-wrap:wrap; gap:14px 32px; margin:18px 0; }
.export-file-facts dt { color:var(--muted); font-size:12px; }
.export-file-facts dd { margin:4px 0 0; font-weight:600; }

/* Loading indicator */
.navigation-status { position:fixed; top:10px; left:50%; transform:translateX(-50%); z-index:10000; display:flex; align-items:center; gap:10px; padding:10px 18px; border:1px solid var(--line); border-radius:var(--radius-l); background:var(--surface); color:var(--ink-2); box-shadow:0 4px 18px rgb(16 24 40 / 14%); pointer-events:none; font-size:13px; }
.navigation-status[hidden] { display:none; }
.loading-spinner { width:16px; height:16px; border:2px solid var(--accent-soft); border-top-color:var(--accent); border-radius:50%; animation:navigation-spin .8s linear infinite; }
@keyframes navigation-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-spinner { animation:none; } }

/* Responsive */
@media (max-width:1280px) {
  .workflow-steps { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .export-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:1100px) {
  :root { --sidebar:184px; }
  .content { padding:14px 18px 28px; }
  .panel-grid, .configuration-layout { grid-template-columns:1fr; }
  .review-split { grid-template-columns:1fr; }
  .review-rail { display:none; }
  .example-comparison { grid-template-columns:1fr; }
  .review-filters { grid-template-columns:1fr 1fr; }
  .requirement-source-layout { grid-template-columns:200px minmax(0,1fr); }
}
@media (max-width:760px) {
  .shell { display:block; }
  .sidebar { position:static; width:auto; height:auto; padding:10px 12px; }
  .sidebar nav { display:flex; flex-wrap:wrap; }
  .sidebar-foot, .nav-caption { display:none; }
  .brand { margin:0 0 8px; }
  .brand br { display:none; }
  .brand small { margin-left:5px; }
  .topbar { padding:0 14px; }
  .content { padding:12px 12px 24px; }
  .page-heading { flex-direction:column; align-items:stretch; gap:10px; }
  .workflow-steps, .export-filters, .review-filters, form.grid, .assistance-fields.grid, .field-grid { grid-template-columns:1fr; }
  .toolbar > *, .toolbar label { max-width:100%; width:100%; }
  .requirement-workbench { height:auto; min-height:0; }
  .requirement-body { min-height:60vh; }
  .requirement-source-layout { grid-template-columns:1fr; }
  .requirement-source-list { max-height:220px; border-right:0; border-bottom:1px solid var(--line); }
  .credential-form { align-items:stretch; flex-direction:column; }
  dl { grid-template-columns:110px minmax(0,1fr); }
  .review-selection-tools { width:100%; }
  .review-selection-tools .review-delete { margin-left:0; }
}
@media (pointer:coarse) { button, .button, select, input:not([type=checkbox]):not([type=radio]), .sidebar nav a { min-height:40px; } input, select, textarea { font-size:16px; } }
