/* Hymnworks desk. Adapted from the approved Reference study. Evidence images are never filtered or tinted. */
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color-scheme: light;
  --ground: #edf0f4;
  --surface: #ffffff;
  --subtle: #f5f7fa;
  --hover: #e9edf3;
  --ink: #232c39;
  --muted: #596574;
  --faint: #5c697a;
  --line: #dfe4eb;
  --control-line: #8994a3;
  --accent: #003f71;
  --accent-soft: #e8eff8;
  --button: #003f71;
  --button-ink: #ffffff;
  --button-hover: #00335b;
  --focus: #426cab;
  --removed: #8b394d;
  --removed-bg: #fbedf1;
  --added: #176951;
  --added-bg: #eaf5ef;
  --warning: #795a25;
  --warning-dot: #a37935;
  --preview: #edf5ef;
  --preview-ink: #365d43;
  --shadow: #24304416;
  --scrim: #11182799;
  --annotation: #345b8b;
  --annotation-line: #627fa8;
  --panel: 420px;
  background: var(--ground);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #111419;
  --surface: #1b1f25;
  --subtle: #22272f;
  --hover: #2b323c;
  --ink: #e7e9ef;
  --muted: #a7afbb;
  --faint: #939eae;
  --line: #303742;
  --control-line: #687583;
  --accent: #8cbae0;
  --accent-soft: #263749;
  --button: #b0cbea;
  --button-ink: #12212f;
  --button-hover: #c6dbf2;
  --focus: #96bfff;
  --removed: #f1b3c4;
  --removed-bg: #34262d;
  --added: #94d1b7;
  --added-bg: #22352e;
  --warning: #dfc194;
  --warning-dot: #c7a46f;
  --preview: #203329;
  --preview-ink: #acd8b9;
  --shadow: #00000040;
  --scrim: #080b10c4;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, summary, select { touch-action: manipulation; }
button { cursor: pointer; color: inherit; background: transparent; border: 0; border-radius: 6px; }
button:hover:not(:disabled) { background: var(--hover); }
button:disabled { opacity: .38; cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
[hidden] { display: none !important; }
.grow { flex: 1; }
.dim { color: var(--faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app { height: 100dvh; min-height: 480px; display: flex; flex-direction: column; }
/* One bar: the package on the left, the view switch, the role, and the menu on the right. */
.appbar { height: 56px; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.environment { font-size: 11px; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.environment b { font-weight: 550; }
.bar-button { height: 30px; font-size: 11px; padding: 4px 10px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.bar-button[aria-pressed="true"], .bar-button[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.menu-anchor { position: relative; }
.menu-button { width: 34px; padding: 0; font-size: 16px; }
.desk-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 280px; max-height: calc(100dvh - 80px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 40px var(--shadow); padding: 8px; font-size: 12px; z-index: 40; }
.menu-note { margin: 4px 8px 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.menu-note:empty { display: none; }
.menu-section { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 8px; }
.menu-section legend { float: left; width: 100%; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; padding: 0; }
.region-list { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.region-list label { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.region-list input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu-row select { font-size: 12px; padding: 4px 8px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.menu-actions { display: grid; gap: 2px; padding: 6px 0; }
.menu-item { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; padding: 8px; font-size: 12px; border-radius: 6px; }
.menu-item kbd { font-size: 10px; }
.menu-version { margin: 0; padding: 8px 8px 4px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.brand-tile { display: block; width: 34px; height: 34px; flex: none; }
.brand-lockup { display: block; width: 180px; height: auto; }
:root[data-theme="dark"] .brand-light, :root:not([data-theme="dark"]) .brand-dark { display: none; }
.app-divider { height: 22px; border-left: 1px solid var(--line); margin-left: 7px; }
.publication { font-weight: 550; padding: 7px 3px; font-size: 13px; }
.edition { padding: 4px 8px; background: var(--subtle); color: var(--muted); font-size: 11px; border-radius: 4px; }
.operator { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.avatar { width: 25px; height: 25px; display: grid; place-items: center; background: var(--subtle); color: var(--muted); border-radius: 50%; font-size: 11px; }
.workspace { display: flex; flex: 1; min-height: 0; }
.rail { width: 68px; flex: none; border-right: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 16px; flex-direction: column; padding: 20px 8px; min-height: 0; }
.rail-toggle { font-size: 16px; width: 34px; height: 30px; color: var(--muted); }
/* A collapsed rail keeps only its toggle and the count of findings to review. */
.rail[data-collapsed="true"] { width: 40px; padding: 14px 3px; }
.rail[data-collapsed="true"] > :is(.rail-label, .thumbnails, .rail-rule, .rail-caption) { display: none; }
.rail-label { font-size: 10px; color: var(--muted); }
/* The page list scrolls on its own so a long book never stretches the page.
   It reaches into the rail padding to leave room for a thin scrollbar. */
.thumbnails { display: flex; flex-direction: column; gap: 10px; align-items: center; flex: 0 1 auto; min-height: 0; align-self: stretch; margin: 0 -8px; padding: 2px 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-gutter: stable; }
/* The page rail and the page canvas keep their scrollbar space but show the
   bar only while they scroll. app.js adds .scrolling for 800 ms after a scroll. */
.thumbnails, .canvas-scroll { scrollbar-color: transparent transparent; }
.thumbnails.scrolling, .canvas-scroll.scrolling { scrollbar-color: var(--control-line) transparent; }
.thumbnail { flex: none; padding: 4px 4px 2px; width: 53px; border: 1px solid var(--line); border-radius: 5px; }
.thumbnail.active { border-color: var(--accent); background: var(--accent-soft); }
.thumbnail img { display: block; width: 43px; background: #fff; }
.thumbnail span { display: block; font-size: 10px; padding-top: 3px; color: var(--accent); }
.rail-rule { width: 28px; border-top: 1px solid var(--line); }
.candidate-count { background: var(--accent-soft); color: var(--accent); width: 29px; height: 29px; font-size: 12px; font-weight: 600; }
.rail-caption { font-size: 9px; color: var(--muted); margin-top: -11px; white-space: nowrap; }
.document-area { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--ground); }
.document-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 23px 13px; gap: 15px; }
.eyebrow { font-size: 10px; font-weight: 550; color: var(--muted); }
.document-heading h1 { font-size: 18px; letter-spacing: -.5px; font-weight: 600; margin: 4px 0 5px; }
.document-heading p { font-size: 11px; color: var(--muted); margin: 0; display: flex; gap: 7px; }
.button { min-height: 35px; padding: 8px 11px; font-size: 12px; font-weight: 550; border-radius: 7px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.quiet { border: 1px solid var(--control-line); background: var(--surface); }
.count { font-size: 10px; background: var(--subtle); padding: 2px 5px; border-radius: 4px; color: var(--muted); }
.tools-wrap { position: relative; }
.document-tools { display: flex; align-items: center; gap: 14px; height: 41px; min-height: 41px; margin: 0 23px 12px; padding: 5px 0 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); overflow-x: auto; scrollbar-width: none; }
.document-heading[hidden] + .tools-wrap .document-tools { border-top: 0; margin-top: 8px; }
.tool-group { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.tool-group button { font-size: 19px; width: 28px; height: 28px; }
.toolbar-divider { height: 16px; border-left: 1px solid var(--line); }
.document-tools > button { padding: 7px 8px; font-size: 11px; white-space: nowrap; }
.on-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: 4px; }
.canvas-scroll { flex: 1; min-height: 0; overflow: auto; padding: 3px 25px 20px; }
/* safe center keeps a page wider than the canvas scrollable to its left edge. */
.page-stage { min-height: 460px; display: flex; justify-content: safe center; align-items: flex-start; }
/* The page keeps a fixed margin for two lanes of badges. A margin sized to the
   lanes in use would change the page width, the line spacing, and the lanes. */
/* Width follows zoom: 1 fills the stage beside the badge margin (fit width). */
.proof-page { --badge-gutter: 76px; --zoom: 1; position: relative; width: calc((100% - var(--badge-gutter)) * var(--zoom)); aspect-ratio: 3 / 4; flex-shrink: 0; margin-right: var(--badge-gutter); background: #fff; box-shadow: 0 3px 12px var(--shadow); }
.proof-image { width: 100%; height: 100%; display: block; }
/* A size container, so badges can be placed in page widths (cqw) at any zoom. */
.marker-layer { position: absolute; inset: 0; pointer-events: none; container-type: size; }
.marker { position: absolute; top: var(--top); left: var(--left); width: var(--width); height: var(--height); border: 1px dashed var(--annotation-line); border-radius: 2px; pointer-events: auto; background: transparent !important; scroll-margin: 24px 72px 24px 24px; }
/* The badge sits 8px beyond the page edge, one lane step further per lane. */
.marker > .badge { position: absolute; left: calc((100 - var(--left-n)) * 1cqw + 8px + var(--lane, 0) * 30px); top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--annotation); box-shadow: 0 0 0 1px var(--annotation-line); font-size: 11px; font-weight: 650; }
/* The leader runs from the outline's right edge to the badge. The extra 2px covers both borders. */
.marker > .leader { position: absolute; left: 100%; top: 50%; height: 1px; width: calc((100 - var(--left-n) - var(--width-n)) * 1cqw + 10px + var(--lane, 0) * 30px); background: var(--annotation-line); opacity: .8; }
.marker.selected > .leader { background: var(--annotation); opacity: 1; }
.marker.selected { outline: 2px solid var(--annotation); outline-offset: 2px; border-color: transparent; }
.marker[data-kind="suppressed"], .marker[data-kind="diagnostic"], .marker[data-kind="abstention"] { border-style: dotted; }
.marker[data-kind="suppressed"] > .badge { box-shadow: none; border: 1px dashed var(--annotation-line); }
.marker[data-kind="diagnostic"] > .badge { border-radius: 4px; }
.marker[data-kind="abstention"] > .badge { border-radius: 0; box-shadow: 0 0 0 1px var(--annotation-line), 0 0 0 3px #fff, 0 0 0 4px var(--annotation-line); }
.marker.selected > .badge { background: var(--annotation); color: #fff; box-shadow: none; }
.document-footer { height: 31px; min-height: 31px; display: flex; align-items: center; padding: 0 20px; font-size: 10px; gap: 6px; color: var(--muted); border-top: 1px solid var(--line); background: var(--subtle); }
.lock-icon { font-size: 10px; }
.inspector { width: var(--panel); flex: none; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); min-height: 0; }
.inspector-top { height: 49px; min-height: 49px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-kicker { font-weight: 600; font-size: 12px; }
.panel-nav { display: flex; gap: 7px; align-items: center; font-size: 11px; color: var(--muted); }
.panel-nav button { height: 29px; width: 28px; font-size: 20px; }
.panel-nav { gap: 3px; }
.panel-nav .nav-position { min-width: 52px; text-align: center; white-space: nowrap; }
.panel-nav [data-nav] { font-size: 15px; }
.panel-nav .return:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.nav-divider { height: 16px; border-left: 1px solid var(--line); margin: 0 3px; }
.inspector-top { padding: 0 12px 0 20px; }
.inspector-body { padding: 23px 27px 20px; overflow: auto; flex: 1; min-height: 0; }
.candidate-heading h2 { font-size: 25px; letter-spacing: -.7px; font-weight: 570; line-height: 1.2; margin: 9px 0 6px; }
.candidate-heading > p { font-size: 11px; color: var(--muted); margin: 0; }
.status { display: flex; align-items: center; gap: 6px; color: var(--warning); font-size: 11px; }
.status b { font-weight: 400; }
.status[data-kind="equal"], .status[data-kind="suppressed"] { color: var(--muted); }
.status[data-kind="equal"] > span, .status[data-kind="suppressed"] > span { background: var(--control-line); }
.status > span { width: 5px; height: 5px; background: var(--warning-dot); border-radius: 50%; }
.status[data-kind="reviewed"] { color: var(--added); }
.status[data-kind="reviewed"] > span { background: var(--added); }
.mode-tabs { display: flex; gap: 20px; margin: 23px -27px 20px; padding: 0 27px; border-bottom: 1px solid var(--line); }
.mode-tabs button { font-size: 12px; padding: 11px 0; border-radius: 0; border-bottom: 2px solid transparent; color: var(--muted); }
.mode-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 25px; margin-bottom: 9px; }
.section-heading h3 { font-size: 12px; font-weight: 600; margin: 0; }
.section-heading > span { font-size: 11px; color: var(--muted); }
.target-quote, .source-quote { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink); white-space: pre-line; }
.target-quote em, .source-quote em { color: var(--muted); font-size: 12px; }
.target-quote { padding-left: 11px; border-left: 2px solid var(--control-line); }
.target-quote del { color: var(--removed); background: var(--removed-bg); text-decoration-thickness: 1px; }
.source-quote ins { color: var(--added); background: var(--added-bg); text-decoration-thickness: 1px; }
.source-heading { margin-top: 26px; }
.text-button { font-size: 11px; color: var(--accent); padding: 4px 0; }
.witness-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); gap: 0 17px; }
.witness-tabs small { font-weight: 400; }
.witness-tabs button { font-size: 11px; border-radius: 0; padding: 7px 0 8px; color: var(--muted); border-bottom: 2px solid transparent; }
.witness-tabs button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.witness-crop { margin: 18px 0 9px; }
.crop-frame { position: relative; overflow: hidden; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.crop-frame img { position: absolute; max-width: none; display: block; }
.witness-crop figcaption { font-size: 10px; color: var(--muted); margin-top: 6px; }
.diagnostic { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 0; color: var(--muted); background: var(--subtle); border-radius: 6px; padding: 12px; font-size: 11px; line-height: 1.6; }
.diagnostic p { margin: 0; }
body[data-kind="findings"] .diagnostic { color: var(--ink); font-size: 13px; }
.finding-extra h3 { font-size: 12px; font-weight: 600; margin: 18px 0 6px; }
.context-text { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); white-space: pre-line; }
.evidence-list { margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.5; }
.evidence-list li + li { margin-top: 8px; }
.evidence-list a { color: var(--ink); overflow-wrap: anywhere; }
.evidence-list small { color: var(--muted); }
.evidence-quote { margin: 4px 0 0; color: var(--muted); }
.info-icon { display: grid; place-items: center; font-size: 9px; width: 13px; height: 13px; border: 1px solid var(--muted); border-radius: 50%; flex: none; margin-top: 2px; }
.provenance { font-size: 11px; margin: 15px 0; color: var(--muted); line-height: 1.7; }
.provenance summary { cursor: pointer; }
.provenance dl { display: grid; grid-template-columns: 60px 1fr; gap: 6px; }
.provenance dt { font-weight: 600; }
.provenance dd { margin: 0; }
.proposal-content .section-heading { margin-top: 5px; }
.input-label { font-size: 11px; display: block; color: var(--muted); margin-bottom: 6px; }
.input-label span { color: var(--faint); margin-left: 4px; }
.notes-label { margin-top: 12px; }
textarea { width: 100%; resize: vertical; border: 1px solid var(--control-line); border-radius: 7px; padding: 10px 11px; font-size: 14px; line-height: 1.6; min-height: 120px; color: var(--ink); background: var(--surface); }
textarea::placeholder { color: var(--faint); font-size: 12px; }
.draft-explanation { font-size: 10px; line-height: 1.6; color: var(--faint); margin: 6px 0; }
.section-heading .draft-status { color: var(--muted); }
.decision-area { border-top: 1px solid var(--line); padding: 16px 26px 12px; background: var(--surface); }
.decision-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.decision-head > label { font-size: 11px; color: var(--muted); }
.decision-current { font-size: 11px; color: var(--muted); text-align: right; }
.decision-current[data-state="committed"] { color: var(--added); font-weight: 600; }
.decision-area .decision-note { display: block; min-height: 0; height: 52px; margin-top: 8px; padding: 7px 9px; font-size: 12px; line-height: 1.5; }
.decision-area .decision-note:disabled { opacity: .6; }
.decision-status { font-size: 10px; line-height: 1.5; color: var(--faint); margin: 8px 0 0; min-height: 15px; }
.decision-status b { font-weight: 600; }
.decision-status[data-kind="committed"], .decision-status[data-kind="advanced"] { color: var(--added); }
.decision-status[data-kind="refused"] { color: var(--removed); }
.decision-controls { display: grid; grid-template-columns: 1fr 145px; gap: 8px; margin-top: 7px; }
.decision-controls select { border: 1px solid var(--control-line); border-radius: 7px; min-height: 35px; padding: 7px 8px; font-size: 10px; background: var(--surface); color: var(--ink); width: 100%; }
.primary { background: var(--button); color: var(--button-ink); min-height: 36px; font-size: 11px; }
.primary:hover:not(:disabled) { background: var(--button-hover); }
.receipt-preview { margin-top: 18px; padding: 12px; background: var(--preview); border-radius: 7px; font-size: 12px; color: var(--preview-ink); }
.receipt-preview p { line-height: 1.6; }
.receipt-preview small { font-size: 11px; line-height: 1.6; display: block; }
.history-content { margin-top: 23px; }
.history-content h3 { font-size: 12px; }
.history-entry { display: flex; gap: 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.history-entry { margin-bottom: 12px; }
.history-entry b { color: var(--ink); }
.history-entry p { margin: 2px 0 0; }
.history-entry .history-note { color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.history-dot { width: 7px; height: 7px; background: var(--control-line); border-radius: 50%; flex: none; margin-top: 6px; }
.history-entry.current .history-dot { background: var(--added); }
.candidate-list { position: absolute; top: calc(100% - 6px); right: 27px; width: 320px; max-height: min(70dvh, 640px); overflow: auto; background: var(--surface); box-shadow: 0 10px 40px var(--shadow); border: 1px solid var(--line); border-radius: 10px; z-index: 20; padding: 7px; }
.list-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 6px 8px; }
.list-head button { font-size: 20px; width: 28px; height: 28px; }
.list-controls { display: flex; align-items: center; gap: 8px; }
.list-controls .button { min-height: 30px; padding: 5px 9px; }
/* A filter in force is shown in the accent color, so it is never forgotten. */
.builder-options { clear: both; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.builder-options label { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.builder-options label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.builder-options input { margin: 0; accent-color: var(--accent); }
.builder-options small { color: var(--muted); }
.candidate-row { display: flex; width: 100%; align-items: center; text-align: left; gap: 10px; padding: 12px 9px; }
.candidate-row > span:first-child { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.candidate-row b { font-size: 12px; font-weight: 550; }
.candidate-row small { display: block; font-size: 11px; margin-top: 3px; color: var(--muted); }
.candidate-section h4 { font-size: 11px; font-weight: 600; color: var(--muted); margin: 12px 9px 2px; }
.candidate-row[data-kind="suppressed"] > span:first-child, .candidate-row[data-kind="diagnostic"] > span:first-child, .candidate-row[data-kind="abstention"] > span:first-child { background: var(--subtle); color: var(--muted); border-radius: 4px; }
.list-empty { font-size: 12px; color: var(--muted); padding: 8px 9px; }
.empty-state h2 { font-size: 20px; font-weight: 570; margin: 4px 0 8px; }
.empty-state p { font-size: 12px; color: var(--muted); line-height: 1.6; }
.load-error { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); background: var(--removed-bg); color: var(--removed); border: 1px solid var(--removed); padding: 12px 16px; border-radius: 8px; font-size: 12px; line-height: 1.6; z-index: 50; }
dialog { width: min(720px, calc(100vw - 28px)); max-height: 92dvh; border: 1px solid var(--line); border-radius: 12px; padding: 0; box-shadow: 0 30px 100px var(--shadow); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: var(--scrim); }
dialog > header { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
dialog h2 { font-size: 18px; margin: 3px 0; }
dialog header button { font-size: 25px; width: 36px; height: 36px; }
dialog > p { font-size: 12px; color: var(--muted); padding: 0 20px 12px; line-height: 1.7; }
.witness-document { background: var(--ground); padding: 22px; text-align: center; }
.full-page { position: relative; margin: 0 auto; width: 100%; max-width: 450px; background: #fff; box-shadow: 0 2px 8px var(--shadow); }
.full-page img { display: block; width: 100%; height: 100%; }
.full-region { position: absolute; outline: 2px solid var(--annotation); outline-offset: 2px; pointer-events: none; }
/* Canvas is a layout state, not a second theme or a second review desk. */
.canvas-focus .rail { display: none; }
.canvas-focus .document-heading { padding: 19px 30px 12px; }
.canvas-focus .document-heading .eyebrow { display: none; }
.canvas-focus .document-tools { margin: 0 auto 12px; width: min(820px, calc(100% - 60px)); padding: 0 10px; height: 39px; min-height: 39px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
@media (max-width: 1000px) {
  :root { --panel: 360px; }
  .rail { display: none; }
  .document-heading { padding: 16px; }
  .document-heading h1 { font-size: 16px; }
  .document-tools { margin-left: 16px; margin-right: 16px; gap: 5px; }
  .document-tools #annotations { display: none; }
  .canvas-scroll { padding-left: 15px; padding-right: 15px; }
  .operator { font-size: 0; }
  .operator .avatar { font-size: 11px; }
  .appbar { gap: 12px; padding: 0 15px; }
  #canvas-hint { display: none; }
  .decision-controls { display: flex; flex-direction: column; }
  .page-stage { min-height: 380px; }
  /* The toolbar wraps so every control stays in view, and the review
     panel's navigation spreads across the panel instead of past it. */
  .document-tools, .canvas-focus .document-tools { flex-wrap: wrap; height: auto; min-height: 0; overflow: visible; row-gap: 6px; padding-bottom: 2px; }
  .document-tools .grow { display: none; }
  .inspector-top { padding: 0 6px; }
  .panel-nav { flex: 1; justify-content: space-between; min-width: 0; }
}
/* Phones in portrait. The page sits above the review panel. Text stays at
   reading size, and the app bar alone names the book. */
@media (max-width: 650px) {
  .app { min-height: 0; }
  .environment, #canvas-toggle { display: none; }
  .appbar { height: 52px; min-height: 52px; padding: 0 12px; gap: 10px; }
  .brand-tile { width: 30px; height: 30px; }
  .app-divider { margin: 0; height: 19px; }
  .publication { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .edition { font-size: 12px; padding: 3px 6px; white-space: nowrap; }
  .operator { display: none; }
  .workspace { flex-direction: column; }
  .document-area { min-height: 0; flex: 1 1 42%; }
  .document-heading { display: none; }
  .document-tools, .canvas-focus .document-tools { margin: 8px 12px 6px; border-top: 0; padding-top: 0; }
  .candidate-list { left: 8px; right: 8px; width: auto; }
  /* Page and zoom controls share the first row with the panel toggle, which
     keeps its name for screen readers only. The filter gets the next row. */
  .document-footer { display: none; }
  .canvas-scroll { padding: 0 10px 10px; }
  .page-stage { min-height: 0; }
  .inspector { width: 100%; height: auto; flex: 1 1 58%; min-height: 0; border: 0; border-top: 1px solid var(--line); }
  .inspector-body { padding: 14px 16px; }
  .candidate-heading h2 { font-size: 20px; margin: 5px 0; }
  .section-heading { margin-top: 15px; }
  .decision-area { padding: 10px 16px; }
  .decision-controls { display: grid; grid-template-columns: 1fr 140px; margin-top: 4px; }
  .decision-area .decision-note { height: 44px; }
  .mode-tabs { margin: 12px -16px 12px; padding-left: 16px; }
  dialog > header { padding: 11px 14px; }
  dialog h2 { font-size: 16px; }
  .witness-document { padding: 12px; }
  textarea { min-height: 75px; }
}

/* Phones in landscape and other short screens. The page keeps the height
   the heading and footer would take. */
@media (max-height: 520px) and (min-width: 651px) {
  .app { min-height: 0; }
  .appbar { height: 46px; min-height: 46px; }
  .document-heading, .document-footer { display: none; }
  .document-tools, .canvas-focus .document-tools { margin-top: 6px; border-top: 0; padding-top: 0; }
  .inspector-top { height: 44px; min-height: 44px; }
  .inspector-body { padding: 10px 16px; }
  .mode-tabs { margin: 10px -16px 10px; padding-left: 16px; }
  .decision-area { padding: 8px 16px; }
  /* Side by side, so the choice and Save fit above the fold. */
  .decision-controls { display: grid; grid-template-columns: 1fr 140px; margin-top: 4px; }
  .decision-area .decision-note { height: 40px; min-height: 0; margin-top: 6px; }
  .page-stage { min-height: 0; }
}

/* Touch screens. Controls are at least 44 points, the size Apple asks for,
   and form fields use 16px text so Safari does not zoom in on focus. */
@media (pointer: coarse) {
  input, select, textarea, .decision-controls select, .decision-area .decision-note { font-size: 16px; }
  .tool-group button, #menu-open, .rail button { min-width: 44px; min-height: 44px; }
  #canvas-toggle { min-height: 44px; }
  /* Eight buttons share the panel's width, so they keep the height and give
     up some width. */
  .panel-nav button { min-width: 36px; min-height: 44px; }
  .panel-nav .nav-divider { display: none; }
  .document-tools > button, .list-controls .button, .decision-controls .primary, .menu-item, .mode-tabs button { min-height: 44px; }
  .tool-group { gap: 2px; }
  .panel-nav { gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
.signin-page { display: grid; place-items: center; min-height: 100vh; background: var(--subtle); }
.signin { width: min(360px, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.signin h1 { font-size: 20px; margin: 14px 0 6px; }
.signin p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.signin form { display: grid; gap: 6px; }
.signin label { font-size: 12px; font-weight: 600; margin-top: 6px; }
.signin input { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--control-line); border-radius: 6px; background: transparent; color: var(--ink); }
.signin button { margin-top: 14px; }
.signin .signin-status { min-height: 1.4em; margin: 8px 0 0; }
.list-controls { flex: none; }

/* Preferences apply in this browser only. */
dialog.preferences { width: min(420px, calc(100vw - 28px)); }
dialog.preferences header button { font-size: 20px; width: 28px; height: 28px; }
.preference-list { display: grid; gap: 12px; padding: 16px 20px 20px; font-size: 13px; }
.preference-list p { margin: 0; color: var(--muted); font-size: 12px; }
.preference-list label { display: flex; gap: 9px; align-items: center; }
.preference-list input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Keys: the help list and the key editor in Preferences. */
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font: 600 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; background: var(--subtle); color: var(--ink); }
dialog.preferences { width: min(600px, calc(100vw - 28px)); overflow: auto; }
.preference-list h3 { font-size: 14px; margin: 8px 0 0; }
.binding-list h4, .help-list h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; }
.binding-row, .help-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.binding-label { flex: 1 1 auto; }
.binding-keys { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.binding { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.binding-remove { width: 20px; height: 20px; font-size: 14px; line-height: 1; color: var(--muted); }
.binding-add, .binding-reset { min-height: 28px; padding: 4px 9px; font-size: 12px; white-space: nowrap; }
.binding-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.binding-status { font-size: 12px; color: var(--muted); }
.help-list { padding: 8px 20px 4px; }
.help-row > span:first-child { flex: 1 1 auto; }
.help-keys { color: var(--muted); font-size: 12px; }

/* Client desk dialog. */
.menu-badge { font-size: 10px; color: var(--added); font-weight: 600; }
.client-state { font-size: 13px !important; color: var(--ink) !important; }
.client-state b[data-online="true"] { color: var(--added); }
.client-link-row { display: flex; gap: 6px; }
.client-link-row input { flex: 1; min-width: 0; height: auto; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--subtle); color: var(--ink); }
.client-choice { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; }
.client-choice legend { font-size: 12px; font-weight: 600; padding: 0 4px; }
.client-choice .builder-options { margin-top: 4px; }
.client-count { font-weight: 600; color: var(--ink) !important; }
.client-actions { display: flex; gap: 8px; }
.reviewer-seats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.reviewer-seats:empty { display: none; }
.reviewer-seat { display: inline-flex; gap: 6px; align-items: baseline; font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--control-line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.reviewer-seat small { color: var(--muted); }
.reviewer-seat[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.reviewer-form-title { font-size: 13px; font-weight: 600; margin: 4px 0 0; }
.reviewer-name { display: grid !important; gap: 4px; font-size: 12px; font-weight: 600; }
.reviewer-name input { font: inherit; width: auto; height: auto; font-weight: 400; font-size: 13px; padding: 6px 8px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--surface); color: var(--ink); }
/* The editing view is a layout state of the editor desk, like Canvas. The
   finding to correct gets a thick outline, a ring, and a label. None of them
   covers or tints the page image. */
:root { --edit-mark: #b45309; --edit-done: #15803d; --edit-done-bg: #e8f6ec; }
:root[data-theme="dark"] { --edit-mark: #f59e0b; --edit-done: #4ade80; --edit-done-bg: #173323; }
.rail-pages { font-size: 9px; line-height: 1.2; padding: 3px 4px; margin-top: -10px; border: 1px solid var(--line); color: var(--muted); max-width: 56px; }
.rail-pages[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.rail[data-collapsed="true"] > .rail-pages { display: none; }
.editing-view .document-heading { display: none !important; }
/* The editing view keeps the page arrows and zoom from the toolbar. The
   Toolbar choice in the menu hides them in both views. */
.editing-view .document-tools > :not(.page-nav, .zoom-group, .toolbar-divider), .editing-view .candidate-list { display: none !important; }
.editing-view .document-tools { border-top: 0; margin-top: 8px; margin-bottom: 0; }
.editing-bar { margin: 10px 23px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "filters actions" "finding row" "banner banner"; gap: 8px 14px; align-items: start; font-size: 12px; }
.edit-row { grid-area: row; justify-self: end; }
.edit-finding { grid-area: finding; }
.edit-banner { grid-area: banner; }
.edit-actions { grid-area: actions; display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.edit-undo { min-height: 30px; padding: 5px 10px; font-size: 11px; }
.edit-done { min-width: 150px; min-height: 40px; font-size: 14px; font-weight: 650; }
.view-order select { border: 1px solid var(--control-line); border-radius: 6px; padding: 4px 6px; background: var(--surface); color: var(--ink); font-size: 11px; }
.view-order { flex: none; }
/* The page takes pinch gestures itself, so the desk zooms the page, not
   the screen, and the controls stay where they are. */
.canvas-scroll { touch-action: pan-x pan-y; }
.edit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.edit-filter { display: inline-flex; border: 1px solid var(--control-line); border-radius: 7px; overflow: hidden; }
.edit-filter button { border-radius: 0; padding: 6px 10px; font-size: 11px; color: var(--muted); }
.edit-filter button + button { border-left: 1px solid var(--line); }
.edit-filter button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.edit-finding { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.edit-finding b { font-size: 14px; font-weight: 600; }
.edit-location { color: var(--muted); font-size: 11px; }
.edit-state { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--edit-mark); color: var(--edit-mark); }
.edit-state[data-state="corrected"] { border-color: var(--edit-done); color: var(--edit-done); background: var(--edit-done-bg); }
.edit-edit { flex-basis: 100%; margin: 0; font-size: 15px; line-height: 1.5; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.edit-edit del { color: var(--removed); background: var(--removed-bg); text-decoration-thickness: 2px; }
.edit-edit ins { color: var(--added); background: var(--added-bg); text-decoration: none; font-weight: 650; }
.edit-arrow { color: var(--muted); }
.edit-banner { margin: 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
.edit-banner[data-kind="done"] { color: var(--edit-done); background: var(--edit-done-bg); border-color: var(--edit-done); }
.edit-banner[data-kind="cleared"], .edit-banner[data-kind="notice"] { color: var(--ink); background: var(--subtle); }
.editing-view .marker:not(.selected) { opacity: .45; }
.editing-view .marker.selected { outline: 4px solid var(--edit-mark); outline-offset: 3px; border: 2px solid var(--edit-mark); animation: edit-ring 1.6s ease-out 2; }
.editing-view .marker.selected::before { content: "Edit here"; position: absolute; left: -4px; bottom: calc(100% + 8px); padding: 2px 8px; border-radius: 10px; background: var(--edit-mark); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.editing-view .marker.selected > .badge { background: var(--edit-mark); }
.editing-view .marker.selected > .leader { background: var(--edit-mark); }
.editing-view .proof-page[data-corrected="true"] .marker.selected { outline-color: var(--edit-done); border-color: var(--edit-done); }
.editing-view .proof-page[data-corrected="true"] .marker.selected::before { content: "✓ Corrected"; background: var(--edit-done); }
.editing-view .proof-page[data-corrected="true"] .marker.selected > .badge { background: var(--edit-done); }
.editing-view .proof-page[data-corrected="true"] { outline: 4px solid var(--edit-done); outline-offset: 4px; }
.proof-page.edit-flash { animation: edit-flash 1.2s ease-out; }
@keyframes edit-ring { from { box-shadow: 0 0 0 0 var(--edit-mark); } to { box-shadow: 0 0 0 14px transparent; } }
@keyframes edit-flash { from { outline: 10px solid var(--edit-done); outline-offset: 2px; } to { outline: 4px solid var(--edit-done); outline-offset: 4px; } }
@media (prefers-reduced-motion: reduce) { .editing-view .marker.selected, .proof-page.edit-flash { animation: none; } }
/* Phones, tablets, and every touch screen. Done is a full-width button
   fixed to the bottom of the screen, so it stays in view while the page
   scrolls or zooms. Undo sits beside it, smaller but still 44 points. */
@media (max-width: 1000px), (pointer: coarse) {
  .editing-bar { margin: 8px 12px 6px; padding: 8px 10px; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "filters filters" "finding row" "banner banner"; gap: 6px 8px; }
  .edit-row { gap: 6px 10px; }
  .edit-filter button { min-height: 40px; padding: 6px 9px; }
  .edit-finding b { font-size: 13px; }
  .edit-edit { font-size: 16px; }
  .editing-view .edit-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px var(--shadow); }
  .editing-view .edit-done { flex: 1; min-height: 56px; font-size: 18px; border-radius: 10px; }
  .editing-view .edit-undo { flex: none; min-width: 72px; min-height: 44px; font-size: 13px; }
  /* The workspace ends above the Done bar, so the page, the review panel,
     and its folded strip with the finding navigation all stay above it. */
  .editing-view .workspace { padding-bottom: calc(77px + env(safe-area-inset-bottom)); }
  .editing-view .document-footer { display: none; }
}
@media (max-width: 650px) {
  .edit-location { flex-basis: 100%; }
  .edit-row { justify-content: space-between; }
  .edit-filter { order: 3; flex: 1 1 100%; }
  .edit-filter button { flex: 1; white-space: nowrap; }
}

/* Page numbers. The page pane's arrows turn pages only, and the page they
   show stands out, as does the page of the finding in the editing bar. */
.page-nav #page-position { white-space: nowrap; }
.page-label, .edit-location .edit-page { color: var(--ink); font-size: 12px; font-weight: 650; }
.edit-location .edit-page { padding: 1px 6px; border: 1px solid var(--control-line); border-radius: 4px; background: var(--subtle); }

/* The filter bar, after Grafana's ad hoc filters. Builder shows each
   filter as a chip, "key operator value", with Add filter after them. Code
   shows the same query as text. */
.filter-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -4px 23px 10px; font-size: 12px; }
.filter-mode { display: inline-flex; flex: none; border: 1px solid var(--control-line); border-radius: 7px; overflow: hidden; }
.filter-mode button { border-radius: 0; padding: 5px 10px; font-size: 11px; color: var(--muted); }
.filter-mode button + button { border-left: 1px solid var(--line); }
.filter-mode button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.chip { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent-soft); color: var(--accent); overflow: hidden; }
.chip > * { padding: 4px 7px; border-radius: 0; font-size: 12px; white-space: nowrap; }
.chip-key { font-weight: 600; padding-right: 3px; }
.chip-op { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 650; padding: 4px 4px; }
.chip-value { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chip-remove { border-left: 1px solid var(--accent); font-size: 14px; line-height: 1; }
.chip-custom { border-style: dashed; }
.add-filter { border: 1px dashed var(--control-line); border-radius: 6px; padding: 4px 9px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.add-filter:not(:disabled):hover { color: var(--accent); border-color: var(--accent); }
.filter-code { display: flex; flex: 1 1 260px; gap: 6px; align-items: center; min-width: 0; }
.filter-code input { flex: 1; min-width: 0; font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--control-line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.filter-code input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.filter-code input.filtered { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.filter-code input[aria-invalid="true"] { border-color: var(--removed); background: var(--removed-bg); color: var(--removed); }
.filter-bar .button { min-height: 30px; padding: 5px 9px; }
.filter-clear { flex: none; }
.filter-error { flex-basis: 100%; margin: 0; padding: 6px 10px; font-size: 11px; color: var(--removed); background: var(--removed-bg); border: 1px solid var(--removed); border-radius: 6px; }
.filter-pop { position: absolute; z-index: 35; width: min(320px, 100%); max-height: 420px; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 40px var(--shadow); }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.pick-close { font-size: 18px; width: 28px; height: 28px; }
.pick-hint { margin: 0 2px; color: var(--muted); font-size: 11px; }
.pick-input { font: inherit; padding: 6px 8px; border: 1px solid var(--control-line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.pick-list { display: flex; flex-direction: column; overflow: auto; min-height: 0; }
.pick { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 8px; font-size: 12px; }
.pick .pick-label { flex: 1; }
.pick small { color: var(--muted); }
.pick.active { background: var(--accent-soft); color: var(--accent); }
.pick-typed { font-style: italic; }
.pick-check { font-size: 14px; }
.pick-empty { margin: 4px 8px; color: var(--muted); }
.pick-foot { display: flex; justify-content: flex-end; }
.filter-syntax { position: absolute; z-index: 35; top: calc(100% + 4px); right: 0; width: min(460px, 100%); max-height: 60dvh; overflow: auto; padding: 7px 12px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 40px var(--shadow); font-size: 11px; color: var(--muted); }
.filter-syntax dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 4px 8px 0; }
.filter-syntax dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); white-space: nowrap; }
.filter-syntax dd { margin: 0; }
/* A folded filter bar keeps its count on the toggle. */
.filters-toggle[data-active="true"], .edit-filters-toggle[data-active="true"] { border-color: var(--accent); color: var(--accent); }
.filters-toggle .filter-count, .edit-filters-toggle .filter-count { background: var(--accent); color: var(--button-ink); font-weight: 650; }
.editing-bar { position: relative; z-index: 25; }
.editing-bar .filter-bar { margin: 0; flex: 1 1 320px; min-width: 0; }
.edit-filters { grid-area: filters; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.edit-query { display: contents; }
.edit-filters-toggle { min-height: 30px; padding: 5px 10px; }

/* The review panel folds like the page rail: a toggle on its own edge, and
   a strip that keeps the finding navigation in reach. */
.panel-edge { font-size: 16px; width: 34px; height: 30px; flex: none; color: var(--muted); }
.inspector-top { gap: 4px; padding: 4px 8px 4px 4px; flex-wrap: wrap; height: auto; min-height: 49px; }
.panel-edge { width: 30px; }
.inspector-top .finding-nav { flex-wrap: wrap; }
.inspector-top .nav-position { min-width: 46px; }
.finding-nav { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; justify-content: space-between; }
.panel-strip { width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 3px; background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; }
.panel-strip .finding-nav { flex-direction: column; flex: none; }
.panel-strip .panel-nav { flex-direction: column; gap: 4px; }
.panel-strip .nav-divider { width: 16px; height: 0; border-left: 0; border-top: 1px solid var(--line); margin: 3px 0; }
.panel-strip .nav-position { min-width: 0; font-size: 10px; white-space: normal; line-height: 1.2; }
.canvas-focus .panel-strip { display: none; }
@media (max-width: 1000px) {
  .filter-bar { margin: 0 16px 8px; }
  .inspector-top { flex-wrap: wrap; height: auto; min-height: 49px; padding-top: 4px; padding-bottom: 4px; }
}
/* Phones in portrait. The panel sits under the page, so its edge is the
   top: the toggle points down to fold it, and the folded strip runs along
   the bottom with the finding navigation in one row. */
@media (max-width: 650px) {
  .filter-bar { margin: 0 12px 6px; }
  .filter-code { flex-basis: 100%; }
  .panel-edge > span { display: inline-block; transform: rotate(90deg); }
  .panel-strip { width: auto; flex-direction: row; padding: 2px 6px calc(2px + env(safe-area-inset-bottom)); gap: 4px; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .editing-view .panel-strip { padding-bottom: 2px; }
  .panel-strip .finding-nav, .panel-strip .panel-nav { flex-direction: row; flex: 1; }
  .panel-strip .panel-nav { justify-content: space-between; gap: 0; }
  .panel-strip .nav-position { font-size: 11px; white-space: nowrap; }
  .panel-strip .nav-divider { display: none; }
  .finding-nav .panel-nav button { min-width: 34px; }
  .edit-filters { gap: 6px 8px; }
  .editing-bar .filter-bar { flex-basis: 100%; }
}
@media (pointer: coarse) {
  .filter-mode button, .chip > *, .add-filter, .filters-toggle, .edit-filters-toggle, .panel-edge, .pick, .pick-close, .filter-bar .button { min-height: 44px; }
  .panel-edge { min-width: 44px; }
  .pick-input, .filter-code input { min-height: 44px; font-size: 16px; }
  .chip-remove { min-width: 40px; }
  .view-order select { min-height: 44px; font-size: 16px; }
}
/* A narrow review panel keeps every finding button on its first row and
   moves the order choice under them. */
@media (max-width: 1000px), (pointer: coarse) {
  .inspector-top .finding-nav { display: contents; }
  .inspector-top .panel-nav { flex: 1 0 auto; }
  .inspector-top .view-order { margin-left: auto; }
}
