:root {
  --ink: #10233d;
  --ink-soft: #53647b;
  --muted: #8290a3;
  --line: #dfe6ef;
  --line-strong: #cbd6e4;
  --canvas: #f3f6fa;
  --panel: #ffffff;
  --navy: #0b172a;
  --blue: #245bc7;
  --blue-deep: #18479e;
  --cyan: #29a6b8;
  --mint: #dff7f1;
  --mint-ink: #08776f;
  --amber: #e7a322;
  --amber-soft: #fff4dc;
  --red: #c94e5c;
  --red-soft: #fff0f1;
  --violet: #6d5ad1;
  --shadow: 0 18px 46px rgba(16, 35, 61, .08);
  --shadow-soft: 0 8px 24px rgba(16, 35, 61, .06);
  --radius: 18px;
  --font: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
/* Keep DOM state authoritative even when a component's layout rule sets display. */
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled, a.disabled { cursor: not-allowed; }
img { display: block; max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 3vw, 52px);
  color: #fff;
  background: var(--navy);
  box-shadow: 0 4px 20px rgba(5, 19, 39, .18);
}
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 260px; }
.brand-lockup h1 { margin: 0; color: #fff; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 30px; height: 30px; padding: 5px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: linear-gradient(145deg, #17355e, #0f2442); }
.brand-mark span { display: block; width: 4px; border-radius: 2px; background: linear-gradient(#75e6d5, #2b91d3); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 20px; opacity: .8; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.topbar .eyebrow { color: #7e93b0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #c4d1e3; background: rgba(255,255,255,.06); font-size: 12px; }
.status-dot, .pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(231,163,34,.13); }
.status-ready .status-dot { background: #61d7b2; box-shadow: 0 0 0 4px rgba(97,215,178,.14); }
.status-error .status-dot { background: #ec7180; box-shadow: 0 0 0 4px rgba(236,113,128,.14); }
.status-pending .status-dot { animation: breathe 1.5s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; transform: scale(.7); } }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; font-weight: 700; transition: .18s ease; }
.button:focus-visible, .icon-button:focus-visible, .text-button:focus-visible, .download-button:focus-visible, .record-button:focus-visible, .crop-thumb:focus-visible, .focus-button:focus-visible { outline: 3px solid rgba(58, 147, 225, .3); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(36,91,199,.2); }
.button-primary:hover { background: var(--blue-deep); transform: translateY(-1px); }
.button-secondary { color: var(--ink); border-color: var(--line-strong); background: #fff; }
.button-secondary:hover { border-color: var(--blue); color: var(--blue); }
.button-ghost { color: #d5e0ef; border-color: rgba(255,255,255,.19); background: rgba(255,255,255,.06); }
.button-ghost:hover { color: #fff; background: rgba(255,255,255,.12); }
.button-slow { width: 100%; min-height: 42px; color: #5742ad; border-color: #d8cff9; background: #f3f0ff; }
.button-slow:hover:not(:disabled) { color: #fff; border-color: var(--violet); background: var(--violet); }
.button-large { min-height: 45px; padding: 0 19px; font-size: 14px; }
.button:disabled { color: #99a6b7; border-color: #e1e7ef; background: #eef2f6; box-shadow: none; transform: none; }
.notice-banner { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 20px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.notice-info { color: #2a568f; background: #eaf3ff; }
.notice-success { color: #1d725e; background: #e8f8f2; }
.notice-warning { color: #885e0a; background: var(--amber-soft); }
.notice-error { color: #9e3543; background: var(--red-soft); }

.workspace { flex: 1; width: min(1760px, 100%); margin: 0 auto; padding: clamp(20px, 3vw, 38px) clamp(16px, 3vw, 48px) 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-soft); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.muted { color: var(--muted); }

.empty-state { display: flex; min-height: calc(100vh - 150px); flex-direction: column; align-items: center; justify-content: center; padding: 46px 20px 70px; text-align: center; }
.empty-state h2 { max-width: 600px; margin: 6px 0 13px; font-size: clamp(25px, 4vw, 42px); line-height: 1.15; letter-spacing: -.045em; }
.empty-copy { max-width: 540px; margin: 0; color: var(--ink-soft); font-size: 15px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.empty-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px 25px; margin-top: 26px; color: var(--muted); font-size: 12px; }
.meta-icon { margin-right: 5px; color: var(--cyan); font-style: normal; font-size: 16px; vertical-align: -1px; }
.empty-config { min-height: 23px; margin-top: 23px; color: var(--ink-soft); font-size: 12px; }
.empty-orbit { position: relative; width: 126px; height: 126px; margin-bottom: 23px; }
.orbit-core { position: absolute; inset: 30px; display: grid; place-items: center; border: 1px solid #b7d8ef; border-radius: 50%; color: var(--blue); background: linear-gradient(145deg, #eaf6ff, #fff); box-shadow: 0 12px 28px rgba(36,91,199,.12); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.orbit-line { position: absolute; inset: 13px; border: 1px solid #c9e4ef; border-radius: 50%; transform: rotate(30deg); }
.orbit-line-two { inset: 1px 24px; border-color: #d8d2f4; transform: rotate(-48deg); }
.orbit-line::after, .orbit-line-two::after { content: ''; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(41,166,184,.13); }
.orbit-line-two::after { top: auto; right: -4px; bottom: 25%; left: auto; background: var(--violet); box-shadow: 0 0 0 5px rgba(109,90,209,.12); }

.job-view { display: flex; flex-direction: column; gap: 14px; }
.progress-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(190px, .55fr); align-items: center; gap: 22px; padding: 15px 19px; }
.progress-title-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 13px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e8edf4; }
.progress-value { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .25s ease; }
.progress-count { display: flex; align-items: baseline; gap: 4px; color: var(--blue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-count strong { font-size: 23px; }
.progress-count small { margin-left: 4px; color: var(--muted); font-size: 11px; }
.current-task { display: flex; align-items: center; gap: 9px; min-width: 0; overflow: hidden; color: var(--ink-soft); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.current-task > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.pulse-dot { flex: 0 0 auto; animation: breathe 1.15s ease-in-out infinite; }
.pulse-idle { animation: none; opacity: .35; }
.shortfall-banner { display: flex; align-items: center; gap: 9px; padding: 11px 15px; border: 1px solid #f2c4a7; border-radius: 12px; color: #8b3d1c; background: #fff4ed; font-size: 12px; font-weight: 700; }
.shortfall-banner::before { content: '⚠'; display: inline-grid; width: 21px; height: 21px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: #d9783f; font-size: 12px; }
.demo-banner { display: flex; align-items: center; gap: 11px; padding: 11px 16px; border: 1px solid #ded6fb; border-radius: 13px; color: #554590; background: #f4f1ff; }
.demo-banner strong { display: block; font-size: 13px; }
.demo-banner span:not(.demo-icon) { display: block; margin-top: 2px; color: #7268a7; font-size: 12px; }
.demo-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px; color: #fff; background: var(--violet); }

.workbench-grid { display: grid; grid-template-columns: minmax(236px, 255px) minmax(420px, 1fr) minmax(380px, 455px); gap: 14px; align-items: stretch; min-height: 680px; }
.records-panel, .viewer-panel, .inspector-panel { min-height: 680px; overflow: hidden; }
.records-panel { display: flex; flex-direction: column; }
.records-heading { padding: 19px 17px 15px; border-bottom: 1px solid var(--line); }
.count-badge { display: inline-flex; min-width: 28px; height: 25px; align-items: center; justify-content: center; padding: 0 7px; border-radius: 8px; color: var(--blue); background: #eaf1ff; font-size: 12px; font-weight: 800; }
.list-toolbar { display: grid; gap: 9px; padding: 12px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.search-box { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; }
.search-box:focus-within { border-color: #9bb9ea; box-shadow: 0 0 0 3px rgba(36,91,199,.08); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box kbd { padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: #f6f8fb; font-size: 10px; }
.select-control { width: 100%; height: 33px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #fff; outline: none; font-size: 12px; }
.select-control:focus { border-color: #9bb9ea; box-shadow: 0 0 0 3px rgba(36,91,199,.08); }
.record-list { flex: 1; overflow: auto; padding: 6px; }
.record-item { border-radius: 12px; }
.record-item + .record-item { margin-top: 2px; }
.record-item.selected { background: #eef4ff; }
.record-button { display: grid; grid-template-columns: 43px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 9px 7px; border: 0; border-radius: 12px; color: inherit; text-align: left; background: transparent; }
.record-button:hover { background: #f1f5fa; }
.record-item.selected .record-button { background: transparent; }
.record-thumb { display: grid; width: 43px; height: 43px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; color: #90a0b3; background: #edf1f6; }
.record-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { font-size: 17px; }
.record-main { display: grid; min-width: 0; gap: 2px; }
.record-main strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.record-main > span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0 8px; border-radius: 7px; color: #617189; background: #eef2f6; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-badge.small { min-height: 20px; padding: 0 6px; font-size: 9px; }
.status-ok { color: #08776f; background: var(--mint); }
.status-review { color: #8c6518; background: var(--amber-soft); }
.status-failed { color: #a63e4c; background: var(--red-soft); }
.status-processing { color: #245bc7; background: #eaf1ff; }
.status-queued { color: #637185; background: #eef2f6; }
.status-unknown { color: #6d5ad1; background: #f2efff; }
.list-empty { display: grid; place-items: center; gap: 5px; height: 170px; padding: 22px; color: var(--muted); text-align: center; font-size: 12px; }
.list-empty strong { color: var(--ink-soft); }
.list-empty-icon { color: var(--blue); font-size: 24px; }

.viewer-panel { padding: 18px; background: #fafbfd; }
.viewer-empty, .inspector-empty { display: flex; height: 100%; min-height: 620px; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; }
.viewer-empty strong, .inspector-empty strong { color: var(--ink-soft); font-size: 15px; }
.viewer-empty-icon, .inspector-empty-icon { display: grid; width: 62px; height: 62px; place-items: center; margin-bottom: 4px; border: 1px dashed #b9c7d8; border-radius: 18px; color: #6e91c8; background: #f1f6fe; font-size: 27px; }
.inspector-empty-icon { color: #8a79d4; background: #f5f2ff; }
.viewer-content { min-width: 0; }
.viewer-heading { align-items: center; margin: 0 2px 14px; }
.viewer-heading h2 { max-width: 370px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.viewer-heading .muted { display: block; margin-top: 2px; font-size: 11px; }
.viewer-tools { display: flex; align-items: center; gap: 5px; }
.icon-button, .text-button { display: inline-grid; min-width: 29px; height: 29px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: #fff; font-weight: 700; }
.icon-button:hover, .text-button:hover { color: var(--blue); border-color: #a5bde9; }
.text-button { min-width: auto; padding: 0 8px; font-size: 11px; font-weight: 700; }
.zoom-label { width: 37px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; }
.source-stage { position: relative; display: grid; min-height: 365px; max-height: 510px; place-items: center; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #e9eef5; }
.source-stage::before { position: absolute; inset: 0; z-index: 0; opacity: .34; background-image: linear-gradient(45deg, #d8e0ea 25%, transparent 25%, transparent 75%, #d8e0ea 75%), linear-gradient(45deg, #d8e0ea 25%, transparent 25%, transparent 75%, #d8e0ea 75%); background-position: 0 0, 7px 7px; background-size: 14px 14px; content: ''; }
.source-stage img { position: relative; z-index: 1; width: auto; max-width: 100%; max-height: 500px; object-fit: contain; transform-origin: center center; transition: transform .18s ease; }
.source-image-empty { position: relative; z-index: 1; color: var(--muted); font-size: 12px; }
.source-loading { position: absolute; z-index: 2; top: 10px; left: 50%; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 8px; color: #fff; background: rgba(16,35,61,.82); font-size: 11px; transform: translateX(-50%); }
.spinner { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.source-caption { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px 15px; color: var(--muted); font-size: 11px; }
.source-caption-status { color: var(--ink-soft); font-weight: 700; }
.crop-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 0 2px 7px; }
.crop-heading strong { font-size: 13px; }
.evidence-source-label { color: var(--blue); font-size: 11px; font-weight: 700; }
.crop-viewer { display: grid; min-height: 118px; max-height: 185px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #eef2f6; }
.crop-viewer img { width: 100%; height: 100%; min-height: 118px; max-height: 185px; object-fit: contain; }
.crop-placeholder { padding: 25px; color: var(--muted); font-size: 12px; text-align: center; }
.crop-strip { display: flex; gap: 6px; overflow-x: auto; padding-top: 9px; }
.crop-thumb { display: grid; flex: 0 0 54px; gap: 4px; padding: 3px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; font-size: 9px; }
.crop-thumb:hover, .crop-thumb.active { color: var(--blue); border-color: #9fbae9; background: #edf4ff; }
.crop-thumb-image { display: grid; width: 48px; height: 32px; place-items: center; overflow: hidden; border-radius: 5px; color: #8fa1b7; background: #e4eaf2; font-size: 9px; }
.crop-thumb img { width: 100%; height: 100%; object-fit: cover; }

.inspector-panel { position: relative; display: flex; flex-direction: column; }
.inspector-heading { padding: 18px 18px 13px; border-bottom: 1px solid var(--line); }
.inspector-heading h2 { max-width: 260px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.inspector-heading .muted { display: block; max-width: 270px; overflow: hidden; margin-top: 2px; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.record-warning { display: flex; align-items: baseline; gap: 8px; margin: 12px 15px 0; padding: 9px 10px; border: 1px solid #f1d798; border-radius: 10px; color: #825b0d; background: #fff8e8; font-size: 11px; }
.record-warning strong { flex: 0 0 auto; }
.record-warning span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspector-scroll { flex: 1; overflow: auto; padding: 14px 15px 16px; }
.serial-card { margin-bottom: 15px; padding: 12px; border: 1px solid #cfe1f3; border-radius: 13px; background: #f5f9ff; }
.field-topline { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.field-label { color: var(--ink); font-size: 12px; font-weight: 800; }
.field-short { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.mini-state { color: var(--blue); font-size: 10px; font-weight: 700; }
.section-title-row { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.section-title-row h3 { margin: 0; font-size: 14px; }
.section-note { color: var(--muted); font-size: 10px; }
.metric-group + .metric-group { margin-top: 17px; }
.metric-group-title { display: flex; align-items: center; gap: 7px; margin: 0 1px 7px; color: var(--ink-soft); font-size: 11px; }
.metric-group-title > span:last-child { color: var(--muted); font-weight: 500; }
.metric-swatch { width: 7px; height: 7px; border-radius: 2px; background: var(--blue); }
.metric-swatch.current { background: var(--cyan); }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.field-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
.field-card:hover, .field-card.active { border-color: #9ebbe9; box-shadow: 0 4px 13px rgba(36,91,199,.08); }
.serial-field-card { padding: 2px 0 0; border: 0; background: transparent; box-shadow: none; }
.serial-field-card:hover, .serial-field-card.active { border-color: transparent; box-shadow: none; }
.field-card-head { display: flex; align-items: start; justify-content: space-between; gap: 5px; min-height: 29px; }
.field-card-head > div { min-width: 0; }
.field-state { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 17px; padding: 0 4px; border-radius: 5px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.field-state-good { color: #08776f; background: var(--mint); }
.field-state-review { color: #8c6518; background: var(--amber-soft); }
.field-state-alert { color: #a63e4c; background: var(--red-soft); }
.field-input-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.field-input { width: 100%; min-width: 0; height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fbfcfe; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; outline: none; }
.field-input:focus { border-color: #83a8e5; box-shadow: 0 0 0 3px rgba(36,91,199,.1); }
.field-input.dirty { border-color: #e1af42; background: #fffaf0; }
.field-input::placeholder { color: #acb7c6; font-weight: 500; }
.field-unit { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.focus-button { display: inline-grid; flex: 0 0 auto; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--blue); background: #fff; font-size: 14px; }
.focus-button:hover { border-color: #9ebbe9; background: #edf4ff; }
.field-meta { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 7px; color: var(--muted); font-size: 9px; }
.field-meta > span:first-child { white-space: nowrap; }
.field-meta strong { color: var(--ink-soft); font-weight: 800; }
.localization-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; margin-left: auto; color: var(--blue); cursor: pointer; font-size: 9px; font-weight: 800; }
.confirm-toggle input { width: 12px; height: 12px; margin: 0; accent-color: var(--blue); }
.evidence-details { margin-top: 8px; border-top: 1px solid #edf0f5; }
.evidence-details summary { display: flex; justify-content: space-between; gap: 5px; padding-top: 7px; color: var(--blue); cursor: pointer; list-style: none; font-size: 9px; font-weight: 700; }
.evidence-details summary::-webkit-details-marker { display: none; }
.evidence-details summary span:last-child { color: var(--muted); font-weight: 500; }
.evidence-detail-body { padding-top: 7px; }
.evidence-path { display: flex; justify-content: space-between; gap: 7px; padding-bottom: 6px; color: var(--muted); font-size: 10px; }
.evidence-path button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 10px; font-weight: 700; }
.evidence-geometry { display: flex; justify-content: space-between; gap: 7px; padding-bottom: 6px; color: var(--muted); font-size: 9px; }
.evidence-geometry code { overflow: hidden; color: var(--ink-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.candidate-list { display: grid; gap: 4px; }
.candidate-head, .candidate-row { display: grid; grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 2px 5px; }
.candidate-head { padding: 0 6px 2px; color: #829081; font-size: 8px; line-height: 1.2; }
.candidate-row { padding: 5px 6px; border-radius: 6px; background: #f6f8fb; font-size: 10px; }
.candidate-family { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.candidate-row strong { font-variant-numeric: tabular-nums; }
.candidate-raw { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.candidate-confidence { color: var(--blue); text-align: right; }
.evidence-issues, .reason-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.evidence-issues span, .reason-list span { padding: 3px 5px; border-radius: 5px; color: #8c6518; background: var(--amber-soft); font-size: 9px; }
.audit-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.audit-content { display: grid; gap: 10px; }
.audit-block { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.audit-block-title { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.audit-block-title span { color: var(--muted); font-weight: 500; }
.audit-row, .history-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: var(--muted); font-size: 10px; }
.audit-row strong { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.history-row { align-items: flex-start; }
.history-row span:last-child { max-width: 72%; color: var(--ink-soft); text-align: right; word-break: break-word; }
.history-row + .history-row { border-top: 1px solid #edf0f5; }
.inspector-actions { padding: 12px 15px 15px; border-top: 1px solid var(--line); background: #fff; }
.action-hint { min-height: 19px; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.action-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; margin-bottom: 8px; }
.action-row .button { min-width: 0; padding: 0 8px; font-size: 11px; }

.downloads-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 19px; }
.downloads-copy h2 { margin: 0; font-size: 15px; }
.downloads-copy .muted { display: block; margin-top: 3px; font-size: 11px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.download-button { display: flex; min-width: 98px; flex-direction: column; align-items: center; justify-content: center; min-height: 47px; padding: 0 13px; border: 1px solid #bcd0ec; border-radius: 10px; color: var(--blue); background: #f4f8ff; font-size: 12px; font-weight: 800; text-decoration: none; }
.download-button small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 500; }
.download-button:hover:not(.disabled) { border-color: var(--blue); background: #eaf2ff; }
.download-button.disabled { color: #9aa7b8; border-color: var(--line); background: #f3f5f8; }
.download-button.disabled small { color: #aab4c1; }
.footer-bar { display: none; }
.usage-details { margin-top: 16px; color: var(--ink-soft); font-size: 12px; }
.usage-details > summary { cursor: pointer; }
.usage-details[open] > summary { margin-bottom: 12px; }

.lightbox { position: fixed; z-index: 40; inset: 0; display: grid; grid-template-rows: 1fr auto; padding: 30px; background: rgba(5, 14, 28, .89); }
.lightbox-stage { display: grid; min-height: 0; place-items: center; overflow: auto; }
.lightbox-stage img { max-width: 95vw; max-height: 82vh; object-fit: contain; box-shadow: 0 18px 70px rgba(0,0,0,.35); }
.lightbox-close { position: absolute; top: 15px; right: 18px; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: #fff; background: rgba(0,0,0,.18); font-size: 25px; }
.lightbox-close:hover { background: rgba(255,255,255,.15); }
.lightbox-caption { padding-top: 12px; color: #d7e4f5; text-align: center; font-size: 12px; }

@media (max-width: 1280px) {
  .workbench-grid { grid-template-columns: 230px minmax(350px, 1fr) 390px; }
  .topbar { padding-right: 25px; padding-left: 25px; }
  .workspace { padding-right: 25px; padding-left: 25px; }
}
@media (max-width: 1080px) {
  .workbench-grid { grid-template-columns: 230px minmax(0, 1fr); }
  .inspector-panel { grid-column: 1 / -1; min-height: auto; }
  .inspector-scroll { max-height: none; }
  .inspector-content { min-height: auto; }
  .metric-grid { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 14px 16px; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .topbar-actions .status-chip { max-width: 170px; overflow: hidden; }
  .topbar-actions .status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions .button-ghost { display: none; }
  .workspace { padding: 14px 10px 16px; }
  .empty-state { min-height: calc(100vh - 138px); padding-top: 26px; }
  .empty-state h2 { font-size: 28px; }
  .empty-copy { font-size: 13px; }
  .empty-meta { display: grid; gap: 5px; text-align: left; }
  .progress-strip { grid-template-columns: 1fr auto; gap: 12px; padding: 13px; }
  .current-task { grid-column: 1 / -1; }
  .workbench-grid { display: flex; flex-direction: column; min-height: 0; }
  .records-panel, .viewer-panel, .inspector-panel { min-height: 0; }
  .records-panel { max-height: 330px; }
  .record-list { max-height: 215px; }
  .viewer-empty { min-height: 280px; }
  .viewer-panel { padding: 13px; }
  .viewer-heading { align-items: flex-start; flex-direction: column; }
  .viewer-tools { align-self: flex-end; margin-top: -43px; }
  .source-stage { min-height: 250px; max-height: 370px; }
  .source-stage img { max-height: 355px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .downloads-panel { align-items: flex-start; flex-direction: column; }
  .download-actions { width: 100%; }
  .download-button { flex: 1; min-width: 0; }
  .footer-bar { padding-right: 13px; padding-left: 13px; }
}
@media (max-width: 390px) {
  .button-large { padding: 0 12px; }
  .metric-grid { grid-template-columns: 1fr; }
  .field-card { display: grid; grid-template-columns: 1fr; }
  .field-meta { flex-wrap: wrap; }
  .action-row { grid-template-columns: 1fr; }
}

/* Editorial industrial review desk: warm paper, dark instrumentation, one
   bright signal colour.  Kept local and dependency-free for the offline app. */
:root {
  --ink: #18372d;
  --ink-soft: #4f675a;
  --muted: #7e8d80;
  --line: #d9ded4;
  --line-strong: #b8c5b8;
  --canvas: #f3f0e7;
  --panel: #fbfaf5;
  --navy: #17362d;
  --blue: #35634e;
  --blue-deep: #214b39;
  --cyan: #7eaa68;
  --mint: #e7f2df;
  --mint-ink: #35603f;
  --amber: #c98b25;
  --amber-soft: #fff1cc;
  --red: #b7554b;
  --red-soft: #fce9e1;
  --violet: #72615d;
  --acid: #d8ee5a;
  --acid-deep: #bfdc3b;
  --shadow: 0 20px 50px rgba(26, 48, 37, .1);
  --shadow-soft: 0 8px 24px rgba(26, 48, 37, .06);
  --radius: 16px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

html { background: var(--canvas); }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(216, 238, 90, .12), transparent 28rem),
    var(--canvas);
}
.job-view { gap: 9px; }
.topbar {
  min-height: 72px;
  border-bottom: 1px solid rgba(216, 238, 90, .12);
  background: var(--navy);
  box-shadow: 0 8px 24px rgba(14, 38, 29, .18);
}
.brand-lockup { gap: 12px; }
.brand-lockup h1 { letter-spacing: -.035em; }
.brand-mark {
  border-color: rgba(216, 238, 90, .32);
  background: linear-gradient(145deg, #254b3b, #122a22);
}
.brand-mark span { background: linear-gradient(#e9f889, #98b83e); }
.brand-mark span:nth-child(1) { opacity: .7; }
.topbar .eyebrow { color: #91a89a; }
.batch-context {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
  margin-right: auto;
  padding-left: 20px;
  color: #d9e5d6;
  font-size: 12px;
}
.batch-context-label { color: #88a095; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.batch-context strong { overflow: hidden; max-width: 190px; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.batch-context-count { color: #a8bdb0; font-variant-numeric: tabular-nums; }
.status-chip { border-color: rgba(216, 238, 90, .2); color: #d3dfd5; background: rgba(255,255,255,.055); }
.status-ready .status-dot { background: var(--acid); box-shadow: 0 0 0 4px rgba(216,238,90,.14); }
.status-pending .status-dot { background: var(--amber); }
.button-primary {
  color: var(--ink);
  background: var(--acid);
  box-shadow: 0 8px 18px rgba(216,238,90,.16);
}
.button-primary:hover { color: var(--ink); background: var(--acid-deep); }
.button-secondary { color: var(--ink); border-color: var(--line-strong); background: var(--panel); }
.button-secondary:hover { color: var(--blue-deep); border-color: var(--blue); background: #fff; }
.button-ghost:hover { border-color: rgba(216,238,90,.4); color: #f2f7df; }
.workspace { padding-top: clamp(18px, 2.4vw, 32px); }
.panel { border-color: var(--line); border-radius: var(--radius); background: rgba(251,250,245,.92); box-shadow: var(--shadow-soft); }
.eyebrow { color: #859487; letter-spacing: .16em; }
.muted { color: var(--muted); }
.notice-banner { border-color: var(--line); }
.notice-info { color: #365e4b; background: #eaf2df; }
.notice-success { color: #315b3e; background: #e5f1dc; }
.notice-warning { color: #805e17; background: var(--amber-soft); }
.notice-error { color: #92463d; background: var(--red-soft); }
.empty-state { min-height: calc(100vh - 140px); }
.empty-state h2 { color: var(--ink); max-width: 680px; }
.empty-copy { color: var(--ink-soft); }
.empty-orbit { filter: saturate(.7); }
.orbit-core { border-color: #b6c96e; color: var(--ink); background: linear-gradient(145deg, #f3f8d9, #fff); box-shadow: 0 12px 28px rgba(102,129,55,.13); }
.orbit-line { border-color: #c9d3ad; }
.orbit-line-two { border-color: #d9cec0; }
.orbit-line::after, .orbit-line-two::after { background: var(--acid-deep); box-shadow: 0 0 0 5px rgba(191,220,59,.16); }
.orbit-line-two::after { background: var(--amber); box-shadow: 0 0 0 5px rgba(201,139,37,.12); }

.progress-strip { gap: 14px; padding: 10px 14px; border-color: #cbd5c8; background: #f9f8f1; }
.progress-track { background: #e6eadf; }
.progress-value { background: linear-gradient(90deg, var(--acid-deep), #87a957); }
.progress-count { color: var(--blue-deep); }
.current-task { color: var(--ink-soft); }
.shortfall-banner { border-color: #e7c98d; color: #805c19; background: #fff7df; }
.demo-banner { border-color: #d6dfc4; color: #4c643e; background: #f2f5e4; }
.demo-banner span:not(.demo-icon) { color: #6e7d61; }
.demo-icon { color: var(--ink); background: var(--acid); }

.workflow-panel { padding: 10px 15px 9px; }
.workflow-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.workflow-heading .eyebrow { display: none; }
.workflow-heading h2 { margin: 0; font-size: 13px; letter-spacing: -.02em; }
.workflow-heading .muted { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.workflow-step { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; color: #a3afa1; }
.workflow-step:not(:last-child)::after { position: absolute; top: 13px; right: 12%; left: 52px; height: 1px; background: #d9ded4; content: ''; }
.workflow-index { position: relative; z-index: 1; display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border: 1px solid #d1d9cf; border-radius: 50%; color: #98a69a; background: var(--panel); font-size: 9px; font-variant-numeric: tabular-nums; font-weight: 800; }
.workflow-step > span:last-child { display: grid; min-width: 0; gap: 1px; }
.workflow-step strong { color: #89988b; font-size: 11px; }
.workflow-step small { overflow: hidden; color: #a3aea2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-step.is-active .workflow-index { border-color: var(--acid-deep); color: var(--ink); background: var(--acid); box-shadow: 0 0 0 4px rgba(216,238,90,.18); }
.workflow-step.is-active strong, .workflow-step.has-attention strong { color: var(--ink); }
.workflow-step.is-done .workflow-index { border-color: #a7c098; color: #fff; background: #6f9b61; }
.workflow-step.is-done strong { color: var(--blue-deep); }
.workflow-step.is-done:not(:last-child)::after { background: #b2caa9; }
.workflow-step.has-attention .workflow-index { border-color: var(--amber); color: #6d4b0c; background: #fff0c7; box-shadow: 0 0 0 4px rgba(201,139,37,.12); }

.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.summary-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: baseline; padding: 8px 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(251,250,245,.8); }
.summary-card strong { grid-row: 1 / 3; grid-column: 1; color: var(--ink); font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-card > span:last-child { grid-column: 2; color: var(--muted); font-size: 10px; }
.summary-kicker { grid-column: 2; color: #859487; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.summary-auto { border-color: #cbd9c4; }
.summary-auto strong { color: #5e8f51; }
.summary-confirmed strong { color: #557c68; }
.summary-review { border-color: #ead4a3; }
.summary-review strong { color: #b77d20; }

.workbench-grid { grid-template-columns: minmax(230px, 255px) minmax(520px, 1fr) minmax(400px, 470px); gap: 12px; min-height: 690px; }
.records-panel, .viewer-panel, .inspector-panel { min-height: 690px; }
.records-heading { padding: 17px 16px 13px; border-color: var(--line); }
.count-badge { color: var(--ink); background: var(--acid); }
.list-toolbar { border-color: var(--line); background: #f6f5ee; }
.search-box, .select-control { border-color: var(--line-strong); background: #fdfcf8; }
.search-box:focus-within, .select-control:focus { border-color: #8ca878; box-shadow: 0 0 0 3px rgba(111,155,97,.12); }
.record-list { padding: 7px; }
@media (min-width: 721px) {
  .records-panel { min-height: 0; max-height: max(420px, calc(100vh - 170px)); align-self: start; }
  .record-list { min-height: 180px; }
}
.record-item.selected { background: #eaf0dc; }
.record-button:hover { background: #f0f3e8; }
.record-thumb { border-color: #cbd6c8; background: #e9eee5; }
.record-main strong { color: var(--ink); }
.status-badge { border: 1px solid transparent; }
.status-ok { color: #35603f; border-color: #c6ddbc; background: var(--mint); }
.status-review { color: #8a6218; border-color: #ead39d; background: var(--amber-soft); }
.status-failed { color: #93463d; border-color: #e9c4ba; background: var(--red-soft); }
.status-processing { color: #315c48; border-color: #c9dac2; background: #e7f0df; }
.status-queued { color: #718176; border-color: #d8ded4; background: #eef1ea; }

.viewer-panel { padding: 17px; background: #f8f7f0; }
.viewer-heading { margin: 0 1px 12px; }
.viewer-heading h2, .inspector-heading h2 { color: var(--ink); }
.icon-button, .text-button { border-color: var(--line-strong); color: var(--ink-soft); background: #fcfbf6; }
.icon-button:hover, .text-button:hover { border-color: #8aa877; color: var(--blue-deep); background: #f0f4e8; }
.source-stage { min-height: 390px; max-height: 515px; border-color: #c8cfc4; border-radius: 13px; background: #e4e3d8; }
.source-stage::before { opacity: .28; background-image: linear-gradient(45deg, #cdd0c2 25%, transparent 25%, transparent 75%, #cdd0c2 75%), linear-gradient(45deg, #cdd0c2 25%, transparent 25%, transparent 75%, #cdd0c2 75%); }
.source-image-frame { position: relative; z-index: 1; display: block; width: fit-content; height: fit-content; max-width: 100%; max-height: 500px; transform-origin: center center; transition: transform .18s ease; }
.source-image-frame img { position: relative; z-index: 1; width: auto; max-width: 100%; max-height: 500px; object-fit: contain; }
.source-roi { position: absolute; z-index: 2; border: 2px solid var(--acid); border-radius: 4px; box-shadow: 0 0 0 1px rgba(24,55,45,.6), 0 0 20px rgba(216,238,90,.18); pointer-events: none; }
.source-roi span { position: absolute; top: -22px; left: -2px; padding: 3px 5px; color: var(--ink); background: var(--acid); font-size: 9px; font-weight: 800; white-space: nowrap; }
.source-caption { border-bottom: 1px solid #e2e3d9; }
.source-caption-status { color: var(--blue-deep); }
.source-mode-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: -7px 2px 11px; }
.source-mode-button { flex: 0 0 auto; white-space: nowrap; min-height: 29px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink-soft); background: #fcfbf6; font-size: 10px; font-weight: 800; }
.source-mode-button:hover:not(:disabled) { border-color: #8aa877; color: var(--blue-deep); background: #f0f4e8; }
.source-mode-button.active { border-color: var(--acid-deep); color: var(--ink); background: var(--acid); }
.source-mode-button:disabled { cursor: not-allowed; opacity: .52; }
.source-mode-note { flex: 1 1 100%; min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.crop-viewer { min-height: 132px; max-height: 205px; border-color: #c8cfc4; background: #e5e5dc; }
.crop-viewer img { min-height: 132px; max-height: 205px; }
.crop-thumb:hover, .crop-thumb.active { color: var(--blue-deep); border-color: #a0b88e; background: #ecf2e1; }
.crop-thumb-image { background: #dde4d8; }

.inspector-heading { padding: 17px 17px 12px; border-color: var(--line); }
.record-warning { border-color: #e8d09a; color: #7b5916; background: #fff7dd; }
.inspector-scroll { padding: 13px 14px 15px; }
.serial-card { border-color: #cbd9c4; background: #f0f5e8; }
.field-label { color: var(--ink); }
.field-short { color: #7c8b7d; white-space: nowrap; }
.metric-group + .metric-group { margin-top: 15px; }
.metric-group-title { color: var(--blue-deep); }
.metric-swatch { background: #82a75f; }
.metric-swatch.current { background: #c8983f; }
.metric-grid { grid-template-columns: 1fr; gap: 6px; }
.field-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(145px, 45%); grid-template-rows: auto auto auto; align-items: center; column-gap: 10px; padding: 8px 10px; border-color: #d6ddd3; border-radius: 11px; background: #fdfcf8; }
.field-card:hover, .field-card.active { border-color: #9eb787; box-shadow: 0 5px 16px rgba(82,113,70,.12); }
.field-card-name { display: flex; align-items: baseline; min-width: 0; gap: 5px; }
.phase-token { display: inline-grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center; border-radius: 4px; color: var(--ink); background: var(--acid); font-size: 10px; font-weight: 900; }
.field-card-name .field-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-card-head { grid-column: 1; grid-row: 1; min-height: 27px; align-items: center; }
.field-state { border: 1px solid transparent; }
.field-state-good { color: #35603f; border-color: #c7ddbe; background: var(--mint); }
.field-state-review { color: #8b641c; border-color: #ead39d; background: var(--amber-soft); }
.field-state-alert { color: #93463d; border-color: #e9c4ba; background: var(--red-soft); }
.field-input-row { grid-column: 2; grid-row: 1; margin-top: 0; }
.field-input { height: 38px; border-color: #c8d2c5; color: var(--ink); background: #f7f8f2; font-size: 20px; letter-spacing: .015em; }
.field-input:focus { border-color: #88a873; box-shadow: 0 0 0 3px rgba(111,155,97,.13); }
.field-input.dirty { border-color: var(--amber); background: #fff9e8; }
.field-unit { display: none; color: #829081; }
.focus-button { border-color: #c8d2c5; color: var(--blue-deep); background: #f9faf5; }
.focus-button:hover { border-color: #91ad7c; background: #edf3e5; }
.field-meta { grid-column: 1 / -1; grid-row: 2; color: #829081; }
.field-meta strong { color: var(--blue-deep); }
.evidence-details { grid-column: 1 / -1; grid-row: 3; }
.confirm-toggle { color: var(--blue-deep); }
.confirm-toggle input { accent-color: #719957; }
.evidence-details { border-color: #e8ebe2; }
.evidence-details summary { color: var(--blue-deep); }
.candidate-row { background: #f1f3ec; }
.candidate-confidence { color: #648a52; }
.evidence-issues span, .reason-list span { color: #805d18; border: 1px solid #ead39d; background: #fff5d8; }
.audit-section { border-color: var(--line); }
.audit-block { border-color: #d9ded4; background: #f8f8f2; }
.technical-details { margin-top: 11px; border: 1px solid #d9ded4; border-radius: 10px; background: #f8f8f2; }
.technical-details > summary { display: flex; justify-content: space-between; gap: 8px; padding: 10px; color: var(--blue-deep); cursor: pointer; font-size: 11px; font-weight: 800; list-style: none; }
.technical-details > summary::-webkit-details-marker { display: none; }
.technical-details > summary span:last-child { color: var(--muted); font-size: 9px; font-weight: 500; }
.technical-content { display: grid; gap: 8px; padding: 0 9px 9px; }
.technical-block { padding: 8px; border: 1px solid #e1e4da; border-radius: 8px; background: #fcfcf7; }
.technical-block-title { margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.technical-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; color: var(--muted); font-size: 10px; }
.technical-row strong { max-width: 70%; overflow: hidden; color: var(--ink-soft); font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.technical-row.technical-orientation-summary { padding: 5px 6px; border-radius: 6px; color: var(--blue-deep); background: #edf3e5; }
.technical-row.technical-orientation-summary strong { color: var(--blue-deep); }
.technical-secondary { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.technical-reason { white-space: normal; }
.technical-details, .technical-details > summary, .technical-content, .technical-block, .technical-block-title, .technical-row, .technical-row > span, .technical-row > strong, .candidate-list, .candidate-head, .candidate-row, .candidate-head > *, .candidate-row > *, .technical-details > summary > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.technical-details { width: 100%; }
.technical-content, .technical-block, .candidate-list { overflow: hidden; }
.technical-row { align-items: flex-start; }
.technical-row > span { flex: 0 1 42%; overflow-wrap: anywhere; word-break: break-word; }
.technical-row > strong { flex: 1 1 58%; max-width: 100%; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.candidate-head > *, .candidate-row > * { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
.candidate-family, .candidate-raw { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.inspector-actions { border-color: var(--line); background: #fbfaf5; }
.review-nav-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 1px 0 8px; }
.review-nav-button { min-height: 32px; padding: 0 6px; color: var(--blue-deep); font-size: 10px; }
.button-slow { width: auto; min-height: 28px; padding: 0 4px; border: 0; color: #82756e; background: transparent; box-shadow: none; font-size: 10px; }
.button-slow:hover:not(:disabled) { color: var(--blue-deep); background: transparent; }
.button-slow:disabled { color: #9ca69a; border: 0; background: transparent; }

.downloads-panel { border-color: #ccd6c8; background: #f8f8f1; }
.download-button { border-color: #bdd0ad; color: var(--blue-deep); background: #eff5e7; }
.download-button:hover:not(.disabled) { border-color: #789b62; background: #e4efda; }
.download-button.disabled { color: #a0a9a0; border-color: var(--line); background: #f0f1eb; }
.footer-bar { color: #7b8b7e; }
.lightbox { background: rgba(16, 38, 29, .91); }

@media (max-width: 1280px) {
  .workbench-grid { grid-template-columns: 220px minmax(440px, 1fr) 415px; }
  .topbar { padding-right: 25px; padding-left: 25px; }
  .workspace { padding-right: 25px; padding-left: 25px; }
}
@media (max-width: 1080px) {
  .workbench-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .inspector-panel { grid-column: 1 / -1; min-height: auto; }
  .records-panel, .viewer-panel { min-height: 620px; }
  .inspector-scroll { max-height: none; }
  .metric-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 10px; min-height: 0; padding: 10px 12px; }
  .batch-context { grid-column: 1 / -1; grid-row: 2; width: auto; padding: 0; }
  .topbar-actions { grid-column: 2; grid-row: 1; width: auto; justify-content: flex-end; gap: 6px; }
  .brand-lockup .eyebrow { display: none; }
  .brand-lockup h1 { overflow: visible; white-space: nowrap; }
  .topbar-actions .status-chip { display: none; }
  .topbar-actions .status-chip { max-width: 165px; }
  .workflow-panel { padding: 9px 10px; }
  .workflow-heading { align-items: center; flex-direction: row; gap: 8px; margin-bottom: 6px; }
  .workflow-heading .muted { max-width: 58%; text-align: right; }
  .workflow-line { overflow: visible; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding-bottom: 0; }
  .workflow-step { display: grid; justify-items: center; gap: 2px; text-align: center; }
  .workflow-step:not(:last-child)::after { top: 12px; right: calc(-50% + 14px); left: calc(50% + 14px); }
  .workflow-index { width: 24px; height: 24px; font-size: 8px; }
  .workflow-step strong { font-size: 10px; }
  .workflow-step small { display: none; }
  .summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .summary-card { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 2px; align-items: start; padding: 7px 5px; }
  .summary-card strong { grid-column: 1; grid-row: 1; font-size: 19px; }
  .summary-card .summary-kicker { grid-column: 1; grid-row: 2; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .summary-card > span:last-child { grid-column: 1; grid-row: 3; font-size: 9px; line-height: 1.2; }
  .workspace { padding: 14px 10px 16px; }
  .progress-strip { grid-template-columns: minmax(0, 1fr) auto; gap: 11px; padding: 13px; }
  .progress-copy { min-width: 0; }
  .progress-title-row { align-items: flex-start; flex-direction: column; gap: 2px; }
  .progress-title-row strong, .progress-title-row .muted { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .progress-count { min-width: 76px; flex-wrap: nowrap; white-space: nowrap; }
  .progress-count small { white-space: nowrap; }
  .current-task { grid-column: 1 / -1; }
  .workbench-grid { display: flex; flex-direction: column; min-height: 0; }
  .records-panel { max-height: 250px; }
  .record-list { max-height: 155px; }
  .viewer-panel { min-height: 0; padding: 13px; }
  .viewer-empty { min-height: 260px; }
  .viewer-heading { align-items: flex-start; flex-direction: column; }
  .viewer-tools { align-self: flex-end; margin-top: -42px; }
  .source-stage { min-height: 255px; max-height: 370px; }
  .source-image-frame, .source-image-frame img { max-height: 355px; }
  .source-mode-switch { flex-wrap: wrap; margin-top: -4px; }
  .source-mode-button { min-height: 36px; }
  .source-mode-note { flex-basis: 100%; }
  .inspector-panel { min-height: 0; }
  .metric-grid { grid-template-columns: 1fr; }
  .field-card { padding: 8px 6px; }
  .field-state { max-width: none; overflow: visible; text-overflow: clip; }
  .field-input { padding: 0 7px; font-size: 20px; }
  .field-unit { display: none; }
  .downloads-panel { align-items: flex-start; flex-direction: column; }
  .download-actions { width: 100%; }
  .download-button { flex: 1; min-width: 0; }
}
@media (max-width: 390px) {
  .brand-lockup { min-width: 0; }
  .brand-lockup h1 { font-size: 18px; }
  .topbar-actions .button-ghost { display: none; }
  .topbar-actions .status-chip { max-width: 116px; min-height: 30px; padding: 0 8px; font-size: 10px; }
  .topbar-actions .button { min-height: 34px; padding: 0 9px; font-size: 12px; }
  .batch-context { font-size: 11px; }
  .batch-context strong { max-width: 150px; }
  .summary-card { padding: 7px 5px; }
  .summary-card strong { font-size: 19px; }
  .summary-card > span:last-child, .summary-kicker { font-size: 9px; }
  .metric-grid { grid-template-columns: 1fr; gap: 8px; }
  .field-card { padding: 10px 8px; }
  .field-card-name { gap: 4px; }
  .field-card-name .field-label { font-size: 12px; }
  .field-short { font-size: 12px; }
  .phase-token { width: 20px; height: 20px; font-size: 11px; }
  .field-state { max-width: none; min-height: 24px; padding: 0 6px; font-size: 12px; }
  .field-input { height: 42px; padding: 0 7px; font-size: 20px; }
  .focus-button { width: 40px; height: 40px; border-radius: 8px; font-size: 17px; }
  .field-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 7px; font-size: 12px; line-height: 1.35; }
  .field-meta .localization-label { display: block; flex-basis: 100%; margin-top: 3px; }
  .confirm-toggle { display: inline-flex; min-height: 36px; align-items: center; margin: 2px 0 0; font-size: 12px; }
  .confirm-toggle input { width: 17px; height: 17px; }
  .review-nav-row { grid-template-columns: 1fr; }
}
@media (min-width: 721px) {
  .workspace { padding-top: 16px; }
  .job-view { gap: 7px; }
  .progress-strip { gap: 12px; padding: 8px 12px; }
  .workflow-panel { padding: 6px 14px; }
  .workflow-heading { display: none; }
  .workflow-line { min-height: 27px; align-items: center; }
  .workflow-step small { display: none; }
  .summary-card { min-height: 42px; padding: 6px 10px; }
  .summary-card strong { font-size: 19px; }
  .summary-card > span:last-child { font-size: 9px; }
  .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .metric-group + .metric-group { margin-top: 0; }
  .metric-group .field-card { display: block; padding: 8px; }
  .metric-group .field-card-head { display: flex; min-height: 24px; align-items: center; }
  .metric-group .field-card-name { min-width: 0; }
  .metric-group .field-short { display: none; }
  .metric-group .field-input-row { display: flex; margin-top: 6px; }
  .metric-group .field-input { min-width: 96px; height: 40px; font-size: 20px; }
  .metric-group .field-meta { display: flex; min-height: 18px; margin-top: 5px; font-size: 9px; }
  .metric-group .localization-label { max-width: 100%; }
  .metric-group .evidence-details { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Narrow desktop and tablet chrome must not compress actions into vertical text. */
.serial-card .field-card { display: block; }
.serial-card .field-input-row { margin-top: 6px; }
.serial-card .field-input { min-width: 12ch; }
@media (max-width: 1100px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 12px 16px; }
  .brand-lockup { min-width: 0; }
  .brand-lockup h1, .topbar button, .viewer-tools button { white-space: nowrap; }
  .topbar .eyebrow { display: none; }
  .topbar-actions { grid-column: 2; grid-row: 1; width: auto; gap: 8px; }
  .topbar-actions .status-chip { display: none; }
  .batch-context { grid-column: 1 / -1; grid-row: 2; width: auto; padding: 0; }
  .progress-title-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .progress-title-row strong { flex-shrink: 0; white-space: nowrap; }
  .viewer-heading { flex-direction: column; gap: 10px; }
  .viewer-tools { align-self: flex-end; margin-top: 0; flex-shrink: 0; }
}
@media (max-width: 850px) {
  .topbar-actions .button-ghost { display: none; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 12px; }
  .summary-card .summary-kicker { display: none; }
  .summary-card > span:last-child { grid-row: 2; font-size: 12px; line-height: 1.35; }
  .summary-card strong { font-size: 22px; }
  .workflow-step strong { font-size: 12px; }
}

/* v3.3 questions-only workflow: accepted fields stay legible but quiet. */
.secondary-flow[hidden], .summary-strip[hidden], .button-slow[hidden] { display: none !important; }
.field-card-accepted { border-color: #dce5d6; background: #f8faf4; }
.field-card-accepted .field-input { border-color: #d7e1d0; background: #f4f7ef; }
.field-confirmation { display: inline-flex; flex: 0 0 auto; align-items: center; min-height: 17px; margin-left: auto; padding: 0 5px; border-radius: 5px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.field-confirmation.is-accepted { color: #35603f; background: #e5f0df; }
.field-confirmation.is-question { color: #8b641c; background: #fff1c9; }
.secondary-exports { min-width: 142px; }
.secondary-exports > summary { min-height: 47px; padding: 0 12px; border: 1px solid #bdd0ad; border-radius: 10px; color: var(--blue-deep); background: #eff5e7; cursor: pointer; font-size: 11px; font-weight: 800; line-height: 47px; list-style: none; text-align: center; }
.secondary-exports > summary::-webkit-details-marker { display: none; }
.secondary-exports[open] > summary { border-color: #789b62; background: #e4efda; }
.secondary-export-links { display: flex; gap: 6px; margin-top: 6px; }
.secondary-export-links .download-button { min-width: 83px; min-height: 40px; padding: 0 8px; font-size: 11px; }
.secondary-export-links .download-button small { font-size: 8px; }
.download-primary { min-width: 132px; }

.engine-details { width: min(620px, 100%); margin: 9px auto 0; border: 1px solid #d9ded4; border-radius: 9px; color: var(--ink-soft); background: #f8f8f2; text-align: left; }
.engine-details > summary { padding: 7px 10px; color: var(--blue-deep); cursor: pointer; font-size: 10px; font-weight: 800; list-style: none; }
.engine-details > summary::-webkit-details-marker { display: none; }
.engine-details > summary::before { content: '＋'; display: inline-block; margin-right: 5px; color: var(--cyan); }
.engine-details[open] > summary::before { content: '−'; }
.engine-details > div { padding: 0 10px 9px; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }

.audit-details { margin-top: 10px; border: 1px solid #d9ded4; border-radius: 10px; background: #f8f8f2; }
.audit-details.audit-section { padding-top: 0; border-top: 1px solid var(--line); }
.audit-details > summary { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; color: var(--blue-deep); cursor: pointer; font-size: 11px; font-weight: 800; list-style: none; }
.audit-details > summary::-webkit-details-marker { display: none; }
.audit-details > summary span:last-child { color: var(--muted); font-size: 9px; font-weight: 500; }
.audit-details > .audit-content { padding: 0 9px 9px; }

@media (max-width: 720px) {
  .secondary-exports { width: 100%; }
  .secondary-exports > summary { width: 100%; }
  .secondary-export-links { width: 100%; }
  .secondary-export-links .download-button { flex: 1; }
  .engine-details { width: 100%; }
}
/* Real source pixels and table warp; independent of the full-photo ROI frame. */
.rectification-compare { display: grid; gap: 12px; margin-top: 12px; min-width: 0; }
.rectification-compare figure { margin: 0; min-width: 0; }
.rectification-compare figcaption { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.rectification-compare img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid #d6ded1; }

/* v3.4 focused-question workflow.  The existing evidence and review styles
   remain intact; these rules only change the order and affordances of the
   compact review surface. */
.records-heading-actions { display: flex; align-items: center; gap: 7px; }
.list-toggle { display: none; min-height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--blue-deep); background: var(--panel); font-size: 11px; font-weight: 800; }
.list-toggle:hover { border-color: #8aa877; background: #f0f4e8; }
.question-section { border-color: #cbd9c4; background: #f0f5e8; }
.question-section .section-title-row { margin-bottom: 8px; }
.question-section .section-title-row h3 { color: var(--ink); }
.all-readings { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8f8f2; }
.all-readings > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; color: var(--blue-deep); cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.all-readings > summary::-webkit-details-marker { display: none; }
.all-readings > summary span:last-child { color: var(--muted); font-size: 10px; font-weight: 500; text-align: right; }
.all-readings-grid { display: grid; gap: 10px; padding: 0 10px 10px; }
.all-readings-grid .metric-group { min-width: 0; }
.all-readings-grid .metric-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }
.field-card-readonly .field-input { cursor: default; color: var(--ink-soft); }
.field-card-readonly .field-input:focus { border-color: #d7e1d0; box-shadow: none; }
.field-card-compact .evidence-details { margin-top: 5px; }
.all-done-state { display: grid; justify-items: start; gap: 3px; padding: 10px 2px 4px; color: var(--muted); font-size: 12px; }
.all-done-state strong { color: var(--blue-deep); font-size: 14px; }
.all-done-icon { display: grid; width: 30px; height: 30px; place-items: center; margin-bottom: 2px; border-radius: 9px; color: var(--ink); background: var(--acid); font-weight: 900; }
.source-photo-details { min-width: 0; }
.source-photo-details > summary { display: flex; min-height: 36px; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--blue-deep); background: #fcfbf6; cursor: pointer; font-size: 11px; font-weight: 800; list-style: none; }
.source-photo-details > summary::-webkit-details-marker { display: none; }
.source-photo-details > summary span:last-child { color: var(--muted); font-size: 9px; font-weight: 500; }
.source-photo-details[open] > summary { border-color: #a0b88e; background: #f0f4e8; }
.question-pixel { display: grid; gap: 4px; margin: 8px 0 12px; text-align: center; color: var(--muted); font-size: 11px; }
.question-pixel img { display: block; width: 100%; height: 76px; object-fit: contain; border-radius: 8px; background: #e5e9dc; }
.operator-question .field-card-head, .operator-question .field-meta { display: none; }
.question-reason { margin: 0 0 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.value-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.value-comparison > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8f8f2; }
.value-comparison > div:last-child { background: #edf3de; border-color: #b6c78d; }
.value-comparison span { display: block; font-size: 10px; color: var(--muted); }
.value-comparison strong { display: block; margin-top: 4px; font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.candidate-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.candidate-choices button { flex: 1; min-width: 95px; min-height: 48px; padding: 6px 12px; border: 1px solid #b8c5ac; border-radius: 8px; background: white; color: var(--ink); cursor: pointer; }
.candidate-choices strong, .candidate-choices small { display: block; }
.candidate-choices strong { font-size: 17px; }
.candidate-choices small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.candidate-choices button:hover, .candidate-choices button:focus-visible { outline: 2px solid #81954a; outline-offset: 2px; background: #f2f7e7; }
.live-comparison-state { min-height: 30px; margin: 8px 0; font-size: 11px; color: var(--ink-soft); }
.operator-input-label { display: block; font-size: 11px; color: var(--muted); margin: 4px 0 6px; }
#next-review-photo-button { display: none; }
.operator-question .evidence-details { margin-top: 12px; }
.inspector-heading .eyebrow { display: none; }
.viewer-panel .crop-heading, .viewer-panel .crop-viewer, .viewer-panel .crop-strip { display: none; }
.inspector-actions { position: sticky; bottom: 0; z-index: 2; }
@media (min-width: 1100px) {
  .inspector-panel { min-height: 0; align-self: start; }
  #inspector-content { display: flex; flex-direction: column; height: calc(100vh - 175px); min-height: 530px; }
  .inspector-scroll { min-height: 0; }
  .inspector-heading, .inspector-actions { flex-shrink: 0; }
}

@media (max-width: 720px) {
  .question-pixel { display: grid; gap: 4px; margin: 8px 0; text-align: center; color: var(--muted); font-size: 10px; }
  .question-pixel img { display: block; width: 100%; height: 70px; object-fit: contain; border-radius: 6px; background: #e5e9dc; }
  .records-heading-actions { gap: 5px; }
  .list-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .records-panel.is-collapsed .list-toolbar,
  .records-panel.is-collapsed .record-list,
  .records-panel.is-collapsed .list-empty { display: none; }
  .records-panel.is-collapsed { min-height: 0; }
  .workbench-grid { display: flex; flex-direction: column; }
  .inspector-panel { order: 1; }
  .viewer-panel { order: 2; }
  .records-panel { order: 3; }
  .viewer-content { display: flex; flex-direction: column; }
  .viewer-heading { order: 0; }
  .crop-heading { order: 1; }
  .crop-viewer { order: 2; }
  .crop-strip { order: 3; }
  .source-photo-details { order: 4; }
  .source-photo-details > summary { min-height: 44px; margin: 10px 0 8px; }
  .source-stage { min-height: 240px; max-height: 350px; }
  .source-image-frame, .source-image-frame img { max-height: 335px; }
  .all-readings > summary { min-height: 48px; }
  .all-readings-grid { padding: 0 8px 8px; }
  .field-input { font-size: 16px; }
  .field-card-compact .field-input { min-height: 44px; }
  .button, .icon-button, .text-button, .focus-button, .source-mode-button, .crop-thumb { min-height: 44px; }
  .icon-button, .focus-button { min-width: 44px; }
  .source-mode-button { padding-right: 12px; padding-left: 12px; }
  .crop-thumb { flex-basis: 60px; }
  .crop-thumb-image { width: 54px; height: 38px; }
  .downloads-panel { position: relative; }
  .download-primary { min-height: 56px; font-size: 14px; }
}

@media (max-width: 390px) {
  .workspace { padding-right: 8px; padding-left: 8px; }
  .question-section, .all-readings { border-radius: 12px; }
  .question-section .field-card { padding-right: 8px; padding-left: 8px; }
  .downloads-copy h2 { font-size: 16px; }
}

/* v3.4.1 operator surface: one clear upload action, one focused question,
   and optional supporting evidence.  The underlying audit and export data
   stays available; it is simply out of the way during routine work. */
.empty-state { min-height: calc(100vh - 130px); padding-top: 30px; }
.empty-state h2 { max-width: 540px; margin-top: 0; font-size: clamp(24px, 3.5vw, 36px); letter-spacing: -.035em; }
.empty-copy { max-width: 480px; font-size: 14px; }
.empty-actions { margin-top: 20px; }
.empty-folder-button { color: var(--ink-soft); background: #f8faf4; }
.import-help { margin: 12px 0 0; color: var(--ink-soft); font-size: 12px; }
.import-summary { padding: 10px 14px; margin-bottom: 10px; font-size: 12px; color: var(--ink-soft); }
.import-summary > summary { cursor: pointer; color: var(--ink); }
.import-summary > p { margin: 8px 0 0; line-height: 1.7; }
.empty-meta { margin-top: 18px; gap: 8px 18px; font-size: 11px; }
.empty-config { min-height: 18px; margin-top: 14px; font-size: 11px; }
.empty-orbit { display: none; }
.topbar { min-height: 64px; }
.brand-lockup { min-width: 190px; }
.brand-lockup h1 { font-size: 18px; }
.batch-context-label { color: #8fa3bb; }
.viewer-heading { margin-bottom: 9px; }
.viewer-heading h2 { font-size: 14px; }

/* Full-photo inspection is useful for an ambiguous field but should not push
   the focused crop and comparison below the fold. */
.source-photo-details > summary { display: flex !important; }
.source-photo-details:not([open]) > :not(summary) { display: none !important; }
.source-photo-details:not([open]) > summary { margin-bottom: 0; }
.source-photo-details[open] > summary { margin-bottom: 8px; }

/* Audit and technical evidence are a single optional drawer.  The audit
   section is kept as a stable node for app.js and history rendering. */
.technical-content > .audit-details { margin: 0; padding: 0 0 2px; border: 0; border-bottom: 1px solid #e4e8de; border-radius: 0; background: transparent; }
.technical-content > .audit-details .audit-content { padding: 0; }
.technical-content > #technical-evidence-body { display: grid; gap: 8px; min-width: 0; }
.technical-details > summary { min-height: 42px; align-items: center; }

/* There is no action to take until a value is edited.  Remove the disabled
   save button from the routine view so the confirm/skip action has one clear
   target; it returns automatically once a draft is dirty. */
.action-row #save-button:disabled { display: none; }
.action-row #save-button:disabled + #save-confirm-button { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .empty-state { min-height: calc(100vh - 116px); padding-top: 22px; }
  .empty-state h2 { font-size: 27px; }
  .empty-actions { width: min(360px, 100%); flex-direction: column; }
  .empty-actions .button { width: 100%; }
  .empty-meta { flex-direction: column; align-items: center; gap: 4px; }
  .brand-lockup { min-width: 0; }
  .brand-lockup h1 { font-size: 17px; }
  .technical-details > summary { min-height: 48px; }
}

/* Desktop/tablet review layout: keep the photo list narrow and give the
   focused question the full main column.  The full-photo panel follows the
   question as an optional, collapsed row instead of reserving a third empty
   column. */
@media (min-width: 721px) {
  .workbench-grid {
    grid-template-columns: minmax(210px, 255px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    min-height: 0;
  }
  .records-panel {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: stretch;
    min-height: 0;
    max-height: calc(100vh - 176px);
  }
  .inspector-panel {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    min-height: 0;
    overflow: visible;
  }
  .viewer-panel {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    min-height: 0;
    padding: 12px 14px;
  }
  .viewer-empty { min-height: 0; }
  #inspector-content {
    display: block;
    height: auto;
    min-height: 0;
  }
  .inspector-scroll {
    flex: none;
    max-height: none;
    overflow: visible;
  }
  .inspector-actions { position: static; }
}

@media (max-width: 720px) {
  /* The same no-inner-scroll rule keeps the question, evidence and actions
     continuous on a phone; the record list remains the final collapsed row. */
  .inspector-panel { overflow: visible; }
  .inspector-scroll { flex: none; max-height: none; overflow: visible; }
  .inspector-actions { position: static; }
}
