/* ============================================================================
   MTMS design system (M2 / WP3) — ported from the Claude Design handoff
   (inline-mtms-design-reference/design_handoff_mtms_webapp/styles.css).
   The handoff CSS is the canonical visual source; it ports near-verbatim.
   Tokens, the app frame, top bar, sidebar (incl. expandable nav), and the
   list/reference views live here. The IGI indigo theme is the M2 design
   system; the official Inline brand-palette pass is deferred (open-questions).
   Blazor boot/error UI is appended at the end, retinted to the accent.
   ============================================================================ */
:root{
  --accent:#4b54c6; --accent-ink:#fff;
  --rail:#2b2d3c; --rail-2:#34374a; --rail-ink:#aeb3c7;
  --bg:#eceef3; --surface:#fff; --surface-2:#f7f8fb; --surface-3:#f1f3f8;
  --ink:#1d2130; --ink-2:#565d72; --muted:#8b91a4;
  --line:#e3e6ee; --line-2:#edeff5;
  --calc-bg:#f2f4fa;
  --pass:#1f7a52; --pass-bg:#e7f3ec; --pass-line:#bfe0cd;
  --fail:#c0392b; --fail-bg:#fbeae8; --fail-line:#eecac4;
  --req:#b45309; --req-bg:#fdf4e8; --req-line:#f0d9b5;
  --r:8px; --r-sm:6px;
  --font:'IBM Plex Sans',system-ui,-apple-system,sans-serif;
  --mono:'IBM Plex Mono',ui-monospace,monospace;
  --row-h:34px; --pad:16px; --fs:13px;
}
html[data-density="compact"]{ --row-h:28px; --pad:11px; --fs:12px; }

*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; }
body{ font-family:var(--font); color:var(--ink); background:var(--bg); font-size:var(--fs);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
button{ font-family:inherit; cursor:pointer; }
a{ color:inherit; }
.mono{ font-family:var(--mono); font-feature-settings:"tnum" 1; }
::-webkit-scrollbar{ width:11px; height:11px; }
::-webkit-scrollbar-thumb{ background:#c4c9d6; border-radius:6px; border:3px solid transparent; background-clip:content-box; }
.ws-content ::-webkit-scrollbar-thumb{ background:#cfd4e0; border-radius:6px; border:3px solid transparent; background-clip:content-box; }
h1:focus,h2:focus,h3:focus{ outline:none; }

/* ---------- app frame ---------- */
.app-root{ display:flex; flex-direction:column; height:100vh; overflow:hidden; background:var(--bg); }
.ws-main{ flex:1; display:flex; flex-direction:column; min-width:0; background:var(--bg); }

/* ---------- top bar ---------- */
.ws-topbar{ height:48px; background:var(--surface); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:12px; padding:0 14px; flex-shrink:0; }
.ws-burger{ display:none; border:0; background:transparent; color:var(--ink-2); padding:6px; border-radius:6px; }
.ws-burger:hover{ background:var(--surface-3); }
.ws-tab{ display:flex; align-items:center; gap:8px; font-weight:600; color:var(--ink); border:0; background:transparent; padding:0; }
.ws-app-glyph{ width:26px; height:26px; border-radius:7px; background:var(--accent); color:#fff;
  display:grid; place-items:center; font-weight:700; font-size:11px; letter-spacing:.01em; }
.ws-app-glyph.sm{ width:22px; height:22px; font-size:9px; }
.ws-tab-name{ font-size:13px; }
.ws-host-pill{ font-size:9.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  color:var(--ink-2); background:var(--surface-3); border:1px solid var(--line); padding:2px 7px; border-radius:20px; }
.ws-search{ flex:1; max-width:520px; margin:0 auto; display:flex; align-items:center; gap:8px;
  background:var(--surface-3); border:1px solid var(--line); border-radius:7px; padding:6px 11px; color:var(--muted); }
.ws-search input{ border:0; background:transparent; outline:none; flex:1; font-family:inherit; font-size:12.5px; color:var(--ink); }
/* App-chrome report search dropdown (ChromeSearch, M4). Roughly half-page wide so the table-style rows
   (reused from My Reports / Find) don't feel squished. */
.ws-search-wrap{ flex:1; max-width:56rem; margin:0 auto; position:relative; }
.ws-search-wrap .ws-search{ flex:none; max-width:none; margin:0; width:100%; }
.ws-search-wrap .ws-search:focus-within{ border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.ws-search-menu{ position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:50; background:var(--surface);
  border:1px solid var(--line); border-radius:9px; box-shadow:0 10px 28px rgba(0,0,0,.14); overflow:hidden; }
.ws-search-empty{ padding:12px 14px; font-size:12.5px; color:var(--muted); }
/* Bespoke result row: familiar atoms (type icon, stacked id/type + name/number, status chip), trimmed
   to id · project · area-over-tech · date · status so it doesn't squish at the dropdown width. */
.ws-search-results{ display:flex; flex-direction:column; }
.ws-result{ display:flex; align-items:center; gap:16px; width:100%; border:0; border-bottom:1px solid var(--line);
  background:transparent; cursor:pointer; padding:10px 14px; text-align:left; }
.ws-result:last-child{ border-bottom:0; }
.ws-result:hover{ background:var(--surface-3); }
.ws-result .lv-type-ic{ flex:0 0 auto; }
/* Fixed basis (not auto): a long report number must not grow the column and shove the next column right —
   every row's report-id column is the same width so Area/Location lines up as a clean column. An unusually
   long number ellipsizes with a full-text title. Shared by the chrome search and the DFR packaged-reports
   picker. */
.ws-result-id{ flex:0 0 12rem; min-width:0; }
.ws-result-id strong{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ws-result-col{ flex:1 1 0; min-width:0; }
.ws-result-col strong, .ws-result-col em{ display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ws-result-date{ flex:0 0 auto; font-size:12px; color:var(--ink-2); }
.ws-result .lv-status{ flex:0 0 auto; }
.ws-search-more{ width:100%; border:0; border-top:1px solid var(--line); background:transparent; cursor:pointer;
  padding:9px 14px; text-align:left; font-size:12.5px; font-weight:600; color:var(--accent); }
.ws-search-more:hover{ background:var(--surface-3); }
.ws-top-right{ display:flex; align-items:center; gap:10px; }
.ws-icobtn{ border:0; background:transparent; color:var(--ink-2); padding:6px; border-radius:6px; display:grid; place-items:center; }
.ws-icobtn:hover{ background:var(--surface-3); }
.ws-avatar{ width:30px; height:30px; border-radius:50%; background:#7a8195; color:#fff; font-size:11px; font-weight:600;
  display:grid; place-items:center; position:relative; flex-shrink:0; }

/* ---------- content split ---------- */
.ws-content{ flex:1; display:flex; min-height:0; position:relative; }

/* ---------- app sidebar ---------- */
.app-sidebar{ width:250px; background:var(--surface); border-right:1px solid var(--line);
  display:flex; flex-direction:column; padding:14px 12px; flex-shrink:0; overflow-y:auto; overflow-x:hidden;
  transition:width .2s ease, padding .2s ease; }
.as-head{ display:flex; align-items:center; gap:8px; padding:2px 4px 12px; }
.as-logo{ display:flex; align-items:center; gap:8px; flex:1; min-width:0; border:0; background:transparent; padding:0; text-align:left; }
.as-logo-mark{ width:28px; height:28px; border-radius:8px; background:var(--accent); color:#fff;
  font-weight:700; font-size:11px; letter-spacing:.01em; display:grid; place-items:center; flex-shrink:0; }
.as-logo-text{ display:flex; flex-direction:column; line-height:1.2; min-width:0; }
.as-logo-text strong{ font-size:13px; font-weight:700; letter-spacing:.01em; }
.as-logo-text em{ font-style:normal; font-size:10px; color:var(--muted); }
.as-mark{ display:none; width:34px; height:34px; border-radius:9px; background:var(--accent); color:#fff;
  font-weight:700; font-size:12px; letter-spacing:.01em; place-items:center; flex-shrink:0; }
.as-collapse{ border:0; background:transparent; color:var(--muted); padding:5px; border-radius:6px;
  display:grid; place-items:center; cursor:pointer; flex-shrink:0; }
.as-collapse:hover{ background:var(--surface-3); color:var(--ink); }
.as-group-label{ font-size:10.5px; font-weight:600; letter-spacing:.07em; text-transform:uppercase; color:var(--muted); padding:6px 8px; }
.as-nav{ display:flex; flex-direction:column; gap:2px; }
.as-navsep{ display:none; }
.as-item{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; border:0; background:transparent;
  padding:8px; border-radius:var(--r-sm); color:var(--ink); }
.as-item:hover{ background:var(--surface-3); }
.as-item.active{ background:color-mix(in srgb, var(--accent) 11%, #fff); }
.as-item.active .as-ic{ color:var(--accent); }
.as-item.active .as-item-text strong{ color:var(--accent); }
.as-ic{ width:30px; height:30px; border-radius:7px; background:var(--surface-3); display:grid; place-items:center; color:var(--ink-2); flex-shrink:0; }
.as-item.active .as-ic{ background:color-mix(in srgb, var(--accent) 16%, #fff); }
.as-item-text{ display:flex; flex-direction:column; line-height:1.25; min-width:0; flex:1; }
.as-item-text strong{ font-size:13px; font-weight:600; }
.as-item-text em{ font-style:normal; font-size:11px; color:var(--muted); }
.as-badge{ margin-left:auto; background:var(--surface-3); color:var(--ink-2); font-size:11px; font-weight:600; border-radius:10px; padding:1px 7px; }
.as-badge.amber{ background:var(--req-bg); color:var(--req); }
.as-foot{ margin-top:auto; padding-top:12px; position:relative; }
.as-proj{ width:100%; text-align:left; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r);
  padding:10px 12px; display:flex; flex-direction:column; gap:1px; cursor:pointer; }
.as-proj:not(:disabled):hover{ border-color:color-mix(in srgb,var(--accent) 35%,var(--line)); }
.as-proj.open{ border-color:var(--accent); }
.as-proj:disabled{ cursor:default; }
.as-proj em{ font-style:normal; font-size:10px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.as-proj strong{ font-size:12.5px; }
.as-proj span{ font-size:11px; color:var(--ink-2); font-family:var(--mono); }
.as-proj-menu{ position:absolute; left:0; right:0; bottom:calc(100% - 2px); background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r); box-shadow:0 -6px 24px rgba(20,24,50,.16); padding:5px; margin-bottom:6px; max-height:280px; overflow-y:auto; z-index:30; }
.as-proj-opt{ width:100%; text-align:left; border:0; background:transparent; border-radius:var(--r-sm); padding:7px 9px;
  display:flex; flex-direction:column; gap:1px; cursor:pointer; }
.as-proj-opt:hover{ background:var(--surface-3); }
.as-proj-opt.active{ background:color-mix(in srgb,var(--accent) 10%,#fff); }
.as-proj-opt strong{ font-size:12px; }
.as-proj-opt span{ font-size:11px; color:var(--ink-2); }

/* ---------- app sidebar — collapsed (icon rail) ---------- */
.app-sidebar.collapsed{ width:64px; padding:14px 8px; }
.app-sidebar.collapsed .as-head{ flex-direction:column; gap:10px; padding:2px 0 12px; }
.app-sidebar.collapsed .as-logo{ display:none; }
.app-sidebar.collapsed .as-mark{ display:grid; }
.app-sidebar.collapsed .as-group-label,
.app-sidebar.collapsed .as-item-text,
.app-sidebar.collapsed .as-badge,
.app-sidebar.collapsed .as-foot{ display:none; }
.app-sidebar.collapsed .as-nav{ align-items:stretch; }
.app-sidebar.collapsed .as-item{ justify-content:center; padding:8px; gap:0; }
.app-sidebar.collapsed .as-navsep{ display:block; height:1px; background:var(--line); margin:7px 10px; }

/* ===================================================================
   Expandable nav sections (New Report / Review Report / Setup)
   =================================================================== */
.as-sec{ display:flex; flex-direction:column; }
.as-sec-head{ cursor:pointer; }
.as-sec-head.accent .as-ic{ background:color-mix(in srgb, var(--accent) 16%, #fff); color:var(--accent); }
.as-sec-head.accent .as-item-text strong{ color:var(--accent); }
.as-chev{ margin-left:auto; color:var(--muted); display:grid; place-items:center; flex-shrink:0; transition:transform .18s ease; }
.as-sec.open > .as-sec-head .as-chev{ transform:rotate(90deg); }
.as-sub{ display:flex; flex-direction:column; gap:1px; margin:1px 0 5px; position:relative; }
.as-sub::before{ content:""; position:absolute; left:20px; top:3px; bottom:3px; width:1px; background:var(--line); }
.as-subitem{ display:flex; align-items:center; gap:9px; width:100%; text-align:left; border:0; background:transparent;
  padding:6px 8px 6px 18px; border-radius:var(--r-sm); color:var(--ink-2); cursor:pointer; }
.as-subitem:hover{ background:var(--surface-3); color:var(--ink); }
.as-subitem.active{ background:color-mix(in srgb, var(--accent) 11%, #fff); }
.as-subitem.active .as-subic{ color:var(--accent); }
.as-subitem.active .as-item-text strong{ color:var(--accent); }
.as-subitem.disabled{ cursor:default; opacity:.62; }
.as-subitem.disabled:hover{ background:transparent; color:var(--ink-2); }
.as-subic{ width:26px; height:26px; border-radius:6px; background:var(--surface-2); border:1px solid var(--line);
  display:grid; place-items:center; color:var(--muted); flex-shrink:0; }
.as-subitem .as-item-text strong{ font-size:12.5px; font-weight:600; }
.as-subitem .as-item-text em{ font-size:10.5px; }
.as-soon{ margin-left:auto; font-size:8.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  color:var(--muted); background:var(--surface-3); border:1px solid var(--line); border-radius:4px; padding:1px 5px; white-space:nowrap; }
.app-sidebar.collapsed .as-chev{ display:none; }
.as-navsep{ height:1px; background:var(--line); margin:10px 8px 8px; display:block; }

/* ---------- main surface ---------- */
/* min-height:0 lets this flex column shrink below its content height so .report-scroll becomes the
   bounded scroll region (toolbar + action bar pinned), instead of the column growing past .ws-content
   and the action bar overflowing onto the content (#94). Same flex-overflow pattern as .stub/.lv-page. */
.report{ flex:1; min-height:0; display:flex; flex-direction:column; min-width:0; background:var(--bg); position:relative; }

/* placeholder report editor toolbar (WP4 replaces the body) */
.report-toolbar{ display:flex; align-items:center; gap:16px; padding:12px 20px; background:var(--surface);
  border-bottom:1px solid var(--line); flex-wrap:wrap; flex-shrink:0; }
.rt-title{ display:flex; align-items:baseline; gap:10px; }
.rt-title h1{ margin:0; font-size:17px; font-weight:600; letter-spacing:-.01em; }
.variant-pill{ font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; padding:2px 8px; border-radius:5px;
  background:color-mix(in srgb,var(--accent) 12%,#fff); color:var(--accent); }
.astm{ font-size:11px; font-family:var(--mono); color:var(--ink-2); background:var(--surface-3); padding:2px 7px; border-radius:5px; }
.rt-spacer{ flex:1; }
.status-pill{ font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px; background:var(--req-bg); color:var(--req); }
.report-scroll{ flex:1; overflow-y:auto; padding:18px 20px; }

/* ===================================================================
   Compaction capture editor (M2 WP4): toolbar extras, header cards,
   the QuickGrid + owned edit layer, and the sticky action bar.
   =================================================================== */
.status-pill.submitted{ background:color-mix(in srgb,var(--accent) 12%,#fff); color:var(--accent); }
.save-ind{ font-size:11.5px; color:var(--muted); }
.save-ind.save-saving{ color:var(--ink-2); }
.save-ind.save-saved{ color:var(--pass); }
.save-ind.save-savedlocally{ color:var(--req); font-weight:600; }
.result-tally{ display:flex; gap:6px; }
.result-tally .tally{ font-size:11px; font-weight:600; padding:2px 8px; border-radius:20px; background:var(--surface-3); color:var(--ink-2); }
.result-tally .tally.pass{ background:var(--pass-bg); color:var(--pass); }
.result-tally .tally.fail{ background:var(--fail-bg); color:var(--fail); }

/* open-set tab strip (M2 WP6, design handoff ReportTabs) */
.report-tabs{ display:flex; align-items:flex-end; gap:8px; background:var(--surface-2); padding:7px 12px 0; border-bottom:1px solid var(--line); }
.rtabs-scroll{ display:flex; gap:3px; overflow-x:auto; flex:1; scrollbar-width:none; }
.rtabs-scroll::-webkit-scrollbar{ height:0; }
.rtab{ display:flex; align-items:center; gap:9px; padding:8px 9px 9px 11px; border:1px solid transparent; border-bottom:none;
  border-radius:8px 8px 0 0; cursor:pointer; max-width:220px; min-width:148px; position:relative; margin-bottom:-1px; color:var(--ink-2); }
.rtab:hover{ background:var(--surface-3); }
.rtab.active{ background:var(--surface); border-color:var(--line); color:var(--ink); }
.rtab-ic{ color:var(--muted); display:flex; flex-shrink:0; }
.rtab.active .rtab-ic{ color:var(--accent); }
.rtab-text{ display:flex; flex-direction:column; min-width:0; line-height:1.25; flex:1; }
.rtab-text strong{ font-size:12px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rtab-text em{ font-style:normal; font-size:10px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rtab-dot{ width:7px; height:7px; border-radius:50%; background:var(--req); flex-shrink:0; }
.rtab-close{ border:0; background:transparent; color:var(--muted); font-size:17px; line-height:1; width:19px; height:19px; border-radius:5px; display:grid; place-items:center; flex-shrink:0; opacity:0; }
.rtab:hover .rtab-close, .rtab.active .rtab-close{ opacity:1; }
.rtab-close:hover{ background:var(--line); color:var(--ink); }
.rtab-placeholder{ font-style:italic; }
.rtab-placeholder.active{ border-style:dashed; }
.rtab-placeholder strong{ font-weight:500; color:var(--ink-2); }
.rtabs-actions{ display:flex; align-items:center; gap:6px; flex-shrink:0; padding-bottom:8px; }
.rtabs-confirm{ font-size:12px; color:var(--ink-2); white-space:nowrap; }
.rtabs-btn{ border:1px solid transparent; background:transparent; color:var(--muted); font-size:12px; font-weight:600; padding:5px 10px; border-radius:6px; cursor:pointer; white-space:nowrap; }
.rtabs-btn:hover{ background:var(--surface-3); color:var(--ink); }
.rtabs-btn.ghost{ border-color:var(--line); background:var(--surface); color:var(--ink-2); }
.rtabs-btn.ghost:hover{ background:var(--surface-3); color:var(--ink); }
.rtabs-btn.danger{ color:var(--fail); }
.rtabs-btn.danger:hover{ background:var(--fail-bg); color:var(--fail); }
.rtabs-btn:disabled{ opacity:.55; cursor:default; }

.editor-scroll{ display:flex; flex-direction:column; gap:14px; }
/* The column is flex only for the gap; its cards must NOT flex-shrink. Without this, a tight viewport
   shrinks the cards to fit the scroll region instead of overflowing it — and a .hdr-card (overflow:hidden,
   so its flex auto-min is 0) collapses to ~2px with its content clipped, which is how Remarks/Attachments
   became unreachable even after .report got min-height:0 (#94). flex-shrink:0 keeps each card at its natural
   height so .report-scroll actually scrolls. */
.editor-scroll > *{ flex-shrink:0; }
.editor-banner.err{ background:var(--fail-bg); color:var(--fail); border:1px solid var(--fail-line); border-radius:var(--r-sm); padding:9px 12px; font-size:12.5px; }
.editor-banner.warn{ background:var(--req-bg); color:var(--req); border:1px solid var(--req-line); border-radius:var(--r-sm); padding:9px 12px; font-size:12.5px; }
.editor-prompt{ background:var(--surface); border:1px dashed var(--line); border-radius:var(--r); padding:36px 20px; text-align:center; color:var(--muted); font-size:13px; }

/* header cards */
.hdr-cards{ display:flex; flex-direction:column; gap:10px; }
.hdr-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.hdr-head{ display:flex; align-items:center; gap:10px; width:100%; border:0; background:transparent; cursor:pointer;
  padding:11px 14px; font-size:13.5px; color:var(--ink); text-align:left; }
.hdr-head strong{ font-weight:600; }
/* Non-collapsible card header (e.g. the read-only Identity card): the hdr-head layout without the button affordances. */
.hdr-head-static{ display:flex; align-items:center; gap:10px; width:100%; padding:11px 14px; font-size:13.5px; color:var(--ink); }
.hdr-head-static strong{ font-weight:600; }
.hdr-chev{ display:inline-block; transition:transform .15s ease; color:var(--muted); font-size:11px; }
.hdr-chev.open{ transform:rotate(90deg); }
.hdr-hint{ margin-left:auto; font-size:11.5px; color:var(--muted); }
.hdr-body{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px 14px; padding:4px 14px 16px; }
.fld{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.fld.fld-wide{ grid-column:span 2; }
.fld-label{ font-size:10.5px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:var(--muted); }
.fld-label em{ font-style:normal; color:var(--req); font-weight:600; margin-left:4px; text-transform:none; letter-spacing:0; }
.fld-input{ font:inherit; font-size:13px; padding:6px 9px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); color:var(--ink); }
.fld-input:focus{ outline:2px solid color-mix(in srgb,var(--accent) 40%,#fff); outline-offset:-1px; border-color:var(--accent); }
.fld-input:disabled{ background:var(--surface-3); color:var(--ink-2); }
.fld-input.mono,.fld-ro.mono{ font-family:var(--mono); }
.fld-ro{ font-size:13px; padding:6px 0; color:var(--ink); }
.fld-area{ min-height:62px; line-height:1.4; resize:vertical; white-space:pre-wrap; overflow-wrap:anywhere; }
.fld-empty{ margin:0; grid-column:1 / -1; font-size:12.5px; color:var(--muted); }

/* Proctor | gauge split: one card, a vertical divide between the two groups. */
.hdr-split{ display:grid; grid-template-columns:1fr 1fr; gap:0; padding:6px 0 16px; }
.hdr-split .hdr-col{ padding:4px 16px; }
.hdr-split .hdr-col + .hdr-col{ border-left:1px solid var(--line); }
.hdr-col-head{ font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--accent); margin-bottom:9px; }
.hdr-col-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; }
.hdr-col-grid .fld-wide{ grid-column:span 2; }
@media (max-width: 700px){
  /* Project/Report bodies are 4-up by default; collapse to 2 so fields stop squishing on mobile (#92).
     :not(.hdr-split) leaves the proctor/gauge split (one card, its own collapse below) untouched, and
     remarks/attach bodies are display:block so the grid columns are inert there. */
  .hdr-body:not(.hdr-split){ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .hdr-split{ grid-template-columns:1fr; }
  .hdr-split .hdr-col + .hdr-col{ border-left:0; border-top:1px solid var(--line); }
}

/* variant-driven remarks (ADR-0015, WP5): tabbed sections, one textarea per section */
.remarks-body{ display:block; padding:4px 14px 16px; }
.remarks-tabs{ display:flex; gap:3px; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.rmk-tab{ display:inline-flex; align-items:center; gap:6px; border:0; background:transparent; cursor:pointer;
  color:var(--ink-2); font:inherit; font-size:12.5px; font-weight:600; padding:8px 12px; border-bottom:2px solid transparent; margin-bottom:-1px; }
.rmk-tab:hover{ color:var(--ink); }
.rmk-tab.active{ color:var(--accent); border-bottom-color:var(--accent); }
.rmk-dot{ width:6px; height:6px; border-radius:50%; background:var(--accent); }
.rmk-tab:not(.active) .rmk-dot{ background:var(--muted); }
.remarks-area{ width:100%; box-sizing:border-box; margin-top:12px; border:1px solid var(--line); border-radius:var(--r-sm);
  padding:10px; font:inherit; font-size:13px; line-height:1.4; resize:vertical; outline:none; color:var(--ink); background:var(--surface); }
.remarks-area:focus{ border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent); }
.remarks-area:disabled{ background:var(--surface-3); color:var(--ink-2); }

/* report attachments (M3 WP3, ADR-0007/0022): add buckets + thumb/preview list in the footer card */
.attach-body{ display:block; padding:10px 14px 16px; }
.attach-add{ display:flex; flex-wrap:wrap; gap:8px; }
.attach-btn{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; padding:8px 14px; }
.attach-btn input[type="file"]{ display:none; } /* label-wrapped: the whole chip opens the OS picker/camera */
.attach-note{ margin:10px 0 0; font-size:12px; color:var(--ink-2); }
.attach-note.err{ color:var(--fail); }
.attach-empty{ margin:12px 0 0; font-size:12.5px; color:var(--muted); }
.attach-list{ list-style:none; margin:12px 0 0; padding:0; display:flex; flex-direction:column; gap:8px; }
.attach-item{ display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:var(--r);
  padding:8px 10px; background:var(--surface); }
.attach-item.failed{ border-color:var(--fail-line); background:var(--fail-bg); }
.attach-item.uploading{ opacity:.75; }
.attach-thumb{ width:48px; height:48px; flex-shrink:0; border-radius:var(--r-sm); overflow:hidden;
  background:var(--surface-3); display:grid; place-items:center; }
.attach-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.attach-ico{ font-size:22px; line-height:1; }
.attach-meta{ display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.attach-meta strong{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.attach-meta em{ font-style:normal; font-size:11px; color:var(--muted); }
/* Caption (#251): a compact inline field under the file meta; the office read-only view shows it as quoted text. */
.attach-caption{ margin-top:3px; width:100%; max-width:360px; font:inherit; font-size:12px; color:var(--ink);
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); padding:5px 8px; min-height:30px; }
.attach-caption:focus{ outline:none; border-color:var(--accent); }
.attach-caption::placeholder{ color:var(--muted); }
.attach-caption-view{ margin-top:2px; font-size:12px; font-style:italic; color:var(--ink-2); }
.attach-err{ font-size:11px; color:var(--fail); }
.attach-actions{ display:flex; align-items:center; gap:8px; flex-shrink:0; flex-wrap:wrap; justify-content:flex-end; }
.attach-status{ font-size:11.5px; color:var(--muted); }
.attach-link{ border:0; background:transparent; color:var(--accent); font:inherit; font-size:12.5px; font-weight:600;
  padding:6px 8px; border-radius:var(--r-sm); cursor:pointer; text-decoration:none; min-height:32px; display:inline-flex; align-items:center; }
.attach-link:hover{ background:var(--surface-3); }
.attach-link.danger{ color:var(--fail); }
.attach-toggle{ border:1px solid var(--line); background:var(--surface); color:var(--ink-2); font:inherit; font-size:11px;
  font-weight:600; padding:5px 10px; border-radius:20px; cursor:pointer; min-height:32px; }
.attach-toggle:hover{ background:var(--surface-3); }
.attach-toggle.internal{ background:var(--req-bg); border-color:var(--req-line); color:var(--req); }
.attach-badge{ font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--ink-2); background:var(--surface-3); border:1px solid var(--line); padding:3px 9px; border-radius:20px; }
.attach-badge.internal{ background:var(--req-bg); border-color:var(--req-line); color:var(--req); }

/* DFR child-report packaging (M7 WP4, ADR-0028): the packaged-report list + the approved-report picker,
   reusing the attachment list vocabulary (attach-list/item/meta/actions) with a few DFR-specific bits */
.child-body{ display:block; padding:10px 14px 16px; }
.child-list{ counter-reset:none; }
.child-item{ align-items:center; }
.child-link{ font-size:13px; font-weight:600; color:var(--accent); text-decoration:none; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.child-link:hover{ text-decoration:underline; }
.child-ord{ flex-shrink:0; width:26px; height:26px; display:grid; place-items:center; border-radius:50%;
  background:var(--surface-3); color:var(--ink-2); font-size:12px; font-weight:700; }
.child-item{ flex-wrap:wrap; }
.child-rev{ display:flex; align-items:center; gap:6px; flex-shrink:0; }
.child-rev-label{ font-size:10.5px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:var(--muted); }
.child-rev .fld-input{ font-size:12px; padding:4px 8px; min-width:150px; }
.child-add{ margin-top:12px; }
/* The add-report search tray is an absolutely-positioned menu under the input; the card must not clip it.
   .hdr-card is overflow:hidden for its rounded corners, which cut the tray off at the card's bottom edge.
   overflow:visible here is safe from the #94 flex-collapse — a visible box no longer has a 0 flex auto-min,
   so the card keeps its natural height regardless. Applies to the picker on both capture and review. */
.child-card{ overflow:visible; }
.child-menu-head{ padding:8px 12px 4px; font-size:10.5px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.child-result{ width:100%; }

/* grid toolbar + legend */
.capture-grid-wrap{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:10px; }
.grid-toolbar{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:8px; }
.grid-add{ padding:6px 12px; font-size:12.5px; }
.grid-legend{ display:flex; align-items:center; gap:6px; font-size:11px; color:var(--ink-2); }
.grid-legend .lg{ width:11px; height:11px; border-radius:3px; display:inline-block; margin-left:8px; border:1px solid var(--line); }
.grid-legend .lg-in{ background:var(--surface); }
.grid-legend .lg-ca{ background:var(--calc-bg); }
.grid-hint{ font-size:11px; color:var(--muted); }
.grid-hint kbd{ font-family:var(--mono); font-size:10px; background:var(--surface-3); border:1px solid var(--line); border-radius:3px; padding:0 4px; }

/* the grid itself */
.capture-grid-scroll{ overflow-x:auto; }
.capture-grid{ width:100%; border-collapse:collapse; font-size:12px; }
.capture-grid th{ background:var(--surface-2); color:var(--ink-2); font-weight:600; text-align:left;
  padding:6px 8px; white-space:nowrap; border-bottom:1px solid var(--line); position:sticky; top:0; }
.capture-grid td{ border-bottom:1px solid var(--line-2); padding:0; vertical-align:middle; }
.capture-grid .cell-view{ display:block; box-sizing:border-box; width:100%; min-height:30px; padding:5px 8px; outline:none; white-space:nowrap; }
.capture-grid .col-computed .cell-view,.capture-grid .cell-view.col-computed{ background:var(--calc-bg); color:var(--ink-2); font-family:var(--mono); }
.capture-grid .cell-input{ display:block; box-sizing:border-box; width:100%; min-width:64px; min-height:30px;
  padding:4px 7px; font:inherit; font-size:12px; border:1px solid var(--accent); border-radius:4px; background:#fff; }
.capture-grid .cell-input:focus{ outline:2px solid color-mix(in srgb,var(--accent) 35%,#fff); outline-offset:-2px; }
.capture-grid .cell-input.is-invalid{ border-color:var(--fail); background:var(--fail-bg); }
.grid-invalid{ margin:0 2px 8px; font-size:12px; color:var(--fail); font-weight:600; }
.capture-grid .cell-select{ min-width:58px; }
.capture-grid tr.row-editing td{ background:color-mix(in srgb,var(--accent) 6%,#fff); }
.capture-grid .col-index .cell-view{ color:var(--muted); font-family:var(--mono); }
.capture-grid .col-location .cell-input{ min-width:120px; }
/* Match the read-only view cells to the editor inputs so locking/unlocking a row doesn't resize columns. */
.capture-grid .col-num:not(.col-index) .cell-view{ min-width:64px; }
.capture-grid .col-mode .cell-view{ min-width:58px; }
.capture-grid .col-location .cell-view{ min-width:120px; }
/* Numeric columns whose max DB value is wider than the header (so the value never scrolls in-cell):
   coordinates decimal(12,3) ≈ 13 chars, elevation decimal(9,3) ≈ 10 chars. */
.capture-grid .col-coord .cell-view,.capture-grid .col-coord .cell-input{ min-width:116px; }
.capture-grid .col-elev .cell-view,.capture-grid .col-elev .cell-input{ min-width:92px; }
.capture-grid .cell-chip{ display:flex; align-items:center; }
.capture-grid .pf{ font-size:10.5px; font-weight:700; letter-spacing:.02em; padding:2px 9px; border-radius:20px;
  border:1px solid transparent; white-space:nowrap; }
.capture-grid .pf-pass{ color:var(--pass); background:var(--pass-bg); border-color:var(--pass-line); }
.capture-grid .pf-fail{ color:var(--fail); background:var(--fail-bg); border-color:var(--fail-line); }
.capture-grid .pf-na{ color:var(--muted); background:var(--surface-3); border-color:var(--line-2); }
/* leading lock toggle + trailing delete/commit */
.capture-grid .col-lock,.capture-grid .col-del{ width:34px; text-align:center; }
.capture-grid .row-lock,.capture-grid .row-del,.capture-grid .row-commit{ display:inline-grid; place-items:center; width:26px; height:26px;
  border:0; background:transparent; border-radius:var(--r-sm); cursor:pointer; color:var(--muted); }
.capture-grid .row-lock.locked{ color:var(--ink-2); }
.capture-grid .row-lock.unlocked{ color:var(--accent); }
.capture-grid .row-lock.readonly{ cursor:default; }
.capture-grid .row-lock:not(.readonly):hover{ background:var(--surface-3); color:var(--ink); }
.capture-grid .row-del:hover{ background:var(--fail-bg); color:var(--fail); }
.capture-grid .row-commit{ color:var(--accent); }
.capture-grid .row-commit:hover{ background:var(--pass-bg); color:var(--pass); }
.capture-grid-empty{ padding:28px 16px; text-align:center; color:var(--muted); font-size:12.5px; }

/* sticky action bar */
.action-bar{ display:flex; align-items:center; gap:16px; padding:12px 20px; background:var(--surface);
  border-top:1px solid var(--line); flex-wrap:wrap; flex-shrink:0; }
.ab-summary{ flex:1; min-width:0; font-size:12.5px; }
.ab-summary .ab-ready{ color:var(--pass); font-weight:600; }
.ab-summary .ab-done{ color:var(--accent); font-weight:600; }
.ab-summary .ab-issue{ color:var(--req); }
.ab-actions{ display:flex; gap:10px; }
.action-bar .btn:disabled{ opacity:.5; cursor:not-allowed; }

/* shared generated-PDF actions (Preview / Download), used on both Capture and Review (M5 WP4) */
.pdf-actions{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pdf-actions-error{ font-size:12.5px; color:var(--fail); }

.grid-prior{ padding:6px 12px; font-size:12.5px; }

/* ===================================================================
   Prior-test lookup drawer (M2 WP7): right-side slide-over + scrim.
   Master list of the project's tests → tap one for its full data.
   =================================================================== */
/* Shared slide-over drawer chrome (SlideOverDrawer). Consumers: prior-test lookup (ptl-), report
   preview (rpd-), office Find (M4). The scrim/panel/header/close + slide animation generalize here;
   content classes stay per-consumer. */
.drawer-scrim{ position:fixed; inset:0; background:rgba(20,24,40,.35); z-index:50; }
.drawer{ position:fixed; top:0; right:0; bottom:0; width:min(420px, 92vw); background:var(--surface);
  border-left:1px solid var(--line); box-shadow:-10px 0 40px rgba(20,24,50,.18); z-index:51;
  display:flex; flex-direction:column; outline:none; animation:drawer-slide .18s ease; }
@keyframes drawer-slide{ from{ transform:translateX(100%); } to{ transform:translateX(0); } }
.drawer-head{ display:flex; align-items:center; gap:10px; padding:12px 14px; border-bottom:1px solid var(--line); flex-shrink:0; }
.drawer-head-title{ display:flex; flex-direction:column; line-height:1.25; min-width:0; flex:1; }
.drawer-head-title strong{ font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.drawer-head-title em{ font-style:normal; font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ptl-back{ display:inline-flex; align-items:center; gap:4px; border:0; background:transparent; color:var(--accent);
  font:inherit; font-size:12.5px; font-weight:600; padding:4px 6px; border-radius:var(--r-sm); cursor:pointer; }
.ptl-back:hover{ background:var(--surface-3); }
.ptl-back svg{ transform:rotate(180deg); }
.drawer-close{ border:0; background:transparent; color:var(--muted); padding:5px; border-radius:var(--r-sm);
  display:grid; place-items:center; cursor:pointer; flex-shrink:0; }
.drawer-close:hover{ background:var(--surface-3); color:var(--ink); }
.ptl-scope{ display:flex; gap:4px; margin:12px 14px 0; padding:3px; background:var(--surface-3);
  border:1px solid var(--line); border-radius:var(--r-sm); flex-shrink:0; }
.ptl-seg{ flex:1; border:0; background:transparent; color:var(--muted); font:inherit; font-size:12.5px;
  font-weight:600; padding:7px 0; border-radius:calc(var(--r-sm) - 2px); cursor:pointer; }
.ptl-seg:hover{ color:var(--ink); }
.ptl-seg:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
.ptl-seg.active{ background:var(--surface); color:var(--ink); box-shadow:0 1px 3px rgba(30,40,80,.10); }
.ptl-search{ display:flex; align-items:center; gap:8px; margin:12px 14px 0; padding:0 10px; color:var(--muted);
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-sm); flex-shrink:0; }
.ptl-search:focus-within{ border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 16%,transparent); }
.ptl-search input{ border:0; background:transparent; outline:none; padding:9px 0; font:inherit; font-size:13px; color:var(--ink); width:100%; }
.ptl-search input::placeholder{ color:var(--muted); }
.ptl-search-x{ border:0; background:transparent; color:var(--muted); display:grid; place-items:center; cursor:pointer; padding:2px; }
.ptl-search-x:hover{ color:var(--ink); }
.ptl-body{ flex:1; min-height:0; overflow-y:auto; padding:12px 14px 20px; }
.ptl-state{ padding:36px 12px; text-align:center; color:var(--muted); font-size:12.5px; }
.ptl-state.err{ color:var(--fail); }
.ptl-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.ptl-row{ width:100%; text-align:left; border:1px solid var(--line); background:var(--surface); border-radius:var(--r);
  padding:10px 12px; display:flex; align-items:center; gap:10px; cursor:pointer; transition:border-color .12s, box-shadow .12s; }
.ptl-row:hover{ border-color:color-mix(in srgb,var(--accent) 40%,var(--line)); box-shadow:0 2px 10px rgba(30,40,80,.06); }
.ptl-row:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
.ptl-row-main{ display:flex; flex-direction:column; line-height:1.3; min-width:0; flex:1; }
.ptl-row-main strong{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ptl-row-main em{ font-style:normal; font-size:11px; color:var(--muted); }
.ptl-row-meta{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.ptl-row-meta em{ font-style:normal; font-size:10.5px; color:var(--muted); }
.ptl-overall{ display:inline-block; font-size:12px; font-weight:700; padding:4px 11px; border-radius:20px;
  border:1px solid transparent; margin-bottom:14px; }
.ptl-sect{ margin-bottom:16px; }
.ptl-sect h3{ margin:0 0 8px; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--accent); }
.ptl-fields{ margin:0; display:grid; grid-template-columns:1fr 1fr; gap:9px 14px; }
.ptl-fld{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.ptl-fld-label{ font-size:10px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:var(--muted); }
.ptl-fld-value{ font-size:13px; color:var(--ink); word-break:break-word; }
/* the chip/pill vocabulary is shared with the grid */
.drawer .pf{ font-size:10.5px; font-weight:700; letter-spacing:.02em; padding:2px 9px; border-radius:20px;
  border:1px solid transparent; white-space:nowrap; }
.drawer .pf-pass{ color:var(--pass); background:var(--pass-bg); border-color:var(--pass-line); }
.drawer .pf-fail{ color:var(--fail); background:var(--fail-bg); border-color:var(--fail-line); }
.drawer .pf-na{ color:var(--muted); background:var(--surface-3); border-color:var(--line-2); }

/* Report preview drawer (ReportPreviewDrawer, #116): read-only peek before opening a report. */
.rpd-body{ flex:1; min-height:0; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:16px; }
.rpd-state{ padding:36px 12px; text-align:center; color:var(--muted); font-size:12.5px; }
.rpd-state.err{ color:var(--fail); }
.rpd-status{ align-self:flex-start; font-size:11px; font-weight:700; letter-spacing:.02em; padding:3px 11px;
  border-radius:20px; border:1px solid transparent; }
.rpd-status.draft{ color:var(--muted); background:var(--surface-3); border-color:var(--line-2); }
.rpd-status.submitted{ color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,transparent); border-color:color-mix(in srgb,var(--accent) 30%,transparent); }
.rpd-status.approved{ color:var(--pass); background:var(--pass-bg); border-color:var(--pass-line); }
.rpd-sect h3{ margin:0 0 8px; font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--accent); }
.rpd-fields{ margin:0; display:grid; grid-template-columns:1fr 1fr; gap:9px 14px; }
.rpd-fields-3{ grid-template-columns:repeat(3, 1fr); }
.rpd-fld{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.rpd-fld-label{ font-size:10px; font-weight:600; letter-spacing:.02em; text-transform:uppercase; color:var(--muted); }
.rpd-fld-value{ font-size:13px; color:var(--ink); word-break:break-word; }
.rpd-foot{ padding:12px 14px; border-top:1px solid var(--line); flex-shrink:0; display:flex; flex-direction:column; gap:8px; }
.rpd-foot .btn{ width:100%; justify-content:center; }
.rpd-confirm{ font-size:12.5px; color:var(--ink-2); }
.rpd-confirm-row{ display:flex; gap:8px; }
.rpd-confirm-row .btn{ flex:1; }
.rpd-foot-err{ margin:0; font-size:12px; color:var(--fail); }

/* ---------- placeholder / stub surface (WP3 honest placeholders) ---------- */
.stub{ flex:1; min-height:0; overflow-y:auto; padding:22px 24px 48px; }
.stub-panel{ display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center;
  background:var(--surface); border:1px dashed var(--line); border-radius:var(--r); padding:48px 24px; margin-top:18px; }
.stub-panel .stub-ic{ width:46px; height:46px; border-radius:12px; background:var(--surface-3); display:grid; place-items:center; color:var(--muted); }
.stub-tag{ font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--accent);
  background:color-mix(in srgb,var(--accent) 12%,#fff); padding:3px 9px; border-radius:5px; }
.stub-panel strong{ font-size:15px; }
.stub-panel p{ margin:0; font-size:12.5px; color:var(--ink-2); max-width:440px; }

/* ===================================================================
   List / reference view chrome (My Reports · Find Report · Setup)
   =================================================================== */
.lv-page{ flex:1; min-height:0; overflow-y:auto; padding:22px 24px 48px; }
.lv-head{ display:flex; align-items:flex-start; gap:16px; margin-bottom:18px; }
.lv-head-main{ flex:1; min-width:0; }
.lv-eyebrow{ font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); }
.lv-head h1{ margin:3px 0 4px; font-size:22px; font-weight:600; letter-spacing:-.01em; }
.lv-sub{ margin:0; font-size:13px; color:var(--ink-2); }
.lv-sub strong{ color:var(--ink); font-weight:600; }
.lv-count{ font-size:12.5px; color:var(--ink-2); background:var(--surface); border:1px solid var(--line);
  padding:5px 11px; border-radius:20px; white-space:nowrap; }

/* KPI cards (clickable status filters) */
.lv-kpis{ display:grid; grid-template-columns:repeat(5, 1fr); gap:10px; margin-bottom:18px; }
.lv-kpis.k3{ grid-template-columns:repeat(3, 1fr); }
.lv-kpi{ display:flex; flex-direction:column; gap:2px; align-items:flex-start; text-align:left;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px; cursor:pointer; transition:border-color .12s, box-shadow .12s; }
.lv-kpi:hover{ box-shadow:0 2px 10px rgba(30,40,80,.06); }
.lv-kpi.active{ border-color:color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow:0 2px 10px rgba(30,40,80,.06); }
.lv-kpi strong{ font-size:24px; font-weight:600; line-height:1; }
.lv-kpi em{ font-style:normal; font-size:11px; font-weight:600; color:var(--ink-2); letter-spacing:.01em; }
.lv-kpi.draft strong{ color:var(--ink-2); }
.lv-kpi.submitted strong{ color:var(--accent); }
.lv-kpi.approved strong{ color:var(--pass); }

/* toolbar: search + filters */
.lv-toolbar{ display:flex; align-items:center; gap:18px; margin-bottom:14px; flex-wrap:wrap; }
.lv-search{ display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-sm); padding:0 10px; min-width:280px; flex:0 1 360px; color:var(--muted); }
.lv-search input{ border:0; background:transparent; outline:none; padding:9px 0; font:inherit; font-size:13px; color:var(--ink); width:100%; }
.lv-search input::placeholder{ color:var(--muted); }
.lv-search:focus-within{ border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.lv-search-x{ border:0; background:transparent; color:var(--muted); font-size:17px; line-height:1; cursor:pointer; padding:2px 4px; }
.lv-search-x:hover{ color:var(--ink); }
.lv-filter{ display:flex; align-items:center; gap:8px; }
.lv-filter-label{ font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.lv-chips{ display:flex; gap:5px; flex-wrap:wrap; }
/* Reset filters: pushed to the right edge of the toolbar row, after the Status pills. */
.lv-reset{ margin-left:auto; }
.lv-chip{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line); background:var(--surface);
  color:var(--ink-2); font-size:12px; font-weight:500; padding:5px 11px; border-radius:20px; cursor:pointer; transition:.12s; }
.lv-chip:hover{ border-color:var(--line-2); color:var(--ink); }
.lv-chip.active{ background:color-mix(in srgb, var(--accent) 11%, #fff); border-color:color-mix(in srgb, var(--accent) 40%, var(--line)); color:var(--accent); }
.lv-chip i{ font-style:normal; font-size:10.5px; font-weight:700; background:var(--surface-3); color:var(--ink-2); border-radius:9px; padding:0 6px; }
.lv-chip.active i{ background:color-mix(in srgb, var(--accent) 18%, #fff); color:var(--accent); }
/* facet selects + date inputs (office Find), styled to match the search field */
.lv-select{ border:1px solid var(--line); background:var(--surface); color:var(--ink); font:inherit; font-size:12.5px;
  padding:7px 9px; border-radius:8px; outline:none; cursor:pointer; }
.lv-select:focus-visible{ border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.lv-date-in{ cursor:text; }
.lv-date-sep{ color:var(--muted); font-size:12px; }

/* table */
/* overflow-x:auto so narrow screens scroll the table instead of clipping columns (date/status/updated
   were cut off on mobile). min-width keeps the columns readable rather than crushed. */
.lv-tablewrap{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow-x:auto; }
.lv-table{ width:100%; min-width:60rem; border-collapse:collapse; }
.lv-client{ white-space:nowrap; }
.lv-table thead th{ text-align:left; font-size:10.5px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  color:var(--muted); padding:11px 14px; border-bottom:1px solid var(--line); background:var(--surface-2); white-space:nowrap; }
/* Right-align beats the base `.lv-table thead th` left-align (higher specificity). */
.lv-table thead th.lv-th-num{ text-align:right; }
.lv-th-status{ width:108px; }
.lv-th-date{ width:150px; }
.lv-date{ white-space:nowrap; }
.lv-th-act{ width:1%; white-space:nowrap; }
.lv-th-report{ width:210px; }
.lv-row{ border-bottom:1px solid var(--line); cursor:pointer; transition:background .1s; }
.lv-row:last-child{ border-bottom:0; }
.lv-row:hover{ background:var(--surface-2); }
.lv-row:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
.lv-table td{ padding:11px 14px; font-size:13px; color:var(--ink); vertical-align:middle; }
.lv-cell-report{ display:flex; align-items:center; gap:10px; }
.lv-type-ic{ width:28px; height:28px; border-radius:7px; background:var(--surface-3); display:grid; place-items:center; color:var(--ink-2); flex-shrink:0; }
.lv-report-id{ display:flex; flex-direction:column; line-height:1.3; min-width:0; }
.lv-report-id strong{ font-size:12.5px; font-weight:600; }
.lv-report-id em{ font-style:normal; font-size:11px; color:var(--muted); }
.lv-proj{ display:flex; flex-direction:column; line-height:1.3; }
.lv-proj strong{ font-size:12.5px; font-weight:500; }
.lv-proj em{ font-style:normal; font-size:11px; color:var(--muted); }
.lv-muted{ color:var(--ink-2); }
.lv-loc{ font-size:12px; max-width:240px; }
.lv-tech{ white-space:nowrap; }
.lv-num{ text-align:right; font-size:12.5px; color:var(--ink-2); white-space:nowrap; }
.lv-act{ text-align:right; white-space:nowrap; }
.lv-act-btn{ display:inline-flex; align-items:center; vertical-align:middle; gap:4px; border:1px solid var(--line); background:var(--surface);
  color:var(--ink-2); font-size:11.5px; font-weight:600; padding:5px 9px; border-radius:6px; cursor:pointer; }
.lv-act-btn + .lv-act-btn{ margin-left:6px; }
.lv-act-btn:hover{ background:var(--surface-3); color:var(--ink); }
.lv-act-btn.open{ border-color:color-mix(in srgb,var(--accent) 35%,var(--line)); color:var(--accent); }
.lv-act-btn.open:hover{ background:color-mix(in srgb,var(--accent) 10%,#fff); color:var(--accent); }

/* setup in-page tabs */
.lv-tabs{ display:flex; gap:4px; margin-bottom:16px; border-bottom:1px solid var(--line); }
.lv-tab{ display:inline-flex; align-items:center; gap:7px; border:0; background:transparent; color:var(--ink-2);
  font-size:13px; font-weight:600; padding:9px 14px; border-bottom:2px solid transparent; margin-bottom:-1px; cursor:pointer;
  text-decoration:none; }
.lv-tab:hover{ color:var(--ink); }
.lv-tab.active{ color:var(--accent); border-bottom-color:var(--accent); }

/* empty state */
.lv-empty{ display:flex; flex-direction:column; align-items:center; gap:10px; padding:56px 20px; color:var(--muted);
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); }
.lv-empty p{ margin:0; font-size:13px; }

/* status chips (shared vocabulary) */
.lv-status{ display:inline-block; font-size:11px; font-weight:600; padding:3px 10px; border-radius:20px; white-space:nowrap; border:1px solid transparent; }
.lv-status.draft{ background:var(--surface-3); color:var(--ink-2); border-color:var(--line-2); }
.lv-status.submitted{ background:color-mix(in srgb, var(--accent) 11%, #fff); color:var(--accent); border-color:color-mix(in srgb, var(--accent) 28%, var(--line)); }
.lv-status.review{ background:var(--req-bg); color:var(--req); border-color:var(--req-line); }
.lv-status.approved{ background:var(--pass-bg); color:var(--pass); border-color:var(--pass-line); }
.lv-status.revise{ background:var(--fail-bg); color:var(--fail); border-color:var(--fail-line); }

/* ---------- office per-report review view (M4 WP3, ADR-0025) ---------- */
.rv-rev{ display:inline-block; font-size:11px; font-weight:700; padding:3px 9px; border-radius:20px;
  background:var(--surface-3); color:var(--ink-2); border:1px solid var(--line-2); white-space:nowrap; }
.rv-details{ margin:0 0 14px; }
.rv-details-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 10px; }
.rv-details-title{ margin:0; font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.rv-edit-btn{ padding:5px 10px; font-size:12px; }
/* Section-head actions: Edit, replaced in place by the completion buttons while editing (so only the
   cards below flip, not the header). Compact to sit on the head row. */
.rv-head-actions{ display:flex; gap:8px; }
.rv-head-actions .btn{ padding:5px 10px; font-size:12px; }
.rv-summary{ display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:12px; margin:0; }
.rv-card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px; }
.rv-card h2{ margin:0 0 8px; font-size:11px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.rv-card dl{ display:grid; grid-template-columns:auto 1fr; gap:4px 12px; margin:0; }
.rv-card dt{ font-size:12px; color:var(--ink-2); }
.rv-card dd{ margin:0; font-size:13px; color:var(--ink); text-align:right; }

/* Remarks + attachments review section: two large cards (Remarks left, Attachments right). */
.rv-extras{ margin:14px 0 0; }
.rv-extras-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:12px; align-items:start; }
.rv-empty{ margin:0; font-size:13px; color:var(--muted); }
.rv-remark{ margin:0 0 12px; }
.rv-remark:last-child{ margin-bottom:0; }
.rv-remark h3{ margin:0 0 2px; font-size:12px; font-weight:700; color:var(--ink-2); }
.rv-remark p{ margin:0; font-size:13px; color:var(--ink); white-space:pre-wrap; }
.rv-attach-controls{ display:flex; align-items:center; gap:10px; margin:0 0 12px; }
.rv-attach-select{ flex:1 1 auto; min-width:0; }
.rv-attach-toggle{ border:1px solid var(--line); background:var(--surface); color:var(--ink-2); font:inherit;
  font-size:11px; font-weight:600; padding:6px 12px; border-radius:20px; cursor:pointer; white-space:nowrap; }
.rv-attach-toggle:hover{ background:var(--surface-3); }
.rv-attach-toggle.internal{ background:var(--req-bg); border-color:var(--req-line); color:var(--req); }
.rv-attach-preview{ display:flex; align-items:center; justify-content:center; min-height:240px;
  background:var(--surface-3); border:1px solid var(--line); border-radius:var(--r); padding:10px; }
.rv-attach-preview img{ max-width:100%; max-height:440px; object-fit:contain; border-radius:6px; }
.rv-attach-doc{ display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center; }
.rv-attach-ico{ font-size:48px; line-height:1; }
/* Revise reason row: the input shrinks to 0 (min-width:0) so input + Cancel + confirm always fit on one
   line — they never wrap below and grow the footer (action-bar is flex-wrap:wrap). ab-actions-grow gives
   the row the full width while revising (the summary line is suppressed), so the input fills the space. */
.rv-reason{ flex:1 1 160px; min-width:0; font-size:13px; padding:7px 10px; border:1px solid var(--line); border-radius:8px; }
.ab-actions-grow{ flex:1; }
.ab-actions .btn{ white-space:nowrap; }

/* ---------- buttons (shared) ---------- */
.btn{ border:0; border-radius:var(--r-sm); font-weight:600; font-size:13px; padding:9px 16px;
  display:inline-flex; align-items:center; gap:8px; text-decoration:none; }
.btn.primary{ background:var(--accent); color:#fff; }
.btn.primary:hover{ filter:brightness(1.06); }
.btn.ghost{ background:var(--surface); border:1px solid var(--line); color:var(--ink-2); }
.btn.ghost:hover{ background:var(--surface-3); color:var(--ink); }
.btn.danger{ background:var(--fail); color:#fff; }
.btn.danger:hover{ filter:brightness(1.06); }
.btn.ghost.danger-text{ color:var(--fail); }
.btn.ghost.danger-text:hover{ background:var(--fail-bg); border-color:var(--fail-line); color:var(--fail); }
.ab-confirm{ font-size:12.5px; color:var(--fail); font-weight:600; align-self:center; margin-right:2px; }

/* ---------- home landing ---------- */
/* .lv-page is flex:1 with height; making the home instance a column lets .home-status pin to the
   bottom via margin-top:auto (diagnostics out of the way of the actions, still on-screen). */
.home-page{ display:flex; flex-direction:column; }
.home-actions{ display:flex; gap:10px; margin:6px 0 20px; flex-wrap:wrap; }
.home-status{ display:flex; flex-direction:column; gap:8px; margin-top:auto; padding-top:24px; }
.home-line{ font-size:12.5px; color:var(--ink-2); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.home-line .dot{ width:8px; height:8px; border-radius:50%; background:var(--muted); flex-shrink:0; }
.home-line.ok{ color:var(--ink); }
.home-line.ok .dot{ background:var(--pass); }
.home-line.err{ color:var(--fail); }
.home-line.err .dot{ background:var(--fail); }
.home-line .mono{ font-family:var(--mono); color:var(--muted); font-size:11.5px; }
.home-line strong{ font-weight:600; }

/* ---------- top-right user menu ---------- */
.ws-user{ position:relative; }
.ws-user > summary{ list-style:none; cursor:pointer; user-select:none; }
.ws-user > summary::-webkit-details-marker{ display:none; }
.ws-user > summary::marker{ content:""; }
.ws-usermenu{ position:absolute; right:0; top:calc(100% + 8px); min-width:200px; background:var(--surface);
  border:1px solid var(--line); border-radius:var(--r); box-shadow:0 8px 28px rgba(20,24,50,.16); padding:6px; z-index:40; }
.ws-usermenu-head{ display:flex; flex-direction:column; gap:2px; padding:8px 10px 10px; border-bottom:1px solid var(--line-2); }
.ws-usermenu-name{ font-size:13px; font-weight:600; }
.ws-usermenu-host{ font-size:11px; color:var(--muted); }
.ws-usermenu-item{ width:100%; text-align:left; border:0; background:transparent; color:var(--ink);
  font-size:13px; padding:9px 10px; border-radius:var(--r-sm); margin-top:4px; }
.ws-usermenu-item:hover{ background:var(--surface-3); }

/* ---------- auth gate (shell waits on /api/me) ---------- */
.auth-gate{ height:100vh; display:grid; place-items:center; background:var(--bg); }
.auth-gate-card{ display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:36px 40px;
  box-shadow:0 2px 10px rgba(30,40,80,.06); max-width:360px; }
.auth-gate-card strong{ font-size:15px; }
.auth-gate-card p{ margin:0; font-size:12.5px; color:var(--ink-2); }
.ws-app-glyph.lg{ width:44px; height:44px; border-radius:11px; font-size:15px; margin-bottom:4px; }
.auth-gate-spinner{ width:26px; height:26px; border-radius:50%; border:3px solid var(--line);
  border-top-color:var(--accent); animation:auth-spin .8s linear infinite; }
@keyframes auth-spin{ to{ transform:rotate(360deg); } }
.auth-gate-who{ color:var(--muted); }
.auth-gate-card .btn{ margin-top:6px; }

/* ---------- office-only page guard (cosmetic; API enforces) ---------- */
.access-denied{ display:flex; flex-direction:column; align-items:flex-start; gap:14px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:22px 24px;
  max-width:520px; color:var(--ink-2); font-size:13px; }
.access-denied p{ margin:0; }

/* ---------- scrim (drawer mode) ---------- */
.sidebar-scrim{ display:none; }

/* ---------- responsive ---------- */
@media (max-width: 860px){
  .ws-burger{ display:grid; place-items:center; }
  .app-sidebar{ position:absolute; left:0; top:0; bottom:0; z-index:30; transform:translateX(-100%); transition:transform .22s ease; box-shadow:0 10px 40px rgba(20,24,50,.18); }
  .app-sidebar.open{ transform:translateX(0); }
  /* In drawer mode, always show the full sidebar even if collapsed was persisted on desktop */
  .app-sidebar.collapsed{ width:250px; padding:14px 12px; }
  .app-sidebar.collapsed .as-logo{ display:flex; }
  .app-sidebar.collapsed .as-mark{ display:none; }
  .app-sidebar.collapsed .as-group-label,
  .app-sidebar.collapsed .as-item-text,
  .app-sidebar.collapsed .as-badge,
  .app-sidebar.collapsed .as-foot{ display:revert; }
  .app-sidebar.collapsed .as-head{ flex-direction:row; }
  .app-sidebar.collapsed .as-item{ justify-content:flex-start; padding:8px; gap:10px; }
  .sidebar-scrim.open{ display:block; position:absolute; inset:0; background:rgba(20,24,40,.35); z-index:20; }
  .ws-search{ display:none; }

  /* Mobile chrome (drawer mode): keep the top bar and report toolbar on a single row instead of
     wrapping and growing tall (#93). The top bar has a fixed 48px height, so wrapping only crowds it;
     drop the host pill and stop the tab name wrapping. The report toolbar is the real grower
     (flex-wrap:wrap with title + ASTM + save + tally + status), so pin it nowrap, hide the decorative
     bits (variant pill, ASTM chip, save indicator), truncate the title, and keep the operationally
     important pass/fail tally and Draft/Submitted status fully visible. */
  .ws-host-pill{ display:none; }
  .ws-tab-name{ white-space:nowrap; }

  .report-toolbar{ flex-wrap:nowrap; gap:10px; padding:10px 14px; }
  .rt-title{ min-width:0; }
  .rt-title h1{ font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .report-toolbar .variant-pill,
  .report-toolbar .astm,
  .report-toolbar .save-ind{ display:none; }
  .result-tally,
  .status-pill{ flex-shrink:0; }
}
@media (max-width: 600px){
  .report-scroll{ padding:12px 12px; }
  .lv-page,.stub{ padding:18px 14px 40px; }
}

/* ============================================================================
   Blazor boot progress + error UI (referenced from index.html), retinted.
   ============================================================================ */
.loading-progress{ position:relative; display:block; width:8rem; height:8rem; margin:20vh auto 1rem; }
.loading-progress circle{ fill:none; stroke:var(--line); stroke-width:.6rem; transform-origin:50% 50%; transform:rotate(-90deg); }
.loading-progress circle:last-child{ stroke:var(--accent);
  stroke-dasharray:calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition:stroke-dasharray .05s ease-in-out; }
.loading-progress-text{ position:absolute; text-align:center; font-weight:bold; inset:calc(20vh + 3.25rem) 0 auto .2rem; color:var(--ink-2); }
.loading-progress-text::after{ content:var(--blazor-load-percentage-text, "Loading"); }

#blazor-error-ui{ background:lightyellow; bottom:0; box-shadow:0 -1px 2px rgba(0,0,0,.2); display:none;
  left:0; padding:.6rem 1.25rem .7rem 1.25rem; position:fixed; width:100%; z-index:1000; }
#blazor-error-ui .dismiss{ cursor:pointer; position:absolute; right:.75rem; top:.5rem; }
