/* WHY THE ID SELECTORS BELOW ALSO CARRY A data-av TWIN.

   view-audit.js is a factory: a second instance is mounted by CLONING the host's
   surface and rewriting every `id="x"` to `data-av="x"`, so the document keeps
   unique ids and the module's own scoped `$()` still resolves each name inside
   its own root. Phase 0's document view is exactly that second mount — see
   `recMountSurface` in assets/view-project.js.

   The MODULE was ready for this; the STYLESHEET was not. A clone carrying no ids
   matched none of the id rules here, so the second surface came up with its
   markup right and its layout gone: `#docview` alone is what makes the document a
   flex row, and without it the panes, the dividers and the Inspector fall into a
   column and the rendered page has no height at all.

   Fifteen names are twinned — the surface ids this file actually styles. A rule
   written as `#x` keeps working unchanged in both hosts; the twin is what makes
   it work in a mount that has no ids to match. */
/*
  view-audit styles — the Audit Editor, folded into the shell (Phase 2d).
  Editor-specific rules; generic base dropped (tms.css supplies it). Custom
  properties re-scoped to #view-findings (the audit host) and mapped to the
  shell palette (accent = --blue). #toolbar renamed to #av-toolbar.
*/
/* TWO hosts carry this surface: the web shell's #view-findings and the PC shell's
   #view-shared-audit. Both must define the tokens below.

   SCOPING RULE (P2.1): #view-findings means OPPOSITE things in the two hosts —
   the shared surface on the web app, but the PC's OWN local review. So class
   rules that the PC also uses on its own chrome (.sevchip, .stat, .viewtoggle,
   .scr-*, .st2-tier) cannot be scoped by id; they are scoped to the
   [data-av-surface] marker that each host sets on whichever element hosts this
   surface. Unscoped rules below are ones only this module ever renders —
   verified empirically by developer/tests/e2e/css_bleed_guard.cjs, which fails
   if a rule here matches an element outside the marker. The token rule itself
   stays id-scoped: the tokens are unused by PC-local chrome, so they are inert
   there. */
#view-findings,#view-shared-audit,[data-av-surface]{--accent:var(--blue);--accent-soft:#eaf1fb;--bg:#fff;--line2:#eef0f3;
  --radius:8px;--shadow:0 1px 3px rgba(20,30,50,.07),0 1px 2px rgba(20,30,50,.04);
  flex-direction:column;overflow:auto}
/* top bar */
#topbar{display:flex;align-items:center;gap:10px;padding:10px 18px;background:var(--panel);
  border-bottom:1px solid var(--line)}
#topbar .brandlogo{width:26px;height:26px;border-radius:7px;object-fit:contain;box-shadow:0 2px 6px rgba(20,25,35,.14)}
#topbar .brand{font-weight:800;color:var(--accent);letter-spacing:.3px}
.badge{display:inline-block;background:var(--accent);color:#fff;font-size:11px;font-weight:600;
  padding:3px 9px;border-radius:20px;letter-spacing:.3px}
#topbar h1{font-size:15px;font-weight:600;margin:0}
#topbar .spacer{flex:1}
#topbar .navlink{font-size:13px;color:var(--mut)}
#topbar .navlink:hover{color:var(--ink)}

/* gate / login */
#gate,[data-av="gate"]{margin:auto;text-align:center;color:var(--mut);max-width:560px;padding:40px}
.loginbox{padding:24px;display:flex;flex-direction:column;gap:12px}
.loginbox h3{margin:0}
.loginbox label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--mut)}

/* toolbar */
#av-toolbar,[data-av="av-toolbar"]{display:flex;align-items:center;gap:10px;padding:12px 18px;background:var(--panel);
  border-bottom:1px solid var(--line);flex-wrap:wrap}
#av-toolbar select#audit-sel,[data-av="av-toolbar"] select[data-av="audit-sel"]{width:auto;min-width:280px;font-weight:600}
#av-toolbar .spacer,[data-av="av-toolbar"] .spacer{flex:1}
[data-av-surface] .stat{font-size:12.5px;color:var(--mut);white-space:nowrap}
[data-av-surface] .stat b{color:var(--ink);font-weight:600}
#a-live .live,[data-av="a-live"] .live{color:var(--green)}
#a-live .down,[data-av="a-live"] .down{color:var(--amber)}

/* audit summary */
#summary,[data-av="summary"]{padding:10px 18px;background:var(--panel);border-bottom:1px solid var(--line2)}
#summary summary,[data-av="summary"] summary{cursor:pointer;font-weight:600;font-size:13px;color:var(--ink);list-style:none}
#summary summary::-webkit-details-marker,[data-av="summary"] summary::-webkit-details-marker{display:none}
#summary summary::before,[data-av="summary"] summary::before{content:"▸ ";color:var(--accent)}
#summary[open] summary::before,[data-av="summary"][open] summary::before{content:"▾ "}
#summary .body,[data-av="summary"] .body{margin-top:8px;font-size:13px;color:#3a4150;white-space:pre-wrap;max-width:900px}

/* filter bar */
#filterbar,[data-av="filterbar"]{display:flex;align-items:center;gap:10px;padding:10px 18px;background:var(--panel);
  border-bottom:1px solid var(--line2);flex-wrap:wrap}
[data-av-surface] .viewtoggle{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
[data-av-surface] .viewtoggle .vt{border:none;border-radius:0;padding:6px 14px;font-size:12.5px;font-weight:600;color:var(--mut);background:var(--panel)}
[data-av-surface] .viewtoggle .vt+.vt{border-left:1px solid var(--line)}
/* THE REVIEW-FEEDBACK DOOR, and the blind pass wearing it. Class-scoped rather
   than by id for the reason at the head of this file: Phase 0's mount is a
   clone with every id rewritten to `data-av`, so an `#av-feedback` rule would
   style one surface and not the other. */
[data-av-surface] .fb-btn{flex:none}
[data-av-surface] .fb-btn.is-blind{background:#fdf6e7;border-color:#ecdaae;color:#7a5510;font-weight:600}
[data-av-surface] .fb-btn.is-blind:hover:not(:disabled){filter:brightness(.98)}
/* The re-run's own notice, beside the button that raises it. Class-scoped, like
   everything else here, so ⓪'s cloned surface gets it too. */
/* A line of its own ABOVE the toolbar now (avRerunMsgEl), not a span beside a
   button inside it: that bar is `mb-gone` wherever the shell's strip exists. */
[data-av-surface] .av-rerun-msg{font-size:12px;color:var(--mut);margin:6px 12px}
[data-av-surface] .av-rerun-msg a{margin-left:2px;font-weight:600;color:var(--blue)}
[data-av-surface] .viewtoggle .vt.on{background:var(--accent,var(--blue));color:#fff}
/* The count on the Coverage tab. Inherits the tab's colour rather than setting its
   own, so it stays legible on both the resting and the selected background — the
   selected tab is a solid accent fill and a fixed grey would vanish into it. */
[data-av-surface] .viewtoggle .vt .n{display:inline-block;margin-left:6px;padding:0 5px;
  min-width:16px;border-radius:8px;font-size:11px;font-weight:700;line-height:16px;
  text-align:center;background:color-mix(in srgb, currentColor 14%, transparent);
  font-variant-numeric:tabular-nums}
#filterbar #a-search,[data-av="filterbar"] [data-av="a-search"]{flex:1;min-width:180px;max-width:380px}
#filterbar select,[data-av="filterbar"] select{width:auto;padding:6px 9px}
#pager,[data-av="pager"]{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--mut);margin-left:auto}

/* ============ findings list view ============ */
#a-list,[data-av="a-list"]{flex:1;min-height:0;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:12px;align-items:center}
[data-av-surface] .sevchip{font-size:11px;font-weight:800;letter-spacing:.4px;padding:2px 8px;border-radius:20px;border:1px solid}
.sa-cat{font-size:11.5px;font-weight:600;color:#3a4150;background:#f1f3f6;border:1px solid var(--line);border-radius:6px;padding:1px 7px}
/* The issue number, leading the row on BOTH surfaces that show a finding — the
   list rows here and the editor drawer's collapsed cards. Tabular mono so 1-,
   2- and 3-digit numbers occupy the same width and read as a column; muted
   because it identifies the finding rather than grading it, which is the job of
   the chips beside it.

   Note what this sits next to: `.sa-seg` is ALSO a "#n", and it means the
   segment. Two bare hash numbers on one row would be unreadable, so the segment
   one is labelled "seg #35" — see fTop/btTop. */
.fnum{flex:none;font:600 12px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-variant-numeric:tabular-nums;color:#7b8390}
.sa-seg{font-size:12px}
/* the segment number as a jump into the document ("Show in document") */
.sa-seg.link{cursor:pointer;text-decoration:underline dotted;text-underline-offset:2px}
.sa-seg.link:hover{color:var(--accent)}
/* ---- a finding that covers more than one sentence (bug-260911-023619) -------
   Between a quarter and a third of every published audit's findings name several
   segments (measured: 216/164/216/226 of 714/726/714/788), and the header used to
   print only the first — so a reviewer landing there found no Replace button and
   nothing saying the quoted wording was two sentences further on.

   Grouped in their own flex box because `.f-top`'s 10px gap would otherwise space
   "seg", the numbers and the note evenly across the row and break them apart into
   four unrelated-looking chips. */
.sa-segs{display:inline-flex;align-items:baseline;gap:5px;flex-wrap:wrap}
.sa-span{font-size:11px;font-style:italic;opacity:.85}
/* The sentence the quoted wording is actually in — the only one where Replace can
   act. Marked rather than reordered: the span's order is the finding's own, and
   shuffling it would make two findings on the same sentences list them
   differently. */
.sa-seg-quote{font-weight:700;text-decoration-style:solid}
/* ---- a finding sitting on a Bible quotation (bug-260911-070903) -------------
   Amber rather than red: it is context, not a defect. The provisional variant is
   outlined rather than filled because "we think this is a quotation" and "this is
   a quotation" must not look the same on a row a reviewer is scanning. */
.sa-scripture{font-size:10.5px;font-weight:800;letter-spacing:.3px;padding:1px 7px;
  border-radius:20px;color:#7a4b00;background:#fdf0d5;border:1px solid #e8c886}
.sa-scripture-prov{color:#7a5a2a;background:transparent;border-style:dashed}
.sa-lock{font-size:11.5px;color:var(--amber)}
.sa-res{width:auto;padding:4px 8px;font-size:12.5px;font-weight:600}
.f-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.f-issue{margin-top:8px;font-size:13.5px;color:var(--ink);white-space:pre-wrap}
.f-rec{margin-top:6px;font-size:13px;color:#1a5fb4;background:#f3f8ff;border:1px solid #dbe6f6;border-radius:8px;padding:6px 10px;white-space:pre-wrap}
/* What the corpus says about a term finding's term (`ciRulesSlot`), on the card —
   the primary, each alternate with when it is used, and what is never allowed. */
.ci-rules:not(:empty){margin-top:6px;font-size:12.5px;background:#fafaf7;border:1px solid var(--line);border-radius:8px;padding:6px 10px}
.ci-rules .ci-rules-h{font-weight:600;margin-bottom:2px}
.ci-rules .ci-alts{margin:2px 0 0;padding-left:18px}
.ci-rules .ci-alts li{margin:1px 0}
.ci-rules .ci-when{color:var(--muted,#666)}
.ci-rules .ci-flag{font-size:11px;color:var(--amber);white-space:nowrap}
.ci-rules .ci-proh{margin-top:2px;color:#9b2c2c}
.f-txt{margin-top:6px;font-size:12.5px;color:#3a4150}
.f-txt b{display:inline-block;min-width:30px;color:var(--mut);font-size:11px}
.f-by{margin-top:6px;font-size:11px}
.sa-f{width:100%;max-width:900px;background:var(--panel);border:1px solid var(--line);border-left:4px solid var(--mut);
  border-radius:var(--radius);box-shadow:var(--shadow);padding:12px 15px}
.sa-f.res-open{border-left-color:var(--amber)}
.sa-f.res-fixed{border-left-color:var(--green)}
.sa-f.res-accepted{border-left-color:#2a7a2a}
.sa-f.res-dismissed{border-left-color:var(--mut);opacity:.72}
/* U3.1 — advisories ("potential issues"): machine-flagged and uncertain, so present and
   resolvable but visibly not review work. Violet echoes the PC's own advisory colour.
   COMPOUND selectors throughout (`.sa-f.advisory`, never a bare `.advisory`): user/tms.html
   puts the class `advisory` on its own `.frow` rows in 26 places, and a bare rule here would
   bleed into the PC's findings table — which css_bleed_guard.cjs exists to catch. */
.sa-f.advisory{border-left-color:#7a6ba8;opacity:.85}
.a-potential{color:#6b5f91}
/* The coverage share of the open count. Its own colour rather than the advisory
   purple: these ARE open work here (see renderHead), they are simply a different
   kind of it — mechanical rather than judged — and two things that count
   differently must not read as the same thing. */
.a-coverage{color:#7a5c2e}
/* scripture (Bible Verse audit) card extras */
.scr-judge{margin-top:6px;font-size:11.5px;color:var(--mut)}
.scr-ref{font-weight:700;color:#3a4150}
[data-av-surface] .scr-cebulb{margin-top:6px;font-size:12.5px;color:#3a4150;border-left:3px solid #b7791f;
  padding:4px 8px;background:#fbf7ef;border-radius:4px;white-space:pre-wrap}
[data-av-surface] .scr-cebulb.proposed{border-left-color:#6a4ec2;background:#f4f1fb}
[data-av-surface] .scr-diff{margin-top:6px;font-size:12.5px;line-height:1.75;background:#fafbfc;border:1px solid var(--line2);
  border-radius:6px;padding:6px 8px}
[data-av-surface] .scr-diff .d-del{background:#fde2e1;color:#8a1c13;text-decoration:line-through;border-radius:3px;padding:0 2px}
[data-av-surface] .scr-diff .d-ins{background:#dcf3e3;color:#146c2e;border-radius:3px;padding:0 2px}
[data-av-surface] .st2-tier{font-size:10px;font-weight:700;letter-spacing:.3px;padding:1px 6px;border-radius:10px;border:1px solid}
[data-av-surface] .st2-tier.AUTO{color:#146c2e;background:#e7f6ec;border-color:#b6e0c2}
[data-av-surface] .st2-tier.PROPOSE{color:#8a5a00;background:#fbf1de;border-color:#e6d4a6}
[data-av-surface] .st2-tier.REFUSE{color:#8a1c13;background:#fdeceb;border-color:#f2c3bf}
#a-phase,[data-av="a-phase"]{background:#6a4ec2}
.ew-finding .ew-apply{padding:2px 8px;font-size:11.5px}

/* ============ document view (stacked panes + right edit window) ============ */
#docview,[data-av="docview"]{flex:1;min-height:0;display:flex}
/* Which side the Inspector is docked on (M26 #panel-side, ported at 1.81.0).
   `row-reverse` rather than an `order` property, so the DOM order — document,
   handle, Inspector — stays the reading order for a screen reader and for the
   keyboard, while the paint order flips. Only the border has to move with it. */
#docview.insp-left,[data-av="docview"].insp-left{flex-direction:row-reverse}
#docview.insp-left #edwin,[data-av="docview"].insp-left [data-av="edwin"]{border-left:0;border-right:1px solid var(--line)}

/* ---- DOCKED AT THE BOTTOM (the owner's third side, 17 Sep) ------------------
   The same three children — documents, handle, Inspector — turned from a row into
   a column, so the two documents get the WHOLE width. That is the point of the
   arrangement and not a side effect: measured at 1600, a side-by-side pane goes
   from 538px to 742px when the Inspector moves out of the row, which is the
   difference between an 816px sheet fitting and the surface falling back to the
   flow render.

   DOM ORDER IS ALREADY THE READING ORDER here — document, handle, Inspector — so
   unlike `insp-left` this needs no reversal, only the axis.

   `min-height:0` on the panes is what stops a tall document from pushing the dock
   off the bottom: a flex child's default `min-height:auto` refuses to shrink below
   its content, and without it the handle walks off screen on a long page. */
#docview.insp-bottom,[data-av="docview"].insp-bottom{flex-direction:column}
#docview.insp-bottom #doc-panes,[data-av="docview"].insp-bottom [data-av="doc-panes"]{
  flex:1 1 auto;min-height:0;min-width:0;
}
/* `[data-w]` IS LOAD-BEARING HERE, and it was measured rather than reasoned: the
   dock came out 400px wide with a full-width handle under it. The bucket rules
   below — `#docview[data-w="wide"] #edwin{width:400px}` — carry the SAME
   specificity as `#docview.insp-bottom #edwin` (two ids and one qualifier each)
   and are declared later, so they win a tie. Adding the attribute makes this
   strictly more specific instead of relying on source order, which is what the
   folded rail's own rule already does for the same reason. */
#docview.insp-bottom[data-w] #edwin,[data-av="docview"].insp-bottom[data-w] [data-av="edwin"]{
  width:auto;max-width:none;flex:0 0 260px;height:260px;min-height:0;
  border-left:0;border-right:0;border-top:1px solid var(--line);overflow:auto;
}
/* The handle, through 90 degrees with the container it divides. `row-resize` and
   a horizontal grip, because a vertical one on a full-width bar reads as a seam
   rather than something to pull. */
#docview.insp-bottom .av-idiv,[data-av="docview"].insp-bottom .av-idiv{
  flex:0 0 9px;align-self:stretch;width:auto;cursor:row-resize;
}
#docview.insp-bottom .av-idiv::after,[data-av="docview"].insp-bottom .av-idiv::after{
  width:44px;height:2px;
}

/* The Inspector's own drag handle — the twin of .av-pdiv, and of the PC's
   #ed-resizer. Shown ONLY where the Inspector is a column or a bottom dock: a
   bottom SHEET has no side to be dragged from, a folded rail has nothing to
   resize, and a detached one is not in this document at all. */
.av-idiv{
  flex:0 0 8px;align-self:stretch;background:var(--line);cursor:col-resize;
  position:relative;touch-action:none;transition:background .12s;display:none;
}
#docview[data-w="wide"] .av-idiv,[data-av="docview"][data-w="wide"] .av-idiv,#docview[data-w="standard"] .av-idiv,[data-av="docview"][data-w="standard"] .av-idiv,#docview[data-w="laptop"] .av-idiv,[data-av="docview"][data-w="laptop"] .av-idiv{display:block}
#docview.insp-out .av-idiv,[data-av="docview"].insp-out .av-idiv,#docview.insp-folded .av-idiv,[data-av="docview"].insp-folded .av-idiv{display:none}
.av-idiv:hover,.av-idiv:focus-visible,.av-idiv[data-drag="1"]{background:var(--accent,#1a5fb4)}
.av-idiv:focus-visible{outline:2px solid var(--accent,#1a5fb4);outline-offset:1px}
.av-idiv::after{
  content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:2px;height:26px;border-radius:2px;background:rgba(255,255,255,.75);
}
/* The two documents. STACKED by default, which is what this surface has always
   done; `.cols` sets them side by side, which neither host had — on a wide screen
   two 1164px-wide panes at half height each is the worst of both. The PC app's
   local review (#panes / #divider in user/tms.html) has had the drag and the swap
   since it shipped; PC_WEB_P3_PLAN M26 records that they were never ported here. */
#doc-panes,[data-av="doc-panes"]{flex:1;min-width:0;display:flex;flex-direction:column}
#doc-panes.cols,[data-av="doc-panes"].cols{flex-direction:row}
/* The pane's own bottom padding is a variable because the action strip has to
   cancel it exactly — see the strip's `bottom` below. Two literals that must stay
   equal are two literals that will not.

   `flex:1 1 0` and `min-width:0` are main's, and they are what lets the panes sit
   side by side under `#doc-panes.cols` without either one refusing to shrink. Both
   halves are needed: the layout is theirs, the cancellable padding is this
   branch's, and they do not overlap. */
.docpane{--pane-pad-b:16px;
  flex:1 1 0;min-height:0;min-width:0;overflow:auto;
  padding:0 18px var(--pane-pad-b);background:var(--panel)}
.docpane+.docpane{border-top:1px solid var(--line)}
#doc-panes.cols .docpane+.docpane,[data-av="doc-panes"].cols .docpane+.docpane{border-top:0;border-left:1px solid var(--line)}

/* The drag handle. Deliberately a visible 8px strip rather than an invisible
   hairline: a resize target you cannot see is one nobody finds. */
.av-pdiv{
  flex:0 0 8px;align-self:stretch;background:var(--line);cursor:row-resize;
  position:relative;touch-action:none;transition:background .12s;
}
#doc-panes.cols .av-pdiv,[data-av="doc-panes"].cols .av-pdiv{cursor:col-resize}
.av-pdiv:hover,.av-pdiv:focus-visible,.av-pdiv[data-drag="1"]{background:var(--accent,#1a5fb4)}
.av-pdiv:focus-visible{outline:2px solid var(--accent,#1a5fb4);outline-offset:1px}
/* The grip, so the strip reads as a handle and not as a border. */
.av-pdiv::after{
  content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:26px;height:2px;border-radius:2px;background:rgba(255,255,255,.75);
}
#doc-panes.cols .av-pdiv::after,[data-av="doc-panes"].cols .av-pdiv::after{width:2px;height:26px}
/* A popped-out pane leaves a slot behind; a divider between a pane and a slot is
   a handle for something that is not there. */
#doc-panes.has-out .av-pdiv,[data-av="doc-panes"].has-out .av-pdiv{display:none}
/* STICKY IN BOTH AXES, because the pane can now scroll in both. A frame holding a
   sheet wider than the pane makes `.docpane{overflow:auto}` scroll sideways (see
   `view-audit.js`, where the frame is sized), and a header sticky only on `top`
   slides out of view to the left the moment it does — taking the one label that
   says which document this pane is. `left:0` costs nothing where there is no
   horizontal overflow. */
.docpane h3{position:sticky;top:0;left:0;margin:0 -18px 8px;padding:8px 18px;background:#f7f8fa;
  border-bottom:1px solid var(--line2);font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--mut);z-index:1;
  display:flex;align-items:center;gap:10px}
/* `display:flex` HERE RATHER THAN A NEW RULE, so nothing has to reason about which
   of two declarations wins. The two rules that HIDE this band — `[data-w="phone"]`
   and `[data-h="short"]` below, and `[data-p0-surface] .docpane.tl>h3` in tms.css —
   are all more specific than `.docpane h3`, so `display:none` still beats this. */
.docpane h3 .pane-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---- the zoom cluster ------------------------------------------------------
   `margin-left:auto` rather than `justify-content:space-between` on the heading:
   the pair is label-then-controls whatever else the heading grows, and a heading
   with one child must not have that child pushed anywhere. */
.docpane h3 .zoombar{margin-left:auto;flex:0 0 auto;display:inline-flex;align-items:center;gap:2px}
/* The heading is 11px uppercase with letter-spacing; a percentage is neither, so
   every inherited text property is said again here rather than left to chance. */
.docpane h3 .zoombar button{font:inherit;font-size:11px;line-height:1;letter-spacing:0;
  text-transform:none;padding:3px 6px;min-width:22px;border:1px solid var(--line);border-radius:5px;
  background:#fff;color:var(--mut);cursor:pointer}
.docpane h3 .zoombar button:hover{background:#ececea;border-color:var(--mut);color:var(--ink,#222)}
.docpane h3 .zoombar button:focus-visible{outline:2px solid var(--accent,#1a5fb4);outline-offset:1px}
/* Tabular figures and a floor wide enough for "100%", so stepping through the
   range does not shuffle the two buttons either side of it. */
.docpane h3 .zoombar .zpct{min-width:46px;font-variant-numeric:tabular-nums}
.docpane h3 .zoombar button[disabled]{opacity:.45;cursor:default;background:#fff;border-color:var(--line);color:var(--mut)}
/* A pane with nothing rendered in it has nothing to zoom. */
.docpane h3 .zoombar.hide{display:none}
.docpane.tl .body{font-size:14.5px;line-height:1.9}
.docpane.en .body{font-size:13.5px;line-height:1.9;color:#3a4150}
/* The "no document to show" state (review D4). It used to be two entirely blank panes
   whose only explanation was a muted phrase up in the toolbar — so the explanation now
   lives where the user is looking. Readable measure, not full-bleed, because it is prose
   rather than a document. */
.doc-empty{max-width:46em;margin:26px auto;padding:16px 18px;border:1px solid var(--line);
  border-radius:8px;background:#fbfcfd;font-size:13.5px;line-height:1.65;color:var(--mut)}
/* Only the HEADING is a block. Scoped to the first child on purpose: `b{display:block}`
   here turned the inline <b>Findings</b> inside the body copy into a block and split the
   sentence across three lines — caught by looking at the rendered screen, not the DOM. */
.doc-empty > b:first-child{display:block;margin-bottom:6px;font-size:14.5px;color:var(--ink,#222)}
.doc-empty div+div{margin-top:8px}
.dseg{cursor:pointer;padding:1px 4px;border-radius:4px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.dseg:hover{background:var(--accent-soft)}
.dseg.flagged{background:#fff5e6;box-shadow:inset 2px 0 0 var(--amber)}
.dseg.flagged.sev-CRITICAL{background:#f9e3e3;box-shadow:inset 2px 0 0 #7f1d1d}
.dseg.flagged.sev-HIGH{background:#fdeaea;box-shadow:inset 2px 0 0 #b3261e}
.dseg.flagged.sev-MODERATE{background:#fdf0e4;box-shadow:inset 2px 0 0 #e07020}
.dseg.flagged.sev-MINOR{background:#fbf6df;box-shadow:inset 2px 0 0 #c2a200}
/* The back-translation scale is the other thing segTopSev can return. Same
   gradient job as the severities above: without these, every sentence flagged by
   the default engine painted the same flat amber and the document view lost its
   triage. Counted confidence first — that is the axis segTopSev ranks on — with
   the tier rules kept below for audits that predate the band. */
.dseg.flagged.sev-CONF-VERY-HIGH{background:#f9e3e3;box-shadow:inset 2px 0 0 #7f1d1d}
.dseg.flagged.sev-CONF-HIGH{background:#fdeaea;box-shadow:inset 2px 0 0 #b3261e}
.dseg.flagged.sev-CONF-MEDIUM{background:#fdf0e4;box-shadow:inset 2px 0 0 #e07020}
.dseg.flagged.sev-CONF-LOW{background:#fbf6df;box-shadow:inset 2px 0 0 #c2a200}
.dseg.flagged.sev-LIKELY{background:#fdeaea;box-shadow:inset 2px 0 0 #b3261e}
.dseg.flagged.sev-PROBABLE{background:#fdf0e4;box-shadow:inset 2px 0 0 #e07020}
.dseg.flagged.sev-POSSIBLE{background:#fbf6df;box-shadow:inset 2px 0 0 #c2a200}
/* a segment carrying ONLY advisories: distinguishable from both "needs review" and "clean",
   because reading as clean is what made the advisory channel invisible in the first place */
.dseg.potential{background:#f6f4fa;box-shadow:inset 2px 0 0 #7a6ba8;opacity:.85}
.dseg.potential:hover{background:#efeaf7}
/* The SELECTION ring moves to the inner span for the same reason the editing one
   is there: `.dseg` carries `box-decoration-break:clone`, which repeats the whole
   decoration on every line fragment. That is right for `.flagged`'s left rail and
   wrong for a ring — on a phone, where a sentence wraps over six lines, a selected
   sentence drew six disconnected boxes. The tint stays on the `.dseg` so the whole
   sentence still lights up; only the ring moves. */
.dseg.sel{background:var(--accent-soft)}
.dseg.sel > .dtxt{box-shadow:inset 0 0 0 2px #9dc0ee;border-radius:4px;
  box-decoration-break:slice;-webkit-box-decoration-break:slice}
.dseg .dnum{font-size:9.5px;color:var(--mut);vertical-align:super;margin-right:2px;user-select:none}

/* ---- edit in place: the sentence IS the editor (Phase 1) -------------------
   `.dtxt` is the only editable region — `.dnum` is its SIBLING, so the superscript
   never lands in `textContent` and cannot be backspaced away.

   State rides on `data-segedit`, not a class, because `afterResolve()` rewrites a
   `.dseg`'s `className` wholesale after every resolve and would wipe a class here
   mid-edit. And the ring is an OUTLINE, not a `box-shadow`: `.flagged`'s severity
   rail and `.sel`'s ring are both box-shadows and do not compose, so a third one
   would erase whichever it landed after — an editing sentence would lose its
   severity colour exactly when the reviewer is working on it. `.rseg-sel` inside
   the rendered frame makes the same choice for the same reason. */
/* `box-decoration-break` is NOT inherited, so `.dtxt` keeps the initial `slice`
   even though `.dseg` sets `clone`. That is deliberate and it is the whole reason
   the ring reads correctly: `clone` repeats the WHOLE decoration on every line
   fragment, which is right for `.flagged`'s left rail (a marker you want beside
   every line) and wrong for a ring — it drew six separate boxes around a sentence
   wrapping over six lines. `slice` draws one ring, opened where the lines break. */
.dtxt{outline:none;border-radius:4px}
/* An untranslated sentence has nothing in it, and an empty inline box is zero
   pixels wide — there is nowhere to aim a caret. Give the empty editable a target
   without changing its `display`, which would break the wrapping of every long
   sentence around it. */
.dseg[data-segedit] .dtxt:empty{padding-right:8ch}
.dseg[data-segedit]{cursor:text}
/* THE RING IS ON `.dtxt`, THE RAIL IS ON `.dseg` — two elements, so they compose
   instead of one replacing the other. That is why this is not an `outline` on the
   .dseg, which was the first attempt: an outline on an inline element draws a
   separate rectangle around every LINE FRAGMENT, so a sentence wrapping over six
   lines on a phone came out as six disconnected boxes. `box-shadow` honours
   `box-decoration-break:clone` and follows the wrap the way the flagged tint
   already does. */
.dseg[data-segedit] > .dtxt{padding:1px 3px;box-decoration-break:slice;-webkit-box-decoration-break:slice}
.dseg[data-segedit="editing"] > .dtxt,.dseg[data-segedit="saving"] > .dtxt{box-shadow:inset 0 0 0 2px #0b6e63;background:#fff}
.dseg[data-segedit="unsaved"] > .dtxt{box-shadow:inset 0 0 0 2px var(--amber);background:var(--amber-bg)}
.dseg[data-segedit="saved"] > .dtxt{box-shadow:inset 0 0 0 2px var(--green);background:var(--green-bg)}
.dseg[data-segedit="held"] > .dtxt{box-shadow:inset 0 0 0 1px var(--mut);opacity:.75}
.dseg[data-segedit="held"]{cursor:default}
/* State is never colour alone: each one also changes the glyph in front of the
   sentence. Placed on the .dseg, so it sits outside the editable region. */
.dseg[data-segedit]::before{font-size:9.5px;margin-right:3px;vertical-align:.15em;
  user-select:none;-webkit-user-select:none;font-family:-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
.dseg[data-segedit="editing"]::before,.dseg[data-segedit="saving"]::before{content:"✎";color:#0b6e63}
.dseg[data-segedit="unsaved"]::before{content:"✎";color:var(--amber)}
.dseg[data-segedit="saved"]::before{content:"✓";color:var(--green)}
.dseg[data-segedit="held"]::before{content:"🔒"}
/* …except where the named chip already carries one. `data-lockchip` is set by the
   same two code paths that create and remove `.dlock`, because CSS cannot look
   forward to a later sibling without `:has()`. */
.dseg[data-lockchip]::before{content:none}

/* WHOSE sentence it is, said out loud rather than left to a hover title. A SIBLING
   of `.dtxt`, never a child: inside the editable region a teammate's name is read
   back by `segTextOf` as the reviewer's own wording and saved into the translation.
   `user-select:none` keeps it out of a drag-select that crosses the sentence end,
   and `white-space:nowrap` keeps "🔒 mel" from breaking across two lines. */
.dseg > .dlock{margin-left:5px;padding:0 5px;border-radius:8px;white-space:nowrap;
  font:600 10px/1.7 -apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--mut);background:#eef0f3;border:1px solid var(--bd);
  vertical-align:.1em;user-select:none;-webkit-user-select:none}

@media (prefers-reduced-motion:no-preference){
  .dseg[data-segedit] > .dtxt{transition:box-shadow .12s ease,background .12s ease}
}

/* The action strip: pinned to the foot of the translation pane, which is the
   scroll container — so `bottom:0` is the pane's own bottom edge and the sentences
   scroll behind it. The negative margins full-bleed it across the pane's padding,
   the same trick `.docpane h3` uses at the top.

   NOT anchored to `[data-av-surface]`, unlike most of this file. `assets/popout.js`
   moves a region into a child window whose body is `.tms-popout > .popout-host >
   the adopted node` — the surface marker is an ANCESTOR and does not travel with
   it, so a rule scoped that way silently stops applying: the strip arrives unstyled
   and unpinned and scrolls away with the text until Save is off-screen. A bare
   `[data-av=…]` is safe here for the same reason a bare `.dseg` is — only this
   module ever renders one, so there is nothing outside the surface to reach.

   Every control carries its own font/border/padding on purpose: `assets/pc.css`
   dresses bare buttons only inside `#view-corpus, #view-shared-audit`, and
   `app.html` does not load pc.css at all — so anything relying on that would
   render as a raw native widget on the web and look correct only on the PC. */
/* A flex column so the strip can be pushed to the FOOT of the pane by
   `margin-top:auto` when the document is short, while `position:sticky` keeps it
   there once the document is long enough to scroll. Without the column it simply
   followed the last sentence, leaving it stranded halfway up an empty pane. Only
   the translation pane: the original has no strip and must keep its plain flow. */
.docpane.tl{display:flex;flex-direction:column}
.docpane.tl > .body{flex:0 0 auto}
/* `bottom` is NEGATIVE, and that is not a nudge. A sticky element's offsets
   resolve against its scrollport's PADDING box, so `bottom:0` pins the strip
   `--pane-pad-b` above the pane's bottom edge — a 16px band of pane showing under
   a bar that is supposed to sit on the split line. The negative bottom margin
   cannot fix it: that moves the strip's flow position, not where sticky pins it.
   The margin still earns its place for the OTHER case — a document short enough
   not to scroll, where `margin-top:auto` drops the strip to the foot and sticky
   never engages. */
/* SHARED BY BOTH HOMES — see `segBarHome` in view-audit.js. The strip is a row
   in the Inspector's header where the Inspector is a docked open column, and the
   foot of the translation pane in the three states where it is not (a bottom
   sheet, a folded rail, a detached window). Everything that is about being a
   toolbar is here; the two rules under it add only what is about the place. */
[data-av="av-segbar"]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
/* At the foot of the pane, pinned, exactly as it always was — the paragraphs
   above are the reasoning for every number in this rule and they still hold for
   this home. Scoped to the pane by the child combinator rather than left bare, so
   the Inspector's copy does not inherit a sticky it has no scrollport for. */
.docpane.tl > [data-av="av-segbar"]{position:sticky;bottom:calc(-1 * var(--pane-pad-b,16px));z-index:3;
  margin:auto -18px calc(-1 * var(--pane-pad-b,16px));padding:7px 18px;background:var(--panel);
  border-top:1px solid var(--line);box-shadow:0 -2px 6px rgba(20,30,50,.06)}
/* bug-260909-103037 — *"I dont want the bottom bar. All that info is in the
   inspector bar."* In the Inspector it is a row of that panel and nothing more:
   no sticky, no negative margins reaching through a pane's padding, no shadow
   lifting it off a document behind it. It is inside the thing it belongs to and
   it scrolls with it. */
[data-av="av-inspbar"] [data-av="av-segbar"]{
  padding:6px 10px 8px;border-top:1px solid var(--line2);background:#f7f9fc}
[data-av="av-segbar"] .sb-gap{flex:1}
[data-av="av-segbar"] .sb-id{font:600 11px/1.6 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-variant-numeric:tabular-nums;color:var(--mut);white-space:nowrap}
[data-av="av-segbar"] button{font:inherit;font-size:12.5px;line-height:1.5;
  padding:3px 11px;border:1px solid var(--line);border-radius:6px;background:#fff;
  color:var(--ink);cursor:pointer}
[data-av="av-segbar"] button:hover:not(:disabled){background:#eef0f3}
[data-av="av-segbar"] button:disabled{background:#eef0f3;color:var(--mut);cursor:not-allowed}
[data-av="av-segbar"] button.primary{background:var(--blue);border-color:var(--blue);color:#fff;font-weight:600}
[data-av="av-segbar"] button.primary:disabled{background:#c7d4e6;border-color:#c7d4e6;color:#fff}
[data-av="av-segbar"] button.ghost{border-color:transparent;background:none;color:var(--mut)}
/* bug-260909-043023 — the two arrows. A single glyph in a button sized for a
   word reads as a typo, so they get their own square and a font big enough to
   see the hook on the arrow. */
[data-av="av-segbar"] button[data-av="sb-undo"],
[data-av="av-segbar"] button[data-av="sb-redo"]{font-size:15px;line-height:1;
  padding:3px 8px;min-width:30px}
[data-av="av-segbar"] button.ghost:hover:not(:disabled){background:#eef0f3;color:var(--ink)}
/* bug-260909-081620 — the go-to-sentence box. Sized to the numbers it takes (a
   document runs to hundreds, not millions) so it sits in the nav row rather than
   dominating it, and it says when the number is not in the document. */
.ew-gonum{width:58px;font:inherit;font-size:12px;line-height:1.5;padding:2px 6px;
  border:1px solid var(--line);border-radius:4px;background:#fff;color:var(--ink)}
.ew-gonum::placeholder{color:var(--mut)}
.ew-gonum.bad{border-color:var(--red);color:var(--red)}

[data-av="av-segbar"] .sb-msg{font-size:12px;color:var(--mut)}
/* The note composer's own line. A note is only a note once it is ADDED —
   plain Enter is a newline here on purpose — so text sitting in the box needs
   to say which of the two it is. */
[data-av="ew-note-msg"]{font-size:11.5px;color:var(--mut);flex-basis:100%}
[data-av="ew-note-msg"].warn{color:#b45309;font-weight:600}
[data-av="ew-note-msg"].bad{color:var(--red);font-weight:600}
#ew-note-add-row.has-draft textarea,
[data-av="ew-note-add-row"].has-draft textarea{box-shadow:inset 0 0 0 2px #fed7aa}
[data-av="av-segbar"] .sb-msg.unsaved{color:var(--amber);font-weight:600}
[data-av="av-segbar"] .sb-msg.ok{color:var(--green);font-weight:600}
[data-av="av-segbar"] .sb-msg.bad{color:var(--red);font-weight:600}
/* faithful rendered document (uploaded self-contained HTML, shown in an iframe) */
.docframe{width:100%;border:0;display:block;background:#fff;min-height:140px}
/* ---- the zoom box around a rendered frame ----------------------------------
   WHY THE SCALE IS ON THE HOST SIDE AND NOT INSIDE THE DOCUMENT. `docx-sheets.js`
   decides whether to repaginate by comparing each paragraph's live
   `getBoundingClientRect().height` against the `data-sheet-h` it recorded at build
   time, within 0.75px. A `zoom` or a `transform` applied INSIDE the frame scales
   every one of those rects, so `moved()` answers true for every paragraph and
   Print View repaginates continuously; `footNotes` measures against the unzoomed
   `rec.h` the same way. Scaling the `<iframe>` element leaves the document's own
   coordinate space untouched, so every one of those measurements is still the one
   the sheets were built from.

   A WRAPPER RATHER THAN MARGINS ON THE FRAME. A transformed element keeps its
   untransformed layout size, so at zoom > 1 the painted document reaches past the
   pane's scrollable area. Compensating with a margin would depend on a child's
   margin box being propagated into the scroll container's overflow, which is not
   something to rely on; a block with an explicit width and height is.

   THE GEOMETRY IS WRITTEN BY `applyFrameZoom`: the box is `max(100%, W×z)` wide,
   the frame inside it is `calc(100% / z)`, and the `max()` is what keeps the
   frame's internal viewport from ever falling below the document's own column
   width W — which is what stops a zoom from REFLOWING the text instead of
   enlarging it. */
.docframe-zoom{display:block;width:100%}
.docframe-zoom > .docframe{transform-origin:0 0}

#edwin,[data-av="edwin"]{width:390px;flex:none;border-left:1px solid var(--line);background:#fbfcfe;overflow-y:auto;
  display:flex;flex-direction:column}
#edwin .ew-sec,[data-av="edwin"] .ew-sec{padding:12px 14px;border-bottom:1px solid var(--line2)}
#edwin h4,[data-av="edwin"] h4{margin:0 0 6px;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--mut)}
/* THE NAV ROW STAYS PUT — bug-260911-032710: *"the next / prev segment / issue
   buttons should not scroll away nor should everythign above them."*

   `#edwin` is the scroll container and `[data-av="av-inspbar"]` (the "Inspector"
   header and its count) was already sticky at `top:0`. This row was not, so the
   step-to-next-segment controls scrolled away exactly when a segment had enough
   findings to need them.

   `top` comes from `--ew-navtop`, which the module writes from the header's
   MEASURED height (`syncInspNavTop`, re-run on every geometry change) — the
   header is a different height in sheet mode and at a different font size, and a
   typed offset would pin this row over it or leave a gap under it. The 30px
   fallback is only ever used in the instant before the first measurement.

   OPAQUE ON PURPOSE. A sticky row over scrolling content must not let the text
   pass through it; this is the same `#fbfcfe` the panel itself is painted in, so
   the pinned rows read as one header rather than as a floating strip. z-index 3
   sits under the header's 4 so the two stack in the order they are pinned. */
[data-av="ew-navsec"]{position:sticky;top:var(--ew-navtop,30px);z-index:3;
  background:#fbfcfe}
/* Folded, the panel is a 38px rail with `overflow:hidden` and there is nothing to
   pin — and a sticky row inside a hidden overflow is a rendering cost for a row
   nobody can see. */
#edwin[data-folded] [data-av="ew-navsec"],
[data-av="edwin"][data-folded] [data-av="ew-navsec"]{position:static}
#ew-nav,[data-av="ew-nav"]{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
#ew-nav button,[data-av="ew-nav"] button{padding:4px 9px;font-size:13px}
#ew-nav .seglabel,[data-av="ew-nav"] .seglabel{font-weight:700;margin-left:auto}

/* ---- the Resolve button, and what a settled card says instead of a bar ----

   PHASE 1'S GREEN, to the value. `.lc-approve` (view-corpus.css) is
   `--green-bg` ground, `--green` border, `#14622c` ink, and a reviewer crossing
   from ① to ③ should meet one control, not two that merely agree. Weight
   without alarm: approving is not destructive and does not need what red
   carries — it needs to be the obvious next press.

   The `#ew-nav button` rule above is an id selector, so this has to be one too
   or the padding and font-size there win. */
#ew-nav .ew-resolve,[data-av="ew-nav"] .ew-resolve{
  display:inline-flex;align-items:center;gap:6px;white-space:nowrap;
  padding:4px 11px;font-size:12.5px;font-weight:600;border-radius:6px;
  background:var(--green-bg);color:#14622c;border:1px solid var(--green);cursor:pointer}
#ew-nav .ew-resolve:hover:not(:disabled),[data-av="ew-nav"] .ew-resolve:hover:not(:disabled){filter:brightness(.97)}
#ew-nav .ew-resolve:active:not(:disabled),[data-av="ew-nav"] .ew-resolve:active:not(:disabled){transform:translateY(1px)}
#ew-nav .ew-resolve:focus-visible,[data-av="ew-nav"] .ew-resolve:focus-visible{outline:3px solid var(--green);outline-offset:2px}
/* Disabled says which situation it is through `title`; it must not also look
   pressable (§4A: "nothing looks locked" — and nothing dead looks live). */
#ew-nav .ew-resolve:disabled,[data-av="ew-nav"] .ew-resolve:disabled{
  background:#f1f3f6;color:#5b6472;border-color:#d9dde3;cursor:default;filter:none}
/* Everything settled: still a door — the reviewer can read the answers back or
   change one — so it stays live, but it has stopped being the next thing to do. */
#ew-nav .ew-resolve.done,[data-av="ew-nav"] .ew-resolve.done{
  background:#f1f3f6;color:#41505e;border-color:#d9dde3;font-weight:600}
#ew-nav .ew-resolve .cnt,[data-av="ew-nav"] .ew-resolve .cnt{
  font:600 11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  background:#fff;border:1px solid rgba(30,142,62,.45);border-radius:9px;padding:2px 6px;
  font-variant-numeric:tabular-nums}

/* The card's record of what was decided. Not a control: the only pressable
   thing on it is the way back into the window. */
.fresolved{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:7px;
  padding:5px 8px;border-radius:6px;font-size:11.5px;
  background:#f4f7f4;border:1px solid #d9e5da;color:#2a4a32}
.fresolved.is-dismissed{background:#f2f3f5;border-color:#dcdfe3;color:#525b64}
.fresolved b{font-weight:600}
.fres-mark{flex:none;font-size:12px}
.fres-by{color:#5b6472}
.fresolved .ew-changeres{margin-left:auto;font:inherit;font-size:11px;padding:0;
  border:0;background:none;color:var(--accent);text-decoration:underline;cursor:pointer}
.fresolved .ew-changeres:hover{color:#0d4b9c}
/* The translator's own words, under the answer rather than inside it — they are
   prose and the line above is a label. */
.fres-note{margin-top:4px;font-size:11.5px;line-height:1.5;color:#5b6472;white-space:pre-wrap}

/* ---- a findings-LIST row: the way in, and the record ----------------------

   The row is a dense flex line of chips, so neither of these may grow it. The
   button is quiet on purpose: the loud green one is in the Inspector's nav row
   where it opens a whole sentence's worth of work, and a list of 300 rows each
   shouting the same green would make the page unreadable and the real decision
   control harder to find, not easier. */
.f-resolve{font:inherit;font-size:11.5px;line-height:1.5;padding:2px 9px;
  border:1px solid var(--green);border-radius:4px;background:var(--green-bg);
  color:#14622c;font-weight:600;cursor:pointer;white-space:nowrap}
.f-resolve:hover:not(:disabled){filter:brightness(.97)}
.f-resolve:active:not(:disabled){transform:translateY(1px)}
.f-resolve:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.f-resolve:disabled{background:#f1f3f6;color:#5b6472;border-color:#d9dde3;cursor:default;filter:none}
/* Settled: a record, so it reads as text with one link out of it rather than as
   another control. `max-width` keeps a long answer from pushing the chips that
   identify the row off their line. */
.f-settled{display:inline-flex;align-items:baseline;gap:6px;flex-wrap:wrap;
  font-size:11.5px;color:#2a4a32;max-width:34ch}
.f-settled.is-dismissed{color:#525b64}
.f-settled b{font-weight:600}
.f-settled-mark{flex:none}
.f-changeres{font:inherit;font-size:11px;padding:0;border:0;background:none;
  color:var(--accent);text-decoration:underline;cursor:pointer;white-space:nowrap}
.f-changeres:hover{color:#0d4b9c}
.f-changeres:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#ew-en{font-size:13.5px;color:#3a4150;background:#fff;border:1px solid var(--line);border-radius:6px;padding:8px 10px;white-space:pre-wrap}
/* The Inspector's own translation editor — a Quill box, its textarea fallback,
   their Save/Reset row and the MateCAT-style `.fmt-tag` chips that rendered
   opaque inline content inside it — was removed with bug-260907-052753. The
   sentence in the document is the only editor now; see `renderEdWin`. The chip
   rules live on in assets/tms.css, where the PC app's own local editor
   (`#ed-quill` in user/tms.html) still draws them. */
/* A finding card in the edit window is a <details>: collapsed it is ONE line —
   caret, severity (or BT tier) and category — so a segment with six findings
   reads as six scannable rows instead of six walls of prose. `.ftop` is the
   <summary>, `.fbody` everything the caret reveals, including the resolution
   bar: the header carries no controls, so a click anywhere on it means "open
   this", with nothing to mis-hit. Collapsed is the default (renderEdFindings
   emits `open` only for cards the reviewer expanded on THIS segment), which is
   why the resolution state still has to be legible with the body hidden — the
   left rail below is what says it. */
.ew-finding{border:1px solid var(--line);border-left:4px solid var(--mut);border-radius:6px;background:#fff;padding:8px 10px;margin-bottom:8px}
.ew-finding.res-open{border-left-color:var(--amber)}
.ew-finding.res-fixed,.ew-finding.res-accepted{border-left-color:var(--green)}
.ew-finding.res-dismissed{border-left-color:var(--mut);opacity:.72}
.ew-finding .ftop{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
/* The toggle is drawn by us: `display:flex` on a <summary> drops the native
   disclosure marker in WebKit anyway, and `list-style:none` removes it where it
   would otherwise survive — same pattern as #summary above. As a ::before it is
   the first flex item, so it aligns with the chips and inherits the row's gap.

   MONOSPACE, on a fixed 15px box, is load-bearing rather than decoration: "+"
   and "−" have identical advance width there, so the number and chips beside
   them cannot shift sideways as a card opens and closes. And it is a real minus
   (U+2212), not a hyphen — a hyphen sits high and short beside a full-size plus
   and reads as a dash rather than the other half of a pair. */
.ew-finding > summary.ftop{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}
.ew-finding > summary.ftop::-webkit-details-marker{display:none}
.ew-finding > summary.ftop::before{content:"+";flex:none;width:15px;text-align:center;
  font:700 17px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--accent)}
.ew-finding[open] > summary.ftop::before{content:"−"}
.ew-finding .fissue{margin-top:6px;font-size:12.5px;white-space:pre-wrap}
.ew-finding .frec{margin-top:5px;font-size:12.5px;color:#1a5fb4;background:#f3f8ff;border:1px solid #dbe6f6;border-radius:6px;padding:5px 8px}
.ew-finding .facts{margin-top:6px;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.ew-finding .facts button{padding:2px 8px;font-size:11.5px}

/* The segment's Summary of Issues — the block above the cards.

   OPEN by default, unlike the cards below it. That asymmetry is the whole
   point: the cards are collapsed because a reviewer should not have to read six
   walls of prose to triage, and this is what they read instead. It carries the
   accent border so it reads as the pane's own voice rather than as a seventh
   finding, and it is a <details> so a reviewer who does not want it can shut it
   and have that remembered for the segment. */
.ew-summary{border:1px solid var(--accent);background:var(--accent-soft);border-radius:8px;
  padding:9px 12px;margin-bottom:12px}
.ew-summary > summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:9px;
  flex-wrap:wrap;-webkit-user-select:none;user-select:none}
.ew-summary > summary::-webkit-details-marker{display:none}
.ew-summary > summary::after{content:"+";margin-left:auto;flex:none;width:15px;text-align:center;
  font:700 17px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--accent)}
.ew-summary[open] > summary::after{content:"−"}
.sum-pill{flex:none;background:var(--accent);color:#fff;font:600 11px/1.55 -apple-system,Segoe UI,Roboto,Arial,sans-serif;
  letter-spacing:.03em;padding:2px 10px;border-radius:20px;white-space:nowrap}
.sum-head{font-size:12.5px;font-weight:600;color:var(--ink)}
.sum-body{margin-top:9px;padding-top:9px;border-top:1px solid rgba(26,115,232,.22)}
/* The model-written paragraph, when the audit carries one. It leads, and the
   computed lines stay under it: the prose describes the moment the audit ran and
   the counts describe now, so a summary cannot quietly go stale mid-review. */
/* PROSE LEADS, so it is set to be read rather than skimmed: the computed rows
   below it are reference, this is the thing a reviewer acts on. 13.5px/1.65 over
   the 12.5px it used to share with the chips. */
.sum-written{font-size:13.5px;line-height:1.65;color:var(--ink);margin-bottom:10px;white-space:pre-wrap}
.sum-split{font-size:12px;line-height:1.5;color:#8a5a12;background:#fdf3e2;
  border-left:2px solid #c98a1e;padding:7px 10px;border-radius:0 4px 4px 0;margin-bottom:9px}
.sum-stale{font-size:11.5px;line-height:1.5;color:var(--mut);margin-bottom:9px}
.sum-rows{margin-bottom:2px}
.sum-rows > summary{cursor:pointer;list-style:none;font-size:11.5px;color:var(--mut);
  padding:5px 0;display:flex;align-items:center;gap:7px}
.sum-rows > summary::-webkit-details-marker{display:none}
.sum-rows > summary::after{content:"+";margin-left:auto;font-size:13px}
.sum-rows[open] > summary::after{content:"\2212"}
.sum-rows > summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sum-grp{margin-bottom:8px;font-size:12px}
.sum-grp > b{display:block;color:var(--ink);font-size:12px;margin-bottom:3px}
.sum-hint{color:var(--mut);font-size:11.5px;margin-bottom:3px}
.sum-li{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;padding:2px 0}
.sum-cat{font-size:11px;font-weight:600;color:#3a4150}
.sum-sev{font-size:10px;font-weight:700;letter-spacing:.04em;color:var(--mut)}
.sum-what{color:#3a4150;font-size:11.5px}
.sum-nos{font:600 10.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--mut)}
.sum-grades{font-size:11.5px;color:var(--mut);border-top:1px solid rgba(26,115,232,.16);padding-top:6px}

/* "3 flags" — the count of findings this card speaks for. Amber rather than the
   accent: it is a caution that the row is standing in for more than itself, and
   the reviewer should open it before deciding the segment is done. */
.fdupe{flex:none;font-size:10.5px;font-weight:700;letter-spacing:.03em;color:#8a5a10;
  background:var(--amber-bg,#fdf3e0);border:1px solid #e8d9b0;border-radius:20px;padding:1px 8px;white-space:nowrap}
/* Which check found the finding. Quiet by design — it explains a pile, it is not
   a grade, and it must not compete with the severity chip beside it. */
.fsrc{flex:none;font-size:10.5px;color:var(--mut);background:#f6f7f9;border:1px solid var(--line2);
  border-radius:5px;padding:1px 7px;white-space:nowrap}

/* The other findings of a grouped problem, nested in the card that leads it.
   Indented behind a rail so it is visible that they are the same job, and given
   their own resolution bars because grouping here is presentation: the vault
   still holds each as its own record and each still resolves on its own. */
.ew-also{margin-top:9px;padding-top:8px;border-top:1px dashed var(--line)}
.also-head{font-size:11px;color:var(--mut);margin-bottom:6px}
.ew-sub{border-left:2px solid var(--line);padding:4px 0 4px 9px;margin-bottom:7px}
.ew-sub .ftop{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.ew-sub .sevchip{font-size:10px;padding:1px 6px}
.ew-sub .fissue{margin-top:4px;font-size:12px;white-space:pre-wrap}
.ew-sub .frec{margin-top:4px;font-size:12px}

/* Notes on a segment. Deliberately quieter than a finding card — no severity
   rail, no accent border: a note is a person talking, not a machine verdict, and
   the two must not read as the same kind of object in one column. */
.ew-note{border:1px solid var(--line);border-radius:6px;background:#fff;padding:7px 9px;margin-bottom:7px}
.ew-note-top{display:flex;align-items:center;gap:7px;font-size:11.5px;color:var(--mut)}
.ew-note-top b{color:var(--ink);font-size:12px}
.ew-note-top .ew-note-del{padding:0 6px;font-size:11.5px;line-height:1.6}
.ew-note-text{margin-top:4px;font-size:12.5px;color:var(--ink);white-space:pre-wrap;word-break:break-word}
#ew-note-add-row,[data-av="ew-note-add-row"]{margin-top:8px;display:flex;flex-direction:column;align-items:flex-start;gap:6px}
#ew-note-add-row textarea,[data-av="ew-note-add-row"] textarea{width:100%;box-sizing:border-box;font:inherit;font-size:13px;
  border:1px solid var(--line);border-radius:6px;padding:6px 8px;resize:vertical;min-height:46px}

/* ---- detached review regions (assets/popout.js) ----
   The placeholder is a one-line strip, not a pane: without these it would take a
   `flex:1` share of the column (`.docpane`'s rule does not reach it, but the
   default `flex:0 1 auto` still leaves it stretched to full width) or sit where a
   390px sidebar used to be. */
#doc-panes > .popout-slot,[data-av="doc-panes"] > .popout-slot{flex:none}
#docview > .popout-slot,[data-av="docview"] > .popout-slot{flex:none;align-self:flex-start;max-width:300px}
#filterbar .popout-group,[data-av="filterbar"] .popout-group{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
#filterbar .popout-group .lbl,[data-av="filterbar"] .popout-group .lbl{font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--mut)}
#filterbar .popout-group button,[data-av="filterbar"] .popout-group button{font:inherit;font-size:11.5px;padding:2px 8px;border:1px solid var(--line);
  border-radius:5px;background:#fff;cursor:pointer;color:var(--ink)}
#filterbar .popout-group button:hover,[data-av="filterbar"] .popout-group button:hover{background:#ececea;border-color:var(--mut)}
#filterbar .popout-group button.on,[data-av="filterbar"] .popout-group button.on{background:var(--accent-soft,#eaf1fb);border-color:var(--blue,#1a5fb4);color:var(--blue,#1a5fb4)}

/* ==========================================================================
   ONE LAYOUT, FIVE WIDTHS (Phase 3)

   Keyed off `#docview[data-w]`, which a ResizeObserver writes from the PANE's own
   width — not off a media query, which measures the window. A region detached
   into its own OS window and the two hosts' differing chrome both make the
   viewport a bad proxy for how much room the document actually has.

   The media query below stays as the floor for a browser without
   ResizeObserver: without `data-w` nothing above applies and this is what is
   left, which is the arrangement that shipped before Phase 3.
   ========================================================================== */
@media (max-width:820px){
  #topbar h1{display:none}
  #docview:not([data-w]),[data-av="docview"]:not([data-w]){flex-direction:column}
  #docview:not([data-w]) #edwin,[data-av="docview"]:not([data-w]) [data-av="edwin"]{width:auto;border-left:none;border-top:1px solid var(--line)}
}

/* -- wide / standard: the Inspector is a column beside the document -------- */
#docview[data-w="wide"] #edwin,[data-av="docview"][data-w="wide"] [data-av="edwin"]{width:400px}
#docview[data-w="standard"] #edwin,[data-av="docview"][data-w="standard"] [data-av="edwin"]{width:340px}
#docview[data-w="laptop"] #edwin,[data-av="docview"][data-w="laptop"] [data-av="edwin"]{width:300px}

/* -- the Inspector's own header ------------------------------------------- */
[data-av="av-inspbar"]{flex:none;position:sticky;top:0;z-index:4;background:#f2f5f9;
  border-bottom:1px solid var(--line)}
[data-av="av-inspbar"] .ib-toggle{display:flex;align-items:center;gap:8px;width:100%;
  font:inherit;font-size:12px;padding:6px 12px;border:0;background:none;color:var(--ink);
  cursor:pointer;text-align:left}
[data-av="av-inspbar"] .ib-toggle:disabled{cursor:default;color:var(--mut)}
[data-av="av-inspbar"] .ib-grip{display:none}
[data-av="av-inspbar"] .ib-label{font-weight:600;letter-spacing:.02em;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
[data-av="av-inspbar"] .ib-count{flex:none;font:800 10px/1.7 var(--sans,inherit);padding:0 7px;
  border-radius:20px;color:var(--amber);background:var(--amber-bg);border:1px solid #e6d4a6}
[data-av="av-inspbar"] .ib-count.hide{display:none}
[data-av="av-inspbar"] .ib-chev{margin-left:auto;color:var(--mut);font-size:12px}

/* -- any column folds to a rail, and keeps its count ------------------------
   On a 13" laptop the panel is the thing worth trading away, because the sentence
   is editable without it — but the fold is the reviewer's choice at every column
   width, not a band the layout picks for them. Folded it is still a control and
   still says how many findings it is hiding: a fold that hides the count makes the
   reviewer unfold it to learn there was nothing to unfold it for. */
/* `#docview[data-w="…"] #edwin` sets the column width and is (2,1,0); a bare
   `#edwin[data-folded]` is (1,1,0) and loses to it, so the fold set the attribute
   and changed nothing. Match on `#docview[data-w]` to outrank it. */
#docview[data-w] #edwin[data-folded],[data-av="docview"][data-w] [data-av="edwin"][data-folded]{width:38px;overflow:hidden}
#edwin[data-folded] .ew-sec,[data-av="edwin"][data-folded] .ew-sec{display:none}
#edwin[data-folded] [data-av="av-inspbar"],[data-av="edwin"][data-folded] [data-av="av-inspbar"]{border-bottom:0;background:none}
#edwin[data-folded] .ib-toggle,[data-av="edwin"][data-folded] .ib-toggle{flex-direction:column;gap:10px;padding:10px 4px}
#edwin[data-folded] .ib-label,[data-av="edwin"][data-folded] .ib-label{writing-mode:vertical-rl;font-size:10px;
  letter-spacing:.09em;text-transform:uppercase;color:var(--mut);max-height:170px}
#edwin[data-folded] .ib-chev,[data-av="edwin"][data-folded] .ib-chev{margin-left:0}

/* -- tablet / phone: the panel becomes a sheet across the foot -------------
   `position:absolute` inside #docview, not `fixed`: the surface can be detached
   into its own window, where `fixed` would anchor to that window's viewport and
   escape the pane entirely. --tms-kb-inset is the height an on-screen keyboard is
   covering, published by visualViewport — without it the sheet, and the Save on
   the strip above it, sit underneath the keyboard. */
#docview[data-w="tablet"],[data-av="docview"][data-w="tablet"],#docview[data-w="phone"],[data-av="docview"][data-w="phone"]{flex-direction:column;position:relative}
#docview[data-w="tablet"] .docpane.en,[data-av="docview"][data-w="tablet"] .docpane.en,#docview[data-w="phone"] .docpane.en,[data-av="docview"][data-w="phone"] .docpane.en{display:none}
#docview[data-w="tablet"] #edwin,[data-av="docview"][data-w="tablet"] [data-av="edwin"],#docview[data-w="phone"] #edwin,[data-av="docview"][data-w="phone"] [data-av="edwin"]{
  position:absolute;left:0;right:0;bottom:var(--tms-kb-inset,0px);z-index:6;width:auto;
  border-left:0;border-top:1px solid var(--line-firm,#c3c3bb);
  box-shadow:0 -4px 14px rgba(20,30,50,.13);
  max-height:100%;transition:height .16s ease}
#docview[data-w="tablet"] #edwin[data-sheet="peek"],[data-av="docview"][data-w="tablet"] [data-av="edwin"][data-sheet="peek"],#docview[data-w="phone"] #edwin[data-sheet="peek"],[data-av="docview"][data-w="phone"] [data-av="edwin"][data-sheet="peek"]{height:34px}
#docview[data-w="tablet"] #edwin[data-sheet="half"],[data-av="docview"][data-w="tablet"] [data-av="edwin"][data-sheet="half"],#docview[data-w="phone"] #edwin[data-sheet="half"],[data-av="docview"][data-w="phone"] [data-av="edwin"][data-sheet="half"]{height:46%}
#docview[data-w="tablet"] #edwin[data-sheet="full"],[data-av="docview"][data-w="tablet"] [data-av="edwin"][data-sheet="full"],#docview[data-w="phone"] #edwin[data-sheet="full"],[data-av="docview"][data-w="phone"] [data-av="edwin"][data-sheet="full"]{height:88%}
#docview[data-w="tablet"] [data-av="av-inspbar"] .ib-grip,[data-av="docview"][data-w="tablet"] [data-av="av-inspbar"] .ib-grip,#docview[data-w="phone"] [data-av="av-inspbar"] .ib-grip,[data-av="docview"][data-w="phone"] [data-av="av-inspbar"] .ib-grip{display:block;width:26px;height:3px;
  border-radius:3px;background:var(--line-firm,#c3c3bb);flex:none}
/* The document keeps room for the sheet's peek and for the keyboard, so the last
   sentence is never stranded underneath either. */
#docview[data-w="tablet"] #doc-panes,[data-av="docview"][data-w="tablet"] [data-av="doc-panes"],#docview[data-w="phone"] #doc-panes,[data-av="docview"][data-w="phone"] [data-av="doc-panes"]{
  padding-bottom:calc(34px + var(--tms-kb-inset,0px))}
/* Side by side needs width this does not have. The preference is KEPT — a
   reviewer who set columns on a desktop and then narrowed the window gets them
   back on widening — it is only overridden while the room is missing. */
#docview[data-w="tablet"] #doc-panes.cols,[data-av="docview"][data-w="tablet"] [data-av="doc-panes"].cols,#docview[data-w="phone"] #doc-panes.cols,[data-av="docview"][data-w="phone"] [data-av="doc-panes"].cols{
  flex-direction:column}
#docview[data-w="tablet"] #doc-panes.cols .av-pdiv,[data-av="docview"][data-w="tablet"] [data-av="doc-panes"].cols .av-pdiv,#docview[data-w="phone"] #doc-panes.cols .av-pdiv,[data-av="docview"][data-w="phone"] [data-av="doc-panes"].cols .av-pdiv{cursor:row-resize}
#docview[data-w="tablet"] #doc-panes.cols .docpane+.docpane,[data-av="docview"][data-w="tablet"] [data-av="doc-panes"].cols .docpane+.docpane,#docview[data-w="phone"] #doc-panes.cols .docpane+.docpane,[data-av="docview"][data-w="phone"] [data-av="doc-panes"].cols .docpane+.docpane{
  border-left:0;border-top:1px solid var(--line)}
@media (prefers-reduced-motion:reduce){
  #docview[data-w="tablet"] #edwin,[data-av="docview"][data-w="tablet"] [data-av="edwin"],#docview[data-w="phone"] #edwin,[data-av="docview"][data-w="phone"] [data-av="edwin"]{transition:none}
}

/* -- phone: one column, and the strip carries what the panes gave up ------- */
#docview[data-w="phone"] .docpane h3,[data-av="docview"][data-w="phone"] .docpane h3{display:none}
#docview[data-w="phone"] .docpane,[data-av="docview"][data-w="phone"] .docpane{padding-left:12px;padding-right:12px}
#docview[data-w="phone"] [data-av="av-segbar"],[data-av="docview"][data-w="phone"] [data-av="av-segbar"]{margin-left:-12px;margin-right:-12px;padding:6px 12px}

/* The original, in the strip, for the widths that gave up its pane. */
[data-av="av-segbar"] .sb-orig{flex:0 0 100%;display:flex;gap:7px;align-items:baseline;
  font-size:12px;line-height:1.45;color:var(--mut);cursor:pointer;
  border-bottom:1px dashed var(--line);padding-bottom:5px;margin-bottom:2px}
[data-av="av-segbar"] .sb-orig.hide{display:none}
[data-av="av-segbar"] .sb-orig .t{flex:none;font:600 9px/1.6 inherit;letter-spacing:.09em;
  text-transform:uppercase;color:var(--mut)}
[data-av="av-segbar"] .sb-orig-text{color:var(--ink);overflow:hidden;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
[data-av="av-segbar"] .sb-orig.open .sb-orig-text{-webkit-line-clamp:none;display:block}

/* -- short: a landscape phone has no vertical room to spend --------------- */
#docview[data-h="short"][data-w="tablet"] #edwin[data-sheet="full"],[data-av="docview"][data-h="short"][data-w="tablet"] [data-av="edwin"][data-sheet="full"],#docview[data-h="short"][data-w="phone"] #edwin[data-sheet="full"],[data-av="docview"][data-h="short"][data-w="phone"] [data-av="edwin"][data-sheet="full"]{height:94%}
#docview[data-h="short"] .docpane h3,[data-av="docview"][data-h="short"] .docpane h3{display:none}
#docview[data-h="short"][data-w="phone"] [data-av="av-segbar"] .sb-orig,[data-av="docview"][data-h="short"][data-w="phone"] [data-av="av-segbar"] .sb-orig{display:none}
#docview[data-h="short"] [data-av="av-segbar"],[data-av="docview"][data-h="short"] [data-av="av-segbar"]{padding-top:4px;padding-bottom:4px}
#docview[data-h="short"] [data-av="av-segbar"] [data-av="sb-astext"],[data-av="docview"][data-h="short"] [data-av="av-segbar"] [data-av="sb-astext"]{font-size:0;padding:3px 8px}
#docview[data-h="short"] [data-av="av-segbar"] [data-av="sb-astext"]::after,[data-av="docview"][data-h="short"] [data-av="av-segbar"] [data-av="sb-astext"]::after{content:"⇥";font-size:12.5px}

/* ---------------- BT-engine (two-register) finding cards ---------------- */
/* Tier chips: evidence-language, not severity. Distinct from the MAP sevchip
   palette so the two vocabularies cannot be misread as one scale. */
.bt-tierchip{display:inline-block;padding:1px 7px;border-radius:9px;font-size:10.5px;
  font-weight:700;letter-spacing:.4px;border:1px solid}
.bt-tierchip.bt-likely{color:#7c2d12;background:#fff3ea;border-color:#f3c9ad}
.bt-tierchip.bt-probable{color:#1e4c8f;background:#eef4fd;border-color:#c4d8f4}
.bt-tierchip.bt-possible{color:#4b5563;background:#f4f5f7;border-color:#dcdfe4}
/* Judge-agreement confidence: the COUNTED grade, and the one a reviewer reads in
   the list. Four rungs — 1 agreeing reader = LOW, 2 = MEDIUM, 3-4 = HIGH, 5+ =
   VERY HIGH. Deliberately warmer and heavier than the tier chips it replaces, and
   still outside the MAP severity palette so the two scales stay distinguishable
   in a 'both'-engine list where the word HIGH appears on each. */
.bt-confchip{display:inline-block;padding:1px 7px;border-radius:9px;font-size:10.5px;
  font-weight:700;letter-spacing:.4px;border:1px solid;white-space:nowrap}
.bt-confchip.conf-very_high{color:#7f1d1d;background:#f9e3e3;border-color:#e8b9b9}
.bt-confchip.conf-high{color:#b3261e;background:#fdeaea;border-color:#f3c2c2}
.bt-confchip.conf-medium{color:#e07020;background:#fdf0e4;border-color:#f0cfae}
.bt-confchip.conf-low{color:#c2a200;background:#fbf6df;border-color:#e6d9a0}
/* Not counted from the readers — the band came from a fallback. Marked rather
   than hidden: a grade that was inferred must not read as one that was measured. */
.conf-est{font-weight:700;opacity:.75;margin-left:1px}
/* The engine's own tier claimed a different number of agreeing readers than the
   judges actually returned. Measured at 37% of findings, so it is a marker, not
   an alarm — the counted band is what the chip shows. */
.conf-clash{margin-left:3px;font-size:11px;color:#9a6b00;cursor:help}
.bt-evidence-clash{color:#9a6b00}
.bt-track{display:inline-block;padding:1px 7px;border-radius:9px;font-size:10.5px;
  font-weight:700;letter-spacing:.4px;color:#5b3fa8;background:#f4f0fc;border:1px solid #ddd0f2}
.bt-class{display:inline-block;padding:1px 6px;border-radius:4px;font-size:10.5px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#334155;background:#f1f5f9;border:1px solid #dbe3ec}
.bt-xseg{display:inline-block;padding:1px 6px;border-radius:9px;font-size:10.5px;
  color:#0f5c5a;background:#ecf8f7;border:1px solid #c8e8e6}
/* The technical headline: one expert line, monospace — the consultant's index
   line. The plain block below serves the translator. */
.bt-tech{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12px;line-height:1.5;color:#1f2937;background:#f8fafc;
  border-left:3px solid #cbd5e1;padding:6px 9px;border-radius:0 4px 4px 0;margin:6px 0 4px}
.bt-evidence{font-size:11.5px;margin:2px 0}
.bt-plain{margin:6px 0;border:1px solid #e5e9ef;border-radius:6px;padding:0}
.bt-plain summary{cursor:pointer;padding:7px 10px;font-weight:600;font-size:13px}
.bt-plain[open] summary{border-bottom:1px solid #eef1f5}
.bt-plain .bt-row{padding:4px 12px}
.bt-row{font-size:12.5px;line-height:1.5}
.bt-words{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}
/* The parity hedge stays visible by default — it labels the decision the
   translator is making, not a second-class finding. */
.bt-parity{font-size:12px;color:#634d1f;background:#fdf8ec;border:1px solid #f1e4bd;
  border-radius:5px;padding:5px 9px;margin:5px 0}
/* "May be quoting a Bible" (avScriptureNote): the same quiet caution as the
   parity note, in blue so the two read as different advice. */
.f-scripture-note{font-size:12px;color:#1f4a63;background:#eef6fb;border:1px solid #c9e1ee;
  border-radius:5px;padding:5px 9px;margin:5px 0}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .f-scripture-note{color:#a9d3ec;background:#13242e;border-color:#27485a}
}
:root[data-theme="dark"] .f-scripture-note{color:#a9d3ec;background:#13242e;border-color:#27485a}
/* The theology track's reading of the same divergence (avTheologyNote): a
   violet panel, so it reads as the doctrinal consequence of this card rather
   than as a caution about it. */
.f-theology-note{font-size:12px;color:#3f2a63;background:#f4effb;border:1px solid #ddd0ef;
  border-radius:5px;padding:5px 9px;margin:5px 0}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .f-theology-note{color:#cfc0ec;background:#211a2e;border-color:#3d3157}
}
:root[data-theme="dark"] .f-theology-note{color:#cfc0ec;background:#211a2e;border-color:#3d3157}
.bt-caveat{display:inline-block;margin:3px 6px 3px 0;padding:1px 7px;border-radius:9px;
  font-size:10.5px;font-weight:600;color:#8a3b12;background:#fdf1e7;border:1px solid #f0d4bb;
  cursor:help}
/* Two result sets, visibly separated */
.f-section{margin:14px 0 6px;padding:6px 10px;font-weight:700;font-size:12.5px;
  letter-spacing:.3px;color:#5b3fa8;background:#f4f0fc;border:1px solid #ddd0f2;border-radius:6px}
.bt-summary{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 10px;
  padding:8px 10px;background:#fbfcfe;border:1px solid #e5e9ef;border-radius:6px}
.bt-count{font-size:11.5px;color:#475569;white-space:nowrap}
.bt-sep{width:1px;height:16px;background:#dde3ea;margin:0 4px}
.sa-f.bt-theo{border-left:3px solid #ddd0f2}

/* Duplication, said out loud on the stat line, with the offer to fix it beside
   it. Amber like the "N flags" chip and for the same reason: it is a caution
   about the total next to it, not a grade. */
.a-dupes{color:#8a5a10;font-weight:600}
#a-recluster{padding:1px 8px;font-size:11.5px;vertical-align:1px}
/* ---- hybrid corroboration: the cross-engine axis ------------------------ */
/* Green, deliberately outside both grading palettes (MAP amber/red severity,
   BT warm confidence). It is not a third grade competing with those two — it
   answers a different question, "did a second detector see this too", and a
   reader has to be able to tell at a glance that it is a different kind of
   statement. Only the hybrid engine emits it. */
.corrob-chip{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:9px;
  font-size:10px;font-weight:700;letter-spacing:.4px;border:1px solid;white-space:nowrap}
.corrob-chip.corrob-confirmed{color:#14532d;background:#e7f6ec;border-color:#b3ddc2}
.corrob-chip.corrob-strong{color:#166534;background:#eef8f1;border-color:#c3e3ce}
.corrob-chip.corrob-corroborated{color:#3f6212;background:#f4f7ea;border-color:#d5e3b8}
.corrob-chip.corrob-single_source{color:#6b7280;background:#f4f5f7;border-color:#dcdfe4}
/* Nobody blind-read this sentence, so there is no second opinion either way.
   Silence, never agreement — the same rule the BT panel applies to a missing
   protocol, held across engines. */
.corrob-unseen{margin-left:2px;font-size:11px;color:#9a6b00;cursor:help}

/* A published audit that never reached the model reads "0 findings", which is
   exactly what a clean document reads. This is the only thing separating the
   two for a reviewer, so it is sized to be crossed rather than skimmed past --
   and coloured from the existing token set so it holds in both themes. */
#av-degraded{
  padding:10px 18px;
  background:#fdf1e3;
  color:#7a4a06;
  border-bottom:1px solid #e8c99a;
  font-size:13px;
  line-height:1.45;
}
#av-degraded b{font-weight:600}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) #av-degraded{
    background:#2e2413; color:#e8c07a; border-bottom-color:#4a3a1c;
  }
}
:root[data-theme="dark"] #av-degraded{
  background:#2e2413; color:#e8c07a; border-bottom-color:#4a3a1c;
}

/* ===== step 5 — suggested rewording ======================================
   VISUALLY UNLIKE EVERYTHING ELSE IN THE PANE, on purpose. Every other block
   here reports what the audit found; this one carries wording the tool wrote
   itself, and the only measurement of wording like it says 2 of 40 such repairs
   made correct text wrong. A reviewer who cannot tell this apart at a glance
   from a finding will read it as one.

   Amber, the same family the pane already uses for "this is contested"
   (`.sum-split`), rather than a new colour: the message is the same kind of
   message. Collapsed by default, because it is advice and not the audit. */
.rec-block{margin:0 0 10px;border:1px solid #e2c58a;border-radius:4px;
  background:#fffaf0}
.rec-block > summary{cursor:pointer;list-style:none;padding:7px 10px;
  display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rec-block > summary::-webkit-details-marker{display:none}
.rec-block > summary::after{content:"+";margin-left:auto;font-size:13px;color:#8a5a12}
.rec-block[open] > summary::after{content:"\2212"}
.rec-block > summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.rec-pill{font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:#6b430c;background:#f5e3bf;border-radius:3px;padding:2px 7px}
.rec-warn{font-size:11px;color:#8a5a12}
.rec-body{padding:0 10px 10px}
/* THE CLAIM COMES FIRST AND IS BOXED. Both damaging repairs in the measurement
   kept a word's flavour and dropped the sentence's claim, so this is the line a
   reviewer checks before reading any new wording. */
.rec-keeps{font-size:12px;line-height:1.5;color:#3a2d14;background:#f7edd8;
  border-radius:4px;padding:7px 9px;margin-bottom:9px}
.rec-keeps > b{display:block;font-size:10.5px;letter-spacing:.03em;
  text-transform:uppercase;color:#6b430c;margin-bottom:3px}
/* The rewrite itself. NO Insert control anywhere near it — a reviewer retypes
   what they agree with, which is the friction the evidence asks for. */
.rec-text{font-size:13.5px;line-height:1.65;color:var(--ink);background:#fff;
  border:1px solid #ead9b4;border-radius:4px;padding:9px 11px;margin-bottom:9px;
  white-space:pre-wrap}
.rec-why{font-size:12px;line-height:1.55;color:var(--ink);margin-bottom:9px}
.rec-declined{font-size:12.5px;line-height:1.55;color:#6b430c}
.rec-changes,.rec-dismiss{font-size:12px;margin-bottom:4px}
.rec-changes > b,.rec-dismiss > b{display:block;font-size:11px;color:#6b430c;margin-bottom:4px}
.rec-chg{padding:5px 0;border-top:1px solid #f0e2c6}
.rec-from{color:#8a3a2a;text-decoration:line-through}
.rec-arrow{font-size:10.5px;color:var(--mut);margin:0 6px}
.rec-to{color:#1f6b3a;font-weight:600}
.rec-chgwhy{font-size:11.5px;color:var(--mut);line-height:1.5;margin-top:2px}
.rec-dis{padding:4px 0;font-size:11.5px;line-height:1.5;color:var(--ink)}

/* Dark, both switch states, same pattern `#av-degraded` above uses: the amber
   has to survive the theme or the one block a reviewer must not mistake for a
   finding becomes the one block that looks like every other. */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .rec-block{background:#241d10;border-color:#4a3a1c}
  :root:not([data-theme="light"]) .rec-pill{background:#3d2f14;color:#e8c07a}
  :root:not([data-theme="light"]) .rec-warn,
  :root:not([data-theme="light"]) .rec-declined,
  :root:not([data-theme="light"]) .rec-block > summary::after,
  :root:not([data-theme="light"]) .rec-changes > b,
  :root:not([data-theme="light"]) .rec-dismiss > b,
  :root:not([data-theme="light"]) .rec-keeps > b{color:#e8c07a}
  :root:not([data-theme="light"]) .rec-keeps{background:#2e2413;color:#ecdcc0}
  :root:not([data-theme="light"]) .rec-text{background:#1a1a1c;border-color:#4a3a1c}
  :root:not([data-theme="light"]) .rec-chg{border-top-color:#3d2f14}
  :root:not([data-theme="light"]) .rec-from{color:#e4776c}
  :root:not([data-theme="light"]) .rec-to{color:#7fc79a}
}
:root[data-theme="dark"] .rec-block{background:#241d10;border-color:#4a3a1c}
:root[data-theme="dark"] .rec-pill{background:#3d2f14;color:#e8c07a}
:root[data-theme="dark"] .rec-warn,
:root[data-theme="dark"] .rec-declined,
:root[data-theme="dark"] .rec-block > summary::after,
:root[data-theme="dark"] .rec-changes > b,
:root[data-theme="dark"] .rec-dismiss > b,
:root[data-theme="dark"] .rec-keeps > b{color:#e8c07a}
:root[data-theme="dark"] .rec-keeps{background:#2e2413;color:#ecdcc0}
:root[data-theme="dark"] .rec-text{background:#1a1a1c;border-color:#4a3a1c}
:root[data-theme="dark"] .rec-chg{border-top-color:#3d2f14}
:root[data-theme="dark"] .rec-from{color:#e4776c}
:root[data-theme="dark"] .rec-to{color:#7fc79a}

/* ---------------- THE FACES A PAGE IS ACTUALLY DRAWN IN --------------------

   WHY A WEB APP IS SHIPPING FONTS AT ALL. The page view puts a `contenteditable`
   over a picture of the page, and the two have to agree about how wide a word is
   — that is the whole premise. The picture is drawn by LibreOffice on the
   converter; the editor is drawn by the reviewer's browser; and neither side was
   ever told which typeface the other used.

   A .docx NAMES a font, it does not carry one. Measured on a real page in this
   repo, declared Times New Roman 12 pt: the converter had no Times New Roman and
   drew it in DejaVu Serif — x-height 6.24 pt against Times' 5.38, and words 27.8
   per cent wider. The editor then set the same sentence in real Times New Roman,
   which is 22 per cent short of the line the page had measured, and the justifier
   put the difference into word gaps 3.7x a normal space. Reported as trailing
   white space and as the rendered text looking too big; one cause, two symptoms.

   THESE ARE METRIC CLONES, NOT LOOKALIKES. Liberation is drawn to the same
   advance widths as the Microsoft core fonts, glyph for glyph, so a line set in
   Liberation Serif breaks exactly where Times New Roman breaks it. That is the
   property being shipped — a face that merely LOOKED similar would be worse than
   useless here, because it would look right and measure wrong.

   DejaVu is here for the other half: it is what fontconfig falls through to when
   nothing better is installed, so it is the face a page gets whenever the document
   names something nobody has. Shipping it lets the editor match that page exactly
   instead of estimating it.

   `font-display:swap` and no preload: none of this is fetched unless a document
   actually names a family that maps here. A reviewer whose documents are all in
   fonts they already have downloads none of it. */
@font-face{font-family:'TMS Liberation Serif';font-style:normal;font-weight:400;
  font-display:swap;src:url(vendor/fonts/LiberationSerif-Regular.woff2) format('woff2')}
@font-face{font-family:'TMS Liberation Serif';font-style:normal;font-weight:700;
  font-display:swap;src:url(vendor/fonts/LiberationSerif-Bold.woff2) format('woff2')}
@font-face{font-family:'TMS Liberation Serif';font-style:italic;font-weight:400;
  font-display:swap;src:url(vendor/fonts/LiberationSerif-Italic.woff2) format('woff2')}
@font-face{font-family:'TMS Liberation Serif';font-style:italic;font-weight:700;
  font-display:swap;src:url(vendor/fonts/LiberationSerif-BoldItalic.woff2) format('woff2')}
@font-face{font-family:'TMS Liberation Sans';font-style:normal;font-weight:400;
  font-display:swap;src:url(vendor/fonts/LiberationSans-Regular.woff2) format('woff2')}
@font-face{font-family:'TMS Liberation Sans';font-style:normal;font-weight:700;
  font-display:swap;src:url(vendor/fonts/LiberationSans-Bold.woff2) format('woff2')}
@font-face{font-family:'TMS Liberation Sans';font-style:italic;font-weight:400;
  font-display:swap;src:url(vendor/fonts/LiberationSans-Italic.woff2) format('woff2')}
@font-face{font-family:'TMS Liberation Sans';font-style:italic;font-weight:700;
  font-display:swap;src:url(vendor/fonts/LiberationSans-BoldItalic.woff2) format('woff2')}
@font-face{font-family:'TMS DejaVu Serif';font-style:normal;font-weight:400;
  font-display:swap;src:url(vendor/fonts/DejaVuSerif.woff2) format('woff2')}
@font-face{font-family:'TMS DejaVu Serif';font-style:normal;font-weight:700;
  font-display:swap;src:url(vendor/fonts/DejaVuSerif-Bold.woff2) format('woff2')}
@font-face{font-family:'TMS DejaVu Sans';font-style:normal;font-weight:400;
  font-display:swap;src:url(vendor/fonts/DejaVuSans.woff2) format('woff2')}
@font-face{font-family:'TMS DejaVu Sans';font-style:normal;font-weight:700;
  font-display:swap;src:url(vendor/fonts/DejaVuSans-Bold.woff2) format('woff2')}

/* A REFUSED RESOLVE, SAID NEXT TO THE CONTROL THAT WAS PRESSED — not in an
   alert(). It sits in `ew-nav` beside the Resolve button, is an aria-live
   region, and is hidden until there is something to say. Amber by default
   because most refusals are somebody else having got there first, which is not
   an error; `.bad` is the same sentence when the write genuinely failed. */
[data-av="ew-resolve-msg"]{
  display:block; flex-basis:100%; margin:6px 0 0;
  font:600 11.5px/1.45 var(--sans, system-ui, sans-serif);
  color:#8a6d1f; background:#fdf6e3; border:1px solid #e8d9a8;
  border-radius:6px; padding:5px 8px;
}
[data-av="ew-resolve-msg"][hidden]{ display:none }
[data-av="ew-resolve-msg"].bad{ color:#8a1f1f; background:#fdf0f0; border-color:#e8b4b4 }

/* THE GUEST'S FIVE-PAGE WALL (owner, 2026-09-20). Drawn at the foot of the last
   page a guest was sent, in the pane's own scroll rather than inside the render's
   iframe — the frame is sized to its content, so a sibling below it lands where the
   document ends. Modelled on `.doc-empty` above, which is the tree's existing
   answer to "this pane is not showing you a document, and here is why": same
   measure, same prose weight. Warmer than that one on purpose, because this state
   is a thing the reader can act on and an empty pane is not. */
.guest-wall{max-width:46em;margin:22px auto 30px;padding:14px 18px;
  border:1px solid #e8d9b0;border-radius:8px;background:#fdf3e0;
  font-size:13.5px;line-height:1.65;color:#5a4a28}
.guest-wall b{color:#3f3526}
.guest-wall a{color:var(--blue);font-weight:600;text-decoration:none}
.guest-wall a:hover{text-decoration:underline}

/* ---------------- ③ THE DECISION ON A SENTENCE -----------------------------

   Sits under the nav row, above the issues. In ③ Audit it appears only on a
   sentence with no issues (a flagged one is answered through Resolve); in a
   review round it appears on every sentence. The two buttons are a pair of
   equals until the wording moves: then Accept greys — it would be a false
   record — and Changed takes the ring, because it is now the next thing to do. */
#edwin .ew-decide,[data-av="edwin"] .ew-decide{background:#fbfcfe}
.ew-decide h4,.ew-prior h4{display:flex;align-items:center;gap:8px}
.dec-round{font:600 10.5px/1.7 -apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.02em;
  text-transform:none;color:#1a5fb4;background:#eaf2fb;border:1px solid #cfe0f5;border-radius:10px;padding:0 8px}
.dec-lead{margin:2px 0 10px;font-size:12.5px;line-height:1.5;color:#3a4150}
.dec-btns{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.dec-btns button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 10px;
  font:inherit;font-size:13px;font-weight:600;border-radius:7px;cursor:pointer;white-space:nowrap}
.dec-acc{background:var(--green-bg,#e6f6e6);color:#14622c;border:1px solid var(--green,#1e8e3e)}
.dec-chg{background:#fdf3e0;color:#6b4a0c;border:1px solid #d9a441}
.dec-btns button.is-primary{box-shadow:0 0 0 3px rgba(217,164,65,.22)}
.dec-btns button:hover:not(:disabled){filter:brightness(.97)}
.dec-btns button:focus-visible{outline:3px solid var(--blue,#1a5fb4);outline-offset:2px}
.dec-btns button:disabled{background:#f1f3f6;color:#9aa1ab;border-color:#dfe2e7;cursor:default;box-shadow:none;filter:none}
.dec-btns kbd{font:600 10px/1 ui-monospace,Menlo,monospace;border:1px solid currentColor;border-radius:4px;padding:2px 4px;opacity:.55}
.dec-hint{margin:8px 0 0;font-size:11.5px;line-height:1.45;color:var(--mut,#666)}
.dec-hint.warn{color:#7a5510}
.fresolved.dec-settled.is-changed{background:#fdf6e7;border-color:#ecdaae;color:#5a3f08}
.fresolved.dec-pending{background:#fff8ec;border-color:#e9c98b;color:#6b4a0c;margin:0 0 8px}
.dec-diff{margin-top:9px;border:1px solid var(--line,#d8d8d8);border-radius:6px;background:var(--bg,#fff);
  font-size:12.5px;line-height:1.55}
.dec-drow{display:grid;grid-template-columns:78px 1fr;gap:8px;padding:6px 9px}
.dec-drow + .dec-drow{border-top:1px dashed var(--line,#d8d8d8)}
.dec-dlbl{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--mut,#666);padding-top:3px}
.dec-dval{min-width:0;overflow-wrap:anywhere}
.dec-diff del{background:#fde8e8;color:#9b2c20;text-decoration:line-through;
  text-decoration-color:rgba(155,44,32,.55);border-radius:3px;padding:0 2px}
.dec-diff ins{background:#e3f4e5;color:#14622c;text-decoration:none;border-radius:3px;padding:0 2px;font-weight:600}
.dec-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px;font-size:11.5px;color:#5b6472}
.dec-chip{font:600 11px/1.6 -apple-system,Segoe UI,Roboto,Arial,sans-serif;padding:0 8px;border-radius:10px;
  background:#fdf3e0;color:#6b4a0c;border:1px solid #ecdaae;white-space:nowrap}
.dec-chip.blue{background:#eaf2fb;color:#1a5fb4;border-color:#cfe0f5}
.dec-chip.green{background:#e6f6e6;color:#14622c;border-color:#bfe3c4}
.dec-note{margin-top:7px;font-size:11.5px;line-height:1.5;color:#4d5561;white-space:pre-wrap}
.dec-note b{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--mut,#666);margin-right:5px}
.ew-prior h4 + .dec-diff{margin-top:4px}
.ew-prior h4:not(:first-child){margin-top:12px}

@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) #edwin .ew-decide{background:transparent}
  :root:not([data-theme="light"]) .dec-lead{color:var(--ink)}
  :root:not([data-theme="light"]) .dec-round,
  :root:not([data-theme="light"]) .dec-chip.blue{background:#16263b;border-color:#2a4466;color:#8fb8ea}
  :root:not([data-theme="light"]) .dec-chg,
  :root:not([data-theme="light"]) .dec-chip,
  :root:not([data-theme="light"]) .fresolved.dec-settled.is-changed,
  :root:not([data-theme="light"]) .fresolved.dec-pending{background:#2e2413;border-color:#5a4520;color:#e8c07a}
  :root:not([data-theme="light"]) .dec-btns button:disabled{background:#232428;border-color:#34363b;color:#6d727a}
  :root:not([data-theme="light"]) .dec-diff del{background:#3a1c1a;color:#e4776c}
  :root:not([data-theme="light"]) .dec-diff ins{background:#16301f;color:#7fc79a}
  :root:not([data-theme="light"]) .dec-hint.warn{color:#e8c07a}
  :root:not([data-theme="light"]) .dec-note,
  :root:not([data-theme="light"]) .dec-meta{color:var(--mut)}
}
:root[data-theme="dark"] #edwin .ew-decide{background:transparent}
:root[data-theme="dark"] .dec-lead{color:var(--ink)}
:root[data-theme="dark"] .dec-round,
:root[data-theme="dark"] .dec-chip.blue{background:#16263b;border-color:#2a4466;color:#8fb8ea}
:root[data-theme="dark"] .dec-chg,
:root[data-theme="dark"] .dec-chip,
:root[data-theme="dark"] .fresolved.dec-settled.is-changed,
:root[data-theme="dark"] .fresolved.dec-pending{background:#2e2413;border-color:#5a4520;color:#e8c07a}
:root[data-theme="dark"] .dec-btns button:disabled{background:#232428;border-color:#34363b;color:#6d727a}
:root[data-theme="dark"] .dec-diff del{background:#3a1c1a;color:#e4776c}
:root[data-theme="dark"] .dec-diff ins{background:#16301f;color:#7fc79a}
:root[data-theme="dark"] .dec-hint.warn{color:#e8c07a}
:root[data-theme="dark"] .dec-note,
:root[data-theme="dark"] .dec-meta{color:var(--mut)}
