/* ============================================================
   Ceresity Demo — Shared Stylesheet
   All screens should link this file so styling stays consistent.
   Design tokens live in :root — change a color once, everywhere updates.
   ============================================================ */

:root{
  /* Brand tokens taken from ceresity.com's own stylesheet, so the demo and the
     site cannot drift: --green is the site's --green, --brand-ink is the colour
     it puts ON that green (a near-black with a green cast, not pure black), and
     --forest is its darker green for text on light. The two tints are the site's
     --bg-card-alt / --bg-card, used for secondary and selected controls. */
  --page:#f7f9ff; --white:#ffffff; --stroke:#e9eaef; --green:#2ee89e;
  --brand-ink:#0d1a1e; --forest:#1e5c46; --green-tint:#e7f5ee; --green-tint-2:#f5faf8;
  --pill:100px;

  /* ---- Categorical identity palette -------------------------------------
     Validated with the dataviz validator against the light surface, all-pairs
     (these appear on screen together, not merely adjacent):
       CVD separation      worst pair ΔE 10.9  (target ≥8)
       normal-vision floor worst pair ΔE 21.4  (floor 15)
       contrast            all three ≥ 3:1
     Three slots is the honest ceiling here, not laziness. Red, amber and green
     are reserved for severity and must never carry identity. And a second
     blue-family hue fails the normal-vision floor against --cat-1 (ΔE 6.9 —
     full-colour readers genuinely cannot separate them), so there is room for
     exactly one blue.
     Assign in fixed order and never cycle: a fourth value takes --cat-none.
     --------------------------------------------------------------------- */
  --cat-1:#0e83b3; --cat-1-bg:#e8f4fb; --cat-1-line:rgba(14,131,179,0.26);
  --cat-2:#c2497a; --cat-2-bg:#fdedf3; --cat-2-line:rgba(194,73,122,0.26);
  --cat-3:#7c3aed; --cat-3-bg:#f1edfe; --cat-3-line:rgba(124,58,237,0.24);
  --cat-none:#52607e; --cat-none-bg:#eef1f6; --cat-none-line:rgba(82,96,126,0.20);
  /* Darker steps for TEXT in a category colour. The validated hue above is a
     MARK colour, checked at ≥3:1 against the surface; a 10px bold label needs
     4.5:1, which --cat-1 missed at 3.82. Same hue, stepped down — marks keep the
     validated value, labels use these. */
  --cat-1-ink:#0a6285; --cat-2-ink:#a3355f; --cat-3-ink:#6425cc; --cat-none-ink:#414d66;

  /* ---- Surface tints ----------------------------------------------------
     Where the UI needed warmth rather than more accent colour. These are
     surfaces, not marks: very low chroma, so they carry no meaning and cannot
     be confused with the severity set. This is the lever that adds colour
     broadly without competing with anything that signifies. */
  --tint-cool:#f4f8fd; --tint-warm:#fdf8f4; --tint-mint:#f2fbf7; --tint-lilac:#f7f5fe;
  --text-dark:#0d2137; --text-light:#727d9c; --title:#232323; --muted:#64748b;
  --crumb:#bbbbbb; --btn-bg:#f4f5fb; --btn-text:#454567;
  --section-bg:#f7f9fa; --section-num:rgba(58,152,169,0.4);
  --sug-tag-bg:rgba(46,232,158,0.05); --sug-tag-text:#3a98a9;
  --y50:#fefce8; --y200:#fef08a; --y400:#facc15; --y600:#ca8a04;
  --badge-bg:#eafff6; --index-active:rgba(221,246,236,0.28);
  --hl-rest:#fefce8; --hl-hover:#FEF08A;
  --teal:#2e8a9c;
  --bot-grad:linear-gradient(140deg,#10D98C 0%, #1FC2C6 52%, #4FA3FF 100%);
}
*{box-sizing:border-box; margin:0; padding:0;}
html{ scroll-behavior:smooth; }
body{ font-family:'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background:var(--page); color:var(--title); -webkit-font-smoothing:antialiased; }
.app{ width:1440px; margin:0 auto; padding:10px; }
.stack{ display:flex; flex-direction:column; gap:8px; }
svg{ display:block; }
.anchor{ scroll-margin-top:16px; }

/* ---------- Top card ---------- */
.topcard{ background:var(--white); border-radius:12px; padding:17px 19px; }
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
/* the back arrow is a third child of a space-between row, which would otherwise
   push the title into the middle — pinning the slack after the title keeps the
   arrow and the trial name together on the left. Harmless where there is no
   arrow, since auto and space-between agree with two children. */
.title-area{ display:flex; flex-direction:column; gap:9px; margin-right:auto; }
.title{ font-size:20px; font-weight:800; color:var(--title); }
.breadcrumb{ font-size:14px; font-weight:600; color:var(--crumb); }
.breadcrumb .u{ text-decoration:underline; } .breadcrumb .i{ font-style:italic; }
.actions{ display:flex; align-items:center; gap:10px; }
.iconbtn,.textbtn,.primarybtn{ height:32px; border:none; border-radius:8px; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:4px; padding:8px 12px;
  font-family:inherit; font-size:14px; font-weight:600; white-space:nowrap; }
.iconbtn,.textbtn{ background:var(--btn-bg); color:var(--btn-text); }
.iconbtn svg,.textbtn svg{ color:var(--btn-text); }
.iconbtn{ width:44px; } .iconbtn svg{ width:20px; height:20px; } .textbtn svg{ width:16px; height:16px; }
/* the site's primary CTA: brand green, near-black label, fully rounded */
.primarybtn{ background:var(--green); color:var(--brand-ink); border-radius:var(--pill); }
.primarybtn svg{ width:16px; height:16px; color:var(--brand-ink); }

/* ---------- Version picker ----------
   The header's version control opens the list of review runs. Anchored to the
   button rather than centred as a modal: it switches between versions of what
   is already on screen, it is not a separate task. */
.ver-wrap{ position:relative; }
.ver-chev{ width:14px!important; height:14px!important; transition:transform .18s ease; }
.ver-wrap.open .ver-chev{ transform:rotate(180deg); }
.ver-wrap.open .textbtn{ background:#e9ebf4; }
.ver-pop{ display:none; position:absolute; top:calc(100% + 8px); right:0; z-index:60; width:400px;
  background:var(--white); border:1px solid var(--stroke); border-radius:14px; overflow:hidden;
  box-shadow:0 16px 44px rgba(13,33,55,0.16); }
.ver-wrap.open .ver-pop{ display:block; }
.ver-pop-h{ padding:14px 16px; border-bottom:1px solid var(--stroke); }
.ver-pop-h .t{ display:block; font-size:14px; font-weight:700; color:var(--title); }
.ver-pop-h .s{ display:block; font-size:11.5px; line-height:16px; color:var(--text-light); margin-top:3px; }
.ver-list{ max-height:min(430px, 60vh); overflow-y:auto; }
.ver-item{ display:flex; gap:11px; width:100%; padding:12px 16px; border:none; background:none;
  cursor:pointer; text-align:left; font-family:inherit; border-bottom:1px solid #f4f5fa; }
.ver-item:hover{ background:#fafbff; }
.ver-item.active{ background:var(--badge-bg); }
.ver-tick{ width:16px; height:16px; flex:none; margin-top:2px; color:#0a8f57; }
.ver-item:not(.active) .ver-tick{ visibility:hidden; }
.ver-txt{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.ver-txt .vt{ font-size:13.5px; font-weight:700; color:var(--title); }
.ver-item.active .vt{ color:#0a7d4d; }
.ver-txt .vm{ font-size:11px; font-weight:600; color:#9aa3b6; }
.ver-txt .vd{ font-size:12px; line-height:17px; color:var(--text-light); }
.ver-new{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:12px;
  border:none; border-top:1px solid var(--stroke); background:none; cursor:pointer; font-family:inherit;
  font-size:13px; font-weight:700; color:#0a8f57; }
.ver-new:hover{ background:var(--badge-bg); }
a.ver-new{ text-decoration:none; }
.ver-new svg{ width:15px; height:15px; }

/* ---------- Version picker ----------
   The header's version control opens the list of review runs. Anchored to the
   button rather than centred as a modal: it is a switch between versions of
   what is already on screen, not a separate task. */
.ver-wrap{ position:relative; }
.ver-chev{ width:14px!important; height:14px!important; transition:transform .18s ease; }
.ver-wrap.open .ver-chev{ transform:rotate(180deg); }
.ver-wrap.open .textbtn{ background:#e9ebf4; }
.ver-pop{ display:none; position:absolute; top:calc(100% + 8px); right:0; z-index:60; width:400px;
  background:var(--white); border:1px solid var(--stroke); border-radius:14px; overflow:hidden;
  box-shadow:0 16px 44px rgba(13,33,55,0.16); }
.ver-wrap.open .ver-pop{ display:block; }
.ver-pop-h{ padding:14px 16px; border-bottom:1px solid var(--stroke); }
.ver-pop-h .t{ display:block; font-size:14px; font-weight:700; color:var(--title); }
.ver-pop-h .s{ display:block; font-size:11.5px; line-height:16px; color:var(--text-light); margin-top:3px; }
.ver-list{ max-height:min(430px, 60vh); overflow-y:auto; }
.ver-item{ display:flex; gap:11px; width:100%; padding:12px 16px; border:none; background:none;
  cursor:pointer; text-align:left; font-family:inherit; border-bottom:1px solid #f4f5fa; }
.ver-item:hover{ background:#fafbff; }
.ver-item.active{ background:var(--badge-bg); }
.ver-tick{ width:16px; height:16px; flex:none; margin-top:2px; color:#0a8f57; }
.ver-item:not(.active) .ver-tick{ visibility:hidden; }
.ver-txt{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.ver-txt .vt{ font-size:13.5px; font-weight:700; color:var(--title); }
.ver-item.active .vt{ color:#0a7d4d; }
.ver-txt .vm{ font-size:11px; font-weight:600; color:#9aa3b6; }
.ver-txt .vd{ font-size:12px; line-height:17px; color:var(--text-light); }
.ver-new{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:12px;
  border:none; border-top:1px solid var(--stroke); background:none; cursor:pointer; font-family:inherit;
  font-size:13px; font-weight:700; color:#0a8f57; }
.ver-new:hover{ background:var(--badge-bg); }
a.ver-new{ text-decoration:none; }
.ver-new svg{ width:15px; height:15px; }

/* ---------- Main card ---------- */
.maincard{ background:var(--white); border-radius:8px; padding:16px; display:flex; flex-direction:column; gap:24px; }
.tabs-wrap{ padding:0 8px; }
.tabs{ display:flex; align-items:center; border-bottom:1px solid var(--stroke); overflow-x:auto;
  scrollbar-width:none; -ms-overflow-style:none; }
.tabs::-webkit-scrollbar{ display:none; }
.tab{ display:flex; align-items:center; gap:10px; height:56px; padding:22px 14px; cursor:pointer;
  flex:0 0 auto; white-space:nowrap; }
.tab svg{ width:24px; height:24px; } .tab .lbl{ font-size:16px; }
.tab.active{ border-bottom:2px solid var(--green); color:#040b15; }
.tab.active .lbl{ font-weight:600; } .tab.active svg{ color:#040b15; }
.tab:not(.active){ color:var(--text-light); } .tab:not(.active) .lbl{ font-weight:400; }

/* While a trace root is set, every tab that holds something for it carries the
   count of what it holds — `data-root-n`, written by updateTabRootHighlight().
   The number is the point: it says how much is waiting there, not merely that
   something is. Kept small so it never competes with the active-tab underline. */
.tab{ position:relative; }
.tab.has-root-data::after{ content:attr(data-root-n); position:absolute; top:9px; right:2px;
  min-width:17px; height:17px; padding:0 5px; border-radius:9px; background:var(--green); color:var(--brand-ink);
  font-size:10.5px; font-weight:700; line-height:17px; text-align:center;
  box-shadow:0 0 0 3px rgba(46,232,158,0.16); }
.tab.has-root-data:not(.active){ color:var(--text-dark); }
.tab.has-root-data:not(.active) .lbl{ font-weight:500; }
/* same badge on the active tab, just quieter — the underline already says
   "you are here" */
.tab.has-root-data.active::after{ background:#0d8a5f; box-shadow:none; opacity:.62; }

/* Protocol Amendment 2 — predicted added/removed per tab, next to the label */
.amend-badge{ display:inline-flex; gap:5px; font-size:10.5px; font-weight:800; font-style:normal; }
.amend-badge .up{ color:var(--sev-crit); font-style:normal; }
.amend-badge .down{ color:#0a8f57; font-style:normal; }
/* the tab labels have to make room for the badge */
.tab.has-root-data{ padding-right:26px; }
.tab:not(.active) svg{ color:var(--text-light); }

.stats{ display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:12px; }
.stats-left{ display:flex; gap:8px; } .stats-right{ display:flex; gap:10px; align-items:center; }

/* Burden scores reuse the .statcard look so they read as siblings of the
   Similar Trials / Relevant Documents cards rather than a separate widget. */
.statcard{ background:var(--white); border:1px solid var(--stroke); border-radius:12px;
  padding:8px 12px; display:flex; align-items:center; justify-content:center; }
.statcard.w275{ width:275px; } .statcard.clickable{ cursor:pointer; user-select:none; }
.statcard.clickable:hover{ border-color:#cfd3e0; }
.statcard.toggled{ border-color:var(--green); background:rgba(46,232,158,0.05); }
.stats-right .statcard{ width:156px; justify-content:flex-start; }
.stat-row{ display:flex; align-items:center; justify-content:space-between; height:28px; width:100%; }
.stat-label{ font-size:14px; font-weight:600; color:var(--text-light); white-space:nowrap; }
.stat-right{ display:flex; align-items:center; gap:8px; }
.stat-num{ color:var(--text-dark); font-weight:600; }
.stat-num .big{ font-size:20px; } .stat-num .small{ font-size:12px; letter-spacing:0.18px; }
.stat-edit,.stat-info{ width:18px; height:18px; color:var(--green); cursor:pointer; }
.stat-inline{ display:flex; align-items:center; gap:12px; white-space:nowrap; }
/* square, label-less variant — the pencil beside Filter by */
.statcard.icon-only{ width:44px; padding:8px; text-decoration:none; }
.statcard.icon-only .stat-inline{ gap:0; }
.funnel{ width:24px; height:24px; color:var(--text-light); }
.checkbox{ width:16px; height:16px; min-width:16px; background:var(--white); border:1px solid #cbd5e1;
  border-radius:4px; box-shadow:0 1px 2px rgba(0,0,0,0.05); display:flex; align-items:center; justify-content:center; }
.checkbox svg{ width:10px; height:10px; color:var(--brand-ink); opacity:0; }
.checkbox.checked{ background:var(--green); border-color:var(--green); } .checkbox.checked svg{ opacity:1; }

/* ---------- Content row ---------- */
.content{ display:flex; gap:16px; align-items:stretch; position:relative; }

/* left index */
/* The index follows the document. It is a navigation control for a page that
   scrolls for screens at a time — having to scroll back up to reach it defeats
   the point. Sticky rather than fixed so it still sits inside the column and
   stops at the bottom of the document. It scrolls internally when the list is
   taller than the viewport. */
.index{ flex:0 0 244px; width:244px; background:var(--white); border:1px solid var(--stroke);
  border-radius:16px; padding:8px; display:flex; flex-direction:column; gap:2px; align-self:flex-start;
  position:sticky; top:14px; max-height:calc(100vh - 28px); overflow-y:auto; overscroll-behavior:contain; }
.index::-webkit-scrollbar{ width:6px; }
.index::-webkit-scrollbar-thumb{ background:#e4e7f0; border-radius:3px; }
.index-head{ display:flex; align-items:center; justify-content:space-between; padding:8px 8px 6px; }
.index-head .h{ font-size:14px; font-weight:600; color:var(--text-dark); }
.index-toggle{ width:24px; height:24px; color:var(--text-light); cursor:pointer; background:none; border:none; padding:0;
  display:flex; align-items:center; justify-content:center; border-radius:6px; }
.index-toggle:hover{ background:#f4f5fb; color:var(--text-dark); }
.index-divider{ height:1px; background:var(--stroke); width:100%; margin-bottom:4px; }
.index-item{ display:flex; align-items:center; justify-content:space-between; min-height:40px;
  padding:8px 8px 8px 10px; border-radius:8px; cursor:pointer; position:relative; }
.index-item:hover{ background:#f6f8fb; }
.index-item .left{ display:flex; gap:10px; align-items:center; min-width:0; }
.index-item .num{ font-size:12px; font-weight:700; letter-spacing:0.18px; color:var(--text-light);
  width:16px; flex:0 0 16px; text-align:center; }
.index-item .name{ font-size:14px; font-weight:500; color:var(--text-dark); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.index-item .right{ display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.index-item .badge{ background:var(--badge-bg); border:0.6px solid rgba(46,232,158,0.18); border-radius:7px;
  min-width:22px; text-align:center; padding:2px 7px; font-size:12px; font-weight:600; color:var(--green); }
/* a badge carrying a suggestion count is now the control that opens that
   section's list, so it has to read as clickable */
.index-item .badge[data-suglist]{ cursor:pointer; transition:background .15s ease, border-color .15s ease; }
.index-item .badge[data-suglist]:hover{ background:rgba(46,232,158,0.16); border-color:rgba(46,232,158,0.45); }
.index-item .caret{ width:16px; height:16px; color:var(--text-light); transform:rotate(-90deg); transition:transform .2s ease; }
.index-item.open .caret{ transform:rotate(0deg); }
.index-item.active{ background:var(--index-active); box-shadow:inset 2px 0 0 var(--green); }
.index-item.active .num{ color:var(--green); } .index-item.active .name{ color:var(--green); font-weight:600; }
.subs{ display:none; flex-direction:column; gap:1px; padding:2px 0 6px; }
.subs.open{ display:flex; }
.sub-item{ font-size:13px; font-weight:500; color:var(--text-light); padding:7px 8px 7px 36px;
  border-radius:8px; cursor:pointer; position:relative; }
.sub-item:hover{ background:#f6f8fb; color:var(--text-dark); }
.sub-item::before{ content:""; position:absolute; left:22px; top:50%; width:5px; height:5px; border-radius:50%;
  background:#cbd5e1; transform:translateY(-50%); }
.sub-item.active{ color:var(--green); background:var(--index-active); } .sub-item.active::before{ background:var(--green); }

.index-rail{ display:none; flex:0 0 46px; width:46px; align-self:flex-start; background:var(--white);
  border:1px solid var(--stroke); border-radius:16px; padding:10px 0; flex-direction:column; align-items:center; gap:10px;
  position:sticky; top:14px; max-height:calc(100vh - 28px); overflow-y:auto; overscroll-behavior:contain; }
.index-rail button{ background:none; border:none; cursor:pointer; color:var(--text-light); padding:6px; border-radius:6px; }
.index-rail button:hover{ background:#f4f5fb; } .index-rail svg{ width:20px; height:20px; }
.rail-nums{ display:flex; flex-direction:column; align-items:center; gap:6px; margin-top:6px; }
.rail-num{ width:30px; height:30px; border-radius:8px; font-family:inherit; font-size:12px; font-weight:700;
  letter-spacing:0.3px; color:var(--text-light)!important; display:flex; align-items:center; justify-content:center; }
.rail-num:hover{ background:var(--index-active)!important; color:var(--green)!important; }
.content.collapsed .index{ display:none; } .content.collapsed .index-rail{ display:flex; }

/* middle document */
.doc{ flex:1 1 auto; min-width:0; border:1px solid var(--stroke); border-radius:16px; padding:27px;
  display:flex; flex-direction:column; gap:24px; }
.doc-section{ display:flex; flex-direction:column; gap:24px; }
.doc-title{ font-size:16px; font-weight:700; color:var(--title); line-height:1.35; }
.doc-head{ display:flex; flex-direction:column; gap:6px; }
.phase-meta{ font-size:12px; font-weight:500; color:var(--text-light); letter-spacing:0.2px; }
/* nothing sits opposite the label any more, so the heading is label-only —
   `space-between` is kept for the SAP/CSR heads that reuse this class */
.sec-head{ background:var(--section-bg); border-radius:8px; padding:12px 17px; display:flex; align-items:center; justify-content:space-between; }
.sec-head .label{ display:flex; gap:8px; align-items:center; font-size:16px; font-weight:700; }
.sec-head .num{ color:var(--section-num); } .sec-head .name{ color:var(--title); }
.sug-count{ background:var(--sug-tag-bg); border-radius:8px; padding:6px 14px; font-size:14px; font-weight:600;
  color:var(--sug-tag-text); cursor:pointer; user-select:none; display:flex; align-items:center; gap:6px; }
.sug-count:hover{ background:rgba(46,232,158,0.12); }
.sug-count svg{ width:14px; height:14px; }
.para-wrap{ padding:0 16px; }
.para{ font-size:14px; font-weight:400; line-height:21px; color:var(--muted); text-align:justify; }
.show-more{ color:var(--green); font-weight:600; text-decoration:underline; cursor:pointer; margin-left:4px; }
/* important validation comment — one of the ranked few the review wants read
   first. Stepped down from --green because the mark sits on the yellow finding
   highlight as well as on white, and the brand green is too light on both. */
.key-star{ color:#0a8f57; font-weight:700; font-size:12px; line-height:1; margin-left:3px;
  vertical-align:super; cursor:help; }
/* collapsed passage: the remainder is in the DOM but hidden, and the trailing
   "…" disappears once it is revealed (see renderRuns in protocol.js) */
.mt-rest{ display:none; }
.mt-rest.open{ display:inline; }
.mt-ellip.hide{ display:none; }
.sub-block{ padding:0 16px; display:flex; flex-direction:column; gap:24px; }
.sub-head{ font-size:16px; font-weight:600; color:var(--text-dark); }
.sub-divider{ height:1px; background:var(--stroke); width:100%; }
.index-item .badge.empty{ background:#f1f3f8; border-color:#e6e9f0; color:#9aa3b6; }
.empty-state{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:44px 24px;
  border:1px dashed var(--stroke); border-radius:14px; background:#fcfdff; }
.empty-ic{ width:60px; height:60px; border-radius:50%; background:#f3f6fb; display:flex; align-items:center; justify-content:center; color:#b6c0d2; margin-bottom:4px; }
.empty-ic svg{ width:28px; height:28px; }
.empty-t{ font-size:15px; font-weight:700; color:var(--text-dark); }
.empty-s{ font-size:13px; line-height:20px; color:var(--text-light); max-width:380px; }

/* flags — phrase-level highlights are ALWAYS visible (default unchecked state) */
.flag{ border-radius:4px; padding:1px 2px; background:var(--hl-rest); cursor:pointer;
  box-decoration-break:clone; -webkit-box-decoration-break:clone; transition:background .15s ease, color .15s ease; }
.flag.flag-active{ background:var(--hl-hover)!important; color:#000!important; }

/* section-level flag (whole sub-section is the finding, e.g. Exclusion Criteria) */
.flag-section{ position:relative; border-radius:10px; transition:background .15s ease, box-shadow .15s ease; cursor:pointer; }
.flag-section > .sub-head{ display:inline-block; background:var(--hl-rest); border-radius:4px; padding:2px 6px; transition:background .15s ease; }
.flag-section.flag-active{ background:rgba(254,240,138,0.28); box-shadow:inset 3px 0 0 var(--y400); }
.flag-section.flag-active > .sub-head{ background:var(--hl-hover); color:#000; }

/* findings-only (CHECKED) view: keep sections, show flagged items only */
.content.findings-on .doc-section:not(:has(.flag, .flag-section)){ display:none; }
.content.findings-on .sub-block:not(:has(.flag)):not(.flag-section){ display:none; }
.content.findings-on .sub-divider{ display:none; }
.content.findings-on .para:not(.has-flag){ display:none; }
.content.findings-on .has-flag .ctx{ display:none; }
.content.findings-on .incl-list .incl-intro{ display:none; }
.content.findings-on .incl-list li:not(.has-flag){ display:none; }
.content.findings-on .incl-list li.has-flag .ctx{ display:none; }
.content.findings-on .incl-list ol{ gap:14px; }
.content.findings-on .incl-list li::before{ display:none; }
.content.findings-on .incl-list li.has-flag{ padding-left:0; }
.content.findings-on .flag-section .excl-list{ display:none; }   /* condensed: show only the section head */
/* A WHOLE-SECTION finding (`flagSection` in protocol.content.js) has no per-item
   flag to mark, because the whole block IS the finding. The rules above hide any
   paragraph or list item without `.has-flag`, which left such a block showing its
   heading and nothing else — Interim/Other Analyses was a heading over empty
   space in findings-only view. Inside a flag-section, keep the content. */
.content.findings-on .sub-block.flag-section .para,
.content.findings-on .sub-block.flag-section .incl-list li,
.content.findings-on .sub-block.flag-section .incl-list .incl-intro{ display:block; }
.content.findings-on .sub-block.flag-section .incl-list li .ctx{ display:inline; }

.incl-list{ padding:0 16px; }
.incl-intro{ font-size:14px; line-height:21px; color:var(--muted); margin-bottom:14px; }
.incl-list ol{ list-style:none; counter-reset:incl; display:flex; flex-direction:column; gap:10px; padding-left:0; }
.incl-list li{ counter-increment:incl; font-size:14px; line-height:21px; color:var(--muted); text-align:justify;
  position:relative; padding-left:30px; }
.incl-list li::before{ content:counter(incl) "."; position:absolute; left:0; top:0; width:22px; text-align:right;
  font-weight:600; color:var(--text-dark); }

/* ---------- Right column ---------- */
.suggestcol{ flex:0 0 339px; width:339px; position:relative; }
.hint{ position:absolute; top:380px; left:0; width:339px; text-align:center; font-size:13px; color:#c4cbd9;
  font-weight:500; padding:0 24px; line-height:1.5; transition:opacity .2s ease; pointer-events:none; }

/* hover suggestion card */
/* A long suggestion used to run off the bottom of the card, which silently
   truncated the text. The card is now bounded by the viewport and the body
   scrolls inside it — the header and the tags stay put. */
.suggestion-card{ position:absolute; top:380px; left:0; width:339px; background:var(--white);
  border:1px solid rgba(46,232,158,0.49); border-radius:12px; overflow:hidden; box-shadow:0 0 0 3px rgba(46,232,158,0.08);
  display:flex; flex-direction:column; gap:12px; padding-bottom:16px; max-height:calc(100vh - 28px);
  opacity:0; visibility:hidden; pointer-events:none; transform:translateY(4px); transition:opacity .15s ease, transform .15s ease; z-index:5; }
.suggestion-card.show{ opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0); }
.sug-header{ background:rgba(46,232,158,0.03); border-bottom:1px solid rgba(46,232,158,0.16); padding:10px 12px;
  display:flex; align-items:center; justify-content:space-between; min-height:41px; }
.sug-h-left{ display:flex; align-items:center; gap:8px; }
.sug-header svg.spark{ width:18px; height:18px; color:var(--green); }
.sug-header .t{ font-size:14px; font-weight:600; color:var(--green); }
.sug-pager{ display:flex; align-items:center; gap:8px; }
.pager-label{ font-size:13px; font-weight:600; color:var(--text-light); }
.pager-btn{ width:28px; height:28px; border-radius:50%; border:1px solid var(--stroke); background:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:var(--text-light); padding:0; }
.pager-btn:hover{ background:#f4f5fb; color:var(--text-dark); }
.pager-btn svg{ width:14px; height:14px; }
.sug-body{ padding:0 16px; font-size:14px; line-height:21px; color:#000;
  overflow-y:auto; overscroll-behavior:contain; min-height:0; }
.sug-body::-webkit-scrollbar{ width:6px; }
.sug-body::-webkit-scrollbar-thumb{ background:#e4e7f0; border-radius:3px; }
.sug-header,.sug-row,.sug-divider,.sug-tags,.sug-source{ flex:none; }
.sug-row{ padding:0 16px; display:flex; align-items:center; justify-content:space-between; }
.pill-yellow{ background:var(--y50); border:0.5px solid var(--y200); border-radius:34px; padding:3px 10px;
  font-size:10px; font-weight:500; color:var(--y600); letter-spacing:0.15px; white-space:nowrap; }
.view-details{ display:flex; align-items:center; gap:4px; cursor:pointer; text-decoration:none; }
.view-details .vd{ font-size:11px; font-weight:600; color:var(--green); text-decoration:underline; }
.view-details svg{ width:14px; height:14px; color:var(--green); }
.sug-divider{ height:1px; background:#e7e9f0; margin:0 16px; }
.sug-tags{ padding:0 16px; display:flex; flex-direction:column; gap:8px; }
.sug-tags .affects{ font-size:10px; font-weight:500; color:var(--text-dark); letter-spacing:0.15px; }
.sug-tags .pills{ display:flex; flex-wrap:wrap; gap:8px; }
.pill{ border-radius:34px; padding:4px 12px; font-size:12px; letter-spacing:0.18px; white-space:nowrap; }
.pill.green{ background:var(--green); color:var(--brand-ink); font-weight:600; }
.pill.outline{ border:1px solid #ebf0ee; color:var(--text-light); font-weight:500; }
.pill.link{ cursor:pointer; } .pill.link:hover{ border-color:var(--green); color:var(--green); }
/* interlinking source note */
.sug-source{ margin:0 16px; background:#f5f7fa; border-radius:10px; padding:12px 14px; display:flex; flex-direction:column; gap:8px; }
.sug-source p{ font-size:13px; line-height:19px; color:var(--text-light); }
.sug-source a{ display:flex; align-items:center; gap:6px; font-size:13px; font-weight:700; color:var(--teal);
  text-decoration:underline; cursor:pointer; }
.sug-source a svg{ width:14px; height:14px; }

/* ---------- side panels (suggestions list / filters) ----------
   Absolutely positioned rather than sticky: alignPanel() in protocol.js drops
   the panel level with whatever opened it, the same way positionCard() places
   the hover suggestion card. A finding halfway down a long document therefore
   opens its detail beside itself instead of at the top of the column. The
   top/max-height below are only the fallback for a panel opened with no
   anchor (the toolbar's Filters button). */
.side-panel{ position:absolute; top:14px; left:0; z-index:6; width:339px; background:var(--white); border:1px solid var(--stroke);
  border-radius:14px; display:none; flex-direction:column; max-height:calc(100vh - 28px); overflow:hidden;
  box-shadow:0 8px 30px rgba(23,43,77,0.08); }
.side-panel.show{ display:flex; }
.panel-head{ display:flex; align-items:flex-start; justify-content:space-between; padding:16px; border-bottom:1px solid var(--stroke); }
.panel-title{ display:flex; flex-direction:column; gap:2px; }
.panel-title .pt{ font-size:16px; font-weight:700; color:var(--title); }
.panel-title .ps{ font-size:12px; font-weight:600; color:#7c83ff; }
.panel-close{ width:30px; height:30px; border:none; background:none; cursor:pointer; color:var(--text-light);
  display:flex; align-items:center; justify-content:center; border-radius:8px; }
.panel-close:hover{ background:#f4f5fb; color:var(--text-dark); } .panel-close svg{ width:20px; height:20px; }
.panel-scroll{ padding:16px; overflow-y:auto; overscroll-behavior:contain; display:flex;
  flex-direction:column; gap:20px; min-height:0; }
.panel-scroll::-webkit-scrollbar{ width:6px; }
.panel-scroll::-webkit-scrollbar-thumb{ background:#e4e7f0; border-radius:3px; }

/* gray list cards */
.lc{ flex:0 0 auto; background:#fcfcfd; border:1px solid #ededf2; border-radius:14px; overflow:hidden; display:flex; flex-direction:column;
  gap:12px; padding-bottom:14px; cursor:pointer; transition:border-color .15s, background .15s, box-shadow .15s; }
.lc .lc-h{ background:#f7f8fa; border-bottom:1px solid #f0f1f5; padding:11px 14px; display:flex; align-items:center; gap:8px; }
.lc .lc-h svg{ width:17px; height:17px; color:#aab2c4; } .lc .lc-h .t{ font-size:14px; font-weight:600; color:#9aa3b6; }
.lc .lc-body{ padding:0 14px; font-size:13px; line-height:20px; color:#41495a; }
.lc .lc-row{ padding:2px 14px 0; display:flex; align-items:center; justify-content:space-between; }
.lc .pill-yellow{ background:#f6f7f9; border-color:#e6e8ee; color:#8a93a6; }
.lc .view-details .vd{ color:#8a93a6; } .lc .view-details svg{ color:#8a93a6; }
.lc.active{ background:#fff; border-color:rgba(46,232,158,0.5); box-shadow:0 0 0 3px rgba(46,232,158,0.08); }
.lc.active .lc-h{ background:rgba(46,232,158,0.03); border-bottom-color:rgba(46,232,158,0.16); }
.lc.active .lc-h svg{ color:var(--green); } .lc.active .lc-h .t{ color:var(--green); }
.lc.active .lc-body{ color:#000; }
.lc.active .pill-yellow{ background:var(--y50); border-color:var(--y200); color:var(--y600); }
.lc.active .view-details .vd{ color:var(--green); } .lc.active .view-details svg{ color:var(--green); }

/* information panel — opened by the "i" leg of any trace widget */
.panel-scroll .info-sec{ display:flex; flex-direction:column; gap:8px; }
.info-sec-h{ font-size:10px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase; color:#9aa3b6; }
.info-text{ font-size:13px; line-height:19px; color:var(--text-dark); }
.info-note{ font-size:12px; line-height:18px; color:var(--text-light); font-style:italic; }
.info-kv{ display:grid; grid-template-columns:minmax(74px,96px) 1fr; gap:10px; align-items:baseline;
  padding:7px 0; border-bottom:1px solid #f1f3f8; }
.info-sec .info-kv:last-child{ border-bottom:none; }
.info-kv .k{ font-size:11px; font-weight:600; color:var(--text-light); }
.info-kv .v{ font-size:12.5px; line-height:18px; color:var(--text-dark); word-break:break-word; }
.info-kv .v b{ font-weight:700; }
.info-mono{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11.5px; color:var(--btn-text);
  background:var(--btn-bg); border:1px solid var(--stroke); border-radius:4px; padding:1px 6px; }
.info-path{ display:block; margin-top:3px; font-size:10.5px; line-height:15px; color:#9aa3b6; }
.info-chips{ display:inline-flex; flex-wrap:wrap; gap:5px; }
.info-chip{ font-size:10.5px; font-weight:600; color:var(--sug-tag-text); background:var(--sug-tag-bg);
  border:0.6px solid rgba(46,232,158,0.22); border-radius:6px; padding:2px 7px; }
.info-none{ font-size:12px; color:#aab2c4; font-style:italic; }
.info-root-btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; width:100%;
  border:1px solid rgba(46,232,158,0.35); background:var(--badge-bg); color:#0d8a5f; border-radius:9px;
  padding:9px 12px; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer;
  transition:background .15s, border-color .15s; }
.info-root-btn:hover{ background:#d7fbec; }
.info-root-btn svg{ width:14px; height:14px; }

/* filters panel */
.filters-body{ padding:16px; display:flex; flex-direction:column; gap:16px; overflow-y:auto; }
.filters-sec{ display:flex; flex-direction:column; gap:10px; }
.filters-sec.bordered{ border-top:1px solid var(--stroke); padding-top:16px; }
.filters-label{ font-size:14px; font-weight:600; color:var(--title); }
.country-field{ position:relative; }
.country-select{ border:1px solid var(--stroke); border-radius:8px; padding:8px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; cursor:pointer; }
.country-select .ph{ font-size:14px; font-weight:400; color:var(--text-light); }
.country-chip{ background:#f1f3f8; border-radius:6px; padding:4px 9px; font-size:14px; font-weight:400; color:var(--text-dark); display:flex; align-items:center; gap:6px; }
.country-chip svg{ width:12px; height:12px; color:var(--text-light); cursor:pointer; }
.country-select .chev{ margin-left:auto; width:18px; height:18px; color:var(--text-light); transition:transform .2s ease; }
.country-field.open .chev{ transform:rotate(180deg); }
.country-menu{ display:none; position:absolute; left:0; right:0; top:calc(100% + 4px); background:#fff; border:1px solid var(--stroke);
  border-radius:8px; box-shadow:0 8px 24px rgba(20,40,80,0.1); padding:6px; z-index:5; max-height:220px; overflow-y:auto; }
.country-field.open .country-menu{ display:block; }
.country-opt{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:6px; cursor:pointer; font-size:14px; font-weight:400; color:var(--text-dark); }
.country-opt:hover{ background:#f6f8fb; }
.fcheck{ display:flex; align-items:center; gap:10px; cursor:pointer; font-size:14px; font-weight:400; color:var(--text-dark); }
/* the Display section — Findings only moved here from the toggle above the tabs */
.filters-help{ font-size:11.5px; line-height:17px; color:var(--text-light); padding-left:26px; margin-top:-4px; }
#filterFindings,#sapFilterFindings{ font-weight:500; }
/* a filter that changes the document is echoed on the Filter by card */
.statcard.has-filter{ border-color:rgba(46,232,158,0.5); background:rgba(46,232,158,0.05); }
.statcard.has-filter .stat-label{ color:#0d8a5f; font-weight:600; }
.statcard.has-filter .funnel{ color:var(--green); }
.filters-footer{ display:flex; gap:10px; padding:16px; border-top:1px solid var(--stroke); }
.filters-footer button{ flex:1; height:44px; border-radius:10px; border:none; cursor:pointer; font-family:inherit;
  font-size:14px; font-weight:600; }
.btn-reset{ background:#f1f3f8; color:var(--text-dark); }
.btn-apply{ background:var(--green); color:var(--brand-ink); border-radius:var(--pill); }

/* ---------- Evidence overlay (Top Evidence — single column) ---------- */
.evidence-overlay{ position:fixed; inset:0; background:var(--page); z-index:50; overflow-y:auto; display:none; }
.evidence-overlay.show{ display:block; }
.ev-wrap{ width:1440px; margin:0 auto; padding:10px 10px 90px; display:flex; flex-direction:column; gap:8px; }
.ev-topcard{ background:#fff; border-radius:12px; padding:17px 19px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ev-left{ display:flex; align-items:center; gap:14px; }
.ev-back{ width:40px; height:40px; border-radius:10px; background:var(--btn-bg); color:var(--btn-text); border:none;
  cursor:pointer; display:flex; align-items:center; justify-content:center; }
.ev-back:hover{ background:#e9ebf4; } .ev-back svg{ width:20px; height:20px; }

.ev-card{ background:#fff; border:1px solid var(--stroke); border-radius:12px; overflow:hidden; }
.ev-card-head{ background:#f8fafb; border-bottom:1px solid #eef1f4; padding:13px 18px; display:flex; align-items:center; gap:10px; }
.ev-card-head svg{ width:18px; height:18px; color:#8b97aa; }
.ev-card-head .lbl{ font-size:13px; font-weight:600; letter-spacing:1.1px; color:#7a879a; text-transform:uppercase; }
.ev-card-head.green{ background:rgba(46,232,158,0.04); border-bottom-color:rgba(46,232,158,0.14); }
.ev-card-head.green svg{ color:var(--green); } .ev-card-head.green .lbl{ color:var(--green); }
.ev-card-body{ padding:18px; }
.ev-extract{ background:var(--y200); border-radius:4px; padding:2px 4px; font-size:15px; line-height:26px; color:#1c2433;
  box-decoration-break:clone; -webkit-box-decoration-break:clone; }
.ev-text{ font-size:15px; line-height:24px; color:#232323; }
.ev-proposed{ margin:0; padding-left:20px; }
.ev-proposed li{ margin:0 0 8px; font-size:15px; line-height:24px; color:#232323; }
.ev-proposed li:last-child{ margin-bottom:0; }
.ev-checks{ display:flex; flex-direction:column; gap:12px; align-items:flex-start; }
.ev-check{ display:inline-flex; align-items:flex-start; gap:10px; border-radius:10px; padding:9px 14px; font-size:15px; line-height:22px; max-width:100%; }
.ev-check svg{ width:18px; height:18px; flex:0 0 18px; margin-top:1px; }
.ev-check.ok{ background:rgba(46,232,158,0.09); color:#1c2433; } .ev-check.ok svg{ color:var(--green); }
.ev-check.bad{ background:#fdeded; color:#1c2433; } .ev-check.bad svg{ color:#ef4444; }
.ev-check.na{ background:#f3f4f7; color:#6b7280; } .ev-check.na svg{ color:#9aa3b3; }
.ev-srcs{ display:flex; flex-direction:column; gap:14px; }
.ev-group{ border:1px solid var(--stroke); border-radius:12px; overflow:hidden; }
.ev-group-head{ padding:12px 16px; display:flex; align-items:center; gap:12px; cursor:pointer; user-select:none; }
.ev-pill{ background:var(--teal); color:#fff; border-radius:20px; padding:5px 12px; font-size:12px; font-weight:600; white-space:nowrap; }
.ev-count{ font-size:13px; color:var(--text-light); }
.ev-group-head .gchev{ margin-left:auto; width:18px; height:18px; color:var(--teal); transition:transform .2s ease; }
.ev-group.collapsed .gchev{ transform:rotate(180deg); }
.ev-group-body{ padding:0 16px 16px; display:flex; flex-direction:column; gap:12px; }
.ev-group.collapsed .ev-group-body{ display:none; }
.ev-item{ background:#f8fafb; border-radius:10px; padding:14px; display:flex; flex-direction:column; gap:8px; }
.ev-item .it{ font-size:14px; font-weight:600; color:var(--title); line-height:20px; }
/* A cited trial that resolves to a registry record. Same weight as the plain
   title it replaces, so the citation does not shout — the glyph carries it. */
.ev-it-link{ color:inherit; text-decoration:none; display:block; }
.ev-it-link:hover{ color:var(--forest); text-decoration:underline; text-underline-offset:2px; }
.ev-it-link .ev-out{ width:12px; height:12px; margin-left:5px; vertical-align:-1px; color:#9aa3b6; }
.ev-it-link:hover .ev-out{ color:var(--forest); }
.ev-it-nolink{ cursor:help; }
.ev-item .id{ font-size:13px; line-height:20px; color:var(--text-light); }
.ev-page{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:var(--teal); text-decoration:underline; cursor:pointer; }
.ev-page svg{ width:14px; height:14px; }
.ev-ask{ display:flex; align-items:center; gap:16px; padding:16px 18px; border:1.5px solid transparent; border-radius:14px;
  background:
    linear-gradient(120deg,#f6fcfa 0%, #eef4fd 60%, #f5f1fc 100%) padding-box,
    linear-gradient(135deg,#00E185 0%, #28C9C0 50%, #5AA8FF 100%) border-box; }
.ev-ask-ava{ width:46px; height:46px; border-radius:50%; background:var(--bot-grad); display:flex; align-items:center; justify-content:center; flex:0 0 46px; }
.ev-ask-ava svg{ width:24px; height:24px; color:#fff; }
.ev-ask-txt{ flex:1; min-width:0; }
.ev-ask-txt .t{ font-size:15px; font-weight:700; color:#1c2433; }
.ev-ask-txt .s{ font-size:13px; color:#6b7a90; line-height:19px; margin-top:3px; }
.ev-research{ flex:0 0 auto; background:var(--green); color:var(--brand-ink); border:none; border-radius:var(--pill);
  height:46px; padding:0 22px; font-family:inherit; font-size:15px; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:10px; }
.ev-research:hover{ filter:brightness(0.97); }
.ev-research svg{ width:18px; height:18px; }

/* ---------- Ceresity Bot chatbot ---------- */
.chatbot{ position:fixed; top:16px; right:16px; bottom:16px; width:430px;
  border:1.5px solid transparent; border-radius:26px;
  background:
    linear-gradient(165deg,#f6fcfa 0%, #eef4fd 52%, #f5f1fc 100%) padding-box,
    linear-gradient(140deg,#00E185 0%, #28C9C0 45%, #5AA8FF 100%) border-box;
  display:none; flex-direction:column; z-index:70; overflow:hidden; }
.evidence-overlay.chat-open .chatbot{ display:flex; }
.evidence-overlay.chat-open .ev-wrap{ width:auto; margin:0 462px 0 0; padding:10px 28px 40px; }
.cb-head{ display:flex; align-items:center; gap:12px; padding:18px; border-bottom:1px solid rgba(20,40,80,0.06); }
.cb-ava{ width:42px; height:42px; border-radius:50%; background:var(--bot-grad); display:flex; align-items:center; justify-content:center; position:relative; flex:0 0 42px; }
.cb-ava svg{ width:21px; height:21px; color:#fff; }
.cb-ava .dot{ position:absolute; right:0; top:0; width:11px; height:11px; border-radius:50%; background:#22c55e; border:2px solid #fff; }
.cb-title{ flex:1; min-width:0; } .cb-title .n{ font-size:16px; font-weight:700; color:#1c2433; } .cb-title .s{ font-size:13px; color:#7a879a; }
.hbtns{ display:flex; align-items:center; gap:6px; }
.cb-ic{ width:36px; height:36px; border-radius:50%; border:none; background:transparent; color:#46566f; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.cb-ic:hover{ background:rgba(20,40,80,0.06); } .cb-ic svg{ width:18px; height:18px; } .cb-ic.close{ border:1px solid #d6dee9; }
.cb-body{ flex:1; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:14px; }
.cb-row.bot{ display:flex; gap:10px; align-items:flex-start; }
.cb-bot-ava{ width:30px; height:30px; border-radius:50%; background:var(--bot-grad); display:flex; align-items:center; justify-content:center; flex:0 0 30px; margin-top:2px; }
.cb-bot-ava svg{ width:15px; height:15px; color:#fff; }
.cb-bubble{ background:#fff; border:1px solid rgba(20,40,80,0.06); border-radius:16px; border-top-left-radius:6px; padding:14px 16px; font-size:14px; line-height:21px; color:#2a3344; }
.cb-bubble p{ margin-bottom:10px; } .cb-bubble p:last-child{ margin-bottom:0; } .cb-bubble strong{ color:#1c2433; font-weight:700; }
.cb-user{ align-self:flex-end; max-width:88%; background:var(--bot-grad); color:#fff; border-radius:16px; border-bottom-right-radius:6px; padding:14px 16px; font-size:14px; line-height:21px; }
.cb-note{ align-self:flex-end; max-width:88%; text-align:right; font-size:12px; color:#8a93a6; line-height:18px; }
.cb-sugs{ padding:8px 18px 0; }
.cb-sugs .lbl{ font-size:13px; color:#7a879a; margin-bottom:8px; }
.cb-chips{ display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; }
.cb-chip{ white-space:nowrap; border:1px solid #dbe2ec; background:rgba(255,255,255,0.7); border-radius:20px; padding:8px 14px; font-family:inherit; font-size:13px; color:#3a4458; cursor:pointer; }
.cb-chip:hover{ border-color:var(--green); color:#0d8f5a; background:#fff; }
.cb-input{ margin:12px 18px 18px; background:rgba(255,255,255,0.85); border:1px solid #e1e7f0; border-radius:28px; padding:6px 6px 6px 18px; display:flex; align-items:center; gap:8px; }
.cb-input input{ flex:1; border:none; outline:none; font-family:inherit; font-size:14px; color:#2a3344; background:transparent; }
.cb-send{ width:42px; height:42px; border-radius:50%; border:none; background:var(--bot-grad); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; flex:0 0 42px; }
.cb-send svg{ width:18px; height:18px; }

/* ============================================================
   SAP tab — statistical analysis plan review.
   Reuses the Protocol tab's document + suggestion-card layout; only the
   severity tiers, the rule board, the back-check table and the two
   drawer actions are specific to this tab.
   ============================================================ */
:root{
  --sev-crit:#d9534f; --sev-crit-bg:rgba(217,83,79,0.08); --sev-crit-line:rgba(217,83,79,0.35);
  --sev-minor:#ca8a04; --sev-minor-bg:rgba(250,204,21,0.12); --sev-minor-line:rgba(250,204,21,0.5);
  --sev-adv:#12b877;  --sev-adv-bg:rgba(46,232,158,0.07);   --sev-adv-line:rgba(46,232,158,0.35);
}

/* header row — reviewer's aid on the left, Findings Only on the right */
.sap-verdict-bar{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.sap-verdict-bar .statcard{ flex:0 0 auto; }
.sap-aid{ font-size:13px; color:var(--text-light); }

/* severity-tiered flags — same .flag mechanics as the Protocol doc */
.flag.sev-crit{ background:var(--sev-crit-bg); box-shadow:inset 0 -2px 0 var(--sev-crit-line); }
.flag.sev-crit.flag-active{ background:rgba(217,83,79,0.20)!important; color:inherit!important; }
.flag.sev-minor{ background:var(--hl-rest); box-shadow:inset 0 -2px 0 var(--sev-minor-line); }
.flag.sev-minor.flag-active{ background:var(--hl-hover)!important; }
.flag.sev-adv{ background:var(--sev-adv-bg); box-shadow:inset 0 -2px 0 var(--sev-adv-line); }
.flag.sev-adv.flag-active{ background:rgba(46,232,158,0.20)!important; color:inherit!important; }

/* the card is the shared .suggestion-card, positioned beside its highlight the
   same way; it only needs a ceiling because one finding carries a table */
#sapCard{ max-height:calc(100vh - 40px); overflow-y:auto; }
#sapCard::-webkit-scrollbar{ width:6px; }
#sapCard::-webkit-scrollbar-thumb{ background:#dfe3ec; border-radius:4px; }

/* the provenance chain also renders inside an .info-popover */
.info-popover .sap-step:last-child{ padding-bottom:0; }

/* recommendation card bits (the card itself is the shared .suggestion-card) */
.sap-idx{ font-size:11px; font-weight:600; color:var(--text-light); letter-spacing:0.3px; }
.sap-f-title{ font-size:15px; font-weight:700; color:var(--title); line-height:1.35; margin-bottom:3px; }
.sap-f-anchor{ font-size:11px; font-weight:600; color:var(--text-light); letter-spacing:0.2px; margin-bottom:9px; }
.sug-body #sapFRec{ font-size:13.5px; line-height:20px; color:var(--muted); }
.sug-body #sapFRec b{ color:var(--text-dark); font-weight:700; }
.sap-ruleid{ font-size:11px; font-weight:600; color:#9aa3b6; letter-spacing:0.3px; }
.pill-yellow.sev-crit{ background:var(--sev-crit-bg); border-color:var(--sev-crit-line); color:var(--sev-crit); }
.pill-yellow.sev-minor{ background:var(--y50); border-color:var(--y200); color:var(--y600); }
.pill-yellow.sev-adv{ background:var(--sev-adv-bg); border-color:var(--sev-adv-line); color:var(--sev-adv); }

/* provenance chain — rendered inside the Action Trace popover */
.sap-step{ display:grid; grid-template-columns:14px 1fr; gap:10px; padding-bottom:12px; position:relative; }
.sap-step:last-child{ padding-bottom:0; }
.sap-step .mark{ position:relative; display:flex; justify-content:center; }
.sap-step .mark::before{ content:''; width:8px; height:8px; border-radius:50%; margin-top:4px;
  border:1.5px solid rgba(46,232,158,0.55); background:#fff; }
.sap-step:last-child .mark::before{ background:var(--green); }
.sap-step:not(:last-child) .mark::after{ content:''; position:absolute; top:14px; bottom:-6px; width:1px; background:#dfe3ec; }
.sap-step .k{ display:block; font-size:10px; font-weight:700; letter-spacing:0.5px; text-transform:uppercase; color:#9aa3b6; }
.sap-step .v{ display:block; font-size:12.5px; line-height:18px; color:var(--text-dark); margin-top:2px; }

/* sample-size back-check — claimed vs recomputed */
/* flex:none — the card is a max-height flex column, so its children would
   otherwise shrink and clip instead of letting the card scroll */
.sap-calc{ display:none; flex:none; margin:0 16px; border:1px solid var(--stroke); border-radius:10px; overflow:hidden; }
.sap-calc.show{ display:block; }
.sap-calc-head{ display:flex; align-items:center; justify-content:space-between; gap:8px;
  background:#f7f9fa; border-bottom:1px solid var(--stroke); padding:8px 12px; }
.sap-calc-head .t{ font-size:10px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; color:var(--text-light); }
.sap-calc-head .live{ font-size:10px; font-weight:600; color:var(--green); letter-spacing:0.3px; }
table.sap-cmp{ width:100%; border-collapse:collapse; font-size:11px;
  font-variant-numeric:tabular-nums; font-feature-settings:"tnum"; }
table.sap-cmp th{ font-size:9px; font-weight:700; letter-spacing:0.4px; text-transform:uppercase; color:#9aa3b6;
  text-align:right; padding:7px 4px; border-bottom:1px solid var(--stroke); }
table.sap-cmp th:first-child{ text-align:left; padding-left:10px; }
table.sap-cmp th:last-child{ padding-right:10px; }
table.sap-cmp td{ padding:6px 4px; border-bottom:1px solid #f1f3f8; color:var(--muted); text-align:right; white-space:nowrap; }
table.sap-cmp td:first-child{ text-align:left; padding-left:10px; color:var(--text-light); white-space:normal; line-height:1.35; }
table.sap-cmp td:last-child{ padding-right:10px; }
table.sap-cmp td.txt{ white-space:normal; }
table.sap-cmp td.recomp{ color:var(--text-dark); font-weight:600; }
table.sap-cmp tr:last-child td{ border-bottom:none; }
table.sap-cmp tr.flag-row td.recomp,table.sap-cmp tr.flag-row td.delta{ color:var(--sev-crit); font-weight:700; }
table.sap-cmp tr.flag-row td.delta{ background:var(--sev-crit-bg); }
table.sap-cmp tr.fix-row td.recomp{ color:#0d8a5f; font-weight:700; }
.sap-ladder{ padding:10px 12px 12px; border-top:1px solid var(--stroke); }
.sap-ladder .llbl{ font-size:9.5px; font-weight:700; letter-spacing:0.5px; text-transform:uppercase;
  color:#9aa3b6; margin-bottom:8px; }
.sap-lrow{ display:grid; grid-template-columns:38px 1fr 52px 38px; align-items:center; gap:6px;
  font-size:11px; color:var(--text-light); padding:2px 0; font-variant-numeric:tabular-nums; }
.sap-lrow .bar{ height:5px; background:#eef1f6; border-radius:3px; overflow:hidden; }
.sap-lrow .bar i{ display:block; height:100%; background:var(--sev-crit); opacity:0.55; border-radius:3px; }
.sap-lrow.ok .bar i{ background:var(--green); opacity:0.9; }
.sap-lrow .dev{ text-align:right; color:var(--sev-crit); font-weight:600; }
.sap-lrow.ok .dev{ color:#0d8a5f; }
.sap-lrow .vd{ text-align:right; font-size:9.5px; font-weight:700; letter-spacing:0.4px; color:var(--sev-crit); }
.sap-lrow.ok .vd{ color:#0d8a5f; }
.sap-calc-note{ padding:9px 12px; border-top:1px solid var(--stroke); font-size:11px; line-height:16px; color:var(--text-light); }
.sap-calc-note b{ color:var(--text-dark); font-weight:700; }

/* suppressed strip */
.sap-supp{ margin-top:16px; background:var(--white); border:1px solid var(--stroke); border-radius:12px; overflow:hidden; }
.sap-supp-head{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; cursor:pointer;
  background:transparent; border:none; padding:13px 16px; font-family:inherit; font-size:14px;
  font-weight:600; color:var(--text-light); }
.sap-supp-head .chev{ width:14px; height:14px; color:#9aa3b6; transition:transform .15s ease; }
.sap-supp.open .sap-supp-head .chev{ transform:rotate(90deg); }
.sap-supp-head .n{ margin-left:auto; font-size:11px; font-weight:600; color:#9aa3b6;
  border:1px solid var(--stroke); border-radius:6px; padding:2px 8px; }
.sap-supp-body{ display:none; border-top:1px solid var(--stroke); padding:4px 16px 12px; }
.sap-supp.open .sap-supp-body{ display:block; }
.sap-supp-item{ display:grid; grid-template-columns:minmax(180px,280px) 1fr; gap:16px; padding:10px 0;
  border-bottom:1px solid #f1f3f8; font-size:13px; color:var(--text-light); }
.sap-supp-item:last-child{ border-bottom:none; }
.sap-supp-item .sname{ display:flex; align-items:center; gap:8px; color:var(--text-dark); font-weight:500; }
.sap-supp-item .sname::before{ content:''; width:5px; height:5px; border-radius:50%; background:#cfd6e4; flex:0 0 5px; }
.sap-supp-item code{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11px; color:var(--btn-text);
  background:var(--btn-bg); border:1px solid var(--stroke); border-radius:4px; padding:1px 6px; margin-right:6px; }

/* ============================================================
   DASHBOARD — validations per module, split by type.

   Everything under `.rd` is the headline half of the tab: the two
   totals and the per-module breakdown. Scoped to that one class
   because several of the names here (.card, .legend) are generic
   enough to collide with the rest of the sheet.

   The two series have fixed colors — red is always a validation error,
   teal is always a linkage error.
   ============================================================ */
.rd{
  display:flex; flex-direction:column; gap:18px; padding:4px 8px 8px;
  --st-good:#0ca30c; --st-warn:#fab219; --st-serious:#ec835a; --st-crit:#d03b3b;
  --st-neutral:#c9cfdd;
  --ink:#0d2137; --ink-2:#52607e; --ink-3:#8a93a6;
  --card-shadow:0 1px 2px rgba(23,43,77,0.04), 0 8px 24px rgba(23,43,77,0.04);
}

/* card shell */
.rd .card{ background:var(--white); border:1px solid var(--stroke); border-radius:20px; padding:22px 26px 24px;
  box-shadow:var(--card-shadow); display:flex; flex-direction:column; }
.rd .card-title{ font-size:19px; font-weight:700; color:var(--title); text-align:center; letter-spacing:-0.2px; }
/* a card carrying a series legend puts its title on the left and the legend on
   the right; a card without one centres its title */
.rd .card-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rd .card-head .card-title{ text-align:left; }
.rd .card-rule{ height:1px; background:var(--stroke); margin:16px -4px 20px; }
.rd .legend{ display:flex; gap:16px; flex-wrap:wrap; flex:none; }
.rd .legend .li{ display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; color:var(--ink-2); white-space:nowrap; }
.rd .legend .sw{ width:10px; height:10px; border-radius:50%; flex:none; }

/* KPI row */
.rd .kpis{ display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:18px; }
.rd .kpi{ background:var(--white); border:1px solid var(--stroke); border-radius:18px; box-shadow:var(--card-shadow);
  padding:20px 22px; display:flex; flex-direction:column; gap:7px; }
.rd .kpi .k-label{ font-size:13px; font-weight:600; color:var(--ink-2); display:flex; align-items:center; gap:8px; }
.rd .kpi .k-label svg{ width:15px; height:15px; flex:none; }
.rd .kpi .k-value{ font-size:36px; line-height:1.05; font-weight:800; color:var(--ink); }
.rd .kpi .k-sub{ font-size:12px; line-height:17px; color:var(--ink-3); }
.rd .kpi.tone-crit .k-label svg{ color:var(--st-crit); }
.rd .kpi.tone-serious .k-label svg{ color:var(--st-serious); }
.rd .kpi.tone-warn .k-label svg{ color:#b07c00; }
.rd .kpi.tone-good .k-label svg{ color:var(--st-good); }
.rd .kpi.tone-link .k-label svg{ color:var(--teal); }

/* per-module breakdown: one row per module, one labelled track per type */
.rd .vtab{ display:flex; flex-direction:column; }
/* The module names are short ("SOA", "Define-XML") and the counts are single
   numbers, so those four tracks are sized to their content; the two pickers
   split everything that is left so the row fills the width of the card. */
.rd .vrow{ display:grid;
  grid-template-columns:190px 130px 130px minmax(0,1fr) minmax(0,1fr);
  align-items:center; gap:18px; padding:12px 4px; font-size:14px; }
.rd .vrow:hover{ background:#fafbff; }
/* the module name is the link into the tab; the row itself is not clickable,
   because it now carries a <select> */
.rd button.v-mod{ font-family:inherit; font-size:14px; background:none; border:none; padding:0;
  cursor:pointer; text-align:left; }
.rd button.v-mod:hover{ color:#0a8f57; }
.rd .vrow + .vrow{ border-top:1px solid #f1f3f8; }
.rd .vrow.vhead{ padding-bottom:9px; font-size:10.5px; font-weight:700; letter-spacing:0.7px;
  text-transform:uppercase; color:#8a93a6; }
.rd .vrow.vfoot{ border-top:1px solid var(--stroke); }
.rd .v-mod{ display:flex; align-items:center; gap:9px; font-weight:600; color:var(--title); min-width:0; }
.rd .v-mod svg{ width:16px; height:16px; color:var(--ink-2); flex:none; }
.rd .vrow.vfoot .v-mod{ font-weight:700; }

/* the two count columns are numbers, centred — no bar. A validation count and
   a linkage count are different populations, so putting them on shared bars
   invited a comparison that does not mean anything. */
.rd .v-cell{ display:flex; align-items:center; justify-content:center; min-width:0; }
.rd .v-cell b{ font-size:21px; font-weight:800; letter-spacing:-0.3px; }
.rd .v-cell b.val{ color:var(--st-crit); }
.rd .v-cell b.link{ color:var(--teal); }
/* a zero is a pass and a dash is "not measured" — never the same thing */
.rd .v-cell b.zero{ color:#c3cad8; }
.rd .v-cell b.none{ color:#c3cad8; font-weight:600; }
.rd .vrow.vhead .v-cell{ display:block; text-align:center; }

/* document picker — the same versions the repository holds */
.rd .v-doc{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.rd .v-doc .none{ font-style:normal; color:#c3cad8; }
.rd .doc-note{ font-size:10.5px; line-height:14px; font-style:normal; color:#9aa3b6;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rd .doc-note.stale{ color:var(--st-crit); font-weight:600; text-transform:capitalize; }
.rd .vrow.vhead .v-doc{ display:block; }

/* the standards picker — the select alone, no caption under it */
.rd .v-std{ display:flex; flex-direction:column; min-width:0; }
.rd .v-std .none{ font-style:normal; color:#c3cad8; }
.rd .vrow.vhead .v-std{ display:block; }
.rd .v-note{ font-size:12.5px; color:var(--ink-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Both pickers, styled as text rather than as boxes — inside a table the
   borders read as noise. `appearance:none` drops the native control chrome
   along with its arrow, so the chevron is drawn back in as a background: it is
   the only thing left telling you the value can be changed. Hover and focus
   still respond, or the control would be indistinguishable from a label. */
.rd .doc-sel,
.rd .std-sel{ font-family:inherit; font-size:12.5px; font-weight:600; color:var(--text-dark);
  -webkit-appearance:none; appearance:none;
  background-color:transparent; border:none; border-radius:7px;
  padding:5px 22px 5px 6px; margin-left:-6px; cursor:pointer; width:100%;
  text-overflow:ellipsis;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat:no-repeat; background-position:right 4px center; background-size:12px; }
.rd .doc-sel:hover,
.rd .std-sel:hover{ background-color:#f3f6fb; color:var(--title); }
.rd .doc-sel:focus,
.rd .std-sel:focus{ outline:none; background-color:#f3f6fb;
  box-shadow:0 0 0 2px rgba(46,232,158,0.35); }

@media (max-width:1240px){
  .rd .vrow{ grid-template-columns:150px 90px 90px minmax(0,1fr) minmax(0,1fr); gap:12px; }
}

/* ============================================================
   CSR tab — link integrity. Every number resolves to the output
   it came from; every part of the report traces to the protocol.
   Reuses the Define-XML tab's verdict bar, card and drawers.
   ============================================================ */
.csr-meters{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.csr-meter{ flex:1 1 300px; display:flex; flex-direction:column; gap:7px; text-align:left; cursor:pointer;
  background:var(--white); border:1px solid var(--stroke); border-radius:12px; padding:12px 14px;
  font-family:inherit; transition:border-color .15s ease, background .15s ease; }
.csr-meter:hover{ border-color:#cdd5e2; }
.csr-meter.active{ border-color:rgba(46,232,158,0.5); background:rgba(46,232,158,0.04); }
.csr-meter .mh{ display:flex; align-items:baseline; gap:10px; }
.csr-meter .mh .n{ font-size:13.5px; font-weight:600; color:var(--text-dark); }
.csr-meter .mh .v{ margin-left:auto; font-size:15px; font-weight:700; color:var(--sev-crit); }
.csr-meter .mh .v.ok{ color:#0d8a5f; }
.csr-meter .mh .v em{ font-style:normal; font-weight:500; font-size:11.5px; color:#9aa3b6; }
.csr-meter .bar{ height:6px; border-radius:3px; background:#eef1f6; overflow:hidden; }
.csr-meter .bar i{ display:block; height:100%; border-radius:3px; background:var(--sev-crit); opacity:.65; }
.csr-meter.ok .bar i{ background:var(--green); opacity:.9; }
.csr-meter .s{ font-size:11px; color:var(--text-light); }

/* the report */
#csrDoc .sub-head{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
#csrDoc .para{ text-align:left; }
.sec-head .sec-note{ margin-left:auto; font-size:11px; color:#9aa3b6; }
.csr-trace{ display:inline-flex; align-items:center; gap:5px; font-size:10.5px; color:var(--sug-tag-text);
  background:var(--sug-tag-bg); border:1px solid rgba(46,232,158,0.22); border-radius:20px; padding:2px 9px; }
.csr-trace svg{ width:11px; height:11px; }
.csr-trace b{ font-weight:700; opacity:.75; }
.csr-trace.none{ color:var(--sev-crit); background:var(--sev-crit-bg); border-color:var(--sev-crit-line); }

/* a number that resolves — to an output (green) or to a protocol value (teal) */
.csr-n{ cursor:pointer; border-radius:3px; padding:0 2px; font-weight:600;
  transition:background .15s ease, color .15s ease; }
.csr-n.output{ color:#0d8a5f; box-shadow:inset 0 -1px 0 rgba(46,232,158,0.55); }
.csr-n.protocol{ color:var(--teal); box-shadow:inset 0 -1px 0 rgba(46,138,156,0.45); }
.csr-n:hover,.csr-n.on{ background:rgba(46,232,158,0.12); }
.csr-n.protocol:hover,.csr-n.protocol.on{ background:rgba(46,138,156,0.10); }
#csrDoc.csr-filtered .flag:not(.csr-in-scope){ background:transparent; box-shadow:none; opacity:.6; }

/* citation index */
table.csr-cite td{ vertical-align:middle; }
table.csr-cite td:first-child,table.csr-cite td:nth-child(3),table.csr-cite td:nth-child(4){ white-space:nowrap; }
.csr-status{ font-family:var(--dx-mono); font-size:10px; font-weight:700; letter-spacing:0.3px;
  text-transform:uppercase; border-radius:5px; padding:2px 7px; }
.csr-status.final{ color:#0d8a5f; background:var(--sev-adv-bg); border:1px solid var(--sev-adv-line); }
.csr-status.qc{ color:var(--y600); background:var(--y50); border:1px solid var(--y200); }
.csr-status.missing{ color:var(--sev-crit); background:var(--sev-crit-bg); border:1px solid var(--sev-crit-line); }
.csr-ok{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:#0d8a5f; }
.csr-ok svg{ width:12px; height:12px; }
.csr-bad{ font-size:11.5px; font-weight:600; color:var(--sev-crit); }
.csr-warn{ font-size:11.5px; font-weight:600; color:var(--y600); }

/* ============================================================
   PROTOCOL BENCHMARKS page — this protocol's metrics against
   completed trials that ran the same primary endpoint. Every
   row ends in a consequence: what those trials cost to run.
   ============================================================ */
.bx-title-area{ display:flex; align-items:center; gap:12px; }
/* ONE back control for every screen below the portfolio. `.backbtn` was a second
   implementation of the same thing on the review page; both names resolve here so
   neither page drifts from the other. Always a link, so middle-click works. */
.bx-back, .backbtn{ width:34px; height:34px; flex:0 0 34px; border:1px solid var(--stroke);
  border-radius:9px; display:flex; align-items:center; justify-content:center;
  color:var(--text-light); text-decoration:none; transition:background .14s ease, color .14s ease, border-color .14s ease; }
.bx-back:hover, .backbtn:hover{ background:var(--green-tint); border-color:var(--green); color:var(--brand-ink); }
.bx-back svg, .backbtn svg{ width:18px; height:18px; }

/* ---- header ---- */
.bx-head{ display:flex; flex-direction:column; gap:18px; padding:4px 8px 22px;
  border-bottom:1px solid var(--stroke); }
.bx-head-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:24px; flex-wrap:wrap; }
.bx-head-txt .t{ font-size:20px; font-weight:800; color:var(--title); letter-spacing:-0.2px; }
.bx-head-txt .s{ font-size:13.5px; line-height:20px; color:var(--text-light); margin-top:6px; max-width:640px; }
.bx-tally{ display:flex; align-items:center; gap:14px; border:1px solid var(--stroke); border-radius:14px;
  padding:12px 18px; flex:none; }
.bx-tally-n{ font-size:30px; font-weight:800; color:var(--sev-crit); line-height:1; letter-spacing:-1px; }
.bx-tally-n em{ font-style:normal; font-size:16px; font-weight:700; color:#c3cad8; }
.bx-tally-l{ font-size:11.5px; line-height:15px; font-weight:600; color:var(--text-light); }

/* the cohort strip — who is being compared against, and what it cost them */
.bx-cohort{ border:1px solid var(--stroke); border-radius:14px; overflow:hidden; }
.bx-cohort-h{ padding:13px 16px; border-bottom:1px solid var(--stroke); background:#fcfcfe; }
.bx-cohort-h .ep{ display:block; font-size:13px; font-weight:700; color:var(--title); }
.bx-cohort-h .nt{ display:block; font-size:12px; line-height:17px; color:var(--text-light); margin-top:3px; }
.bx-cohort-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); }
.bx-trial{ padding:12px 16px; border-right:1px solid #f1f3f8; border-bottom:1px solid #f1f3f8;
  display:flex; flex-direction:column; gap:3px; min-width:0; }
.bx-trial .n{ font-size:13.5px; font-weight:700; color:var(--text-dark); }
.bx-trial .m{ font-size:11px; color:#9aa3b6; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bx-trial .o{ font-size:11.5px; color:var(--text-light); margin-top:2px; }
.bx-trial .o b{ color:var(--teal); font-weight:700; }
.bx-trial .o i{ font-style:normal; color:#c9cfdd; margin:0 6px; }
.bx-cohort-base{ padding:11px 16px; font-size:12px; color:var(--text-light); background:#fcfcfe; }
.bx-cohort-base b{ color:var(--text-dark); font-weight:700; }

/* ---- domains ---- */
.bx-body{ display:flex; flex-direction:column; gap:26px; padding:22px 8px 8px; }
/* The domain header is the section's collapse toggle, so it is a <button>:
   reset the UA button styling and keep the flex layout it had as a div. */
.bx-domain-h{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px;
  padding:0 4px 10px; flex-wrap:wrap; width:100%; background:none; border:none;
  font-family:inherit; text-align:left; cursor:pointer; border-radius:8px; }
.bx-domain-h:hover .bx-domain-t .n{ color:var(--forest); }
.bx-domain-h:hover .bx-chev{ color:#8b97aa; }
/* Collapsed, the header is the whole section, so it carries the rule that the
   first metric row would otherwise have drawn under it. */
.bx-domain.collapsed .bx-domain-h{ padding-bottom:0; }
.bx-domain.collapsed{ border-bottom:1px solid #f1f3f8; padding-bottom:14px; }
.bx-domain-t{ display:block; min-width:0; }
.bx-domain-r{ display:flex; align-items:center; gap:10px; flex:none; }
.bx-domain-t .n{ font-size:16px; font-weight:800; color:var(--title); }
.bx-domain-t .s{ display:block; font-size:12.5px; color:var(--text-light); margin-top:3px; }
.bx-domain-c{ font-size:11.5px; font-weight:700; color:#8a93a6; background:#f2f4fa; border-radius:20px;
  padding:4px 11px; white-space:nowrap; flex:none; }
.bx-domain-c.hot{ background:var(--sev-crit-bg); color:var(--sev-crit); }

/* ---- metric rows ---- */
.bx-row{ display:grid; grid-template-columns:minmax(0,1.5fr) 108px 108px 132px minmax(0,1.9fr) 20px;
  align-items:center; gap:16px; width:100%; padding:13px 4px; text-align:left; font-family:inherit;
  background:none; border:none; border-top:1px solid #f1f3f8; cursor:pointer; }
.bx-row:hover{ background:#fafbff; }
.bx-row.head{ cursor:default; border-top:1px solid var(--stroke); padding-bottom:9px;
  font-size:10.5px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase; color:#9aa3b6; }
.bx-row.head:hover{ background:none; }
.bx-m{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.bx-m .lbl{ font-size:14px; font-weight:600; color:var(--text-dark); }
.bx-m .nt{ font-size:11.5px; line-height:16px; color:#9aa3b6; }
.bx-v{ font-size:19px; font-weight:800; color:var(--text-dark); letter-spacing:-0.3px; text-align:center; }
.bx-v em{ display:block; font-style:normal; font-size:10.5px; font-weight:600; color:#9aa3b6;
  letter-spacing:0; margin-top:1px; }
.bx-v.med{ color:#9aa3b6; }
.bx-row.head .bx-v{ font-size:10.5px; font-weight:700; color:#9aa3b6; letter-spacing:0.7px; }

.bx-side{ font-size:11.5px; font-weight:700; border-radius:20px; padding:5px 10px; text-align:center;
  background:#f2f4fa; color:#8a93a6; }
.bx-side.demanding{ background:var(--sev-crit-bg); color:var(--sev-crit); }
.bx-row.head .bx-side{ background:none; padding:0; }

.bx-out{ font-size:12px; line-height:17px; color:var(--text-light); }
.bx-out b{ color:var(--text-dark); font-weight:700; }
.bx-out.none{ font-style:italic; color:#c3cad8; }
.bx-row.head .bx-outcell{ font-size:10.5px; font-weight:700; color:#9aa3b6; letter-spacing:0.7px; }
.bx-chev{ width:16px; height:16px; color:#c3cad8; transition:transform .18s ease; }
.bx-chev.open{ transform:rotate(180deg); }

/* ---- expanded: the whole cohort, ranked ---- */
.bx-detail{ padding:4px 4px 20px; }
.bx-detail-src{ font-size:11.5px; color:#9aa3b6; padding:2px 0 12px; }
.bx-detail-src b{ color:var(--text-light); font-weight:600; }
.bx-table{ width:100%; border-collapse:collapse; }
.bx-table th{ font-size:10px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase;
  color:#9aa3b6; text-align:left; padding:0 10px 8px; border-bottom:1px solid var(--stroke); }
.bx-table td{ font-size:12.5px; color:var(--text-light); padding:9px 10px; border-bottom:1px solid #f5f6fa; }
.bx-table .tv,.bx-table .tr,.bx-table .td{ text-align:right; width:110px; }
.bx-table .ts{ width:190px; }
.bx-table td.tn{ font-weight:600; color:var(--text-dark); }
.bx-table td.tn i{ display:block; font-style:normal; font-size:10.5px; font-weight:500; color:#9aa3b6; }
.bx-table td.tv{ font-weight:800; color:var(--text-dark); font-size:14px; }
.bx-table tr.me td{ background:rgba(46,232,158,0.06); }
.bx-table tr.me td.tn,.bx-table tr.me td.tv{ color:#0a7d4d; }
.bx-empty{ padding:40px; text-align:center; color:var(--text-light); font-size:14px; }

@media (max-width:1100px){
  .bx-row{ grid-template-columns:minmax(0,1.4fr) 84px 84px 120px 20px; }
  .bx-outcell{ display:none; }
}

/* ============================================================
   DEFINE-XML tab — the Define metadata contract, checked for
   conformance (CORE) and version drift (reconciliation).
   Reuses the SAP tab's index + document + recommendation-card
   layout, its .flag severity mechanics and its .sap-step chain;
   only the pipeline strip, the metadata document and the
   disposition row are specific to this tab.
   ============================================================ */
:root{ --dx-mono:ui-monospace,SFMono-Regular,Menlo,monospace; }

/* verdict bar */
.dx-verdict{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.dx-counts{ display:flex; align-items:baseline; gap:8px; }
.dx-counts .c{ display:flex; align-items:baseline; gap:5px; }
.dx-counts .n{ font-size:17px; font-weight:700; }
.dx-counts .c.err .n{ color:var(--sev-crit); } .dx-counts .c.warn .n{ color:var(--sev-minor); }
.dx-counts .l{ font-size:13px; color:var(--text-light); }
.dx-counts .sep{ color:#c4cbd9; }
.dx-counts .disp{ font-size:12px; color:#9aa3b6; margin-left:4px; }
/* CSR finding buckets — data / protocol / SAP mismatches, counted in the verdict
   bar and tagged on each finding. Three buckets, three slots of the validated
   categorical palette, assigned in order. */
.csr-cats{ display:flex; align-items:center; gap:6px; margin-left:6px; }
.csr-cat{ display:flex; align-items:center; gap:5px; font-size:11px; font-weight:600; letter-spacing:0.2px;
  border-radius:var(--pill); padding:3px 10px; white-space:nowrap; }
.csr-cat b{ font-size:12px; font-weight:800; }
.csr-cat.data{     background:var(--cat-1-bg); color:var(--cat-1-ink); }
.csr-cat.protocol{ background:var(--cat-2-bg); color:var(--cat-2-ink); }
.csr-cat.sap{      background:var(--cat-3-bg); color:var(--cat-3-ink); }
.csr-cat-tag.data{     border-color:var(--cat-1-line); background:var(--cat-1-bg); color:var(--cat-1-ink); }
.csr-cat-tag.protocol{ border-color:var(--cat-2-line); background:var(--cat-2-bg); color:var(--cat-2-ink); }
.csr-cat-tag.sap{      border-color:var(--cat-3-line); background:var(--cat-3-bg); color:var(--cat-3-ink); }
.csr-cat-tag.timing{   border-color:var(--cat-none-line); background:var(--cat-none-bg); color:var(--cat-none-ink); }
.dx-vsep{ width:1px; height:16px; background:var(--stroke); }
.dx-pinned{ margin-left:auto; display:flex; align-items:center; gap:9px; background:var(--y50);
  border:1px solid var(--y200); border-radius:8px; padding:6px 11px; }
.dx-pinned .k{ font-size:9.5px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase; color:var(--y600); }
.dx-pinned .v{ font-family:var(--dx-mono); font-size:11px; color:var(--btn-text); }
.dx-pinned .v i{ color:#b6bdcc; font-style:normal; padding:0 3px; }

/* three-pass pipeline strip */
.dx-pipe{ display:flex; align-items:stretch; flex-wrap:wrap; margin-bottom:16px; }
.dx-pass{ flex:1 1 220px; display:flex; align-items:center; gap:11px; background:var(--white);
  border:1px solid var(--stroke); border-radius:10px; padding:11px 13px; text-align:left; cursor:pointer;
  font-family:inherit; transition:border-color .15s ease, background .15s ease; }
.dx-pass:hover{ border-color:#cdd5e2; }
.dx-pass.active{ border-color:rgba(46,232,158,0.5); background:rgba(46,232,158,0.04); }
.dx-pass .state{ width:24px; height:24px; border-radius:7px; display:flex; align-items:center;
  justify-content:center; flex:0 0 24px; }
.dx-pass .state svg{ width:14px; height:14px; }
.dx-pass.ok .state{ background:var(--sev-adv-bg); color:var(--sev-adv); border:1px solid var(--sev-adv-line); }
.dx-pass.fail .state{ background:var(--sev-crit-bg); color:var(--sev-crit); border:1px solid var(--sev-crit-line); }
.dx-pass .n{ display:block; font-size:13px; font-weight:600; color:var(--text-dark); }
.dx-pass .s{ display:block; font-size:10.5px; color:#9aa3b6; margin-top:2px; letter-spacing:0.2px; }
.dx-pass .cnt{ margin-left:auto; font-family:var(--dx-mono); font-size:11px; font-weight:700;
  padding:2px 8px; border-radius:20px; }
.dx-pass.ok .cnt{ color:var(--sev-adv); background:var(--sev-adv-bg); }
.dx-pass.fail .cnt{ color:var(--sev-crit); background:var(--sev-crit-bg); }
.dx-arrow{ display:flex; align-items:center; padding:0 9px; color:#c4cbd9; flex:0 0 auto; }
.dx-arrow svg{ width:14px; height:14px; }

/* the Define document — faint metadata grid, node/edge motif kept subtle */
#dxDoc{ background-image:linear-gradient(rgba(58,152,169,0.035) 1px,transparent 1px),
                        linear-gradient(90deg,rgba(58,152,169,0.035) 1px,transparent 1px);
  background-size:34px 34px; }
.dx-sec{ display:flex; flex-direction:column; gap:12px; }
.dx-sec .sec-head .n{ margin-left:auto; font-size:11px; color:#9aa3b6; }
.dx-kv{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1px; background:var(--stroke);
  border:1px solid var(--stroke); border-radius:10px; overflow:hidden; margin:0 16px; }
.dx-kv > div{ background:var(--white); padding:10px 13px; }
.dx-kv .k{ display:block; font-size:9.5px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase; color:#9aa3b6; }
.dx-kv .v{ display:block; font-family:var(--dx-mono); font-size:12px; color:var(--text-dark); margin-top:4px; }
.dx-kv .v.txt{ font-family:inherit; }

.dx-tablewrap{ margin:0 16px; overflow-x:auto; }
table.dx{ width:100%; border-collapse:collapse; font-size:13px; }
table.dx th{ font-size:9.5px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase; color:#9aa3b6;
  text-align:left; padding:0 10px 8px; border-bottom:1px solid var(--stroke); white-space:nowrap; }
table.dx td{ padding:9px 10px; border-bottom:1px solid #f1f3f8; color:var(--muted); vertical-align:top; }
table.dx tr:last-child td{ border-bottom:none; }
table.dx tr:hover td{ background:#fbfcfe; }
table.dx .m{ font-family:var(--dx-mono); font-size:11.5px; color:var(--text-dark); }
table.dx .sub{ font-size:11.5px; color:var(--text-light); }
table.dx .dash{ color:#c4cbd9; }

/* codelists */
.dx-cls{ display:flex; flex-direction:column; gap:10px; margin:0 16px; }
.dx-cl{ border:1px solid var(--stroke); border-left:2px solid var(--stroke); border-radius:0 10px 10px 0;
  padding:12px 14px; display:flex; flex-direction:column; gap:9px; }
.dx-cl.reconciled{ border-left-color:rgba(46,232,158,0.45); }
.dx-cl.flagged{ border-left-color:var(--sev-crit-line); }
.dx-cl.flagged-warn{ border-left-color:var(--sev-minor-line); }
.dx-cl-top{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.dx-cl-name{ font-family:var(--dx-mono); font-size:13px; font-weight:700; color:var(--text-dark); }
.dx-cl-label{ font-size:12.5px; color:var(--text-light); }
.dx-attrs{ display:flex; align-items:center; gap:7px; margin-left:auto; flex-wrap:wrap; }
.dx-attr{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--stroke); border-radius:6px;
  padding:2px 8px; font-size:10.5px; color:var(--text-light); }
.dx-attr .k{ font-size:9px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; color:#9aa3b6; }
.dx-attr .m{ font-family:var(--dx-mono); font-size:10.5px; color:var(--btn-text); }
.dx-attr.ok{ border-color:rgba(46,232,158,0.4); color:var(--sev-adv); background:var(--sev-adv-bg); }
.dx-attr.ok svg{ width:11px; height:11px; }
.dx-terms{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.dx-terms .tlbl{ font-size:9.5px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase;
  color:#9aa3b6; margin-right:3px; }
.dx-term{ font-family:var(--dx-mono); font-size:11px; color:var(--btn-text); background:var(--btn-bg);
  border:1px solid var(--stroke); border-radius:5px; padding:2px 7px; }
.dx-term .dec{ color:#9aa3b6; }
.flag .dx-term{ background:transparent; border-color:transparent; }

/* value-level metadata */
.dx-vlm{ margin:0 16px; border:1px solid var(--stroke); border-radius:10px; overflow:hidden; }
.dx-vlm-head{ display:flex; align-items:center; gap:9px; padding:10px 13px; border-bottom:1px solid var(--stroke);
  background:var(--section-bg); flex-wrap:wrap; }
.dx-vlm-head .m{ font-family:var(--dx-mono); font-size:12px; color:var(--text-dark); }
.dx-vlm-head .where{ font-family:var(--dx-mono); font-size:11.5px; color:var(--text-light); }
.dx-vlm-head .where b{ color:var(--teal); font-weight:600; }
.dx-resolved{ display:inline-flex; align-items:center; gap:5px; font-size:10.5px; color:var(--sev-adv);
  font-family:var(--dx-mono); margin-left:auto; }
.dx-resolved svg{ width:12px; height:12px; }
.dx-vlm-body{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1px; background:var(--stroke); }
.dx-vlm-body > div{ background:var(--white); padding:9px 13px; }
.dx-vlm-body .k{ display:block; font-size:9.5px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase; color:#9aa3b6; }
.dx-vlm-body .v{ display:block; font-family:var(--dx-mono); font-size:12px; color:var(--text-dark); margin-top:4px; }

/* recommendation card — severity pill + source tag + the two drawers */
.dx-badges{ display:flex; align-items:center; gap:7px; margin-bottom:9px; }
.dx-srctag{ font-size:9.5px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase; color:var(--text-light);
  border:1px solid var(--stroke); border-radius:34px; padding:3px 9px; white-space:nowrap; }
#dxFMsg{ font-size:13.5px; line-height:20px; color:var(--muted); }
#dxFMsg b{ color:var(--text-dark); font-weight:700; }
#dxFMsg .m,.dx-drawer .m,#dxFLocus .m{ font-family:var(--dx-mono); font-size:11.5px; color:var(--text-dark); }
#dxFLocus{ display:flex; gap:6px; flex-wrap:wrap; font-family:var(--dx-mono); text-transform:none; }
#dxFLocus i{ color:#c4cbd9; font-style:normal; }
.dx-legs{ display:flex; gap:8px; padding:0 16px; }
.dx-leg{ flex:1 1 0; display:flex; align-items:center; justify-content:center; gap:7px; border:1px solid var(--stroke);
  border-radius:8px; padding:8px 6px; font-family:inherit; font-size:11.5px; font-weight:600; color:var(--text-light);
  background:none; cursor:pointer; }
.dx-leg:hover{ border-color:#cdd5e2; color:var(--text-dark); }
.dx-leg.on{ border-color:rgba(46,232,158,0.5); color:#0d8a5f; background:rgba(46,232,158,0.06); }
.dx-leg svg{ width:14px; height:14px; }
.dx-drawer{ display:none; flex:none; margin:0 16px; border:1px solid var(--stroke); border-radius:10px;
  padding:12px 13px; background:#fbfcfe; }
.dx-drawer.show{ display:block; }
.dx-drawer .dlbl{ font-size:9.5px; font-weight:700; letter-spacing:0.9px; text-transform:uppercase;
  color:#9aa3b6; margin-bottom:11px; }
.dx-drawer .neg{ color:var(--sev-crit); font-weight:600; }
.dx-drawer .pos{ color:#0d8a5f; font-weight:600; }
.dx-own{ display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--stroke); border:1px solid var(--stroke);
  border-radius:8px; overflow:hidden; margin-bottom:11px; }
.dx-own > div{ background:var(--white); padding:9px 11px; }
.dx-own .side{ display:block; font-size:9px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase; color:#9aa3b6; }
.dx-own .who{ display:block; font-size:11.5px; line-height:16px; color:#9aa3b6; margin-top:3px; }
.dx-own > div.act{ background:rgba(46,232,158,0.06); }
.dx-own > div.act .side{ color:#0d8a5f; }
.dx-own > div.act .who{ color:var(--text-light); }
.dx-drawer p{ font-size:12.5px; line-height:19px; color:var(--text-light); }
.dx-drawer p + p{ margin-top:9px; }
.dx-drawer p b{ color:var(--text-dark); font-weight:700; }

/* disposition row */
.dx-disp{ margin:0 16px; padding-top:12px; border-top:1px solid var(--stroke); display:flex; align-items:center;
  gap:8px; flex-wrap:wrap; }
.dx-disp .dl{ font-size:9.5px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase; color:#9aa3b6; }
.dx-status{ font-family:var(--dx-mono); font-size:10.5px; padding:2px 9px; border-radius:20px;
  border:1px solid var(--stroke); color:var(--text-light); }
.dx-status.waived{ color:var(--y600); border-color:var(--y200); background:var(--y50); }
.dx-status.resolved{ color:#0d8a5f; border-color:rgba(46,232,158,0.4); background:var(--sev-adv-bg); }
.dx-status.routed{ color:#3a98a9; border-color:rgba(58,152,169,0.35); background:rgba(58,152,169,0.06); }
.dx-disp-btns{ display:flex; gap:6px; margin-left:auto; }
.dx-disp-btns button{ font-family:inherit; font-size:11px; color:var(--text-light); border:1px solid var(--stroke);
  border-radius:6px; padding:4px 9px; background:none; cursor:pointer; }
.dx-disp-btns button:hover{ border-color:#cdd5e2; color:var(--text-dark); }
.dx-disp-btns button.on{ border-color:rgba(46,232,158,0.5); color:#0d8a5f; background:rgba(46,232,158,0.06); }

/* a dispositioned finding keeps its anchor but drops out of the alarm state */
.flag.dx-done{ background:var(--btn-bg)!important; box-shadow:inset 0 -2px 0 #dfe3ec!important; color:var(--text-light); }
.flag.dx-done.flag-active{ background:#e7eaf1!important; color:var(--text-dark); }

/* the card carries two drawers, so it needs a ceiling of its own */
#dxCard{ max-height:calc(100vh - 40px); overflow-y:auto; }
#dxCard::-webkit-scrollbar{ width:6px; }
#dxCard::-webkit-scrollbar-thumb{ background:#dfe3ec; border-radius:4px; }
#dxListScroll{ gap:8px; }

/* pass filter — while one pass is open the other pass's highlights stand down */
#dxDoc.dx-filtered .flag:not(.dx-in-scope){ background:transparent; box-shadow:none; opacity:.65; }

/* schema-gate panel in the list column */
.dx-gate{ display:flex; gap:11px; align-items:flex-start; padding:2px 0 4px; }
.dx-gate .ic{ width:22px; height:22px; border-radius:7px; background:var(--sev-adv-bg); border:1px solid var(--sev-adv-line);
  color:var(--sev-adv); display:flex; align-items:center; justify-content:center; flex:0 0 22px; }
.dx-gate .ic svg{ width:13px; height:13px; }
.dx-gate p{ font-size:12.5px; line-height:19px; color:var(--text-light); }
.dx-check{ display:flex; align-items:flex-start; gap:9px; padding:9px 0; border-bottom:1px solid #f1f3f8; }
.dx-check:last-child{ border-bottom:none; }
.dx-check .dot{ width:7px; height:7px; border-radius:50%; margin-top:5px; flex:0 0 7px; background:var(--green); }
.dx-check .n{ display:block; font-size:12.5px; font-weight:600; color:var(--text-dark); }
.dx-check .s{ display:block; font-family:var(--dx-mono); font-size:10.5px; color:#9aa3b6; margin-top:2px; }
.dx-check .tag{ margin-left:auto; font-family:var(--dx-mono); font-size:10px; color:var(--sev-adv); }

/* finding rows in the list panel */
.dx-li{ display:flex; align-items:flex-start; gap:9px; width:100%; text-align:left; padding:10px 11px;
  border:1px solid var(--stroke); border-radius:10px; background:var(--white); cursor:pointer; font-family:inherit; }
.dx-li:hover,.dx-li.active{ border-color:rgba(46,232,158,0.45); background:rgba(46,232,158,0.03); }
.dx-li .dot{ width:7px; height:7px; border-radius:50%; margin-top:5px; flex:0 0 7px; }
.dx-li .dot.err{ background:var(--sev-crit); } .dx-li .dot.warn{ background:var(--sev-minor); }
.dx-li .n{ display:block; font-size:12.5px; font-weight:600; color:var(--text-dark); }
.dx-li .s{ display:block; font-family:var(--dx-mono); font-size:10.5px; color:#9aa3b6; margin-top:3px; }
.dx-li .tag{ margin-left:auto; font-family:var(--dx-mono); font-size:10px; color:#9aa3b6; white-space:nowrap; padding-top:2px; }

/* ---------- SoA tab ---------- */
.soa-panel{ display:none; }
.soa-panel.show{ display:block; }
.soa-wrap{ display:flex; gap:16px; align-items:flex-start; }
.soa-table-area{ flex:1 1 auto; min-width:0; overflow:hidden; }
.soa-scroll{ overflow-x:auto; border:1px solid var(--stroke); border-radius:12px; }
.soa-scroll::-webkit-scrollbar{ height:6px; }
.soa-scroll::-webkit-scrollbar-track{ background:transparent; }
.soa-scroll::-webkit-scrollbar-thumb{ background:#dfe3ec; border-radius:4px; }
.soa-scroll::-webkit-scrollbar-thumb:hover{ background:#cdd3df; }
.soa-scroll{ scrollbar-width:thin; scrollbar-color:#dfe3ec transparent; }
table.soa{ border-collapse:separate; border-spacing:0; width:100%; min-width:1034px; table-layout:fixed; font-size:13px; }
.soa th,.soa td{ padding:14px 10px; border-bottom:1px solid #eef0f4; border-right:1px solid #eef0f4; text-align:center; }
.soa th:last-child,.soa td:last-child{ border-right:none; }
.soa thead .grp{ background:#fbfcfe; font-weight:500; color:var(--text-light); font-size:13px;
  text-align:left; vertical-align:top; padding:16px 12px 18px; line-height:1.35;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:0; }
.soa thead .vis{ background:#fbfcfe; font-weight:600; color:var(--text-light); font-size:12px; text-align:left; padding:6px 12px 16px; }
.soa thead .proc{ background:#fbfcfe; }
.soa .proc{ text-align:left; position:sticky; left:0; background:#fff; z-index:2; overflow:visible; }
.soa thead .proc.grp{ z-index:4; font-size:12px; color:var(--text-light); font-weight:600; letter-spacing:0.5px; vertical-align:top; }
.soa thead .proc.vis{ z-index:4; }
.soa tbody tr:last-child td{ border-bottom:none; }
.proc-cell{ display:flex; align-items:center; gap:10px; }
.proc-name{ font-weight:500; color:var(--title); line-height:18px; font-size:14px; flex:0 1 auto; min-width:0; }
.proc-flags{ display:inline-flex; align-items:center; gap:8px; flex:0 0 auto; margin-left:auto; }
.soa-chip{ display:inline-flex; align-items:center; gap:5px; border:1px solid #CFF9E8; background:#F7FEFB; color:#2CDE85;
  border-radius:20px; padding:5px 11px 5px 9px; font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; white-space:nowrap; }
.soa-chip:hover{ background:#eafdf4; }
.soa-chip svg{ width:14px; height:14px; }
.soa-warn{ position:relative; width:26px; height:26px; border:none; background:none; cursor:pointer; color:#f0a020; display:flex; align-items:center; justify-content:center; padding:0; }
.soa-warn svg{ width:18px; height:18px; }
.soa-tip{ position:absolute; top:calc(100% + 7px); left:50%; transform:translateX(-50%); background:#fff; border:1px solid var(--stroke);
  border-radius:7px; padding:5px 10px; font-size:11px; font-weight:600; color:var(--text-dark); white-space:nowrap; box-shadow:0 6px 18px rgba(20,40,80,0.14); opacity:0; pointer-events:none; transition:opacity .15s ease; z-index:50; }
.soa-warn:hover .soa-tip{ opacity:1; }
.soa-band td{ background:#f4f6fa; text-align:center; font-size:11px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; color:#8a93a6; padding:12px;
  border-right:none; box-shadow:inset 0 8px 9px -8px rgba(23,43,77,0.13); }
.soa-row.added td{ background:#fcfdff; }
.soa-row.added .proc{ background:#fcfdff; }
.soa-row.added:last-child td{ box-shadow:inset 0 -8px 9px -8px rgba(23,43,77,0.06); }
.soa-row.added .proc-name{ color:var(--text-light); }
.soa-dash{ display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:24px; border:1px solid #eef0f4; border-radius:7px; color:#c2cbd9; font-weight:600; background:#fff; }
.soa-check{ display:inline-flex; width:16px; height:16px; border-radius:50%; background:#ecfdf4; border:1px solid rgba(46,232,158,0.22); align-items:center; justify-content:center; }
.soa-check svg{ width:8px; height:8px; color:#1fd083; }
.soa-row:hover td{ background:#fafbfd; } .soa-row:hover .proc{ background:#fafbfd; z-index:20; }
.soa-row.added:hover td{ background:#f3f5f9; } .soa-row.added:hover .proc{ background:#f3f5f9; }
.soa-row.selected td{ background:rgba(46,232,158,0.04); } .soa-row.selected .proc{ background:rgba(46,232,158,0.05); box-shadow:inset 2px 0 0 var(--green); }
.soa-row.added.selected td{ background:#eef1f6; } .soa-row.added.selected .proc{ background:#eef1f6; box-shadow:inset 2px 0 0 #aab3c4; }

/* persistent "this row is the current root" highlight — stronger than .selected,
   which is just a transient click/trace state */
.soa-row.root-active td{ background:rgba(46,232,158,0.14); box-shadow:inset 0 1px 0 rgba(46,232,158,0.5), inset 0 -1px 0 rgba(46,232,158,0.5); }
.soa-row.root-active .proc{ background:rgba(46,232,158,0.18); box-shadow:inset 4px 0 0 var(--green), inset 0 1px 0 rgba(46,232,158,0.5), inset 0 -1px 0 rgba(46,232,158,0.5); }
.soa-row.root-active .proc-name{ font-weight:700; color:#0d8a5f; }
.soa-row.root-active .proc-name::after{ content:"ROOT"; margin-left:8px; font-size:10px; font-weight:800; letter-spacing:0.5px;
  color:#0d8a5f; background:rgba(46,232,158,0.18); border-radius:5px; padding:2px 6px; vertical-align:middle; }
.soa-row.root-active:hover td{ background:rgba(46,232,158,0.18); } .soa-row.root-active:hover .proc{ background:rgba(46,232,158,0.22); }
/* Procedures the traced element is ALSO measured off (`traceAlso` in
   protocol.content.js). A softer wash than the root, and labelled TRACED rather
   than ROOT, because only one procedure filters the other tabs — the rest are
   here to show what the endpoint actually depends on. */
.soa-row.root-related td{ background:rgba(46,232,158,0.05); }
.soa-row.root-related .proc{ background:rgba(46,232,158,0.07); box-shadow:inset 3px 0 0 rgba(46,232,158,0.45); }
.soa-row.root-related .proc-name{ font-weight:600; color:#127a55; }
.soa-row.root-related .proc-name::after{ content:"TRACED"; margin-left:8px; font-size:10px; font-weight:800; letter-spacing:0.5px;
  color:#127a55; background:rgba(46,232,158,0.16); border-radius:4px; padding:1px 5px; vertical-align:middle; }
.soa-row.root-related:hover td{ background:rgba(46,232,158,0.09); } .soa-row.root-related:hover .proc{ background:rgba(46,232,158,0.11); }
/* A root narrows the schedule to the procedures it reaches. Same mechanism the
   Protocol document uses (.root-hidden), so both screens filter rather than
   merely mark, and the SOA tab's count badge equals the rows left on screen. */
.soa-row.root-hidden{ display:none; }

/* SoA detail drawer */
.soa-detail{ display:none; flex:0 0 0; width:0; border:1px solid var(--stroke); border-radius:16px; background:#fff; overflow:hidden; flex-direction:column; align-self:flex-start; position:sticky; top:14px; max-height:calc(100vh - 32px); }
.soa-wrap.detail-open .soa-detail{ display:flex; flex:0 0 600px; width:600px; }
.soa-detail-head{ flex:0 0 auto; padding:18px 20px 14px; display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.sd-title{ font-size:18px; font-weight:700; color:var(--title); line-height:24px; }
.soa-detail-body{ flex:1 1 auto; min-height:0; padding:0 20px 20px; display:flex; flex-direction:column; gap:18px; overflow-y:auto; }
.soa-detail-body > *{ flex:0 0 auto; }
.sd2-pills{ display:flex; gap:8px; }
.sd2-pill{ display:inline-flex; align-items:center; gap:6px; border:1px solid #e6e9f0; border-radius:20px; padding:4px 11px; font-size:12px; font-weight:500; color:var(--text-light); }
.sd2-pill .d{ width:6px; height:6px; border-radius:50%; } .sd2-pill .d.teal{ background:#8b7cff; } .sd2-pill .d.red{ background:#ef4444; }
.sd2-pill.gap{ color:#e0533d; border-color:#f6d2cb; }
/* PROTOCOL GAP — the problem (amber, standalone) */
.sd2-gapcard{ background:#fffdf2; border:1px solid #fbe6ad; border-radius:14px; padding:18px; display:flex; flex-direction:column; gap:12px; }
.sd2-gaphead{ display:flex; align-items:center; gap:8px; }
.sd2-gaphead svg{ width:17px; height:17px; color:#d98a1f; flex:0 0 17px; }
.sd2-gaphead .t{ font-size:13px; font-weight:700; letter-spacing:0.6px; color:#c2780a; }
.sd2-gaptext{ font-size:14px; line-height:21px; color:#3a3320; }
.sd2-quote{ border-left:3px solid #f0b429; background:#fffdf6; border-radius:0 8px 8px 0; padding:11px 14px; font-size:13px; line-height:20px; color:#9a916e; }
.sd2-quote .qlbl{ display:block; font-weight:700; font-size:12px; color:#7a6a3a; margin-bottom:5px; }
.sd2-card{ background:#fff; border:1px solid var(--stroke); border-radius:12px; overflow:hidden; }
.sd2-card-head{ background:#f7f9fa; border-bottom:1px solid #eef1f4; padding:12px 16px; display:flex; align-items:center; gap:9px; }
.sd2-card-head svg{ width:17px; height:17px; color:#8b97aa; }
.sd2-card-head .lbl{ font-size:13px; font-weight:600; letter-spacing:0.4px; color:#7a879a; }
.sd2-card-head .per{ margin-left:auto; font-size:12px; font-weight:600; letter-spacing:0.3px; color:#9aa3b6; }
.sd2-card-head.green{ background:rgba(46,232,158,0.06); border-bottom-color:rgba(46,232,158,0.16); }
.sd2-card-head.green svg{ color:var(--green); } .sd2-card-head.green .lbl{ color:#0d9f63; }
.sgpager{ margin-left:auto; display:flex; align-items:center; gap:8px; }
.sgpager .c{ font-size:12px; color:var(--text-light); }
.sgpager button{ width:24px; height:24px; border-radius:50%; border:1px solid var(--stroke); background:#fff; color:var(--text-light); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.sgpager button:hover{ background:#f4f5fb; } .sgpager button svg{ width:13px; height:13px; color:var(--text-light); }
.sgpager button:disabled{ color:#d3d9e3; cursor:default; background:#fff; } .sgpager button:disabled svg{ color:#d3d9e3; }
.sd2-card-body{ padding:16px 16px 18px; }
.sd2-suggtext{ font-size:14px; line-height:22px; color:var(--text-dark); }
.sd2-impact{ display:flex; }
.sd2-impact .imp{ flex:1; min-width:0; display:flex; align-items:center; gap:11px; padding:2px 14px; border-left:1px solid #eef1f4; }
.sd2-impact .imp:first-child{ border-left:none; padding-left:2px; }
.sd2-impact .ic{ width:32px; height:32px; flex:0 0 32px; border-radius:50%; border:1px solid var(--stroke); background:#fff; display:flex; align-items:center; justify-content:center; color:var(--text-dark); }
.sd2-impact .ic svg{ width:15px; height:15px; }
.sd2-impact .txt{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.sd2-impact .lab{ font-size:12px; color:var(--text-light); display:flex; align-items:center; gap:5px; white-space:nowrap; }
.sd2-impact .tr{ display:inline-flex; } .sd2-impact .tr svg{ width:14px; height:14px; }
.sd2-impact .tr.up svg{ color:#e8902a; } .sd2-impact .tr.good svg{ color:#16b06e; }
.sd2-impact .val{ font-size:15px; font-weight:700; color:#16b06e; white-space:nowrap; }
.sd2-list{ display:flex; flex-direction:column; gap:11px; }
.sd2-li{ display:flex; gap:10px; align-items:flex-start; font-size:13.5px; line-height:20px; color:var(--text-dark); }
.sd2-li svg{ width:17px; height:17px; flex:0 0 17px; margin-top:1px; }
.sd2-li.ok svg{ color:var(--green); } .sd2-li.warn svg{ color:#e8a020; }
.sd2-evlist{ display:flex; flex-direction:column; gap:12px; }
.sd2-evitem{ position:relative; background:#f7f9fb; border-radius:10px; padding:14px 40px 14px 14px; display:flex; flex-direction:column; gap:7px; }
.sd2-evlink{ position:absolute; top:13px; right:13px; color:var(--green); cursor:pointer; display:inline-flex; }
.sd2-evlink svg{ width:16px; height:16px; }
.sd2-evitem .it{ font-size:13.5px; font-weight:700; color:var(--title); line-height:19px; }
.sd2-evitem .id{ font-size:12.5px; line-height:19px; color:var(--text-light); }
.sd-visits{ display:flex; flex-wrap:wrap; gap:6px; }
.sd-visit{ background:#e9fbf2; border:0.6px solid rgba(46,232,158,0.22); color:#0d8f5a; border-radius:7px; padding:4px 10px; font-size:12px; font-weight:600; }
.sd2-sec{ display:flex; flex-direction:column; gap:10px; } .sd2-h{ font-size:16px; font-weight:700; color:var(--title); } .sd2-muted{ font-size:14px; line-height:21px; color:var(--text-light); } .sd2-line{ height:1px; background:var(--stroke); }

/* ============================================================
   EDIT TRIAL page (edit-trial.html)
   Row-type colours as tokens so a tag colour changes everywhere.
   ============================================================ */
:root{
  --et-header:#f1f3f8;  --et-header-tx:#4b556b;
  --et-visit:#fff4d6;   --et-visit-tx:#8a6d1c;
  --et-procedure:#eef1f6; --et-procedure-tx:#4b556b;
  --et-footer:#eef1f6;  --et-footer-tx:#6b7280;
  --et-ignored:#f6f7f9; --et-ignored-tx:#9aa3b6;
  --et-visit-bg:#fef9ec;
}
.et-panel{ display:none; }
.et-panel.show{ display:block; }

/* -- top line: mode toggle + draft -- */
.et-topline{ display:flex; align-items:center; justify-content:space-between; padding:0 8px 4px; }
.et-modes{ display:inline-flex; background:var(--btn-bg); border-radius:12px; padding:5px; gap:4px; }
.et-mode{ border:none; background:transparent; font-family:inherit; font-size:14px; font-weight:600; color:var(--text-light);
  padding:9px 18px; border-radius:9px; cursor:pointer; }
.et-mode.active{ background:#fff; color:var(--title); box-shadow:0 1px 2px rgba(20,40,80,0.08); }
.et-draft{ display:flex; align-items:center; gap:16px; }
.et-draft-btn{ display:flex; align-items:center; gap:8px; border:1px solid var(--stroke); background:#fff; color:#9aa3b6;
  font-family:inherit; font-size:14px; font-weight:600; padding:9px 16px; border-radius:10px; cursor:not-allowed; }
.et-draft-btn svg{ width:17px; height:17px; }
.et-draft-status{ font-size:14px; font-weight:600; color:var(--text-light); }

/* -- split: form | preview -- */
.et-split{ display:flex; gap:20px; align-items:flex-start; padding:0 8px; margin-top:16px; }
.et-form{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; gap:24px; }
.et-preview{ flex:1 1 0; min-width:0; position:sticky; top:14px; }

/* -- form section -- */
.et-section{ display:flex; flex-direction:column; gap:20px; }
.et-section-head{ display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--stroke); padding-bottom:14px; }
.et-section-title{ font-size:19px; font-weight:700; color:var(--title); }
.et-section-num{ color:var(--title); }
.et-section-toggle{ width:30px; height:30px; border:none; background:none; cursor:pointer; color:var(--text-light);
  display:flex; align-items:center; justify-content:center; border-radius:8px; }
.et-section-toggle:hover{ background:var(--btn-bg); }
.et-section-toggle svg{ width:20px; height:20px; transition:transform .2s ease; }
.et-section.collapsed .et-section-toggle svg{ transform:rotate(-90deg); }
.et-section.collapsed .et-section-desc,
.et-section.collapsed .et-fields{ display:none; }
.et-section-desc{ font-size:14px; color:var(--text-light); margin-top:-8px; }
.et-fields{ display:flex; flex-direction:column; gap:22px; }

/* -- one field -- */
.et-field{ display:flex; flex-direction:column; gap:10px; }
.et-field-label{ display:flex; align-items:center; gap:9px; font-size:16px; font-weight:600; color:var(--title); }
.et-field-label svg{ width:19px; height:19px; color:#9aa3b6; }
.et-req{ color:#ef4444; font-weight:700; }

/* pills (multi-select) */
.et-pills{ border:1px solid var(--stroke); border-radius:10px; padding:12px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.et-chip{ background:var(--btn-bg); border-radius:8px; padding:7px 10px; font-size:14px; color:var(--text-dark);
  display:flex; align-items:center; gap:7px; }
.et-chip-x{ color:var(--text-light); cursor:pointer; display:flex; } .et-chip-x svg{ width:15px; height:15px; }
.et-chip-x:hover{ color:#ef4444; }
.et-pills-chev{ margin-left:auto; color:var(--text-light); display:flex; } .et-pills-chev svg{ width:20px; height:20px; }

/* select */
.et-select{ position:relative; }
.et-select select{ width:100%; appearance:none; -webkit-appearance:none; border:1px solid var(--stroke); border-radius:10px;
  padding:14px 40px 14px 14px; font-family:inherit; font-size:15px; color:var(--text-dark); background:#fff; cursor:pointer; }
.et-select-chev{ position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--text-light); pointer-events:none; }
.et-select-chev svg{ width:20px; height:20px; }

/* text / textarea */
.et-input,.et-textarea{ width:100%; border:1px solid var(--stroke); border-radius:10px; padding:13px 14px;
  font-family:inherit; font-size:15px; color:var(--text-dark); background:#fff; resize:vertical; }
.et-input:focus,.et-textarea:focus,.et-rt-area:focus,.et-select select:focus{ outline:none; border-color:var(--green); box-shadow:0 0 0 3px rgba(46,232,158,0.08); }

/* richtext */
.et-richtext{ border:1px solid var(--stroke); border-radius:10px; overflow:hidden; }
.et-rt-bar{ display:flex; flex-wrap:wrap; gap:2px; padding:8px 10px; border-bottom:1px solid var(--stroke); background:#fcfdff; }
.et-rt-btn{ min-width:30px; height:30px; border:none; background:transparent; border-radius:6px; cursor:pointer;
  font-family:inherit; font-size:14px; font-weight:600; color:var(--btn-text); }
.et-rt-btn:hover{ background:var(--btn-bg); }
.et-rt-area{ width:100%; border:none; padding:14px; font-family:inherit; font-size:15px; color:var(--text-dark); resize:vertical; }

/* -- preview panel -- */
.et-preview-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:10px; }
.et-preview-title{ font-size:19px; font-weight:700; color:var(--title); }
.et-preview-btns{ display:flex; align-items:center; gap:10px; }
.et-pv-btn{ border:1px solid var(--stroke); background:#fff; color:var(--btn-text); font-family:inherit; font-size:13px;
  font-weight:600; padding:9px 14px; border-radius:9px; cursor:pointer; }
.et-pv-btn.primary{ background:var(--green); color:var(--brand-ink); border-color:var(--green); }
.et-pv-icon{ width:38px; height:38px; border:1px solid var(--stroke); background:#fff; border-radius:9px; cursor:pointer;
  color:var(--text-light); display:flex; align-items:center; justify-content:center; }
.et-pv-icon svg{ width:18px; height:18px; }
.et-preview-doc{ border:1px solid var(--stroke); border-radius:12px; overflow:hidden; background:#fff; }
.et-preview-bar{ background:#2b2f36; color:#cfd3da; font-size:13px; font-weight:600; padding:10px 16px; }
.et-preview-page{ padding:40px 44px; display:flex; flex-direction:column; gap:22px; min-height:520px; }
.et-preview-page p{ font-size:15px; line-height:24px; color:#1c2433; }
.et-preview-page p:first-child{ font-weight:600; }

/* -- SOA tab -- */
.et-soa-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:0 8px 8px; }
.et-soa-desc{ font-size:14px; line-height:21px; color:var(--text-light); max-width:720px; }
.et-soa-actions{ display:flex; gap:10px; flex:0 0 auto; }
.et-soa-btn{ border:1px solid var(--stroke); background:#fff; color:var(--btn-text); font-family:inherit; font-size:14px;
  font-weight:600; padding:10px 18px; border-radius:10px; cursor:pointer; }
.et-soa-btn.primary{ background:var(--green); color:var(--brand-ink); border-color:var(--green); }
.et-soa-block{ padding:0 8px; margin-top:24px; }
.et-soa-name{ font-size:20px; font-weight:700; color:var(--title); margin-bottom:14px; }

/* tag palette bar */
.et-tagbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.et-tagpill{ border:none; border-radius:20px; padding:8px 16px; font-family:inherit; font-size:14px; font-weight:600;
  cursor:pointer; color:var(--et-header-tx); background:var(--et-header); }
.et-tagpill.visit{ background:var(--et-visit); color:var(--et-visit-tx); }
.et-tagpill.procedure{ background:#e7d9fb; color:#6b4ea8; }
.et-tagpill.footer{ background:var(--et-footer); color:var(--et-footer-tx); }
.et-tagpill.ignored{ background:#fff; color:var(--text-light); border:1px solid var(--stroke); }
.et-tagpill.delete{ background:#fbdcdc; color:#c0392b; }
.et-tagpill:hover{ filter:brightness(0.96); }

/* checkbox marks */
.et-check{ width:18px; height:18px; min-width:18px; border:1.5px solid #cbd5e1; border-radius:5px; background:#fff; cursor:pointer;
  display:inline-block; position:relative; }
.et-check.checked{ background:var(--green); border-color:var(--green); }
.et-check.checked::after{ content:""; position:absolute; left:5px; top:1px; width:5px; height:10px;
  border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
.et-check.head{ margin-right:0; }

/* the row-tagging table */
.et-soa-scroll{ overflow-x:auto; border:1px solid var(--stroke); border-radius:12px; scrollbar-width:thin; scrollbar-color:#dfe3ec transparent; }
.et-soa-scroll::-webkit-scrollbar{ height:7px; }
.et-soa-scroll::-webkit-scrollbar-thumb{ background:#dfe3ec; border-radius:4px; }
table.et-soa-table{ border-collapse:separate; border-spacing:0; width:100%; min-width:1000px; table-layout:fixed; font-size:14px; }
.et-soa-table td{ padding:16px 14px; border-bottom:1px solid #eef0f4; border-right:1px solid #eef0f4;
  color:var(--text-dark); vertical-align:middle; }
.et-soa-table td:last-child{ border-right:none; }
.et-soa-table tr:last-child td{ border-bottom:none; }
.et-cell-first{ width:340px; white-space:nowrap; }
.et-cell-first .et-cell-text{ font-weight:500; color:var(--title); }
.et-soa-row > td:not(.et-cell-first){ text-align:center; color:var(--text-dark); }

/* row-type colour fills */
.et-soa-table td.header{ background:var(--et-header); color:var(--et-header-tx); }
.et-soa-table td.visit{ background:var(--et-visit-bg); }
.et-soa-table td.visit.et-cell-first{ background:var(--et-visit); }
.et-soa-table td.procedure{ background:#fff; }
.et-soa-table td.footer{ background:var(--et-footer); color:var(--et-footer-tx); font-style:italic; font-size:13px; }
.et-soa-table td.ignored{ background:var(--et-ignored); color:var(--et-ignored-tx); }
.et-soa-row.selected > td{ box-shadow:inset 0 0 0 9999px rgba(46,232,158,0.05); }

/* per-row type dropdown inside the first cell */
.et-cell-first .et-check,
.et-cell-first .et-rowtype,
.et-cell-first .et-cell-text{ vertical-align:middle; }
.et-rowtype{ position:relative; display:inline-block; margin:0 12px; vertical-align:middle; }
.et-rowtype select{ appearance:none; -webkit-appearance:none; border:1px solid #d9dee8; border-radius:8px; background:#fff;
  font-family:inherit; font-size:13px; font-weight:600; color:var(--text-dark); padding:8px 30px 8px 12px; cursor:pointer; }
.et-rowtype-chev{ position:absolute; right:8px; top:50%; transform:translateY(-50%); color:var(--text-light); pointer-events:none; }
.et-rowtype-chev svg{ width:16px; height:16px; }

/* ============================================================
   SIMILAR TRIALS page
   ============================================================ */
.st-head{ display:flex; align-items:center; gap:12px; padding:4px 8px 0; }

/* panels (tab bodies) */
.st-panel{ display:none; }
.st-panel.show{ display:block; }

/* search row */
.st-searchrow{ display:flex; align-items:center; gap:12px; padding:0 8px; }
.st-searchbox{ flex:1; display:flex; align-items:center; gap:10px; height:48px; background:var(--white);
  border:1px solid var(--stroke); border-radius:12px; padding:0 14px; }
.st-search-ic{ color:var(--text-light); } .st-search-ic svg{ width:20px; height:20px; }
.st-searchbox input{ flex:1; border:none; outline:none; background:transparent; font-family:inherit;
  font-size:14px; color:var(--text-dark); }
.st-searchbox input::placeholder{ color:var(--text-light); }
.st-ai{ display:flex; align-items:center; gap:8px; color:var(--text-dark); font-size:14px; font-weight:600; white-space:nowrap; }
.st-ai svg{ width:18px; height:18px; color:var(--green); }
.st-switch{ width:40px; height:22px; border-radius:20px; background:#dfe3ec; position:relative; cursor:pointer; transition:background .15s; }
.st-switch .st-knob{ position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,0.2); transition:left .15s; }
.st-switch.on{ background:var(--green); } .st-switch.on .st-knob{ left:20px; }
.st-filter{ height:48px; display:flex; align-items:center; gap:8px; padding:0 18px; background:var(--white);
  border:1px solid var(--stroke); border-radius:12px; cursor:pointer; font-family:inherit; font-size:14px;
  font-weight:600; color:var(--btn-text); white-space:nowrap; }
.st-filter svg{ width:18px; height:18px; color:var(--text-light); }
.st-scope{ position:relative; }
.st-scope select{ appearance:none; -webkit-appearance:none; height:48px; border:1px solid var(--stroke); border-radius:12px;
  background:var(--white); font-family:inherit; font-size:14px; font-weight:600; color:var(--text-dark);
  padding:0 40px 0 16px; cursor:pointer; }
.st-scope-chev{ position:absolute; right:14px; top:50%; transform:translateY(-50%); color:var(--text-light); pointer-events:none; }
.st-scope-chev svg{ width:18px; height:18px; }

/* green stats strip */
.st-stats{ display:flex; align-items:center; gap:32px; margin:0 8px; background:var(--badge-bg);
  border-radius:12px; padding:16px 24px; }
.st-stat{ display:flex; align-items:center; gap:8px; font-size:15px; }
.st-stat-l{ color:var(--text-dark); font-weight:500; }
.st-stat-v{ color:var(--title); font-weight:700; }

/* data tables (List / Scores) */
.st-tablewrap{ padding:0 8px; }
.st-scroll{ overflow-x:auto; }
/* FIXED layout, widths from the <colgroup> the renderer builds. An auto-layout
   table ignores max-width, which is why a long trial title used to run straight
   through the columns beside it and print on top of their text. */
table.st-table{ width:100%; border-collapse:collapse; font-size:13.5px; table-layout:fixed;
  min-width:1080px; }
/* headers wrap to a second line rather than truncate — "Inclusion Crite…" tells
   the reader less than two short lines do, and bottom alignment keeps a
   one-line header level with a two-line one */
.st-table thead th{ padding:14px 14px; border-bottom:1px solid var(--stroke);
  color:var(--title); font-weight:700; font-size:12px; line-height:16px; vertical-align:bottom; }
.st-th{ display:flex; align-items:flex-end; gap:7px; }
.st-th-t{ min-width:0; }
.st-th-sort{ color:#c3cad8; cursor:pointer; flex:none; }
.st-th-sort svg{ width:14px; height:14px; }
.st-th-sort:hover{ color:var(--text-light); }
.st-th-check{ width:52px; }
.st-table tbody td{ padding:14px; border-bottom:1px solid var(--stroke); color:var(--text-dark);
  vertical-align:middle; }

/* alignment is per column, declared in the content file. Numbers and dates go
   right so their digits stack; the header follows the body or the two disagree. */
.st-table .al-left{ text-align:left; }
.st-table .al-right{ text-align:right; }
.st-table .al-center{ text-align:center; }
.st-table th.al-right .st-th{ justify-content:flex-end; }
.st-table th.al-center .st-th{ justify-content:center; }
.st-table .al-right, .st-table .al-center{ font-variant-numeric:tabular-nums; }

/* the flexible first column wraps to two lines and then clips, so a long title
   lengthens its own row and never its neighbours' */
.st-td-first{ line-height:19px; font-weight:600; color:var(--title);
  display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.st-table td.al-left:not(.st-td-first){ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.st-td-check{ width:52px; }
/* a percentage and its meter, stacked in a right-aligned cell */
.st-pct{ font-weight:700; font-variant-numeric:tabular-nums; }
.st-pct small{ font-size:10.5px; font-weight:600; color:var(--text-light); margin-left:2px; }
.st-meter{ display:block; width:100%; max-width:150px; margin-left:auto; height:3px; border-radius:2px;
  background:#eceef5; overflow:hidden; margin-top:5px; }
.st-meter i{ display:block; height:3px; background:rgba(46,232,158,0.7); border-radius:2px; }
/* Registry link on the leading column. A row with a verified ClinicalTrials.gov
   record is a real anchor; a row without one keeps a plain label and a tooltip
   saying why, rather than a dead-looking link. */
.st-link{ color:inherit; text-decoration:none; display:inline; }
.st-link:hover{ color:var(--forest); text-decoration:underline; text-underline-offset:2px; }
.st-ext{ width:12px; height:12px; margin-left:5px; vertical-align:-1px; color:#9aa3b6; }
.st-link:hover .st-ext{ color:var(--forest); }
.st-nolink{ cursor:help; border-bottom:1px dotted #cfd6e2; }
.st-sub{ display:block; font-size:11px; font-weight:600; color:#9aa3b6; margin-top:2px; }

/* ---- Relevant Documents table -------------------------------------------
   The document cell carries a title AND its issuer, so the two-line clamp has
   to sit on the title alone — clamping the cell would eat the issuer line on
   any long title. Type uses the validated categorical palette (three kinds,
   three slots, assigned in order and never cycled). */
.st-td-first.rd-doc{ display:block; -webkit-line-clamp:none; line-clamp:none; }
.rd-doc-t{ display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.rd-type{ display:inline-block; padding:3px 11px; border-radius:var(--pill); font-size:11px;
  font-weight:700; letter-spacing:0.2px; white-space:nowrap; }
.rd-type.guidance{   background:var(--cat-1-bg); color:var(--cat-1-ink); }
.rd-type.label{      background:var(--cat-2-bg); color:var(--cat-2-ink); }
.rd-type.literature{ background:var(--cat-3-bg); color:var(--cat-3-ink); }
.rd-none{ color:#c3cad8; }
/* "Show more" lives where the pager's next/prev buttons do on Similar Trials */
.st-more{ display:flex; align-items:center; gap:8px; height:34px; padding:0 15px; font-family:inherit;
  font-size:12.5px; font-weight:600; color:var(--text-dark); background:var(--white);
  border:1px solid var(--stroke); border-radius:10px; cursor:pointer; }
.st-more:hover:not(:disabled){ background:var(--badge-bg); border-color:rgba(46,232,158,0.45); color:#0a8f57; }
.st-more:disabled{ opacity:.4; cursor:default; }
.st-more svg{ width:14px; height:14px; }

/* ---- pager ---- */
.st-pager{ display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  padding:16px 14px 6px; border-top:1px solid var(--stroke); margin-top:-1px; }
.st-pager-count{ font-size:12.5px; color:var(--text-light); }
.st-pager-count b{ color:var(--text-dark); font-weight:700; font-variant-numeric:tabular-nums; }
.st-pager-nav{ margin-left:auto; display:flex; align-items:center; gap:10px; }
.st-pager-lb{ font-size:12.5px; color:var(--text-light); white-space:nowrap; }
.st-pager-lb b{ color:var(--text-dark); font-weight:700; font-variant-numeric:tabular-nums; }
.st-pg{ width:32px; height:32px; border-radius:9px; flex:none; display:grid; place-items:center;
  background:var(--white); border:1px solid var(--stroke); color:var(--text-light);
  cursor:pointer; font-family:inherit; transition:background .14s ease, color .14s ease; }
.st-pg:hover:not(:disabled){ background:var(--badge-bg); border-color:rgba(46,232,158,0.45); color:#0a8f57; }
.st-pg:disabled{ opacity:.4; cursor:default; }
.st-pg svg{ width:15px; height:15px; }
/* pages past the rows this file carries */
.st-beyond{ text-align:center !important; padding:38px 18px !important;
  font-size:12.5px; color:var(--text-light); }
.st-beyond b{ color:var(--text-dark); font-weight:700; }
.st-row.selected{ background:rgba(46,232,158,0.05); }
.st-row:hover{ background:#f6f8fb; }
.st-check{ width:20px; height:20px; border:1.5px solid #cbd5e1; border-radius:5px; background:var(--white);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; color:var(--brand-ink); }
.st-check svg{ width:12px; height:12px; opacity:0; }
.st-check.checked{ background:var(--green); border-color:var(--green); } .st-check.checked svg{ opacity:1; }
.st-check.head{ background:var(--green); border-color:var(--green); } .st-check.head svg{ opacity:1; }
.st-check.head.checked{ background:var(--green); }

/* dashboard charts */
.st-charts{ display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:0 8px; }
.st-chart{ background:var(--white); border:1px solid var(--stroke); border-radius:16px; padding:24px; }
.st-chart-title{ text-align:center; font-size:18px; font-weight:700; color:var(--title);
  padding-bottom:16px; border-bottom:1px solid var(--stroke); margin-bottom:24px; }

/* vertical bars */
.st-bars{ display:flex; align-items:flex-end; gap:18px; height:280px; padding-top:8px; }
.st-bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:10px; height:100%; }
.st-bar-track{ flex:1; width:26px; display:flex; align-items:flex-end; background:#f1f3f8; border-radius:8px; }
.st-bar-fill{ width:100%; background:var(--y400); border-radius:8px; min-height:4px; transition:height .2s; }
.st-bar-lbl{ font-size:12px; color:var(--text-light); text-align:center; white-space:nowrap; }

/* horizontal bars */
.st-hbars{ display:flex; flex-direction:column; gap:18px; }
.st-hbar-row{ display:flex; align-items:center; gap:14px; }
.st-hbar-lbl{ width:170px; flex:0 0 170px; font-size:14px; color:var(--text-dark); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.st-hbar-track{ flex:1; height:18px; background:#f1f3f8; border-radius:20px; overflow:hidden; }
.st-hbar-fill{ display:block; height:100%; background:var(--y400); border-radius:20px; min-width:4px; }
.st-hbar-val{ width:44px; flex:0 0 44px; text-align:right; font-size:14px; font-weight:600; color:var(--text-dark); }

/* ============================================================
   TRACE GROUP — the 2-action info / set-as-root widget used on
   Protocol endpoints+criteria, SOA rows, CRF and SDTM rows.
   Direction lives in the root banner's navigator, not on the row.
   ============================================================ */
/* criterion rows become flex so the widget sits to the right of the text */
.incl-list li.has-trace{ display:flex; align-items:flex-start; gap:12px; text-align:left; }
.incl-list li .crit-text{ flex:1; min-width:0; }

.trace-group{ display:inline-flex; align-items:center; gap:2px; flex:0 0 auto;
  background:var(--badge-bg); border:1px solid rgba(46,232,158,0.35); border-radius:20px; padding:2px; }
.tg-btn{ display:flex; align-items:center; justify-content:center; width:24px; height:24px; border:none;
  background:transparent; border-radius:50%; color:#12b877; cursor:pointer; padding:0;
  transition:background .15s, color .15s; }
.tg-btn svg{ width:13px; height:13px; }
.tg-btn:hover:not(:disabled){ background:#d7fbec; }
.tg-btn:disabled{ opacity:0.3; cursor:default; }
.tg-btn.tg-info{ color:var(--text-light); }
.tg-btn.tg-info:hover:not(:disabled){ background:var(--btn-bg); color:var(--btn-text); }
/* the root leg carries the green of the root banner it feeds */
.tg-btn.tg-root{ color:#0d8a5f; }
.tg-btn.tg-root svg{ width:14px; height:14px; }

/* "Missing procedure" amber warning (shown when a criterion has no SOA match) */
.trace-warn{ display:inline-flex; align-items:center; gap:5px; flex:0 0 auto; margin-top:1px;
  border:1px solid #fde3b0; background:#fff8ec; color:#c9820c;
  border-radius:20px; padding:4px 11px; font-size:12px; font-weight:600; white-space:nowrap; cursor:default; }
.trace-warn svg{ width:14px; height:14px; }

/* endpoint sub-head gets the widget on the right of its title */
.sub-head.with-trace{ display:flex; align-items:center; justify-content:space-between; gap:12px; }

/* brief highlight when a trace lands on its target */
@keyframes tracePulse{
  0%   { background:rgba(46,232,158,0.28); }
  100% { background:rgba(46,232,158,0.04); }
}
.soa-row.trace-pulse td{ animation:tracePulse 1.4s ease-out; }
.soa-row.trace-pulse .proc{ animation:tracePulse 1.4s ease-out; }
.sub-block.trace-pulse, .incl-list li.trace-pulse{ animation:tracePulse 1.4s ease-out; border-radius:6px; }

/* persistent Protocol-doc highlight: the exact endpoint/criterion that IS the
   root (.root-active) vs. others that merely trace to the same procedure
   (.root-related, a softer wash so the root itself still stands out most) */
.sub-block.root-active{ background:rgba(46,232,158,0.09); box-shadow:inset 3px 0 0 var(--green);
  border-radius:8px; padding-top:8px; padding-bottom:8px; }
.sub-block.root-related{ background:rgba(46,232,158,0.04); box-shadow:inset 2px 0 0 rgba(46,232,158,0.4);
  border-radius:8px; padding-top:8px; padding-bottom:8px; }
/* .incl-list li has an absolutely-positioned counter pinned to its top edge —
   skip vertical padding here so "1." etc. stay aligned with the text */
.incl-list li.root-active{ background:rgba(46,232,158,0.09); box-shadow:inset 3px 0 0 var(--green); border-radius:6px; }
.incl-list li.root-related{ background:rgba(46,232,158,0.04); box-shadow:inset 2px 0 0 rgba(46,232,158,0.4); border-radius:6px; }
.root-active .sub-head-txt, .root-active .crit-text{ font-weight:700; color:#0d8a5f; }
.root-active .sub-head-txt::after, .root-active .crit-text::after{
  content:"ROOT"; margin-left:8px; font-size:10px; font-weight:800; letter-spacing:0.5px;
  color:#0d8a5f; background:rgba(46,232,158,0.18); border-radius:5px; padding:2px 6px; vertical-align:middle; }
/* a root filters the whole doc down to what's relevant to it */
.root-hidden{ display:none !important; }

/* ============================================================
   ROOT BANNER — shows the active trace root on every tab
   ============================================================ */
.root-banner{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:rgba(46,232,158,0.06); border:1px solid rgba(46,232,158,0.3); border-radius:10px;
  padding:10px 16px; margin:0 8px; }
.rb-left{ display:flex; align-items:center; gap:8px; color:#0d8a5f; font-size:14px; }
.rb-left svg{ width:16px; height:16px; }
.rb-txt b{ color:var(--title); }
.rb-clear{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--stroke); background:var(--white);
  color:var(--btn-text); border-radius:8px; padding:6px 12px; font-family:inherit; font-size:13px; font-weight:600;
  cursor:pointer; transition:background .15s, border-color .15s; }
.rb-clear:hover{ background:var(--btn-bg); border-color:#cfd3e0; }
.rb-clear svg{ width:14px; height:14px; }

/* the one CTA that walks the root through the tabs it reaches — arrows either
   side of where the reader currently is in that chain */
.rb-nav{ display:inline-flex; align-items:center; gap:2px; margin-left:auto; margin-right:10px;
  background:var(--white); border:1px solid rgba(46,232,158,0.45); border-radius:20px; padding:3px; }
.rb-nav-arrow{ display:flex; align-items:center; justify-content:center; width:26px; height:26px;
  border:none; background:transparent; border-radius:50%; color:#0d8a5f; cursor:pointer; padding:0;
  transition:background .15s; }
.rb-nav-arrow svg{ width:14px; height:14px; }
.rb-nav-arrow:hover:not(:disabled){ background:#d7fbec; }
.rb-nav-arrow:disabled{ opacity:0.28; cursor:default; }
.rb-nav-mid{ display:inline-flex; align-items:baseline; gap:7px; padding:0 8px; white-space:nowrap; }
.rb-nav-mid b{ font-size:13px; font-weight:700; color:var(--title); }
.rb-nav-pos{ font-size:11px; font-weight:600; color:var(--text-light); }

/* ============================================================
   INFO POPOVER — click-to-open card anchored under a tg-info button
   ============================================================ */
.info-popover{ position:absolute; z-index:200; width:300px; max-width:calc(100vw - 32px);
  background:var(--white); border:1px solid var(--stroke); border-radius:12px;
  box-shadow:0 12px 32px rgba(23,43,77,0.16); }
.ip-head{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px;
  border-bottom:1px solid var(--stroke); }
.ip-title{ font-size:13px; font-weight:700; color:var(--title); }
.ip-close{ width:22px; height:22px; border:none; background:none; color:var(--text-light); cursor:pointer;
  display:flex; align-items:center; justify-content:center; }
.ip-close svg{ width:14px; height:14px; }
.ip-body{ padding:12px 14px; font-size:13px; color:var(--text-dark); line-height:1.5; }
.ip-body .ip-text{ margin-bottom:8px; }
.ip-body .ip-sub{ color:var(--text-light); }
.ip-body .ip-sub b{ color:var(--title); }
.ip-factors{ display:flex; flex-direction:column; gap:6px; }
.ip-factor{ display:flex; align-items:center; justify-content:space-between; background:#f6f8fb;
  border:1px solid var(--stroke); border-radius:8px; padding:7px 10px; }
.ip-factor-k{ font-size:12px; font-weight:600; color:var(--text-light); }
.ip-factor-v{ font-size:13px; font-weight:700; color:var(--title); }

/* ============================================================
   CRF TAB (inline in protocol-review, not separate page)
   ============================================================ */
/* wider than the document tabs — the question table carries eight columns */
.crf-content{ padding:24px; max-width:1360px; margin:0 auto; }
.crf-header{ display:flex; align-items:center; gap:12px; margin-bottom:24px; padding-bottom:18px;
  border-bottom:1px solid var(--stroke); }
.crf-proc-name{ font-size:20px; font-weight:700; color:var(--title); }
.crf-source-tag{ font-size:12px; font-weight:700; letter-spacing:0.4px; color:var(--green);
  background:var(--badge-bg); border:1px solid rgba(46,232,158,0.25); border-radius:20px; padding:4px 12px; }
.crf-body{ display:flex; align-items:flex-start; gap:24px; position:relative; }
.crf-fields{ flex:1; min-width:0; }
/* ---------- question tables — one card per (procedure, group) ---------- */
.crf-tblgrp{ background:var(--white); border:1px solid var(--stroke); border-radius:12px;
  overflow:hidden; margin-bottom:16px; }
.crf-tblgrp-head{ display:flex; align-items:center; gap:9px; padding:12px 16px;
  background:var(--section-bg); border-bottom:1px solid var(--stroke); }
.crf-tblgrp-ic{ width:17px; height:17px; color:var(--text-light); flex:0 0 17px; }
.crf-tblgrp-name{ font-size:14px; font-weight:700; color:var(--title); }
.crf-tblgrp-code{ font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--btn-text);
  background:#eef1f6; border:1px solid var(--stroke); border-radius:20px; padding:2px 9px; }
/* in "all procedures" mode a group name alone repeats (four forms carry
   "Laboratory (LB)"), so the owning procedure names the card */
.crf-tblgrp-proc{ margin-left:auto; font-size:12px; font-weight:600; color:var(--text-light); }

.crf-tblwrap{ overflow-x:auto; }
.crf-tblwrap::-webkit-scrollbar{ height:6px; }
.crf-tblwrap::-webkit-scrollbar-thumb{ background:#dfe3ec; border-radius:4px; }
/* fixed layout so the columns line up card to card — each group is its own
   table, and auto layout would size every one of them differently */
table.crf-tbl{ width:100%; min-width:1080px; border-collapse:collapse; font-size:13px; table-layout:fixed; }
table.crf-tbl th{ text-align:left; font-size:12px; font-weight:600; color:var(--text-light);
  padding:10px 12px; border-bottom:1px solid var(--stroke); white-space:nowrap; }
table.crf-tbl td{ padding:12px; border-bottom:1px solid #f1f3f8; color:var(--muted); vertical-align:middle; }
table.crf-tbl tbody tr:last-child td{ border-bottom:none; }
table.crf-tbl tr.crf-row:hover td{ background:#fbfcfe; }
table.crf-tbl tr.crf-row.active td{ background:rgba(46,232,158,0.05); }
/* severity rail on the question cell, as on the SDTM table */
table.crf-tbl tr.crf-row.error td.c-q{ box-shadow:inset 3px 0 0 var(--sev-crit); }
table.crf-tbl tr.crf-row.warn  td.c-q{ box-shadow:inset 3px 0 0 var(--sev-minor); }
/* this specific question IS the current root */
table.crf-tbl tr.crf-row.root-active td{ background:rgba(46,232,158,0.05); }
table.crf-tbl tr.crf-row.root-active td.c-q{ box-shadow:inset 3px 0 0 var(--green); }
table.crf-tbl tr.crf-row.root-active .crf-q::after{ content:"ROOT"; margin-left:7px; font-size:10px;
  font-weight:800; letter-spacing:0.5px; color:#0d8a5f; background:rgba(46,232,158,0.15);
  border-radius:5px; padding:2px 6px; }

/* columns — the question and the description take the slack */
th.c-q{ width:24%; }
th.c-act{ width:104px; } th.c-var{ width:112px; } th.c-def{ width:100px; }
th.c-type{ width:88px; } th.c-core{ width:112px; } th.c-ec{ width:96px; }
th.c-desc{ width:auto; }
.crf-q{ font-size:14px; font-weight:600; color:var(--title); }
td.c-act{ white-space:nowrap; }
td.c-type, td.c-core, td.c-ec{ font-weight:600; color:var(--text-dark); }
.crf-ec{ font-size:14px; font-weight:800; color:var(--text-dark); }
.crf-ec.none{ color:#c3cad8; }
.crf-ec.gap{ color:var(--sev-crit); }
.crf-ec-gap{ display:block; font-style:normal; font-size:10.5px; font-weight:600; color:var(--sev-crit); margin-top:1px; }

/* the SOA row tag now names the finding, so it is colour-coded by what it is */
.soa-chip.missing{ background:var(--sev-crit-bg); border-color:var(--sev-crit-line); color:var(--sev-crit); }
.soa-chip.missing svg{ color:var(--sev-crit); }
.soa-chip.unjustified{ background:var(--y50); border-color:var(--y200); color:var(--y600); }
.soa-chip.unjustified svg{ color:var(--y600); }
td.c-desc{ font-size:12px; color:var(--text-light); line-height:1.45; }

/* the SDTM/CDASH variable the question feeds, and which standard defines it */
.crf-var{ display:inline-block; font-family:var(--dx-mono); font-size:11px; font-weight:700;
  color:#0d8a5f; background:rgba(46,232,158,0.10); border:1px solid rgba(46,232,158,0.30);
  border-radius:20px; padding:3px 10px; white-space:nowrap; }
.crf-def{ display:inline-block; font-size:11px; font-weight:600; color:var(--btn-text);
  background:#eef1f6; border:1px solid var(--stroke); border-radius:20px; padding:3px 10px; white-space:nowrap; }

/* validation chips — click one to open the field's detail panel */
.crf-chip{ margin-left:7px; font-family:inherit; font-size:10px; font-weight:700; border-radius:20px;
  padding:3px 9px; cursor:pointer; white-space:nowrap; vertical-align:1px; }
.crf-chip.error{ background:var(--sev-crit-bg); color:var(--sev-crit); border:1px solid var(--sev-crit-line); }
.crf-chip.warn{ background:var(--y50); color:var(--y600); border:1px solid var(--y200); }
.crf-chip:hover{ filter:brightness(0.97); box-shadow:0 0 0 2px rgba(0,0,0,0.03); }
/* empty fallback */
.crf-empty{ background:var(--white); border:1px dashed var(--stroke); border-radius:12px; padding:40px 28px; text-align:center; }
.crf-empty-t{ font-size:17px; font-weight:700; color:var(--title); margin-bottom:8px; }
.crf-empty-s{ font-size:14px; color:var(--text-light); line-height:1.5; max-width:520px; margin:0 auto; }

/* hover panel (right-hand, like SOA detail drawer)
   The panel is a flex column so the body can take every pixel the head does not:
   `align-self:stretch` already matches the panel to the height of the table
   beside it, and the body then fills that and scrolls inside itself. It used to
   stop at `max-height:calc(100vh - 320px)` — a guess at the chrome above it,
   which left the panel short of its own container on tall viewports and cut the
   body off early on short ones. */
.crf-hover-panel{ flex:0 0 0; width:0; overflow:hidden; align-self:stretch; background:var(--white);
  border:1px solid var(--stroke); border-radius:16px; transition:width .18s ease, opacity .18s ease; opacity:0;
  display:flex; flex-direction:column; }
.crf-hover-panel.show{ flex:0 0 380px; width:380px; opacity:1; box-shadow:0 8px 30px rgba(23,43,77,0.08); }
.crf-hover-head{ flex:none; display:flex; align-items:center; justify-content:space-between;
  padding:20px 22px 16px; border-bottom:1px solid var(--stroke); }
.crf-hover-title{ font-size:18px; font-weight:800; color:var(--title); }
/* min-height:0 is what lets a flex child shrink below its content and scroll
   instead of pushing the panel taller than its container */
.crf-hover-body{ flex:1 1 auto; min-height:0; padding:20px 22px; overflow-y:auto; }
.crf-d-sec{ font-size:12px; font-weight:700; letter-spacing:0.6px; color:var(--text-light);
  margin:18px 0 12px; }
.crf-d-row{ margin-bottom:14px; }
.crf-d-k{ font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--text-light); margin-bottom:5px; }
.crf-d-v{ font-size:14px; font-weight:600; color:var(--title); background:#f6f8fb; border:1px solid var(--stroke);
  border-radius:10px; padding:10px 13px; }
.crf-ver{ display:flex; align-items:flex-start; gap:10px; border:1px solid var(--stroke); border-radius:10px;
  padding:10px 12px; margin-bottom:10px; }
.crf-ver-ic{ flex:0 0 auto; margin-top:1px; } .crf-ver-ic svg{ width:18px; height:18px; }
.crf-ver-name{ font-size:14px; font-weight:700; color:var(--title); }
.crf-ver-note{ font-size:13px; color:var(--text-light); margin-top:2px; line-height:1.4; }
.crf-ver.ok{ background:rgba(46,232,158,0.05); border-color:rgba(46,232,158,0.25); } .crf-ver.ok .crf-ver-ic{ color:#12b877; }
.crf-ver.warn{ background:#fff8ec; border-color:#fde3b0; } .crf-ver.warn .crf-ver-ic{ color:#c9820c; }
.crf-ver.conflict{ background:#fef1f1; border-color:#f9c9c9; } .crf-ver.conflict .crf-ver-ic{ color:#d64545; }

/* ============================================================
   SDTM TAB (inline in protocol-review)
   ============================================================ */
.sdtm-content{ padding:24px; max-width:1200px; margin:0 auto; }
.sdtm-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; padding-bottom:16px;
  border-bottom:1px solid var(--stroke); }
.sdtm-header-left{ display:flex; align-items:center; gap:12px; }
.sdtm-proc-name{ font-size:20px; font-weight:700; color:var(--title); }
.sdtm-source-tag{ font-size:12px; font-weight:700; letter-spacing:0.4px; color:#0e83b3;
  background:#e6f4fb; border:1px solid rgba(14,131,179,0.25); border-radius:20px; padding:4px 12px; }
.sdtm-views{ display:flex; gap:8px; }
.sdtm-view{ display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px; border:1px solid var(--stroke);
  background:var(--white); color:var(--text-light); font-size:13px; font-weight:600; cursor:pointer;
  transition:all .15s; }
.sdtm-view svg{ width:16px; height:16px; }
.sdtm-view:hover{ background:var(--btn-bg); border-color:var(--btn-border); }
.sdtm-view.active{ background:var(--green); border-color:var(--green); color:var(--brand-ink); }
.sdtm-issuebar{ display:flex; align-items:center; justify-content:space-between; padding:14px 20px;
  background:#fef1f1; border:1px solid #f9c9c9; border-radius:12px; margin-bottom:22px; }
.sdtm-issue-left{ display:flex; align-items:center; gap:14px; }
.sdtm-issue-title{ font-size:13px; font-weight:700; letter-spacing:0.5px; color:var(--text-dark);
  border-left:3px solid #d64545; padding-left:10px; }
.sdtm-issue-pill{ display:inline-flex; align-items:center; gap:7px; background:#f3ecfe; color:#7c3aed;
  border:1px solid #e5d5fb; border-radius:20px; padding:6px 14px; font-size:13px; font-weight:600; }
.sdtm-issue-pill svg{ width:16px; height:16px; }
.sdtm-issue-total{ font-size:14px; color:var(--text-light); } .sdtm-issue-total b{ color:var(--title); }
.sdtm-body{ }
.sdtm-domain{ margin-bottom:26px; }
.sdtm-domain-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;
  padding-bottom:10px; border-bottom:2px solid var(--stroke); }
.sdtm-domain-name{ font-size:13px; font-weight:700; letter-spacing:0.6px; color:var(--text-dark); }
.sdtm-domain-issue{ font-size:12px; color:#d64545; font-weight:600; }

/* SDTM variable card */
.sdtm-card{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  background:var(--white); border:1px solid var(--stroke); border-radius:12px; padding:18px 20px;
  margin-bottom:12px; }
.sdtm-card.error{ border-color:#f9c9c9; background:#fef1f1; }
.sdtm-card.warn{ border-color:#fde3b0; background:#fff8ec; }
/* this specific variable IS the current root */
.sdtm-card.root-active{ border-color:var(--green); background:rgba(46,232,158,0.05); box-shadow:inset 3px 0 0 var(--green); }
.sdtm-card.root-active .sdtm-card-title::after{ content:"ROOT"; margin-left:2px; font-size:10px; font-weight:800; letter-spacing:0.5px;
  color:#0d8a5f; background:rgba(46,232,158,0.15); border-radius:5px; padding:2px 6px; }
.sdtm-card-title{ display:flex; align-items:center; gap:10px; font-size:16px; font-weight:700; color:var(--title); }
.sdtm-card-label{ margin-top:6px; font-size:13px; color:var(--text-light); font-weight:500; }
.sdtm-card-note{ margin-top:8px; font-size:12px; color:var(--muted); display:flex; align-items:flex-start; gap:6px; }
.sdtm-card-note::before{ content:"\25CF"; color:#f0a020; font-size:10px; margin-top:1px; }
.sdtm-badge{ font-size:11px; font-weight:700; border-radius:6px; padding:3px 9px; letter-spacing:0.3px; }
.sdtm-badge.error{ background:#d64545; color:#fff; }
.sdtm-badge.warn{ background:#f0a020; color:#fff; }

/* SDTM hover panel + user-defined variables */
.sdtm-wrap{ display:flex; align-items:flex-start; gap:24px; position:relative; }
.sdtm-content{ flex:1; min-width:0; }
/* align-self:flex-start, not stretch: the panel is positioned level with the
   click by alignSdtmPanel() setting its margin-top, so it must size to its own
   content rather than to the full height of the table beside it. */
.sdtm-hover-panel{ flex:0 0 0; width:0; overflow:hidden; align-self:flex-start; background:var(--white);
  border:1px solid var(--stroke); border-radius:16px; transition:width .18s ease, opacity .18s ease; opacity:0; }
.sdtm-hover-panel.show{ flex:0 0 380px; width:380px; opacity:1; box-shadow:0 8px 30px rgba(23,43,77,0.08); }
.sdtm-hover-head{ display:flex; align-items:center; justify-content:space-between; padding:20px 22px 16px;
  border-bottom:1px solid var(--stroke); }
.sdtm-hover-title{ font-size:18px; font-weight:800; color:var(--title); }
.sdtm-hover-body{ padding:20px 22px; max-height:calc(100vh - 320px); overflow-y:auto; }
.sdtm-detail-tag{ display:inline-flex; align-items:center; gap:7px; border-radius:20px; padding:6px 14px;
  font-size:13px; font-weight:700; margin-bottom:22px; }
.sdtm-detail-tag.std{ background:#e6f4fb; color:#0e83b3; }
.sdtm-detail-tag.user{ background:#f0ecfe; color:#7c3aed; }
.sdtm-d-sec{ font-size:12px; font-weight:700; letter-spacing:0.6px; color:var(--text-light); margin:18px 0 12px; }
.sdtm-d-row{ margin-bottom:14px; }
.sdtm-d-k{ font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--text-light); margin-bottom:5px; }
.sdtm-d-v{ font-size:14px; font-weight:600; color:var(--title); background:#f6f8fb; border:1px solid var(--stroke);
  border-radius:10px; padding:10px 13px; }
.sdtm-card.active{ border-color:var(--green); box-shadow:0 0 0 3px rgba(46,232,158,0.08); }
.sdtm-card.user-defined{ border-left:3px solid #7c3aed; }
.sdtm-user-tag{ font-size:10px; font-weight:700; border-radius:6px; padding:3px 8px; letter-spacing:0.3px;
  background:#f0ecfe; color:#7c3aed; }

/* ---------- SDTM variable table ---------- */
.sdtm-issue-untraced{ font-size:12px; font-weight:600; color:var(--sev-crit); background:var(--sev-crit-bg);
  border:1px solid var(--sev-crit-line); border-radius:20px; padding:3px 10px; }
/* the domain index reuses the Protocol index component, so it needs the same
   collapse behaviour on its own wrapper */
.sdtm-wrap.collapsed .index{ display:none; }
.sdtm-wrap.collapsed .index-rail{ display:flex; }
.sdtm-wrap .index{ margin-top:24px; }
.sdtm-wrap .index-rail{ margin-top:24px; }
.index-item .idx-vars{ font-size:11px; font-weight:600; color:#9aa3b6; }

.sdtm-tblwrap{ border:1px solid var(--stroke); border-radius:12px; overflow-x:auto; }
table.sdtm-tbl{ width:100%; border-collapse:collapse; font-size:13px; }
table.sdtm-tbl th{ position:sticky; top:0; z-index:1; background:var(--section-bg); text-align:left;
  font-size:10px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase; color:var(--text-light);
  padding:10px 12px; border-bottom:1px solid var(--stroke); white-space:nowrap; }
table.sdtm-tbl th.v-act{ text-align:right; }
table.sdtm-tbl td{ padding:10px 12px; border-bottom:1px solid #f1f3f8; color:var(--muted); vertical-align:top; }
table.sdtm-tbl tbody tr:last-child td{ border-bottom:none; }
table.sdtm-tbl tr.sdtm-proc td{ background:#eef4f8; font-size:11px; font-weight:700; letter-spacing:0.7px;
  text-transform:uppercase; color:var(--teal); padding:8px 12px; }
table.sdtm-tbl tr.sdtm-grp td{ background:#fafbfd; padding:7px 12px; }
table.sdtm-tbl tr.sdtm-grp .g{ font-size:11px; font-weight:700; letter-spacing:0.6px; color:var(--text-dark); }
table.sdtm-tbl tr.sdtm-grp .gi{ margin-left:10px; font-size:11px; font-weight:600; color:#d64545; }
table.sdtm-tbl tr.sdtm-row:hover td{ background:#fbfcfe; }
table.sdtm-tbl tr.sdtm-row.error td.v-var{ box-shadow:inset 3px 0 0 var(--sev-crit); }
table.sdtm-tbl tr.sdtm-row.warn td.v-var{ box-shadow:inset 3px 0 0 var(--sev-minor); }
table.sdtm-tbl tr.sdtm-row.active td{ background:rgba(46,232,158,0.05); }
table.sdtm-tbl tr.sdtm-row.root-active td.v-var{ box-shadow:inset 3px 0 0 var(--green); }
td.v-var{ white-space:nowrap; }
td.v-var .m{ font-family:var(--dx-mono); font-size:12.5px; font-weight:700; color:var(--title); }
.sdtm-dom{ display:inline-block; margin-left:8px; font-family:var(--dx-mono); font-size:10px; font-weight:600;
  color:var(--text-light); background:var(--btn-bg); border:1px solid var(--stroke); border-radius:5px; padding:1px 6px; }
td.v-label{ min-width:150px; color:var(--text-dark); }
td.v-type{ white-space:nowrap; }
.sdtm-type{ font-family:var(--dx-mono); font-size:10.5px; font-weight:600; color:var(--btn-text);
  background:var(--btn-bg); border-radius:5px; padding:2px 7px; }
td.v-desc{ min-width:220px; max-width:420px; font-size:12.5px; line-height:18px; color:var(--text-light); }
td.v-std{ white-space:nowrap; }
.sdtm-std{ font-size:10.5px; font-weight:700; border-radius:20px; padding:3px 10px; white-space:nowrap;
  cursor:default; }
.sdtm-std.sdtm{ background:#e6f4fb; color:#0e83b3; border:1px solid #cfe8f5; }
.sdtm-std.org{ background:rgba(46,232,158,0.08); color:#0d8a5f; border:1px solid rgba(46,232,158,0.35); }
.sdtm-std.user{ background:#f0ecfe; color:#7c3aed; border:1px solid #ddd3fb; }
td.v-viol{ min-width:150px; }
.sdtm-vtag{ display:inline-block; margin:0 5px 4px 0; font-family:inherit; font-size:10px; font-weight:700;
  letter-spacing:0.3px; text-transform:uppercase; border-radius:6px; padding:3px 8px; cursor:pointer; }
.sdtm-vtag.error{ background:var(--sev-crit-bg); color:var(--sev-crit); border:1px solid var(--sev-crit-line); }
.sdtm-vtag.warn{ background:var(--y50); color:var(--y600); border:1px solid var(--y200); }
.sdtm-vtag:hover{ filter:brightness(0.97); box-shadow:0 0 0 2px rgba(0,0,0,0.03); }
.sdtm-vok{ color:#c4cbd9; }
td.v-act{ text-align:right; white-space:nowrap; }
td.v-act .trace-group{ display:inline-flex; }

/* detail / violation side panel */
.sdtm-detail-tag.sdtm{ background:#e6f4fb; color:#0e83b3; }
.sdtm-detail-tag.org{ background:rgba(46,232,158,0.10); color:#0d8a5f; }
.sdtm-detail-tag.viol.error{ background:var(--sev-crit-bg); color:var(--sev-crit); }
.sdtm-detail-tag.viol.warn{ background:var(--y50); color:var(--y600); }
.sdtm-v-title{ margin-top:12px; font-size:16px; font-weight:700; color:var(--title); line-height:1.35; }
.sdtm-d-note{ font-size:13px; line-height:19px; color:var(--text-light); }
.sdtm-d-note b{ color:var(--text-dark); font-weight:700; }
.sdtm-d-note.quoted{ margin-top:8px; padding:9px 12px; background:var(--section-bg); border-radius:9px;
  border-left:2px solid var(--y400); color:var(--muted); }
.sdtm-d-note code,.sdtm-d-v code{ font-family:var(--dx-mono); font-size:11.5px; color:var(--btn-text);
  background:var(--btn-bg); border:1px solid var(--stroke); border-radius:5px; padding:1px 6px; }

/* SDTM Code View */
.sdtm-code-card{ background:var(--white); border:1px solid var(--stroke); border-radius:12px; padding:20px;
  margin-bottom:16px; }
.sdtm-code-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.sdtm-code-title{ font-size:16px; font-weight:700; color:var(--title); }
.sdtm-code-var{ font-family:'Courier New', monospace; font-size:14px; color:var(--green); font-weight:600; }
.sdtm-code-meta{ display:flex; align-items:center; gap:8px; }
.sdtm-code-badge{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:6px; }
.sdtm-code-badge.type{ background:#e2e8f0; color:#334155; }
.sdtm-code-badge.domain{ background:#dbeafe; color:#075985; }
.sdtm-derivation{ background:#f6f8fb; border:1px solid var(--stroke); border-radius:8px; padding:12px 16px;
  margin-bottom:14px; }
.sdtm-derivation-label{ font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--text-light);
  margin-bottom:6px; }
.sdtm-derivation-text{ font-size:13px; font-weight:600; color:var(--title); line-height:1.5; }
.sdtm-code-block{ background:#1e293b; border-radius:8px; padding:16px 18px; overflow-x:auto; }
.sdtm-code-block pre{ margin:0; font-family:'Courier New', Consolas, monospace; font-size:13px; line-height:1.6;
  color:#e2e8f0; white-space:pre; }
.sdtm-code-block .comment{ color:#94a3b8; }
.sdtm-code-block .keyword{ color:#38bdf8; font-weight:600; }
.sdtm-code-block .string{ color:#86efac; }
.sdtm-code-empty{ text-align:center; padding:60px 20px; color:var(--text-light); }
.sdtm-code-empty svg{ width:48px; height:48px; margin:0 auto 16px; opacity:0.3; }
.sdtm-code-empty-title{ font-size:16px; font-weight:700; color:var(--title); margin-bottom:8px; }
.sdtm-code-empty-sub{ font-size:14px; }

/* =====================================================================
   SOURCE DATA PANEL
   ===================================================================== */
.rd-content{ padding:24px; max-width:100%; margin:0 auto; }
.rd-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; padding:16px 20px;
  background:var(--white); border:1px solid var(--stroke); border-radius:12px; }
.rd-views{ display:flex; gap:8px; }
.rd-view{ display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px; border:1px solid var(--stroke);
  background:var(--white); color:var(--text-light); font-size:13px; font-weight:600; cursor:pointer;
  transition:all .15s; }
.rd-view svg{ width:16px; height:16px; }
.rd-view:hover{ background:var(--btn-bg); border-color:var(--btn-border); }
.rd-view.active{ background:var(--green); border-color:var(--green); color:var(--brand-ink); }
.rd-note{ font-size:13px; color:var(--text-light); }

/* Raw data domain */
.rd-domain{ margin-bottom:32px; }
.rd-domain-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.rd-domain-title{ display:flex; align-items:baseline; gap:6px; }
.rd-domain-name{ font-size:20px; font-weight:800; color:var(--title); }
.rd-domain-subtitle{ font-size:14px; font-weight:600; color:var(--text-light); }
.rd-domain-info{ display:flex; align-items:center; gap:12px; }
.rd-domain-records{ font-size:13px; color:var(--text-light); }
.rd-issues{ display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:8px;
  background:#fef2f2; color:#dc2626; font-size:12px; font-weight:600; cursor:help; position:relative; }
.rd-issues svg{ width:14px; height:14px; }
.rd-issues:hover::after{ content:attr(data-missing); position:absolute; top:100%; right:0; margin-top:8px;
  background:#1f2937; color:#fff; padding:10px 14px; border-radius:8px; font-size:11px; font-weight:500;
  white-space:pre-line; z-index:100; box-shadow:0 4px 12px rgba(0,0,0,0.15); min-width:250px; max-width:350px;
  line-height:1.5; }

/* De-identified view: the screen-level notice, and the per-domain chip. Both are
   deliberately NOT red — withholding an identifier is a control working as
   intended, not a data-quality failure, and the red .rd-issues pill next to it
   means something different. */
.rd-deid{ display:flex; align-items:flex-start; gap:12px; margin-bottom:22px; padding:14px 16px;
  border:1px solid rgba(46,232,158,0.32); border-radius:12px; background:rgba(46,232,158,0.06); }
.rd-deid > svg{ width:20px; height:20px; color:var(--forest); flex:none; margin-top:1px; }
.rd-deid-t{ font-size:13.5px; font-weight:700; color:var(--title); margin-bottom:3px; }
.rd-deid-s{ font-size:12.5px; line-height:19px; color:var(--text-light); }
.rd-deid-s b{ color:var(--text-dark); font-weight:700; }
.rd-phi{ display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:8px;
  background:rgba(46,232,158,0.10); color:var(--forest); font-size:12px; font-weight:600;
  cursor:help; position:relative; }
.rd-phi svg{ width:14px; height:14px; }
.rd-phi:hover::after{ content:attr(data-phi); position:absolute; top:100%; right:0; margin-top:8px;
  background:#1f2937; color:#fff; padding:10px 14px; border-radius:8px; font-size:11px; font-weight:500;
  white-space:pre-line; z-index:100; box-shadow:0 4px 12px rgba(0,0,0,0.15); min-width:280px; max-width:420px;
  line-height:1.5; text-align:left; }

/* Raw data table */
.rd-table-wrap{ overflow-x:auto; border:1px solid var(--stroke); border-radius:12px; background:var(--white); }
.rd-table{ width:100%; border-collapse:collapse; font-size:13px; }
.rd-table thead tr{ background:#f6f8fb; border-bottom:2px solid var(--stroke); }
.rd-table th{ padding:12px 14px; text-align:left; font-weight:700; color:var(--title); border-right:1px solid var(--stroke); }
.rd-table th:last-child{ border-right:none; }
.rd-th-id{ width:140px; }
.rd-th-subject{ width:100px; }
.rd-th-inner{ display:flex; flex-direction:column; gap:4px; }
.rd-col-label{ font-size:13px; font-weight:700; color:var(--title); }
.rd-col-origin{ font-size:10px; font-weight:600; letter-spacing:0.3px; padding:2px 6px; border-radius:4px;
  display:inline-block; }
.rd-origin-protocol .rd-col-origin{ background:#fff7e6; color:#f59e0b; }
.rd-origin-assigned .rd-col-origin{ background:#e6f4fb; color:#0e83b3; }
.rd-origin-collected .rd-col-origin{ background:#d7fbec; color:#12b877; }

.rd-table tbody tr{ border-bottom:1px solid var(--stroke); }
.rd-table tbody tr:hover{ background:#f9fafb; }
.rd-table td{ padding:10px 14px; border-right:1px solid var(--stroke); }
.rd-table td:last-child{ border-right:none; }
.rd-id{ font-family:'Courier New', monospace; font-size:12px; color:var(--text-light); }
.rd-subject{ font-weight:600; color:var(--title); }

/* =====================================================================
   ADAM PANEL
   ===================================================================== */
.adam-content{ padding:24px; max-width:1400px; margin:0 auto; }

/* Adam list view */
.adam-list-header{ margin-bottom:32px; }
.adam-list-title{ font-size:28px; font-weight:800; color:var(--title); margin-bottom:8px; }
.adam-list-subtitle{ font-size:15px; color:var(--text-light); }
.adam-datasets{ display:grid; grid-template-columns:repeat(auto-fill, minmax(400px, 1fr)); gap:20px; }

.adam-dataset-card{ background:var(--white); border:1px solid var(--stroke); border-radius:12px; padding:20px;
  cursor:pointer; transition:all .2s; }
.adam-dataset-card:hover{ box-shadow:0 4px 12px rgba(0,0,0,0.08); border-color:var(--green); }
.adam-dataset-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.adam-dataset-name{ font-size:20px; font-weight:800; color:var(--title); }
.adam-dataset-category{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:6px;
  background:#e6f4fb; color:#0e83b3; }
.adam-dataset-label{ font-size:14px; font-weight:600; color:var(--text); margin-bottom:12px; }
.adam-dataset-desc{ font-size:13px; color:var(--text-light); line-height:1.6; margin-bottom:14px; }
.adam-dataset-footer{ display:flex; align-items:center; justify-content:space-between; padding-top:12px;
  border-top:1px solid var(--stroke); }
.adam-dataset-vars{ font-size:13px; color:var(--text-light); }
.adam-dataset-vars strong{ color:var(--title); font-weight:700; }
.adam-dataset-arrow{ color:var(--green); }
.adam-dataset-arrow svg{ width:18px; height:18px; }

/* Adam detail view */
.adam-detail-view{ display:none !important; }
.adam-detail-view.show{ display:block !important; }
.adam-detail-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:24px;
  padding-bottom:20px; border-bottom:1px solid var(--stroke); }
.adam-back-btn{ display:inline-flex; align-items:center; gap:8px; padding:8px 16px; border-radius:8px;
  border:1px solid var(--stroke); background:var(--white); color:var(--text-light); font-size:14px;
  font-weight:600; cursor:pointer; transition:all .15s; }
.adam-back-btn:hover{ background:var(--btn-bg); border-color:var(--btn-border); color:var(--btn-text); }
.adam-back-btn svg{ width:16px; height:16px; }
.adam-detail-title-area{ flex:1; text-align:center; }
.adam-detail-name{ font-size:24px; font-weight:800; color:var(--title); margin-bottom:4px; }
.adam-detail-label{ font-size:14px; color:var(--text-light); }
.adam-detail-views{ display:flex; gap:8px; }
.adam-detail-view-btn{ display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:8px;
  border:1px solid var(--stroke); background:var(--white); color:var(--text-light); font-size:13px;
  font-weight:600; cursor:pointer; transition:all .15s; }
.adam-detail-view-btn svg{ width:16px; height:16px; }
.adam-detail-view-btn:hover{ background:var(--btn-bg); border-color:var(--btn-border); }
.adam-detail-view-btn.active{ background:var(--green); border-color:var(--green); color:var(--brand-ink); }
.adam-detail-body{ min-height:400px; }

/* Adam data view */
.adam-data-table{ width:100%; border-collapse:collapse; font-size:13px; border:1px solid var(--stroke);
  border-radius:12px; overflow:hidden; background:var(--white); }
.adam-data-table thead tr{ background:#f6f8fb; border-bottom:2px solid var(--stroke); }
.adam-data-table th{ padding:12px 14px; text-align:left; font-weight:700; color:var(--title);
  border-right:1px solid var(--stroke); }
.adam-data-table th:last-child{ border-right:none; }
.adam-data-table tbody tr{ border-bottom:1px solid var(--stroke); }
.adam-data-table tbody tr:hover{ background:#f9fafb; }
.adam-data-table td{ padding:10px 14px; border-right:1px solid var(--stroke); }
.adam-data-table td:last-child{ border-right:none; }

/* Adam schema view */
.adam-schema-card{ background:var(--white); border:1px solid var(--stroke); border-radius:12px; padding:20px;
  margin-bottom:16px; }
.adam-schema-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.adam-schema-var{ font-family:'Courier New', monospace; font-size:16px; font-weight:700; color:var(--green); }
.adam-schema-label{ font-size:13px; color:var(--text-light); margin-top:4px; }
.adam-schema-badges{ display:flex; gap:8px; }
.adam-schema-badge{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:6px; }
.adam-schema-badge.type{ background:#e2e8f0; color:#334155; }
.adam-schema-badge.source{ background:#d7fbec; color:#12b877; }
.adam-schema-badge.derived{ background:#fef3c7; color:#f59e0b; }
.adam-derivation-block{ background:#f6f8fb; border:1px solid var(--stroke); border-radius:8px; padding:16px; }
.adam-derivation-label{ font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--text-light);
  margin-bottom:8px; }
.adam-derivation-text{ font-size:13px; font-weight:600; color:var(--title); margin-bottom:12px; }
.adam-derivation-from{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.adam-derivation-from-label{ font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--text-light); }
.adam-derivation-sources{ display:flex; flex-wrap:wrap; gap:6px; }
.adam-source-chip{ font-family:'Courier New', monospace; font-size:12px; padding:4px 10px; border-radius:6px;
  background:#e6f4fb; color:#0e83b3; font-weight:600; }
.adam-formula{ background:#1e293b; border-radius:8px; padding:12px 16px; margin-top:8px; }
.adam-formula pre{ margin:0; font-family:'Courier New', Consolas, monospace; font-size:12px; line-height:1.5;
  color:#e2e8f0; white-space:pre-wrap; }

/* Adam code view */
.adam-code-section{ margin-bottom:24px; }
.adam-code-desc{ background:#f6f8fb; border:1px solid var(--stroke); border-radius:8px; padding:16px;
  margin-bottom:16px; }
.adam-code-desc-title{ font-size:14px; font-weight:700; color:var(--title); margin-bottom:8px; }
.adam-code-desc-text{ font-size:13px; color:var(--text); line-height:1.6; }
.adam-code-block{ background:#1e293b; border-radius:12px; padding:20px; overflow-x:auto; max-height:600px;
  overflow-y:auto; }
.adam-code-block pre{ margin:0; font-family:'Courier New', Consolas, monospace; font-size:13px; line-height:1.7;
  color:#e2e8f0; white-space:pre; }
.adam-code-block .comment{ color:#94a3b8; }
.adam-code-block .keyword{ color:#38bdf8; font-weight:600; }
.adam-code-block .string{ color:#86efac; }

/* =====================================================================
   TLF PANEL
   ===================================================================== */
.tlf-content{ padding:24px; max-width:1400px; margin:0 auto; }
.tlf-header{ margin-bottom:32px; }
.tlf-header-left{ }
.tlf-title{ font-size:28px; font-weight:800; color:var(--title); margin-bottom:8px; }
.tlf-subtitle{ font-size:15px; color:var(--text-light); }

/* TLF Categories */
.tlf-category{ margin-bottom:32px; }
.tlf-category-header{ display:flex; align-items:center; gap:12px; margin-bottom:16px; padding-bottom:12px;
  border-bottom:2px solid var(--stroke); }
.tlf-category-name{ font-size:20px; font-weight:800; color:var(--title); }
.tlf-category-count{ font-size:13px; color:var(--text-light); }
.tlf-list{ display:flex; flex-direction:column; gap:12px; }

/* TLF Card */
.tlf-card{ background:var(--white); border:1px solid var(--stroke); border-radius:12px; padding:18px 20px;
  cursor:pointer; transition:all .2s; display:flex; align-items:center; gap:16px; }
.tlf-card:hover{ box-shadow:0 4px 12px rgba(0,0,0,0.08); border-color:var(--green); }
.tlf-card-icon{ width:40px; height:40px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  flex-shrink:0; }
.tlf-card-icon svg{ width:20px; height:20px; }
.tlf-card-icon.table{ background:#e6f4fb; color:#0e83b3; }
.tlf-card-icon.listing{ background:#d7fbec; color:#12b877; }
.tlf-card-icon.figure{ background:#f0ecfe; color:#7c3aed; }
.tlf-card-content{ flex:1; min-width:0; }
.tlf-card-header{ display:flex; align-items:baseline; gap:12px; margin-bottom:6px; }
.tlf-card-number{ font-size:14px; font-weight:800; color:var(--title); }
.tlf-card-title{ font-size:14px; font-weight:600; color:var(--text); }
.tlf-card-meta{ display:flex; align-items:center; gap:12px; }
.tlf-card-adam{ display:flex; gap:6px; flex-wrap:wrap; }
.tlf-adam-chip{ font-size:11px; font-weight:700; padding:3px 8px; border-radius:5px; background:#f0ecfe;
  color:#7c3aed; }
.tlf-card-status{ display:flex; align-items:center; gap:6px; margin-left:auto; }
.tlf-status-badge{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:6px; }
.tlf-status-badge.final{ background:#d7fbec; color:#12b877; }
.tlf-status-badge.qc{ background:#dbeafe; color:#075985; }
.tlf-status-badge.draft{ background:#fef3c7; color:#f59e0b; }
.tlf-card-arrow{ color:var(--green); }
.tlf-card-arrow svg{ width:18px; height:18px; }

/* TLF Modal */
.tlf-modal{ position:fixed; top:0; left:0; right:0; bottom:0; z-index:1000; display:flex; align-items:center;
  justify-content:center; }
.tlf-modal-overlay{ position:absolute; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); }
.tlf-modal-content{ position:relative; background:var(--white); border-radius:16px; width:90%; max-width:1200px;
  max-height:90vh; display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(0,0,0,0.3); }
.tlf-modal-header{ padding:24px 28px; border-bottom:1px solid var(--stroke); display:flex; align-items:flex-start;
  justify-content:space-between; }
.tlf-modal-title-area{ flex:1; }
.tlf-modal-number{ font-size:14px; font-weight:700; color:var(--green); margin-bottom:6px; }
.tlf-modal-title{ font-size:20px; font-weight:800; color:var(--title); }
.tlf-modal-close{ width:36px; height:36px; border-radius:50%; border:1px solid var(--stroke); background:var(--white);
  color:var(--text-light); cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:all .15s; flex-shrink:0; }
.tlf-modal-close:hover{ background:var(--btn-bg); color:var(--btn-text); }
.tlf-modal-close svg{ width:18px; height:18px; }
.tlf-modal-body{ flex:1; overflow:hidden; display:flex; flex-direction:column; }
.tlf-modal-tabs{ display:flex; gap:4px; padding:16px 28px 0; border-bottom:1px solid var(--stroke); }
.tlf-modal-tab{ padding:10px 20px; border-radius:8px 8px 0 0; border:none; background:transparent;
  color:var(--text-light); font-size:14px; font-weight:600; cursor:pointer; transition:all .15s; }
.tlf-modal-tab:hover{ background:#f6f8fb; }
.tlf-modal-tab.active{ background:var(--white); color:var(--title); border-bottom:2px solid var(--green); }
.tlf-modal-content-area{ flex:1; overflow-y:auto; padding:24px 28px; }

/* =============================================================================
   COMPACT BIOMEDICAL CONCEPT — the block cnCompactHTML() renders into the SOA
   drawer's card and the Protocol/SAP info panel's section. One rule set for
   both, scoped to .cnc, so the two surfaces cannot drift apart visually. It is
   deliberately narrow-first: the drawer is 600px and the info panel narrower
   still, which is why the tab's five-column answer key becomes a list here.
============================================================================= */
.cnc .cnc-text{ margin:0 0 10px; font-size:13px; line-height:1.6; color:var(--text, #33415c); }
.cnc .cnc-c + .cnc-c{ margin-top:18px; padding-top:18px; border-top:1px solid var(--stroke); }
.cnc .cnc-h{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; margin-bottom:3px; }
.cnc .cnc-h .id{ font-family:'Courier New', monospace; font-size:12px; font-weight:700; color:#1d4ed8;
  background:#eff6ff; padding:1px 6px; border-radius:4px; }
.cnc .cnc-h .nm{ font-size:13.5px; font-weight:700; color:var(--title, #0d2137); }
.cnc .cnc-dom{ font-size:11.5px; font-weight:600; color:#8a93a6; margin-bottom:9px; }
.cnc code{ font-family:'Courier New', monospace; font-size:11.5px; background:#f2f5f9; border-radius:4px;
  padding:1px 5px; color:#334155; }


.cnc .cnc-why{ margin:10px 0; padding:10px 12px; border-left:2px solid var(--stroke); background:#f8fafc;
  border-radius:0 6px 6px 0; font-size:12.5px; line-height:1.6; color:#475569; }
.cnc .cnc-why .h{ display:block; font-size:10.5px; font-weight:800; letter-spacing:.04em; text-transform:uppercase;
  color:#8a93a6; margin-bottom:4px; }

.cnc .cnc-sub{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; margin:14px 0 8px;
  font-size:11px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; color:#8a93a6; }
.cnc .cnc-sub .n{ margin-left:auto; font-weight:600; letter-spacing:0; text-transform:none; font-size:11.5px; }


/* A procedure that resolves to more than two concepts — the safety laboratory
   panel resolves to eleven — folds each one into a disclosure. The summary
   still carries the verdict, so the grade is legible closed: a fold that hid
   whether the study passed would trade one problem for a worse one. */
.cnc .cnc-count{ font-size:11.5px; font-weight:700; color:#7a879a; margin-bottom:10px; }

/* the specialization's variables as chips: they belong to the concept, so they
   stay — but as a reference list, not a scorecard. Mandatory ones carry weight,
   the rest are quiet. */
.cnc .cnc-chips{ display:flex; flex-wrap:wrap; gap:5px; }
.cnc .cnc-chips code{ font-size:11px; padding:3px 7px; color:#7a879a; background:#f2f5f9; }
.cnc .cnc-chips code.m{ color:var(--title, #0d2137); font-weight:700; background:#e8edf5; }

/* the USDM card in the SOA drawer reuses the info panel's rows, which are
   otherwise laid out only inside .panel-scroll */
.sd2-usdm .info-sec{ display:flex; flex-direction:column; gap:8px; }
.sd2-usdm .info-sec + .info-sec{ margin-top:14px; padding-top:14px; border-top:1px solid var(--stroke); }
.cnc .cnc-fold{ border:1px solid var(--stroke); border-radius:8px; margin-bottom:8px; background:var(--white); }
.cnc .cnc-fold > summary{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; cursor:pointer;
  padding:9px 11px; list-style:none; }
.cnc .cnc-fold > summary::-webkit-details-marker{ display:none; }
.cnc .cnc-fold > summary:hover{ background:#f8fafc; border-radius:8px; }
.cnc .cnc-fold[open] > summary{ border-bottom:1px solid var(--stroke); border-radius:8px 8px 0 0; }
.cnc .cnc-fold > summary .id{ font-family:'Courier New', monospace; font-size:11.5px; font-weight:700;
  color:#1d4ed8; }
.cnc .cnc-fold > summary .nm{ font-size:12.5px; font-weight:700; color:var(--title, #0d2137);
  flex:1 1 auto; min-width:0; }
.cnc .cnc-fold .cnc-c{ padding:12px 11px 13px; }
.cnc .cnc-fold .cnc-c .cnc-h{ display:none; }   /* the summary above already names it */

/* TLF Preview
   Each preview line is its own block-level span so a row can be hovered and
   clicked as a row. `pre` is inline-block at min-width:100% so the hover band
   runs the full scroll width rather than stopping at the container edge — a
   highlight that ends mid-table reads as a rendering fault. */
.tlf-preview{ background:#1e293b; border-radius:12px; padding:24px 0; overflow-x:auto; }
.tlf-preview pre{ margin:0; font-family:'Courier New', Consolas, monospace; font-size:13px; line-height:1.7;
  color:#e2e8f0; white-space:pre; display:inline-block; min-width:100%; }
.tlf-prow-plain{ display:block; padding:0 24px; }

/* a row the content file gives a trace for */
.tlf-prow{ display:block; position:relative; padding:0 24px; cursor:pointer; outline:none;
  border-left:2px solid transparent; transition:background .12s, border-color .12s, color .12s; }
/* the dotted rule marks WHICH rows are live without reading as a table grid;
   it lifts to a full row wash on hover */
.tlf-prow .tlf-prow-txt{ position:relative; border-bottom:1px dotted rgba(148,163,184,.38); }
.tlf-prow:hover, .tlf-prow:focus-visible{ background:rgba(96,165,250,.14); border-left-color:#60a5fa; color:#fff; }
.tlf-prow:hover .tlf-prow-txt, .tlf-prow:focus-visible .tlf-prow-txt{ border-bottom-color:rgba(147,197,253,.9); }
.tlf-prow-cue{ position:absolute; right:10px; top:50%; transform:translateY(-50%);
  width:15px; height:15px; opacity:0; transition:opacity .12s; color:#93c5fd; }
.tlf-prow-cue svg{ width:15px; height:15px; display:block; }
.tlf-prow:hover .tlf-prow-cue, .tlf-prow:focus-visible .tlf-prow-cue{ opacity:1; }

.tlf-prow-hint{ display:flex; align-items:center; gap:8px; margin-bottom:12px; font-size:12.5px;
  font-weight:600; color:var(--ink-2, #52607e); }
.tlf-prow-hint svg{ width:14px; height:14px; flex:none; color:#2563eb; }

/* the output a root was set from, kept in the list even when the ADaM filter
   would otherwise drop it */
.tlf-card.root-origin{ border-color:#60a5fa; box-shadow:0 0 0 1px rgba(96,165,250,.35); }
.tlf-card-origin{ font-size:10px; font-weight:800; letter-spacing:.04em; padding:2px 7px; border-radius:4px;
  background:#dbeafe; color:#1d4ed8; white-space:nowrap; }

/* origin of the current root, in the persistent banner */
.rb-from{ opacity:.75; font-weight:600; }

/* TLF Connection View */
.tlf-connection-section{ margin-bottom:24px; }
.tlf-connection-desc{ background:#f6f8fb; border:1px solid var(--stroke); border-radius:8px; padding:16px;
  margin-bottom:16px; }
.tlf-connection-desc-text{ font-size:14px; color:var(--text); line-height:1.6; }
.tlf-connection-title{ font-size:16px; font-weight:700; color:var(--title); margin-bottom:12px; }
.tlf-connection-vars{ display:flex; flex-direction:column; gap:12px; }
.tlf-var-card{ background:var(--white); border:1px solid var(--stroke); border-radius:8px; padding:14px 16px; }
.tlf-var-name{ font-family:'Courier New', monospace; font-size:14px; font-weight:700; color:var(--green);
  margin-bottom:6px; }
.tlf-var-usage{ font-size:13px; color:var(--text); }
.tlf-connection-program{ background:#f6f8fb; border:1px solid var(--stroke); border-radius:8px; padding:14px 16px;
  margin-top:16px; }
.tlf-connection-program-label{ font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--text-light);
  margin-bottom:6px; }
.tlf-connection-program-path{ font-family:'Courier New', monospace; font-size:13px; color:var(--title); }

/* ---------- Tab Loading Indicator ---------- */
.tab-loading{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.3);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  backdrop-filter:blur(2px);
}
.tab-loading-spinner{
  width:48px;
  height:48px;
  border:4px solid rgba(255,255,255,0.3);
  border-top-color:var(--green);
  border-radius:50%;
  animation:spin 0.8s linear infinite;
}
@keyframes spin{
  to{ transform:rotate(360deg); }
}

/* =====================================================================
   EDIT CHECKS PANEL
   ===================================================================== */
.ec-content{ padding:24px; max-width:1400px; margin:0 auto; }
.ec-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.ec-title{ font-size:28px; font-weight:800; color:var(--title); margin:0 0 8px; }
.ec-subtitle{ font-size:15px; color:var(--text-light); margin:0; }
.ec-summary{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.ec-sum-pill{ font-size:12px; font-weight:700; padding:6px 12px; border-radius:8px; white-space:nowrap; }
.ec-sum-pill.total{ background:#f1f5f9; color:#334155; }
.ec-sum-pill.match{ background:#d7fbec; color:#12b877; }
.ec-sum-pill.mismatch{ background:#fff8ec; color:#c9820c; }
.ec-sum-pill.missing{ background:#fef2f2; color:#dc2626; }

.ec-toolbar{ display:flex; flex-direction:column; gap:10px; margin-bottom:20px; padding:16px 20px;
  background:var(--white); border:1px solid var(--stroke); border-radius:12px; }
.ec-filters{ display:flex; gap:8px; flex-wrap:wrap; }
.ec-filter{ padding:7px 14px; border-radius:8px; border:1px solid var(--stroke); background:var(--white);
  color:var(--text-light); font-size:13px; font-weight:600; cursor:pointer; transition:all .15s; }
.ec-filter:hover{ background:var(--btn-bg); }
.ec-filter.active{ background:var(--green); border-color:var(--green); color:var(--brand-ink); }
.ec-filter.status.match.active{ background:#12b877; border-color:#12b877; }
.ec-filter.status.mismatch.active{ background:#c9820c; border-color:#c9820c; }
.ec-filter.status.missing.active{ background:#dc2626; border-color:#dc2626; }
.ec-search{ width:100%; padding:9px 14px; border:1px solid var(--stroke); border-radius:8px; font-size:13px;
  font-family:inherit; color:var(--title); outline:none; }
.ec-search:focus{ border-color:var(--green); }

.ec-stage-group{ margin-bottom:28px; }
.ec-stage-head{ display:flex; align-items:baseline; gap:10px; margin-bottom:12px; }
.ec-stage-name{ font-size:17px; font-weight:800; color:var(--title); }
.ec-stage-count{ font-size:13px; color:var(--text-light); }

.ec-card{ background:var(--white); border:1px solid var(--stroke); border-left-width:4px; border-radius:10px;
  padding:14px 18px; margin-bottom:10px; }
.ec-card.match{ border-left-color:#12b877; }
.ec-card.mismatch{ border-left-color:#f59e0b; }
.ec-card.missing{ border-left-color:#f9c9c9; }
.ec-card.expandable{ cursor:pointer; }
.ec-card.expandable:hover{ box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.ec-card-top{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.ec-id{ font-family:'Courier New', monospace; font-size:12px; color:var(--text-light); }
.ec-status{ font-size:11px; font-weight:800; letter-spacing:0.5px; padding:3px 10px; border-radius:6px; }
.ec-status.match{ background:#d7fbec; color:#12b877; }
.ec-status.mismatch{ background:#fff8ec; color:#c9820c; }
.ec-status.missing{ background:#fef2f2; color:#dc2626; }
.ec-tag{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:6px; background:#e6f4fb; color:#0e83b3; }
.ec-tag.var{ background:#f0ecfe; color:#7c3aed; font-family:'Courier New', monospace; }
.ec-rule{ font-size:13px; color:var(--text-dark); line-height:1.55; }
.ec-detail{ display:none; margin-top:12px; padding-top:12px; border-top:1px dashed var(--stroke); }
.ec-card.open .ec-detail{ display:block; }
.ec-detail-row{ margin-bottom:10px; }
.ec-detail-row:last-child{ margin-bottom:0; }
.ec-detail-k{ display:block; font-size:11px; font-weight:700; letter-spacing:0.4px; color:var(--text-light);
  margin-bottom:4px; }
.ec-detail-v{ font-size:13px; color:var(--title); line-height:1.5; }
.ec-detail-row.issue .ec-detail-v{ color:#b45309; }

/* ---------- CRF edit-check blocks in the detail panel ----------
   Three states: validated (covered), improve (exists but short of the rule),
   missing (nothing covers the rule). Each block also says where the check is
   enforced — in the EDC at entry, or on the mapped SDTM data. */
.crf-ec{ border:1px solid var(--stroke); border-radius:10px; padding:12px 14px; margin-bottom:10px; }
.crf-ec.validated{ background:rgba(46,232,158,0.05); border-color:rgba(46,232,158,0.25); }
.crf-ec.improve{ background:#fff8ec; border-color:#fde3b0; }
.crf-ec.missing{ background:#fef1f1; border-color:#f9c9c9; }
.crf-ec-top{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.crf-ec-status{ font-size:10px; font-weight:800; letter-spacing:0.5px; padding:2px 8px; border-radius:5px; }
.crf-ec-status.validated{ background:#d7fbec; color:#12b877; }
.crf-ec-status.improve{ background:#fde3b0; color:#92600a; }
.crf-ec-status.missing{ background:#fbd5d5; color:#b91c1c; }
.crf-ec-src{ margin-left:auto; font-size:10.5px; font-weight:700; letter-spacing:0.3px; color:var(--btn-text);
  background:#eef1f6; border:1px solid var(--stroke); border-radius:20px; padding:2px 9px; white-space:nowrap; }
.crf-ec-title{ font-size:13px; font-weight:600; color:var(--title); line-height:1.45; margin-bottom:8px; }
.crf-ec-k{ display:block; font-size:10px; font-weight:700; letter-spacing:0.4px; color:var(--text-light);
  margin-bottom:3px; }
.crf-ec-example{ font-size:12px; color:var(--text-dark); line-height:1.45; }
.crf-ec-none{ font-size:12.5px; color:var(--text-light); line-height:1.5; border:1px dashed var(--stroke);
  border-radius:10px; padding:12px 14px; }
/* the count line on a section head — "1 missing · 2 validated" */
.crf-d-sec-n{ margin-left:8px; font-weight:600; letter-spacing:0; text-transform:none; color:#9aa3b6; }

/* ---------- Raw data violation cells + tooltips ---------- */
.rd-cell-viol{ position:relative; cursor:help; }
.rd-cell-viol.error{ background:#fef2f2; box-shadow:inset 0 0 0 1.5px #f0a5a5; }
.rd-cell-viol.warn{ background:#fff8ec; box-shadow:inset 0 0 0 1.5px #f3d28e; }
.rd-cell-viol.error .rd-viol-val{ color:#b91c1c; font-weight:700; }
.rd-cell-viol.warn .rd-viol-val{ color:#a16207; font-weight:700; }
.rd-cell-viol.error .rd-viol-val:empty::before,
.rd-cell-viol.warn .rd-viol-val:empty::before{ content:"(blank)"; font-style:italic; font-weight:500; opacity:0.7; }
.rd-viol-tip{ display:none; position:absolute; top:100%; left:0; margin-top:6px; z-index:120;
  background:#1f2937; color:#fff; border-radius:8px; padding:12px 14px; min-width:280px; max-width:380px;
  box-shadow:0 4px 12px rgba(0,0,0,0.2); text-align:left; white-space:normal; }
.rd-cell-viol:hover .rd-viol-tip{ display:block; }
.rd-table tbody tr:last-child .rd-viol-tip{ top:auto; bottom:100%; margin-top:0; margin-bottom:6px; }
.rd-viol-head{ font-size:11px; font-weight:800; letter-spacing:0.4px; color:#fca5a5; margin-bottom:8px;
  text-transform:uppercase; }
.rd-viol-item{ padding-top:8px; margin-top:8px; border-top:1px solid rgba(255,255,255,0.15); }
.rd-viol-item:first-of-type{ padding-top:0; margin-top:0; border-top:none; }
.rd-viol-rule{ font-size:12px; font-weight:700; line-height:1.4; margin-bottom:4px; }
.rd-viol-issue{ font-size:11px; font-weight:400; color:#d1d5db; line-height:1.5; }
/* provenance line on a CDISC CORE conformance check — green rather than the
   head's red, because it says who checked, not how bad it is */
.rd-viol-src{ font-size:10px; font-weight:600; letter-spacing:0.2px; color:#6ee7b7; line-height:1.5;
  margin-bottom:4px; text-transform:uppercase; }
.rd-viol-src b{ font-weight:800; color:#a7f3d0; }

/* =====================================================================
   SUMMARY PANEL — data-point lineage
   ===================================================================== */
.sum-content{ padding:24px; max-width:1400px; margin:0 auto; }
/* The panel host. Every other .sum- rule below predates it — the renderer and
   this stylesheet were written together, and only the containing panel was
   missing, which is why the lineage screen existed but could not be opened. */
.sum-panel{ display:none; }
.sum-panel.show{ display:block; }
.sum-header{ margin-bottom:20px; }
.sum-title{ font-size:28px; font-weight:800; color:var(--title); margin:0 0 8px; }
.sum-subtitle{ font-size:15px; color:var(--text-light); margin:0; max-width:760px; line-height:1.5; }

.sum-wrap{ display:flex; gap:20px; align-items:flex-start; }

/* left: data point list */
.sum-list{ width:340px; flex:none; display:flex; flex-direction:column; gap:10px; position:sticky; top:12px; }
.sum-dp{ background:var(--white); border:1px solid var(--stroke); border-left-width:4px; border-radius:10px;
  padding:14px 16px; cursor:pointer; transition:all .15s; }
.sum-dp:hover{ box-shadow:0 2px 8px rgba(0,0,0,0.06); }
.sum-dp.active{ border-color:var(--green); border-left-color:var(--green); background:rgba(46,232,158,0.04); }
.sum-dp.ok{ border-left-color:#12b877; }
.sum-dp.warn{ border-left-color:#f59e0b; }
.sum-dp.error{ border-left-color:#dc2626; }
.sum-dp.active.warn{ border-left-color:#f59e0b; }
.sum-dp.active.error{ border-left-color:#dc2626; }
.sum-dp-tlf{ font-family:'Courier New', monospace; font-size:11px; font-weight:700; color:var(--text-light);
  letter-spacing:0.4px; margin-bottom:4px; }
.sum-dp-label{ font-size:14px; font-weight:700; color:var(--title); margin-bottom:4px; line-height:1.4; }
.sum-dp-value{ font-family:'Courier New', monospace; font-size:12px; color:var(--text-dark); margin-bottom:8px; }
.sum-dp-badge{ display:inline-block; font-size:10px; font-weight:800; letter-spacing:0.5px; padding:3px 9px;
  border-radius:6px; }
.sum-dp-badge.ok{ background:#d7fbec; color:#12b877; }
.sum-dp-badge.warn{ background:#fff8ec; color:#c9820c; }
.sum-dp-badge.error{ background:#fef2f2; color:#dc2626; }

/* right: trace timeline */
.sum-trace{ flex:1; min-width:0; }
.sum-trace-head{ margin-bottom:18px; }
.sum-trace-title{ font-size:19px; font-weight:800; color:var(--title); margin-bottom:4px; }
.sum-trace-sub{ font-size:13px; color:var(--text-light); }
.sum-trace-sub b{ font-family:'Courier New', monospace; color:var(--text-dark); }

.sum-stage{ display:flex; gap:14px; }
.sum-stage-rail{ display:flex; flex-direction:column; align-items:center; flex:none; width:40px; }
.sum-stage-dot{ width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  border:2px solid #12b877; background:#eafff6; color:#0b7a52; flex:none; }
.sum-stage-dot svg{ width:20px; height:20px; }
.sum-stage-dot.warn{ border-color:#f59e0b; background:#fff8ec; color:#92600a; }
.sum-stage-dot.error{ border-color:#dc2626; background:#fef2f2; color:#b91c1c; }
.sum-stage-line{ width:2px; flex:1; min-height:18px; background:var(--stroke); margin:4px 0; }

.sum-stage-card{ flex:1; min-width:0; background:var(--white); border:1px solid var(--stroke); border-radius:12px;
  padding:16px 18px; margin-bottom:16px; }
.sum-stage.warn .sum-stage-card{ border-color:#fde3b0; }
.sum-stage.error .sum-stage-card{ border-color:#f9c9c9; }
.sum-stage-top{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.sum-stage-name{ font-size:10px; font-weight:800; letter-spacing:0.7px; text-transform:uppercase;
  padding:3px 9px; border-radius:6px; background:#eef1f8; color:#454567; }
.sum-stage-title{ font-size:14px; font-weight:700; color:var(--title); }
.sum-stage-badge{ margin-left:auto; font-size:10px; font-weight:800; letter-spacing:0.5px; padding:3px 9px;
  border-radius:6px; white-space:nowrap; }
.sum-stage-badge.ok{ background:#d7fbec; color:#12b877; }
.sum-stage-badge.warn{ background:#fff8ec; color:#c9820c; }
.sum-stage-badge.error{ background:#fef2f2; color:#dc2626; }
.sum-stage-desc{ font-size:13px; color:var(--text-dark); line-height:1.55; margin-bottom:10px; }
.sum-stage-quote{ font-size:12.5px; font-style:italic; color:var(--muted); line-height:1.55;
  border-left:3px solid var(--stroke); padding:6px 12px; background:#f8fafc; border-radius:0 8px 8px 0;
  margin-bottom:10px; }
.sum-stage-rows{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.sum-row{ display:flex; gap:12px; font-size:12.5px; line-height:1.5; }
.sum-row-k{ flex:none; width:150px; font-size:10.5px; font-weight:700; letter-spacing:0.4px; color:var(--text-light);
  padding-top:2px; }
.sum-row-v{ color:var(--title); min-width:0; }
.sum-stage-checks{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.sum-check{ display:flex; align-items:flex-start; gap:8px; font-size:12.5px; line-height:1.5; }
.sum-check-status{ flex:none; font-size:9.5px; font-weight:800; letter-spacing:0.5px; padding:2px 8px;
  border-radius:5px; margin-top:1px; }
.sum-check-status.match{ background:#d7fbec; color:#12b877; }
.sum-check-status.mismatch{ background:#fde3b0; color:#92600a; }
.sum-check-status.missing{ background:#fbd5d5; color:#b91c1c; }
.sum-check-label{ color:var(--text-dark); }
.sum-stage-code{ background:#1e293b; border-radius:10px; padding:14px 16px; overflow-x:auto; margin-bottom:10px; }
.sum-stage-code pre{ margin:0; font-family:'Courier New', Consolas, monospace; font-size:12px; line-height:1.6;
  color:#e2e8f0; white-space:pre; }
.sum-stage-code .keyword{ color:#93c5fd; font-weight:700; }
.sum-stage-code .comment{ color:#94a3b8; font-style:italic; }
.sum-stage-code .string{ color:#fbbf24; }
.sum-stage-link{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--stroke);
  background:var(--white); color:var(--btn-text); font-family:inherit; font-size:12px; font-weight:700;
  padding:7px 12px; border-radius:8px; cursor:pointer; transition:all .15s; }
.sum-stage-link:hover{ border-color:var(--green); color:#0b7a52; }
.sum-stage-link svg{ width:14px; height:14px; }

/* ============================================================
   DOCUMENT REPOSITORY — opened from the header's Documents
   button. Folder rail on the left, the selected folder's
   version history on the right.
   ============================================================ */
.docs-overlay{ position:fixed; inset:0; z-index:120; display:none; align-items:center; justify-content:center;
  background:rgba(13,33,55,0.38); padding:32px; }
.docs-overlay.show{ display:flex; }
.docs-modal{ background:var(--white); border-radius:20px; width:min(1180px,100%); height:min(820px,100%);
  display:flex; flex-direction:column; overflow:hidden; box-shadow:0 24px 70px rgba(13,33,55,0.22); }

.docs-head{ display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:20px 24px; border-bottom:1px solid var(--stroke); flex:none; }
.docs-title{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.docs-title .dt{ font-size:19px; font-weight:800; color:var(--title); letter-spacing:-0.2px; }
.docs-title .ds{ font-size:13px; color:var(--text-light); }
.docs-actions{ display:flex; align-items:center; gap:10px; flex:none; }

.docs-body{ flex:1 1 auto; display:flex; min-height:0; }

/* ---- folder rail ---- */
.docs-rail{ flex:0 0 288px; border-right:1px solid var(--stroke); overflow-y:auto; padding:14px 12px 20px;
  background:#fcfcfe; }
.docs-group + .docs-group{ margin-top:18px; }
.docs-group-h{ font-size:10.5px; font-weight:700; letter-spacing:0.8px; text-transform:uppercase;
  color:#9aa3b6; padding:0 10px 8px; }
.docs-folder{ display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px; border:none;
  background:none; border-radius:10px; cursor:pointer; font-family:inherit; font-size:13.5px;
  font-weight:600; color:var(--text-dark); text-align:left; }
.docs-folder:hover{ background:#f2f4fa; }
.docs-folder.active{ background:var(--badge-bg); color:#0a7d4d; }
.docs-folder svg{ width:16px; height:16px; flex:none; color:#9aa3b6; }
.docs-folder.active svg{ color:#0a8f57; }
.docs-folder .fn{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.docs-folder .fc{ flex:none; font-size:11px; font-weight:700; color:#9aa3b6; background:#eef0f6;
  border-radius:20px; padding:2px 8px; }
.docs-folder.active .fc{ background:#fff; color:#0a8f57; }

/* ---- file list ---- */
.docs-main{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; }
.docs-crumb{ flex:none; padding:18px 24px 14px; border-bottom:1px solid var(--stroke); }
.docs-crumb .cb{ font-size:13px; color:var(--crumb); font-weight:600; }
.docs-crumb .cb b{ color:var(--title); font-weight:700; }
.docs-crumb .cn{ display:block; margin-top:5px; font-size:12.5px; line-height:18px; color:var(--text-light); }
.docs-files{ flex:1 1 auto; overflow-y:auto; padding:6px 24px 24px; }

.docs-row{ display:grid; grid-template-columns:minmax(0,1fr) 78px 116px 106px 34px;
  align-items:center; gap:16px; padding:13px 4px; }
.docs-row + .docs-row{ border-top:1px solid #f1f3f8; }
.docs-row.dhead{ font-size:10.5px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase;
  color:#9aa3b6; padding-bottom:9px; border-top:none; }
.docs-row:not(.dhead):hover{ background:#fafbff; }
.docs-name{ display:flex; align-items:center; gap:11px; min-width:0; }
.docs-name .ic{ width:30px; height:30px; border-radius:8px; flex:none; display:flex; align-items:center;
  justify-content:center; font-size:9px; font-weight:800; letter-spacing:0.3px; color:#fff; background:#9aa3b6; }
.docs-name .ic.pdf{ background:#d03b3b; } .docs-name .ic.xlsx{ background:#0a8f57; }
.docs-name .ic.docx{ background:#3a6fd8; } .docs-name .ic.xml{ background:#8a5cd6; }
.docs-name .ic.csv{ background:#ec835a; }
.docs-name .nm{ font-size:13.5px; font-weight:600; color:var(--text-dark);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.docs-ver{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px; font-weight:700;
  color:var(--text-dark); }
.docs-meta{ font-size:12.5px; color:var(--text-light); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.docs-dl{ width:30px; height:30px; border:none; background:none; border-radius:8px; cursor:pointer;
  color:#9aa3b6; display:flex; align-items:center; justify-content:center; }
.docs-dl:hover{ background:#f2f4fa; color:var(--text-dark); }
.docs-dl svg{ width:16px; height:16px; }
/* a version just added in this session, so it is obvious what the upload did */
.docs-row.fresh{ background:rgba(46,232,158,0.07); border-radius:10px; }

@media (max-width:900px){
  .docs-rail{ flex-basis:220px; }
  .docs-row{ grid-template-columns:minmax(0,1fr) 66px 34px; }
  .docs-row .hide-sm{ display:none; }
}

/* ============================================================
   COMPARISON VIEW — one tab of the review at two versions.
   Two columns, one row per finding, the change called out on
   the left so the differences read first.
   ============================================================ */
.cmp-controls{ display:flex; align-items:center; gap:14px; padding:4px 8px 18px; flex-wrap:wrap; }
.cmp-ctl{ display:flex; align-items:center; gap:10px; }
.cmp-ctl .k{ font-size:11px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase; color:#9aa3b6; }
.cmp-sel{ font-family:inherit; font-size:14px; font-weight:700; color:var(--text-dark); background:var(--white);
  border:1px solid var(--stroke); border-radius:10px; padding:9px 12px; cursor:pointer; min-width:170px; }
.cmp-sel:hover{ border-color:#cfd3e0; }
.cmp-sel:focus{ outline:none; border-color:rgba(46,232,158,0.55); box-shadow:0 0 0 3px rgba(46,232,158,0.08); }
.cmp-arrow{ width:18px; height:18px; color:#c3cad8; flex:none; }

/* tab picker — each carries the count at the right-hand version and the delta */
.cmp-tabs{ display:flex; gap:8px; flex-wrap:wrap; padding:0 8px 18px; border-bottom:1px solid var(--stroke); }
.cmp-tab{ display:flex; align-items:center; gap:8px; font-family:inherit; font-size:13.5px; font-weight:600;
  color:var(--text-light); background:var(--white); border:1px solid var(--stroke); border-radius:10px;
  padding:8px 12px; cursor:pointer; }
.cmp-tab:hover{ border-color:#cfd3e0; color:var(--text-dark); }
.cmp-tab.active{ border-color:var(--green); color:#0a7d4d; background:var(--badge-bg); }
.cmp-tab .n{ font-size:11.5px; font-weight:800; color:#8a93a6; background:#f2f4fa; border-radius:20px; padding:2px 8px; }
.cmp-tab.active .n{ background:#fff; color:#0a8f57; }
.cmp-tab .d{ font-size:11px; font-weight:800; }
.cmp-tab .d.up{ color:var(--sev-crit); } .cmp-tab .d.down{ color:#0a8f57; }

.cmp-sum{ display:flex; align-items:center; gap:20px; flex-wrap:wrap; padding:18px 8px 4px; }
.cmp-sum .s{ font-size:13px; color:var(--text-light); }
.cmp-sum .s b{ font-size:19px; font-weight:800; margin-right:5px; }
.cmp-sum .s.new b{ color:var(--sev-crit); }
.cmp-sum .s.closed b{ color:#0a8f57; }
.cmp-sum .s.carried b{ color:var(--text-dark); }
.cmp-sum .s.note{ color:#9aa3b6; font-style:italic; }
.cmp-sum.same{ color:var(--text-light); font-size:13px; font-style:italic; }

/* ---- metrics: what the tab measured, at both versions ---- */
.cmp-mtitle{ font-size:11px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase;
  color:#9aa3b6; padding:20px 8px 10px; }
.cmp-mgrid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:10px; padding:0 8px; }
.cmp-m{ display:grid; grid-template-columns:minmax(0,1fr) auto 14px auto 84px; align-items:center; gap:10px;
  border:1px solid var(--stroke); border-radius:12px; padding:11px 14px; background:var(--white); }
.cmp-m .ml{ font-size:12.5px; font-weight:600; color:var(--text-dark); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cmp-m .mv{ font-size:17px; font-weight:800; color:var(--text-dark); }
.cmp-m .mar{ width:14px; height:14px; color:#c3cad8; }
.cmp-m .md{ font-size:11px; font-weight:800; text-align:right; }
.cmp-m .md.worse{ color:var(--sev-crit); } .cmp-m .md.better{ color:#0a8f57; }
.cmp-m .md.flat{ color:#c3cad8; font-weight:600; }

/* ---- the two columns, with the detail panel beside them ---- */
.cmp-split{ display:flex; gap:16px; align-items:flex-start; }
.cmp-main{ flex:1 1 auto; min-width:0; }
.cmp-body{ padding:16px 8px 8px; }
.cmp-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-left:132px; }
.cmp-head{ border:1px solid var(--stroke); border-radius:14px; padding:14px 16px; background:#fcfcfe; }
.cmp-head-t{ font-size:16px; font-weight:800; color:var(--title); }
.cmp-head-m{ font-size:11.5px; font-weight:600; color:#9aa3b6; margin-top:2px; }
.cmp-head-d{ font-size:12px; line-height:17px; color:var(--text-light); margin-top:7px; }
.cmp-head-n{ display:flex; gap:16px; margin-top:11px; padding-top:11px; border-top:1px solid var(--stroke); }
.cmp-head-n .cn{ font-size:18px; font-weight:800; color:var(--text-dark); }
.cmp-head-n .cn i{ display:block; font-style:normal; font-size:10px; font-weight:700; letter-spacing:0.5px;
  text-transform:uppercase; color:#9aa3b6; margin-top:1px; }
.cmp-head-n .cn.crit{ color:var(--sev-crit); } .cmp-head-n .cn.adv{ color:var(--y600); }
.cmp-head-n .cn.minor{ color:#8a93a6; }

/* ---- one finding across both versions ---- */
.cmp-rows{ display:flex; flex-direction:column; gap:10px; margin-top:18px; }
.cmp-row{ display:grid; grid-template-columns:132px 1fr; align-items:stretch; }
.cmp-kind{ display:flex; align-items:center; padding-right:16px; }
.cmp-kind .k{ font-size:10.5px; font-weight:800; letter-spacing:0.5px; text-transform:uppercase;
  border-radius:20px; padding:4px 10px; white-space:nowrap; }
.cmp-kind .k.new{ background:var(--sev-crit-bg); color:var(--sev-crit); }
.cmp-kind .k.resolved{ background:var(--badge-bg); color:#0a8f57; }
.cmp-kind .k.carried{ background:#f2f4fa; color:#8a93a6; }
.cmp-pair{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.cmp-cell{ display:flex; flex-direction:column; gap:5px; border:1px solid var(--stroke); border-radius:12px;
  padding:12px 14px; background:var(--white); }
.cmp-cell .sev{ font-size:10px; font-weight:800; letter-spacing:0.6px; text-transform:uppercase; }
.cmp-cell .ttl{ font-size:13px; line-height:19px; color:var(--text-dark); }
.cmp-cell.crit{ border-left:3px solid var(--sev-crit); } .cmp-cell.crit .sev{ color:var(--sev-crit); }
.cmp-cell.adv{ border-left:3px solid var(--y400); } .cmp-cell.adv .sev{ color:var(--y600); }
.cmp-cell.minor{ border-left:3px solid #c9cfdd; } .cmp-cell.minor .sev{ color:#8a93a6; }
.cmp-cell.empty{ align-items:center; justify-content:center; background:#fbfcfe;
  border-style:dashed; color:#c3cad8; font-size:12px; font-style:italic; }

/* a cell is now the way into the detail, so it has to read as pressable */
button.cmp-cell{ font-family:inherit; text-align:left; cursor:pointer; }
button.cmp-cell:hover{ border-color:#cfd3e0; }
button.cmp-cell.sel{ border-color:var(--green); box-shadow:0 0 0 3px rgba(46,232,158,0.10); }

/* ---- detail panel — inside the view, never a navigation ---- */
.cmp-panel{ display:none; flex:0 0 360px; width:360px; align-self:flex-start; position:sticky; top:14px;
  background:var(--white); border:1px solid var(--stroke); border-radius:14px; overflow:hidden;
  max-height:calc(100vh - 28px); flex-direction:column; box-shadow:0 8px 30px rgba(23,43,77,0.08); }
.cmp-panel.show{ display:flex; }
.cmp-panel-h{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
  padding:14px 16px; border-bottom:1px solid var(--stroke); flex:none; }
.cmp-panel-t{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.cmp-panel-t .pt{ font-size:14px; font-weight:700; color:var(--title); line-height:19px; }
.cmp-panel-t .ps{ font-size:11px; font-weight:600; color:#9aa3b6; }
.cmp-panel-body{ padding:16px; overflow-y:auto; overscroll-behavior:contain; min-height:0; }
.cp-sec + .cp-sec{ margin-top:16px; }
.cp-h{ font-size:10px; font-weight:700; letter-spacing:0.7px; text-transform:uppercase; color:#9aa3b6; margin-bottom:6px; }
.cmp-panel-body p{ font-size:12.5px; line-height:19px; color:var(--text-dark); }
.cp-tag{ display:inline-block; margin-top:14px; font-size:10.5px; font-weight:600; color:var(--sug-tag-text);
  background:var(--sug-tag-bg); border:0.6px solid rgba(46,232,158,0.22); border-radius:6px; padding:3px 9px; }
/* the finding's life across every version, not just the two on screen */
.cp-life{ display:flex; gap:6px; }
.cp-v{ flex:1 1 0; border:1px solid var(--stroke); border-radius:9px; padding:7px 6px; text-align:center;
  font-size:9.5px; font-weight:600; color:#c3cad8; background:#fbfcfe; }
.cp-v i{ display:block; font-style:normal; font-size:11px; font-weight:700; color:#9aa3b6; margin-bottom:2px; }
.cp-v.on{ background:var(--sev-crit-bg); border-color:var(--sev-crit-line); color:var(--sev-crit); }
.cp-v.on i{ color:var(--sev-crit); }
.cp-v.shown{ box-shadow:0 0 0 2px rgba(46,232,158,0.30); }

@media (max-width:1180px){
  .cmp-split{ flex-direction:column; }
  .cmp-panel{ position:static; width:100%; flex:1 1 auto; max-height:none; }
}
@media (max-width:1000px){
  .cmp-grid{ margin-left:0; }
  .cmp-row{ grid-template-columns:1fr; gap:8px; }
  .cmp-kind{ padding:0 0 4px; }
}

/* ============================================================
   HOME (index.html) — portfolio: therapeutic area > molecule > trial.

   Everything here is prefixed `hm-`. The shared sheet already owns generic
   names like .row, .track and .cell, and this screen is the only place these
   rules apply, so a prefix is cheaper than auditing collisions.

   The trial tile is the unit of the screen. It carries identity, a stage bar
   reading left-to-right through the review chain, and three numbers. The stage
   bar is a position indicator, not a progress bar — it says where the review
   has reached, and deliberately says nothing about whether the trial is going
   well.
   ============================================================ */
.hm{ max-width:1240px; margin:0 auto; padding:44px 24px 96px;
  display:flex; flex-direction:column; gap:22px; }
.hm-head h1{ font-size:28px; font-weight:800; color:var(--title); letter-spacing:-0.4px; }
.hm-head .sub{ font-size:14.5px; line-height:22px; color:var(--text-light); margin-top:8px; max-width:760px; }

/* ---------- toolbar ---------- */
.hm-tools{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.hm-search{ flex:1 1 280px; min-width:220px; font-family:inherit; font-size:13.5px;
  color:var(--text-dark); background:var(--white); border:1px solid var(--stroke);
  border-radius:11px; padding:10px 14px; }
.hm-search::placeholder{ color:#9aa3b6; }
.hm-search:focus{ outline:none; border-color:rgba(46,232,158,0.55);
  box-shadow:0 0 0 3px rgba(46,232,158,0.10); }
.hm-spacer{ flex:1 1 auto; }
.hm-chip, .hm-btn{ font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer;
  background:var(--white); border:1px solid var(--stroke); color:var(--text-light);
  border-radius:999px; padding:8px 14px; white-space:nowrap; transition:background .15s, color .15s, border-color .15s; }
.hm-btn{ border-radius:10px; }
.hm-chip:hover, .hm-btn:hover{ background:#fafbff; border-color:#d8dbe6; color:var(--text-dark); }
.hm-chip.on{ background:var(--green-tint); border-color:var(--green); color:var(--brand-ink); }
.hm-chip .n{ margin-left:7px; opacity:.6; font-variant-numeric:tabular-nums; }

/* ---------- therapeutic area ---------- */
.hm-area{ background:var(--white); border:1px solid var(--stroke); border-radius:20px; overflow:hidden;
  box-shadow:0 1px 2px rgba(23,43,77,0.04), 0 8px 24px rgba(23,43,77,0.04); }
.hm-area-head, .hm-mol-head{ display:flex; align-items:center; gap:11px; width:100%;
  font-family:inherit; text-align:left; background:none; border:none; cursor:pointer; }
.hm-area-head{ padding:18px 22px; }
.hm-area-head:hover{ background:#fafbff; }
.hm-area-name{ font-size:16.5px; font-weight:700; color:var(--title); letter-spacing:-0.2px; }
.hm-area-meta{ margin-left:auto; font-size:12.5px; color:var(--text-light); white-space:nowrap; }
.hm-area-meta b{ font-weight:700; color:var(--text-dark); }
.hm-area-meta b.crit{ color:var(--sev-crit); }
.hm-chev{ width:15px; height:15px; flex:none; color:#9aa3b6; transition:transform .18s ease; }
.hm-area-head.open .hm-chev, .hm-mol-head.open .hm-chev{ transform:rotate(90deg); }

/* ---------- molecule ---------- */
.hm-mol{ border-top:1px solid var(--stroke); }
.hm-mol.hide{ display:none; }
.hm-mol-head{ padding:13px 22px 13px 40px; }
.hm-mol-head:hover{ background:#fafbff; }
.hm-mol-name{ font-size:13.5px; font-weight:700; color:var(--teal); }
.hm-count{ margin-left:auto; font-size:11px; font-weight:600; color:var(--sug-tag-text);
  background:var(--sug-tag-bg); border:0.6px solid rgba(46,232,158,0.22);
  border-radius:6px; padding:3px 9px; white-space:nowrap; }

/* ---------- trial cards ----------
   Full-width rows stacked vertically, not a grid of narrow tiles. A trial's
   description is a sentence and wants a line long enough to read; three of them
   side by side clamped to 316px was unreadable. The trade is vertical length,
   which is why only the live trial's branch is expanded on load.

   Inside a card: identity and description across the top, then one strip with
   the stage bar and the three numbers at FIXED grid columns. Fixed, not
   proportional, so the same measure sits at the same x on every card and the
   list can be read down a column instead of card by card.
   ---------- */
.hm-tiles{ display:flex; flex-direction:column; gap:10px; padding:2px 22px 22px 40px; }
.hm-tiles.hide{ display:none; }

.hm-tile{ display:grid; grid-template-columns:minmax(0,1fr) 152px; align-items:center; gap:24px;
  text-align:left; text-decoration:none; font-family:inherit; color:inherit; cursor:pointer;
  background:var(--white); border:1px solid var(--stroke); border-radius:14px; padding:16px 18px;
  transition:border-color .13s ease, box-shadow .13s ease, background .13s ease; }
.hm-tile:hover{ border-color:#d8dbe6; box-shadow:0 4px 14px rgba(23,43,77,0.07); }
.hm-tile.live{ border-color:rgba(46,232,158,0.40); background:linear-gradient(100deg,#f9fffc 0%,var(--white) 42%); }
.hm-tile.live:hover{ border-color:rgba(46,232,158,0.65); }
/* a trial with no review yet is present but visibly inert */
.hm-tile.quiet{ background:#fcfcfe; }
.hm-tile.quiet .hm-t-name{ color:var(--text-light); }

.hm-t-main{ display:flex; flex-direction:column; gap:10px; min-width:0; }
.hm-t-top{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.hm-t-name{ font-size:16px; font-weight:700; color:var(--title); letter-spacing:-0.2px; }
.hm-tile.live:hover .hm-t-name{ color:#0a8f57; }
.hm-t-no{ font-size:11.5px; font-weight:600; color:#9aa3b6; font-variant-numeric:tabular-nums; }
.hm-tag{ font-size:10.5px; font-weight:700; color:var(--sug-tag-text); background:var(--sug-tag-bg);
  border:0.6px solid rgba(46,232,158,0.22); border-radius:6px; padding:3px 8px; white-space:nowrap; }
.hm-tag.soft{ color:var(--text-light); background:var(--btn-bg); border-color:var(--stroke); }
/* the full width means most descriptions fit on one line; two is the ceiling */
.hm-t-title{ font-size:13.5px; line-height:20px; color:var(--text-light); max-width:104ch;
  display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* ---------- the measure strip ---------- */
/* start-aligned, with a fixed value box under each label: the three numbers use
   different type sizes, and centring them put every caption on its own y. */
.hm-t-foot{ display:grid; grid-template-columns:minmax(230px,1fr) 128px 132px 150px; gap:22px;
  align-items:start; border-top:1px solid var(--stroke); padding-top:12px; margin-top:1px; }

.hm-stage{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.hm-stage-row{ display:flex; align-items:center; gap:12px; min-height:23px; }
.hm-segs{ display:flex; gap:3px; width:168px; flex:none; }
.hm-seg{ flex:1; height:6px; border-radius:2px; background:#eceef5; }
.hm-seg.done{ background:rgba(46,232,158,0.55); }
.hm-seg.now{ background:#0a8f57; box-shadow:0 0 0 2px rgba(46,232,158,0.22); }
.hm-stage-lb{ font-size:11.5px; color:var(--text-light); white-space:nowrap;
  font-variant-numeric:tabular-nums; overflow:hidden; text-overflow:ellipsis; }
.hm-stage-lb b{ font-weight:700; color:var(--text-dark); }
.hm-stage-lb .none{ color:#9aa3b6; font-style:normal; }

.hm-metric{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.hm-mk{ font-size:9.5px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; color:#9aa3b6; }
.hm-mv{ display:flex; align-items:center; gap:7px; min-height:23px; font-size:17px; font-weight:700;
  color:var(--text-dark); letter-spacing:-0.3px; font-variant-numeric:tabular-nums; line-height:1.15; }
.hm-mv small{ font-size:11px; font-weight:600; color:var(--text-light); margin-left:-4px; }
.hm-mv.sm{ font-size:13px; font-weight:600; }
.hm-mv.crit{ color:var(--sev-crit); }
.hm-critdot{ width:6px; height:6px; border-radius:50%; background:var(--sev-crit); flex:none; }
/* inline, so the harmonisation block is the same height as its two neighbours */
.hm-meter{ width:42px; height:3px; border-radius:2px; background:#eceef5; overflow:hidden; flex:none; }
.hm-meter i{ display:block; height:3px; background:rgba(46,232,158,0.7); border-radius:2px; }

/* ---------- open action ---------- */
.hm-t-go{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--green); color:var(--brand-ink); font-size:13px; font-weight:700;
  padding:11px 16px; border-radius:var(--pill); white-space:nowrap; }
.hm-t-go svg{ width:14px; height:14px; }
/* reserved slot on a card with nothing to open — holds the column, says why */
.hm-t-go.ghost{ background:none; color:#a8b0c0; font-size:11.5px; font-weight:600;
  border:1px dashed var(--stroke); }

.hm-empty{ font-size:13px; color:var(--text-light); text-align:center;
  padding:36px; background:var(--white); border:1px solid var(--stroke); border-radius:16px; }

/* ---------- toast ---------- */
.hm-toast{ position:fixed; left:50%; bottom:28px; transform:translateX(-50%) translateY(90px);
  background:var(--text-dark); color:#fff; font-size:13px; font-weight:600;
  padding:11px 20px; border-radius:999px; box-shadow:0 10px 30px rgba(13,33,55,0.25);
  opacity:0; pointer-events:none; transition:transform .22s ease, opacity .22s ease; z-index:90; }
.hm-toast.on{ transform:translateX(-50%); opacity:1; }

@media (max-width:1080px){
  .hm-t-foot{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 22px; }
  .hm-stage{ grid-column:1 / -1; }
}
@media (max-width:900px){
  .hm-tile{ grid-template-columns:minmax(0,1fr); gap:14px; }
  .hm-t-go{ justify-self:start; }
  .hm-tiles{ padding-left:22px; }
  .hm-mol-head{ padding-left:22px; }
  .hm-area-meta{ display:none; }
}

/* ============================================================
   MASTERS TAB — the sponsor's master libraries (Layer 1).

   Prefixed `ms-`. Visual language borrowed from the Dashboard (.rd): same card
   shell, same shadow, same severity vocabulary, so the tab reads as part of the
   review even though its subject is the library rather than the study.
   ============================================================ */
/* the view supplies the gap between sections; the card supplies its own inset */
#mastersRoot, #auditRoot{ display:flex; flex-direction:column; gap:22px; }
.ms-card{ background:var(--white); border:1px solid var(--stroke); border-radius:20px; padding:28px 32px 30px;
  box-shadow:0 1px 2px rgba(23,43,77,0.04), 0 8px 24px rgba(23,43,77,0.04); }
.ms-head{ display:flex; align-items:flex-start; gap:16px; margin-bottom:22px; }
.ms-h-txt{ display:flex; flex-direction:column; gap:5px; min-width:0; }
.ms-title{ font-size:19px; font-weight:700; color:var(--title); letter-spacing:-0.2px; }
.ms-sub{ font-size:12.5px; line-height:19px; color:var(--text-light); max-width:82ch; }
.ms-chip{ font-size:11.5px; font-weight:600; color:var(--text-light); background:var(--btn-bg);
  border:1px solid var(--stroke); border-radius:999px; padding:6px 13px; white-space:nowrap; margin-left:auto; }
.ms-chip b{ color:var(--text-dark); font-weight:700; }
.ms-grow{ flex:1 1 auto; }

/* ---------- the two layers ---------- */
.ms-layers{ display:grid; grid-template-columns:1fr 28px 1fr; gap:16px; align-items:center; margin-bottom:22px; }
.ms-layer{ display:flex; flex-direction:column; gap:4px;
  background:var(--page); border:1px solid var(--stroke); border-radius:14px; padding:18px 20px; }
.ms-lcap{ font-size:10px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; color:#9aa3b6; }
.ms-lbig{ font-size:26px; font-weight:800; color:var(--title); letter-spacing:-0.5px;
  font-variant-numeric:tabular-nums; }
.ms-lbig small{ font-size:13px; font-weight:600; color:var(--text-light); letter-spacing:0; }
.ms-lsm{ font-size:11.5px; line-height:17px; color:var(--text-light); }
.ms-arrow{ display:grid; place-items:center; color:#c3cad8; }
.ms-arrow svg{ width:19px; height:19px; }

/* ---------- library switcher ---------- */
.ms-tabs{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:20px; }
.ms-tab{ position:relative; font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer;
  background:var(--white); border:1px solid var(--stroke); color:var(--text-light);
  border-radius:10px; padding:8px 15px; white-space:nowrap; transition:background .15s, color .15s, border-color .15s; }
.ms-tab:hover{ background:#fafbff; border-color:#d8dbe6; color:var(--text-dark); }
.ms-tab.on{ background:var(--green); border-color:var(--green); color:var(--brand-ink); }
.ms-dot{ display:inline-block; width:6px; height:6px; border-radius:50%;
  background:var(--sev-crit); margin-left:7px; vertical-align:1px; }

/* ---------- table ---------- */
.ms-tablewrap{ overflow-x:auto; }
.ms-table{ width:100%; border-collapse:collapse; font-size:12.5px; min-width:880px; }
.ms-table thead th{ text-align:left; font-size:10px; font-weight:700; letter-spacing:0.6px;
  text-transform:uppercase; color:#9aa3b6; padding:0 10px 9px; border-bottom:1px solid var(--stroke);
  white-space:nowrap; }
.ms-table th.r, .ms-table td.r{ text-align:right; }
.ms-table th.c, .ms-table td.c{ text-align:center; }
.ms-table tbody td{ padding:11px 10px; border-bottom:1px solid #f1f3f8; vertical-align:middle; }
.ms-row{ cursor:pointer; }
.ms-row:hover{ background:#fafbff; }
.ms-row.open{ background:var(--section-bg); }
.ms-row.open .ms-chev{ transform:rotate(90deg); }
/* a deviation is the only row anyone has to act on, so it carries a rail */
.ms-row.dev .ms-name{ box-shadow:inset 2px 0 0 var(--sev-crit); }
.ms-name{ display:flex; align-items:center; gap:8px; font-weight:600; color:var(--title); white-space:nowrap; }
.ms-name.plain{ display:table-cell; }
.ms-chev{ width:13px; height:13px; flex:none; color:#c3cad8; transition:transform .16s ease; }
.ms-dim{ color:var(--text-light); }
.ms-table td.r{ font-variant-numeric:tabular-nums; }
.ms-origin{ font-size:10.5px; font-weight:700; color:var(--sug-tag-text); background:var(--sug-tag-bg);
  border:0.6px solid rgba(46,232,158,0.22); border-radius:6px; padding:3px 8px; white-space:nowrap; }
.ms-origin.spon{ color:var(--teal); background:rgba(46,138,156,0.07); border-color:rgba(46,138,156,0.28); }

.ms-state{ font-size:10px; font-weight:700; letter-spacing:0.3px; padding:3px 9px; border-radius:5px;
  white-space:nowrap; }
.ms-state.aligned{   color:#0a8f57; background:var(--badge-bg); }
.ms-state.extended{  color:var(--sug-tag-text); background:var(--sug-tag-bg); }
.ms-state.sponsor{   color:var(--text-light); background:var(--btn-bg); }
.ms-state.deviation{ color:var(--sev-crit); background:var(--sev-crit-bg); }

/* ---------- expanded row ---------- */
.ms-detail > td{ padding:0 10px 14px !important; background:var(--section-bg); border-bottom:1px solid var(--stroke) !important; }
.ms-dbody{ padding:4px 0 2px 21px; }
.ms-dgrid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px 22px; margin-bottom:6px; }
.ms-kv{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.ms-kv .k{ font-size:10px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase; color:#9aa3b6; }
.ms-kv .v{ font-size:12.5px; color:var(--text-dark); }
.ms-dsec{ font-size:10px; font-weight:700; letter-spacing:0.6px; text-transform:uppercase;
  color:#9aa3b6; margin:14px 0 5px; }
.ms-dtxt{ font-size:12.5px; line-height:19px; color:var(--text-light); max-width:96ch; }
.ms-dtxt b{ color:var(--text-dark); font-weight:700; }

.ms-note{ font-size:12px; line-height:18.5px; color:var(--text-light); background:var(--page);
  border:1px solid var(--stroke); border-left:3px solid var(--green); border-radius:9px;
  padding:13px 16px; margin-top:20px; }
.ms-note.warn{ border-left-color:var(--sev-crit); }
.ms-note b{ color:var(--text-dark); font-weight:700; }

@media (max-width:1000px){
  .ms-layers{ grid-template-columns:1fr; }
  .ms-arrow{ display:none; }
}

/* ============================================================
   APP SHELL — side navigation for the portfolio-level views.

   Prefixed `sh-`. The nav is fixed and the main column scrolls, so the three
   views (Trials, Masters, Audit log) never lose their entry points. Study-level
   navigation stays where it was: the tab bar inside the review.
   ============================================================ */
.sh{ display:grid; grid-template-columns:68px minmax(0,1fr); min-height:100vh; }
/* An icon rail, not a sidebar. Labels live in the tooltip and in .sh-sr for
   screen readers, which buys the content the width the tables actually want. */
.sh-nav{ position:sticky; top:0; align-self:start; height:100vh;
  display:flex; flex-direction:column; align-items:center; gap:6px;
  background:var(--white); border-right:1px solid var(--stroke); padding:18px 0 16px; }
.sh-main{ min-width:0; }

/* only the selected view is in the flow — the others are not rendered at all */
.sh-view{ display:none; }
.sh-view.on{ display:block; }

/* visually hidden, still read aloud and still found by in-page search */
.sh-sr{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }

.sh-brand{ display:grid; place-items:center; width:44px; height:44px; margin-bottom:10px;
  border-radius:12px; text-decoration:none; transition:background .14s ease; }
.sh-brand:hover{ background:var(--green-tint-2); }
/* the real mark from /public. It is already brand green on transparency, so it
   needs no plate behind it — a coloured tile would only fight the logo. */
.sh-mark{ width:28px; height:28px; flex:none; display:block; }

.sh-items{ display:flex; flex-direction:column; align-items:center; gap:4px; }
.sh-item{ display:grid; place-items:center; width:44px; height:44px; padding:0;
  font-family:inherit; background:none; border:none; border-radius:12px;
  cursor:pointer; color:var(--text-light); transition:background .14s ease, color .14s ease; }
.sh-item:hover{ background:var(--green-tint-2); color:var(--text-dark); }
.sh-item svg{ width:19px; height:19px; flex:none; }
/* the selected item is the site's secondary control: green tint, green edge,
   near-black glyph — the same pairing as the buttons, one step quieter */
.sh-item.on{ background:var(--green-tint); color:var(--brand-ink);
  box-shadow:inset 0 0 0 1px var(--green); }

.sh-foot{ margin-top:auto; display:grid; place-items:center; width:36px; height:36px;
  border-radius:10px; color:#c3cad8; cursor:default; }
.sh-foot svg{ width:16px; height:16px; }

/* the rail is only 68px, so the view takes the rest of the width. Long prose
   inside each view is still capped by its own measure (see .hm-t-title,
   .ms-sub, .au-detail) — it is the tables that wanted the room. */
.sh .hm{ max-width:none; padding:36px 34px 96px; }

@media (max-width:900px){
  .sh{ grid-template-columns:1fr; }
  .sh-nav{ position:static; height:auto; flex-direction:row; align-items:center; justify-content:flex-start;
    border-right:none; border-bottom:1px solid var(--stroke); padding:10px 14px; gap:8px; }
  .sh-brand{ margin-bottom:0; }
  .sh-items{ flex-direction:row; }
  .sh-foot{ margin-top:0; margin-left:auto; }
  .sh .hm{ padding:24px 18px 72px; }
}

/* ============================================================
   AUDIT LOG — the append-only record of who did what.
   Reuses the Masters card shell (.ms-card) so the two portfolio views read as
   one screen family. Grouped by day, because a log is read by time.
   ============================================================ */
.au-tools{ display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin-bottom:11px; }
.au-sel{ font-family:inherit; font-size:12.5px; font-weight:600; color:var(--text-dark);
  background:var(--white); border:1px solid var(--stroke); border-radius:11px;
  padding:10px 13px; cursor:pointer; min-width:170px; }
.au-sel:focus{ outline:none; border-color:rgba(46,232,158,0.55); box-shadow:0 0 0 3px rgba(46,232,158,0.10); }
.au-chips{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:22px; }

.au-list{ display:flex; flex-direction:column; }
.au-day{ display:flex; align-items:center; gap:12px; padding:16px 0 9px; }
.au-day .d{ font-size:11.5px; font-weight:800; color:var(--text-dark); letter-spacing:-0.1px; }
.au-day .c{ font-size:10.5px; font-weight:600; color:#a8b0c0; }
.au-day::after{ content:''; flex:1; height:1px; background:var(--stroke); }

.au-row{ display:grid; grid-template-columns:52px 30px minmax(0,1fr) 150px; gap:14px;
  align-items:start; padding:11px 0; border-top:1px solid #f4f5fa; }
.au-row:first-child{ border-top:none; }
.au-time{ font-size:11.5px; font-weight:600; color:#a8b0c0; font-variant-numeric:tabular-nums; padding-top:5px; }
.au-ic{ width:30px; height:30px; border-radius:9px; flex:none; display:grid; place-items:center;
  background:var(--btn-bg); color:var(--text-light); }
.au-ic svg{ width:15px; height:15px; }
/* one colour per kind of action, so a scan can skip to the right sort of entry */
.au-ic.run{      background:var(--badge-bg);             color:#0a8f57; }
.au-ic.decision{ background:var(--sug-tag-bg);           color:var(--sug-tag-text); }
.au-ic.document{ background:var(--btn-bg);               color:var(--btn-text); }
.au-ic.library{  background:rgba(46,138,156,0.09);       color:var(--teal); }
.au-ic.access{   background:var(--y50);                  color:var(--y600); }

.au-body{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.au-head-line{ font-size:13px; line-height:19px; color:var(--text-light); }
.au-head-line b{ font-weight:700; color:var(--title); }
.au-target{ font-weight:600; color:var(--text-dark); }
.au-detail{ font-size:12px; line-height:18px; color:#8b94a8; max-width:96ch; }
.au-role{ font-size:10.5px; font-weight:600; color:#a8b0c0; text-align:right; padding-top:5px; }
.au-empty{ font-size:12.5px; color:var(--text-light); text-align:center; padding:34px;
  background:var(--page); border:1px solid var(--stroke); border-radius:14px; }

@media (max-width:900px){
  .au-row{ grid-template-columns:46px 26px minmax(0,1fr); }
  .au-role{ display:none; }
}

/* ---------- SOA: suggested procedure additions ----------
   A proposed tick must never look like a scheduled one. The solid green check
   means "this happens"; the outlined check below means "this is proposed", and
   the band above each group says which kind of proposal it is. */
.soa-prop{ display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:24px;
  border-radius:7px; background:#fff; border:1px dashed rgba(46,232,158,0.75); color:#0a8f57; }
/* SVG_CHECK ships wrapped in .soa-check — a green pill. Inside a proposal that
   pill reads as a scheduled tick, so it is stripped back to a bare glyph that
   inherits the proposal's own colour (green when accepted, amber when optional). */
.soa-prop .soa-check{ background:none; border:none; width:auto; height:auto; }
.soa-prop .soa-check svg{ width:12px; height:12px; color:inherit; }
.soa-row.added.optional .soa-prop{ border-color:rgba(250,204,21,0.9); color:#b07c00; }
/* the chip on a suggested row says which kind of addition it is */
.soa-chip.required{ color:#0a7d4d; background:var(--badge-bg); border-color:rgba(46,232,158,0.45); }
.soa-chip.optional{ color:#b07c00; background:var(--y50); border-color:var(--y200); }

/* ---------- SDTM: controlled terminology in the variable detail panel ---------- */
.sdtm-ct-terms{ display:flex; flex-wrap:wrap; gap:5px; }
.sdtm-ct-term{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11px; font-weight:600;
  color:var(--sug-tag-text); background:var(--sug-tag-bg); border:0.6px solid rgba(46,232,158,0.28);
  border-radius:5px; padding:2px 7px; white-space:nowrap; }
.sdtm-ct-ext{ font-style:normal; font-size:10px; font-weight:700; letter-spacing:0.4px; text-transform:uppercase;
  color:#0a8f57; background:var(--badge-bg); border-radius:4px; padding:2px 6px; margin-left:7px; }
.sdtm-ct-ext.fixed{ color:var(--text-light); background:var(--btn-bg); }

/* ============================================================
   ADaM TAB — dataset browser.

   The shell (.sdtm-wrap / -content / -header / -issuebar / -body / .sdtm-tbl)
   is shared with the SDTM tab on purpose: two dataset browsers that are meant to
   look identical should not be two sets of rules that have to be kept in step.
   Only what is specific to ADaM lives here — the per-dataset section heading and
   the schema table's derivation cells.
   ============================================================ */
.adam-sec{ scroll-margin-top:12px; }
.adam-sec + .adam-sec{ margin-top:30px; }
.adam-sec-head{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap;
  padding:11px 14px; background:var(--section-bg); border-radius:9px; }
.adam-sec-name{ font-size:15px; font-weight:800; color:var(--title); letter-spacing:-0.2px; }
.adam-sec-label{ font-size:12.5px; color:var(--text-light); }
.adam-sec-cat{ font-size:10px; font-weight:700; letter-spacing:0.5px; color:var(--sug-tag-text);
  background:var(--sug-tag-bg); border:0.6px solid rgba(46,232,158,0.25); border-radius:5px; padding:2px 7px; }
.adam-sec-meta{ margin-left:auto; font-size:11.5px; color:#9aa3b6; font-variant-numeric:tabular-nums;
  white-space:nowrap; }
/* A root narrows this dataset to the columns behind it. The chip says the table
   is a subset before the reader counts columns and works it out; its title
   attribute says which source drew the line. */
.adam-sec-traced{ font-size:10px; font-weight:800; letter-spacing:0.5px; color:#0d8a5f;
  background:rgba(46,232,158,0.14); border:0.6px solid rgba(46,232,158,0.45);
  border-radius:5px; padding:2px 7px; cursor:help; }
/* the columns the ROOT VARIABLE itself produced, as opposed to the identifiers
   and companions kept alongside them — the same green the root marker uses on
   every other tab */
.adam-tbl th.root-col{ color:#0d8a5f; background:rgba(46,232,158,0.16);
  box-shadow:inset 0 2px 0 var(--green); }
.adam-tbl td.root-col{ background:rgba(46,232,158,0.07); font-weight:600; }
table.adam-tbl tr.root-active td:first-child{ box-shadow:inset 3px 0 0 var(--green); }
table.adam-tbl tr.root-active td{ background:rgba(46,232,158,0.06); }
.adam-sec-desc{ font-size:12.5px; line-height:19px; color:var(--text-light); padding:10px 14px 0; max-width:110ch; }
.adam-sec .sdtm-tblwrap{ margin-top:10px; }

/* the data view is a wide record grid, so it needs to scroll on its own */
.adam-tbl{ min-width:100%; }
.adam-tbl td, .adam-tbl th{ white-space:nowrap; }
.adam-var{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11.5px; font-weight:700;
  color:var(--text-dark); background:var(--btn-bg); border:1px solid var(--stroke);
  border-radius:5px; padding:2px 6px; }
.adam-type{ font-size:10px; font-weight:700; letter-spacing:0.4px; color:var(--text-light);
  background:var(--btn-bg); border-radius:4px; padding:2px 6px; }
.adam-src{ font-size:10px; font-weight:700; letter-spacing:0.4px; border-radius:4px; padding:2px 7px; white-space:nowrap; }
.adam-src.sdtm{ color:#0e83b3; background:#e6f4fb; }
.adam-src.derived{ color:#7c3aed; background:#f0ecfe; }

/* derivation: the reason this tab exists, so it stays legible rather than terse.
   Scoped to the schema table by class, not by column position: the data view
   shares .adam-tbl, and under a root its column count changes, so a positional
   rule would wrap whichever record column happened to land fifth. */
.adam-tbl-schema td:nth-child(5){ white-space:normal; min-width:280px; max-width:460px; }
.adam-tbl-schema td:nth-child(6){ white-space:normal; min-width:150px; }
.adam-deriv-type{ display:inline-block; font-size:9.5px; font-weight:700; letter-spacing:0.5px;
  text-transform:uppercase; color:var(--teal); background:rgba(46,138,156,0.08);
  border-radius:4px; padding:2px 6px; margin-bottom:5px; }
.adam-deriv-logic{ display:block; font-size:12px; line-height:18px; color:var(--text-light); }
.adam-deriv-formula{ display:block; margin-top:6px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:11px; color:var(--btn-text); background:var(--page); border:1px solid var(--stroke);
  border-radius:6px; padding:6px 8px; white-space:pre-wrap; }

/* ---------- root narrowing on the CSR and Define-XML tabs ----------
   Both narrow by hiding rows rather than rebuilding, so each tab's own findings
   engine keeps reporting over the whole document. The banner is what stops a
   narrowed view being read as a short one. */
.csr-root-hidden, .dx-root-hidden{ display:none !important; }
.root-note{ font-size:12px; line-height:18px; color:var(--text-light); background:var(--badge-bg);
  border:1px solid rgba(46,232,158,0.35); border-left:3px solid var(--green);
  border-radius:9px; padding:11px 14px; margin:0 0 16px; }
.root-note b{ color:var(--text-dark); font-weight:700; }
.root-note.empty{ background:var(--sev-crit-bg); border-color:var(--sev-crit-line);
  border-left-color:var(--sev-crit); }

/* ============================================================
   COLOUR — categorical identity and surface tints.

   Two rules hold everywhere below:
     1. Identity uses --cat-1..3 in FIXED order and never cycles. A fourth
        value takes --cat-none rather than a newly invented hue.
     2. Severity keeps red / amber / green to itself. Nothing decorative is
        allowed into that set, or a colour that means "critical" starts also
        meaning "the third category".
   ============================================================ */

/* ---- ADaM dataset categories: exactly three values, so exactly three slots ---- */
.adam-sec-cat.cat-1{ color:var(--cat-1-ink); background:var(--cat-1-bg); border-color:var(--cat-1-line); }
.adam-sec-cat.cat-2{ color:var(--cat-2-ink); background:var(--cat-2-bg); border-color:var(--cat-2-line); }
.adam-sec-cat.cat-3{ color:var(--cat-3-ink); background:var(--cat-3-bg); border-color:var(--cat-3-line); }
.adam-sec-cat.cat-none{ color:var(--cat-none-ink); background:var(--cat-none-bg); border-color:var(--cat-none-line); }
/* the section heading picks up a hairline in its dataset's colour */
.adam-sec-head{ border-left:3px solid var(--cat-none-line); }
.adam-sec.c1 .adam-sec-head{ border-left-color:var(--cat-1); background:linear-gradient(90deg,var(--cat-1-bg),var(--section-bg) 62%); }
.adam-sec.c2 .adam-sec-head{ border-left-color:var(--cat-2); background:linear-gradient(90deg,var(--cat-2-bg),var(--section-bg) 62%); }
.adam-sec.c3 .adam-sec-head{ border-left-color:var(--cat-3); background:linear-gradient(90deg,var(--cat-3-bg),var(--section-bg) 62%); }

/* ---- Home: one tint per therapeutic area (three areas, three slots) ---- */
.hm-area.a1 .hm-area-head{ background:linear-gradient(92deg,var(--cat-1-bg),var(--white) 55%); }
.hm-area.a2 .hm-area-head{ background:linear-gradient(92deg,var(--cat-2-bg),var(--white) 55%); }
.hm-area.a3 .hm-area-head{ background:linear-gradient(92deg,var(--cat-3-bg),var(--white) 55%); }
.hm-area.a1{ box-shadow:inset 3px 0 0 var(--cat-1), 0 1px 2px rgba(23,43,77,0.04), 0 8px 24px rgba(23,43,77,0.04); }
.hm-area.a2{ box-shadow:inset 3px 0 0 var(--cat-2), 0 1px 2px rgba(23,43,77,0.04), 0 8px 24px rgba(23,43,77,0.04); }
.hm-area.a3{ box-shadow:inset 3px 0 0 var(--cat-3), 0 1px 2px rgba(23,43,77,0.04), 0 8px 24px rgba(23,43,77,0.04); }
.hm-area.a1 .hm-mol-name{ color:var(--cat-1-ink); }
.hm-area.a2 .hm-mol-name{ color:var(--cat-2-ink); }
.hm-area.a3 .hm-mol-name{ color:var(--cat-3-ink); }

/* ---- Surface tints: warmth without new accents ---- */
.sh-nav{ background:linear-gradient(180deg,var(--tint-cool),var(--white) 30%); }
.ms-card > .ms-head{ margin:-28px -32px 22px; padding:26px 32px 20px;
  background:linear-gradient(180deg,var(--tint-cool),transparent);
  border-bottom:1px solid var(--stroke); border-radius:20px 20px 0 0; }
.index-head{ background:linear-gradient(180deg,var(--tint-mint),transparent); }
.au-day .d{ color:var(--cat-1-ink); }
/* the review's section headings get a cool wash instead of flat grey */
.sec-head{ background:linear-gradient(92deg,var(--tint-cool),var(--section-bg) 60%); }
.sdtm-grp td{ background:linear-gradient(92deg,var(--tint-lilac),var(--section-bg) 55%) !important; }

/* The ADaM tab reuses the SDTM shell, which styles its strip as an ISSUE bar —
   red, because on SDTM those counts are conformance problems. On ADaM the same
   strip reports derived-variable and record counts, which are neutral facts, so
   it takes a cool surface instead. Red here would have said "problem" about
   ordinary metadata. */
#adamIssueBar{ background:linear-gradient(92deg,var(--cat-1-bg),var(--tint-cool) 70%);
  border-color:var(--cat-1-line); }
#adamIssueBar .sdtm-issue-title{ color:var(--cat-1-ink); }
#adamIssueBar .sdtm-issue-pill{ color:var(--cat-3-ink); background:var(--cat-3-bg);
  border-color:var(--cat-3-line); }
#adamIssueBar .sdtm-issue-untraced{ color:var(--cat-1-ink); background:var(--cat-1-bg);
  border-color:var(--cat-1-line); }

/* ============================================================
   ICF TAB — the consent form, section by section.

   Layout mirrors the SOA tab: a main column with a sticky detail
   drawer on the right, opened by clicking a section. Colours come
   from the severity set already defined in :root — a consent gap
   is the same kind of finding as any other, so it must not invent
   a new palette. `missing` uses the critical tokens because an
   absent required element is the more serious of the two states:
   nothing on screen looks wrong, which is exactly the problem.
   ============================================================ */
.icf-wrap{ display:flex; gap:16px; align-items:flex-start; }
.icf-main{ flex:1 1 auto; min-width:0; }

.icf-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:14px; }
.icf-title{ font-size:20px; font-weight:700; color:var(--title); line-height:27px; margin:0; }
.icf-sub{ font-size:13px; line-height:19px; color:var(--text-light); margin:5px 0 0; max-width:70ch; }
.icf-head-right{ flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; gap:5px; }
.icf-meta-l{ font-size:12px; color:var(--text-light); }
.icf-meta-v{ font-size:13px; font-weight:600; color:var(--text-dark); }

/* summary strip — one figure per state, and the reading grade */
.icf-strip{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.icf-stat{ flex:1 1 150px; min-width:0; background:#fff; border:1px solid var(--stroke); border-radius:12px; padding:12px 14px; }
.icf-stat .n{ font-size:22px; font-weight:700; color:var(--title); line-height:26px; }
.icf-stat .l{ font-size:12px; color:var(--text-light); margin-top:2px; }
.icf-stat.crit .n{ color:var(--sev-crit); }
.icf-stat.gap .n{ color:var(--sev-minor); }
.icf-stat.ok .n{ color:var(--sev-adv); }

.icf-cols{ display:flex; gap:16px; align-items:flex-start; }
.icf-doc{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:10px; }
.icf-side{ flex:0 0 268px; display:flex; flex-direction:column; gap:12px; position:sticky; top:14px; }

/* one consent section */
.icf-sec{ background:#fff; border:1px solid var(--stroke); border-radius:12px; padding:15px 17px; cursor:pointer;
  transition:border-color .12s, box-shadow .12s; }
.icf-sec:hover{ border-color:#cfd6e4; box-shadow:0 1px 3px rgba(13,33,55,0.06); }
.icf-sec.selected{ border-color:var(--green); box-shadow:0 0 0 1px var(--green); }
.icf-sec-top{ display:flex; align-items:flex-start; gap:10px; }
.icf-sec-name{ font-size:14.5px; font-weight:700; color:var(--title); line-height:20px; flex:1 1 auto; min-width:0; }
.icf-sec-el{ font-size:11.5px; line-height:17px; color:var(--text-light); margin-top:3px; }
.icf-sec-text{ font-size:13.5px; line-height:21px; color:var(--text-dark); margin-top:9px; }
.icf-sec-empty{ font-size:13.5px; line-height:21px; color:var(--sev-crit); font-style:italic; margin-top:9px; }
.icf-sec-foot{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:11px; }

.icf-badge{ flex:0 0 auto; display:inline-flex; align-items:center; gap:5px; border-radius:var(--pill);
  padding:3px 10px; font-size:11.5px; font-weight:700; letter-spacing:0.2px; border:1px solid transparent; }
.icf-badge.aligned{ color:var(--sev-adv); background:var(--sev-adv-bg); border-color:var(--sev-adv-line); }
.icf-badge.gap{ color:var(--sev-minor); background:var(--sev-minor-bg); border-color:var(--sev-minor-line); }
.icf-badge.missing{ color:var(--sev-crit); background:var(--sev-crit-bg); border-color:var(--sev-crit-line); }

/* trace back to the protocol element this section is derived from */
.icf-src{ display:inline-flex; align-items:center; gap:5px; border:1px solid var(--stroke); background:var(--tint-cool);
  border-radius:7px; padding:3px 9px; font-size:11.5px; color:var(--cat-1-ink); font-weight:600; cursor:pointer; }
.icf-src:hover{ border-color:var(--cat-1-line); }
.icf-src svg{ width:12px; height:12px; }
.icf-src.none{ color:var(--text-light); background:#f7f8fb; cursor:default; font-weight:500; }
.icf-fcount{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:600; color:var(--sev-minor); }
.icf-fcount svg{ width:13px; height:13px; }

/* side cards — reading level and language versions */
.icf-card{ background:#fff; border:1px solid var(--stroke); border-radius:12px; overflow:hidden; }
.icf-card-h{ background:#f7f9fa; border-bottom:1px solid #eef1f4; padding:10px 14px; font-size:12px; font-weight:700;
  letter-spacing:0.4px; color:#7a879a; }
.icf-card-b{ padding:13px 14px; }
.icf-read-n{ font-size:26px; font-weight:700; color:var(--sev-minor); line-height:30px; }
.icf-read-t{ font-size:12px; color:var(--text-light); margin-top:1px; }
.icf-read-bar{ height:6px; border-radius:4px; background:#eef1f6; margin:11px 0 7px; overflow:hidden; }
.icf-read-bar i{ display:block; height:100%; border-radius:4px; background:var(--sev-minor); }
.icf-read-note{ font-size:12px; line-height:18px; color:var(--text-light); }
.icf-lang{ display:flex; align-items:center; gap:9px; padding:7px 0; border-top:1px solid #f1f3f7; }
.icf-lang:first-child{ border-top:none; padding-top:0; }
.icf-lang-n{ font-size:13px; font-weight:600; color:var(--text-dark); flex:1 1 auto; min-width:0; }
.icf-lang-r{ font-size:11px; color:var(--text-light); display:block; font-weight:400; }
.icf-dot{ width:8px; height:8px; border-radius:50%; flex:0 0 8px; }
.icf-dot.current{ background:var(--sev-adv); }
.icf-dot.in-translation{ background:var(--sev-minor); }
.icf-dot.not-started{ background:var(--sev-crit); }

/* detail drawer — same geometry as the SOA drawer */
.icf-detail{ display:none; flex:0 0 0; width:0; border:1px solid var(--stroke); border-radius:16px; background:#fff;
  overflow:hidden; flex-direction:column; align-self:flex-start; position:sticky; top:14px; max-height:calc(100vh - 32px); }
.icf-wrap.detail-open .icf-detail{ display:flex; flex:0 0 560px; width:560px; }
.icf-detail-head{ flex:0 0 auto; padding:18px 20px 14px; display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.icf-detail-t{ font-size:17px; font-weight:700; color:var(--title); line-height:23px; }
.icf-detail-s{ font-size:12.5px; color:var(--text-light); margin-top:3px; }
.icf-detail-close{ flex:0 0 30px; width:30px; height:30px; border-radius:50%; border:1px solid var(--stroke);
  background:#fff; color:var(--text-light); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.icf-detail-close:hover{ background:#f4f5fb; } .icf-detail-close svg{ width:14px; height:14px; }
.icf-detail-body{ flex:1 1 auto; min-height:0; padding:0 20px 20px; display:flex; flex-direction:column; gap:16px; overflow-y:auto; }
.icf-detail-body > *{ flex:0 0 auto; }

/* Evidence locator that is a real link. `.ev-page` already carried the link
   affordance for the span version, so the anchor only has to stop a global
   colour rule winning and add the external-link glyph's sizing. */
a.ev-page{ color:var(--teal); text-decoration:underline; }
a.ev-page:hover{ color:var(--forest); }
.ev-page svg.ev-out{ width:11px; height:11px; margin-left:1px; opacity:.75; }

/* Source tag in the evidence overlay's Suggestion card head. Pushed right the
   same way `.per` is, so it reads as metadata about the card rather than part
   of its label. */
.ev-card-head .ev-tag{ margin-left:auto; }

/* Why it Matters may run to more than one paragraph. Set via textContent, so
   the newlines only survive with pre-line. */
#evWhy{ white-space: pre-line; }

/* ==========================================================================
   CONCEPTS TAB — Biomedical Concept per procedure, the variable set the
   standard mandates for it, and a computed grade against the study's SDTM.
   Follows the SDTM tab's shape: a head strip, then rail + body.
   ========================================================================== */
.cn-panel{ display:none; flex-direction:column; gap:0; }
.cn-panel.show{ display:flex; }

/* ---- head: provenance + scorecard ---- */
.cn-head{ background:var(--white); border:1px solid var(--stroke); border-radius:12px;
  padding:18px 20px 16px; margin-bottom:16px; }
.cn-head-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.cn-head-txt .t{ font-size:17px; font-weight:800; color:var(--title); }
.cn-head-txt .s{ font-size:12.5px; color:var(--text-light); margin-top:4px; max-width:62ch; line-height:18px; }
.cn-lib{ display:flex; align-items:flex-start; gap:9px; background:#f7f9fb; border-radius:10px;
  padding:10px 13px; flex:none; max-width:340px; }
.cn-lib svg{ width:17px; height:17px; color:#8b97aa; flex:none; margin-top:1px; }
.cn-lib-txt b{ display:block; font-size:12.5px; font-weight:700; color:var(--title); }
.cn-lib-txt i{ display:block; font-style:normal; font-size:11.5px; color:var(--text-light);
  line-height:16px; margin-top:2px; }
.cn-score{ display:flex; gap:10px; margin-top:16px; flex-wrap:wrap; }
.cn-tile{ flex:1 1 150px; background:#fcfcfe; border:1px solid var(--stroke); border-radius:10px;
  padding:11px 13px; display:flex; flex-direction:column; gap:3px; }
.cn-tile .n{ font-size:22px; font-weight:800; color:var(--title); line-height:1; }
.cn-tile .l{ font-size:11px; color:var(--text-light); line-height:15px; }
.cn-tile.ok .n{ color:#0d8a5f; }
.cn-tile.bad .n{ color:var(--sev-crit); }
/* a decline is not a failure — it reads as information, not alarm */
.cn-tile.declined{ background:rgba(255,176,32,0.06); border-color:rgba(255,176,32,0.3); }
.cn-tile.declined .n{ color:#a86a00; }
.cn-tile.muted .n{ color:#9aa3b6; }
.cn-note{ margin-top:13px; font-size:11.5px; color:var(--text-light); line-height:17px;
  border-top:1px solid #f1f3f8; padding-top:11px; }

/* ---- rail + body ---- */
.cn-wrap{ display:grid; grid-template-columns:288px minmax(0,1fr); gap:16px; align-items:start; }
.cn-rail{ background:var(--white); border:1px solid var(--stroke); border-radius:12px;
  padding:8px; display:flex; flex-direction:column; gap:2px; max-height:1100px; overflow-y:auto; }
.cn-rail-h{ font-size:10.5px; font-weight:800; letter-spacing:0.7px; text-transform:uppercase;
  color:#9aa3b6; padding:12px 10px 6px; display:flex; align-items:center; gap:7px; }
.cn-rail-h .n{ background:#f2f4fa; border-radius:20px; padding:1px 7px; font-size:10.5px; letter-spacing:0; }
.cn-rail-item{ width:100%; text-align:left; background:none; border:none; font-family:inherit;
  border-radius:9px; padding:9px 11px; cursor:pointer; display:flex; flex-direction:column; gap:2px;
  border-left:3px solid transparent; }
.cn-rail-item:hover{ background:#f7f9fb; }
.cn-rail-item.active{ background:rgba(46,232,158,0.09); border-left-color:var(--green); }
.cn-rail-item .nm{ font-size:13px; font-weight:700; color:var(--title); }
.cn-rail-item .sb{ font-size:11px; color:var(--text-light); line-height:15px; }
.cn-rail-item.declined .nm{ color:#a86a00; }
.cn-rail-item.outofscope .nm{ font-weight:600; color:#7a879a; }
.cn-body{ display:flex; flex-direction:column; gap:16px; min-width:0; }

/* ---- the selected procedure ---- */
.cn-proc-h{ display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:0 2px 2px; flex-wrap:wrap; }
.cn-proc-h .nm{ font-size:16px; font-weight:800; color:var(--title); }
.cn-proc-h .st{ font-size:11px; font-weight:800; letter-spacing:0.5px; border-radius:20px; padding:3px 10px; }
.cn-proc-h .st.resolved{ background:rgba(46,232,158,0.16); color:#0d8a5f; }
.cn-proc-h .st.declined{ background:rgba(255,176,32,0.16); color:#a86a00; }
.cn-proc-h .st.outofscope{ background:#f2f4fa; color:#7a879a; }

.cn-card{ background:var(--white); border:1px solid var(--stroke); border-radius:12px; overflow:hidden; }
.cn-card.declined{ border-color:rgba(255,176,32,0.4); }
.cn-card-head{ background:#f7f9fa; border-bottom:1px solid #eef1f4; padding:12px 16px;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.cn-card-head.declined{ background:rgba(255,176,32,0.07); border-bottom-color:rgba(255,176,32,0.2); }
.cn-card-head.declined svg{ width:17px; height:17px; color:#a86a00; }
.cn-bcid{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px; font-weight:700;
  background:var(--brand-ink); color:#fff; border-radius:6px; padding:3px 8px; }
.cn-bcname{ font-size:14px; font-weight:800; color:var(--title); }
.cn-bcdom{ margin-left:auto; font-size:11.5px; font-weight:700; color:#7a879a;
  background:#eef1f6; border-radius:20px; padding:3px 10px; }
.cn-nomv{ margin-left:auto; font-size:10.5px; font-weight:800; letter-spacing:0.6px;
  background:#a86a00; color:#fff; border-radius:5px; padding:3px 8px; }
.cn-card-body{ padding:15px 16px 17px; display:flex; flex-direction:column; gap:11px; }
.cn-def{ font-size:13.5px; line-height:20px; color:var(--text-dark); }
.cn-text{ font-size:13.5px; line-height:20px; color:var(--text-dark); }
.cn-text.muted{ color:var(--text-light); font-size:12.5px; }
.cn-kv{ display:grid; grid-template-columns:118px minmax(0,1fr); gap:12px; align-items:start; }
.cn-kv .k{ font-size:10.5px; font-weight:800; letter-spacing:0.6px; text-transform:uppercase;
  color:#9aa3b6; padding-top:2px; }
.cn-kv .v{ font-size:12.5px; line-height:18px; color:var(--text-dark); }
.cn-why{ background:#f7f9fb; border-radius:10px; padding:12px 14px; font-size:12.5px;
  line-height:19px; color:var(--text-dark); }
.cn-why .h{ display:block; font-size:10.5px; font-weight:800; letter-spacing:0.6px;
  text-transform:uppercase; color:#8b97aa; margin-bottom:5px; }
.cn-why.weight{ background:rgba(255,176,32,0.07); }
.cn-rejected{ border:1px dashed rgba(255,176,32,0.5); border-radius:10px; padding:12px 14px;
  background:rgba(255,176,32,0.04); }
.cn-rejected .h{ display:block; font-size:10.5px; font-weight:800; letter-spacing:0.6px;
  text-transform:uppercase; color:#a86a00; margin-bottom:7px; }
.cn-rejected .rj{ display:flex; align-items:center; gap:9px; }
.cn-rejected .rj .id{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px;
  font-weight:700; color:#7a879a; background:#eef1f6; border-radius:5px; padding:2px 7px;
  text-decoration:line-through; }
.cn-rejected .rj .nm{ font-size:13px; font-weight:700; color:var(--title); }
.cn-rejected .wy{ font-size:12.5px; line-height:19px; color:var(--text-dark); margin-top:7px; }

/* ---- the derived answer key ---- */
.cn-sub{ padding:12px 16px 10px; border-top:1px solid #f1f3f8; display:flex; align-items:baseline;
  gap:10px; font-size:13px; font-weight:800; color:var(--title); flex-wrap:wrap; }
.cn-sub .n{ font-size:11px; font-weight:700; color:#8b97aa; }
.cn-tblwrap{ overflow-x:auto; }
table.cn-tbl{ width:100%; border-collapse:collapse; }
table.cn-tbl th{ text-align:left; font-size:10.5px; font-weight:800; letter-spacing:0.6px;
  text-transform:uppercase; color:#9aa3b6; padding:8px 14px; border-bottom:1px solid var(--stroke);
  white-space:nowrap; }
table.cn-tbl td{ font-size:12.5px; color:var(--text-dark); padding:9px 14px;
  border-bottom:1px solid #f5f6fa; vertical-align:top; }
table.cn-tbl tr.fail td{ background:rgba(255,77,79,0.04); }
table.cn-tbl tr.perm td{ color:var(--text-light); }
table.cn-tbl .c-v code{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px;
  font-weight:700; color:var(--title); }
table.cn-tbl tr.perm .c-v code{ font-weight:600; color:#7a879a; }
table.cn-tbl .c-v em{ display:block; font-style:normal; font-size:10px; font-weight:700;
  letter-spacing:0.5px; text-transform:uppercase; color:#9aa3b6; margin-top:2px; }
table.cn-tbl code.sm{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11.5px;
  background:#f2f4fa; border-radius:4px; padding:1px 5px; color:#5c6880; }
table.cn-tbl .c-st{ white-space:nowrap; }
.cn-st{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700;
  border-radius:20px; padding:2px 9px; }
.cn-st svg{ width:12px; height:12px; }
.cn-st.ok{ background:rgba(46,232,158,0.16); color:#0d8a5f; }
.cn-st.bad{ background:var(--sev-crit-bg); color:var(--sev-crit); }
.cn-st.muted{ background:#f2f4fa; color:#9aa3b6; }

/* ---- the verdict, computed from the table above ---- */
.cn-verdict{ display:flex; align-items:center; gap:13px; padding:13px 16px;
  border-top:1px solid #f1f3f8; flex-wrap:wrap; }
.cn-verdict.pass{ background:rgba(46,232,158,0.06); }
.cn-verdict.fail{ background:rgba(255,77,79,0.05); }
.cn-verdict.gap{ background:rgba(255,176,32,0.07); }
.cn-verdict.none{ background:#f7f9fb; }
.cn-verdict .vb{ font-size:12.5px; font-weight:800; letter-spacing:0.8px; border-radius:6px;
  padding:4px 11px; flex:none; }
.cn-verdict.pass .vb{ background:#0d8a5f; color:#fff; }
.cn-verdict.fail .vb{ background:var(--sev-crit); color:#fff; }
.cn-verdict.gap .vb{ background:#a86a00; color:#fff; }
.cn-verdict.none .vb{ background:#8b97aa; color:#fff; }
.cn-verdict .vt{ font-size:13px; line-height:19px; color:var(--text-dark); flex:1 1 300px; }
.cn-verdict .vm{ font-size:11px; color:#9aa3b6; flex:1 1 100%; }

@media (max-width:1200px){
  .cn-wrap{ grid-template-columns:1fr; }
  .cn-rail{ max-height:none; }
}
/* a procedure the protocol does not schedule — grading it is the point, but the
   screen has to say so or the FAIL reads as sloppiness instead of the finding */
.cn-proposed{ margin-left:7px; font-size:9.5px; font-weight:800; letter-spacing:0.5px;
  text-transform:uppercase; color:#a86a00; background:rgba(255,176,32,0.16);
  border-radius:4px; padding:1px 5px; vertical-align:middle; }
/* the export filenames under the library chip */
.cn-lib-txt u{ display:block; text-decoration:none; font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:10.5px; color:#8b97aa; margin-top:3px; word-break:break-all; }

/* =============================================================================
   PROTOCOL AMENDMENT 2 — the checkbox strip attached to each affected finding,
   and what checking it does to that finding's row (assets/js/amendments.js).
   ============================================================================= */
/* .incl-list li.has-trace is a flex row (criterion text + trace badge side by
   side) — force the strip and any predicted-add box onto their own full-width
   line under it rather than squeezing in as a third flex item */
.incl-list li:has(.amend-strip){ flex-wrap:wrap; }
.incl-list li .amend-strip, .incl-list li .amend-add{ flex:1 1 100%; }

.amend-strip{ display:flex; align-items:flex-start; gap:10px; margin-top:8px; padding:8px 10px;
  border:1px dashed rgba(109,67,232,0.35); border-radius:10px; background:rgba(109,67,232,0.04); cursor:pointer; }
.amend-strip:hover{ background:rgba(109,67,232,0.09); }
.amend-strip .checkbox{ margin-top:2px; flex:none; }
.amend-strip-txt{ display:flex; flex-direction:column; gap:2px; flex:1 1 auto; min-width:0; }
.amend-strip-txt .ttl{ font-size:12.5px; font-weight:700; color:var(--text-dark); }
.amend-strip-txt .sum{ font-size:11.5px; line-height:16px; color:var(--text-light); }
.amend-strip-tag{ flex:none; font-size:9.5px; font-weight:800; letter-spacing:0.5px; text-transform:uppercase;
  border-radius:20px; padding:3px 8px; margin-top:1px; }
.amend-strip-tag.major{ background:rgba(217,83,79,0.1); color:var(--sev-crit); }
.amend-strip-tag.minor{ background:#f2f4fa; color:#8a93a6; }
.amend-removed-tag{ display:none; flex:none; font-size:9.5px; font-weight:800; letter-spacing:0.5px;
  text-transform:uppercase; border-radius:20px; padding:3px 8px; margin-top:1px; background:#e7e9f0; color:#6b7280; }
.amend-strip.checked .amend-removed-tag{ display:inline-flex; }

/* the finding this amendment resolves, once its box is checked — grey and
   out, but still legible; the strip itself stays at full opacity so the
   control that turned it grey doesn't disappear along with the finding */
.amend-removed{ background:#f5f6fa; border-radius:10px; padding:6px 8px; margin:2px 0; }
.amend-removed > :not(.amend-strip):not(.amend-add){ opacity:0.42; }

/* a new finding this amendment is predicted to raise — hidden until checked */
.amend-add{ display:none; margin-top:8px; padding:10px 12px; border-radius:10px;
  border:1px solid rgba(109,67,232,0.3); background:rgba(109,67,232,0.07); }
.amend-add.show{ display:flex; flex-direction:column; gap:3px; }
.amend-add-tag{ align-self:flex-start; font-size:9.5px; font-weight:800; letter-spacing:0.5px;
  text-transform:uppercase; color:#6d43e8; background:rgba(109,67,232,0.14); border-radius:20px; padding:3px 8px; }
.amend-add-ttl{ font-size:12.5px; font-weight:700; color:#4a2fa8; }
.amend-add-body{ font-size:11.5px; line-height:16px; color:#6d43e8; }

/* the header toggle */
#amendViewBtn.active{ color:#6d43e8; border-color:rgba(109,67,232,0.4); background:rgba(109,67,232,0.08); }

/* =============================================================================
   AMENDMENT VIEW — the per-tab filtered panel that stands in for a tab's real
   content while the global toggle is on (assets/js/amendment-view.js).
   ============================================================================= */
.amend-view-panel{ display:none; padding:22px 24px 30px; }
.amend-view-empty{ padding:40px 20px; text-align:center; color:var(--text-light); font-size:13.5px;
  border:1px dashed var(--stroke); border-radius:12px; }
.amend-view-h{ display:flex; flex-direction:column; gap:3px; margin-bottom:18px; padding-bottom:14px;
  border-bottom:1px solid var(--stroke); }
.amend-view-h .t{ font-size:16px; font-weight:800; color:var(--title); }
.amend-view-h .s{ font-size:12.5px; color:var(--text-light); }

.amend-view-group{ margin-bottom:18px; }
.amend-view-glabel{ display:flex; align-items:center; gap:8px; font-size:11px; font-weight:800;
  letter-spacing:0.6px; text-transform:uppercase; color:#9aa3b6; margin-bottom:10px; }
.amend-view-glabel .n{ background:#f2f4fa; border-radius:20px; padding:1px 8px; font-size:10.5px; color:#8a93a6; }

.amend-view-row{ display:grid; grid-template-columns:minmax(160px,260px) 1fr auto; gap:14px; align-items:center;
  padding:10px 14px; border-radius:10px; margin-bottom:6px; border-left:3px solid transparent; }
.amend-view-row .ref{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11.5px;
  font-weight:600; color:var(--text-dark); word-break:break-word; }
.amend-view-row .lbl{ font-size:12.5px; line-height:18px; color:var(--text-dark); }
.amend-view-row .src{ font-size:10.5px; font-style:italic; color:#9aa3b6; text-align:right; white-space:nowrap; }

.amend-view-row.removed{ background:#f5f6fa; border-left-color:#8a93a6; }
.amend-view-row.removed .ref{ text-decoration:line-through; opacity:0.65; }
.amend-view-group.removed .amend-view-glabel{ color:#8a93a6; }

.amend-view-row.modified{ background:rgba(202,138,4,0.06); border-left-color:var(--y600); }
.amend-view-group.modified .amend-view-glabel{ color:var(--y600); }

.amend-view-row.added{ background:rgba(109,67,232,0.06); border-left-color:#6d43e8; }
.amend-view-group.added .amend-view-glabel{ color:#6d43e8; }

@media (max-width: 860px){
  .amend-view-row{ grid-template-columns:1fr; gap:4px; }
  .amend-view-row .src{ text-align:left; }
}
