/*
 * ================================================================
 *  BENTO SWISS - Design Language Layer
 *  Climate Change Duties Platform - Argyll & Bute Council
 * ================================================================
 *
 *  Loads AFTER civic-swiss.css. Contains all Bento Swiss additions:
 *  handle geometry, channel tokens, shuffle animations, the .cbs-*
 *  vocabulary, .comp-* composition layer, workbench tabs,
 *  provenance strip/panel, and demo mode.
 *
 *  FILE STRUCTURE
 *  -- 01. BENTO TOKENS           Handle, shuffle, channel tokens
 *  -- 02. CIVIC BENTO SWISS      .cbs-* vocabulary
 *  -- 03. COMPOSITION COMPONENTS .comp-* shared components
 *  -- 04. WORKBENCH TABS         .wb-* tab bar + question list
 *  -- 05. PROVENANCE STRIP       Evidence card header + slide-in panel
 *  -- 06. DEMO MODE              View-only lock
 *
 *  v1.0 - May 2026 (extracted from civic-swiss.css v2.0)
 * ================================================================
 */


/* ==============================================================
   01. BENTO TOKENS
   Handle geometry, shuffle animations, channel identity.
   Defined on :root so they cascade into civic-swiss.css rules
   that reference them (e.g. .panel--stripe).
   ============================================================== */

:root {

  /* -- Handle geometry ----------------------------------------- */
  /*  Handles are the inset accent bars that identify card type
      and carry colour meaning. Three thickness tiers:

        --handle-thin  (2px)  Inner/nested accent lines
        --handle-std   (4px)  Standard left bars
        --handle-bold  (6px)  Top stripes, primary card identity

      Two inset dials (independent):
        --handle-inset-h   Top stripe clearance from card edges
        --handle-inset-v   Left bar clearance from card top/bottom     */
  --handle-thin:     2px;
  --handle-std:      4px;
  --handle-bold:     6px;
  --handle-inset-h:  28px;   /* Top stripe - generous clearance */
  --handle-inset-v:  12px;   /* Left bar   - tighter on small cards */

  /* -- Bento Shuffle animations -------------------------------- */
  /*  Hard offset shadow (no blur) + physical lift on hover.
      Two tiers: full (larger tiles) and mini (dense list cards).
      Shadow colour uses --surface3 so it adapts to both themes.  */
  --shadow-tile:            4px 5px 0 var(--surface3);
  --shadow-tile-hover:      6px 7px 0 var(--surface3);
  --shadow-tile-mini:       2px 3px 0 var(--surface3);
  --shadow-tile-mini-hover: 4px 5px 0 var(--surface3);

  /* -- Evidence channel identity tokens ------------------------ */
  /*  Single point of control for evidence channel colours.
      Reference these in compliance.css handle overrides, not the
      brand constants directly - so a palette change propagates.

      ADR-0024 colour domain separation (May 2026):
        Violet  #5C3D78  - committee/institutional pipeline (CCIR, sweep, source)
        Heather #B89BCC  - performance/reporting pipeline (PBCCD)
        Neutral           - officer assessment (no handle, dashed border)
      Icons are the primary differentiator within the violet group.
      Exemplar uses --ch-sweep colour + double-handle CSS treatment. */
  --ch-ccir:    #5C3D78;             /* violet - statutory/institutional   */
  --ch-pbccd:   #B89BCC;             /* heather - performance-assessed     */
  --ch-sweep:   #5C3D78;             /* violet - AI analytical findings    */
  --ch-officer: transparent;         /* no stripe - dashed border instead  */
  --ch-source:  #5C3D78;             /* violet - elevated via card tint    */
}


/* ==============================================================
   02. CIVIC BENTO SWISS - Shared unification vocabulary
   ==============================================================
   Components introduced to cascade the lobby / dashboard grammar
   across every tool page. Existing .panel / .kpi-card / .chart-card
   remain valid - these are additive, not a replacement.

   Vocabulary:
     .cbs-header     Eyebrow + title + lead + rule page opener
     .cbs-strip      Full-width cell context / status bar
     .cbs-card       Bento chassis (4px radius, offset shadow, lift)
     .cbs-card.cbs-handled  Adds inset vertical handle on left edge
     .cbs-section-label  ALL CAPS label with trailing horizontal rule
     .cbs-door       Prefix rule + DOOR NN + multi-line heavy title
     .cbs-zone-*     Zone colour accents (teal / charcoal / red / amber)

   Defaults to lobby teal; zone modifiers override via --cbs-accent.
   ============================================================== */

:root {
  --cbs-radius: var(--tile-radius);
  --cbs-shadow: var(--shadow-tile);
  --cbs-shadow-hover: var(--shadow-tile-hover);
  --cbs-accent: var(--primary);
}

/*
 * ── CANONICAL TYPOGRAPHY VOCABULARY ─────────────────────────────
 *
 *  Eight classes cover the entire platform. Add no new font-size /
 *  font-weight / color declarations in page CSS. If a new need
 *  arises, add a variant here so the change propagates everywhere.
 *
 *  .cbs-eyebrow        10px 700 UC 0.1em   labels, categories
 *  .cbs-card-title     14px 700            card headings (collapsed)
 *  .cbs-body           14px 400 lh1.5      all content / body text
 *  .cbs-body--muted    12px text-m         secondary / metadata
 *  .cbs-subhead        18px 300 text-m     page sub-heading (after title)
 *  .cbs-highlight      left border + bg    callout panel (--highlight-accent)
 *  .cbs-quote          12px italic border  inline quote / aside block
 *  .cbs-cite           10px mono text-f    legal basis, source refs
 *
 *  Merge targets (replace as each page is touched):
 *    → .cbs-eyebrow      .sidebar-label .kpi-label .filter-label
 *                        .legend-col-title .ev-band-label .item-num
 *                        .qf-label .sec-label .pbs-code .ev-form-label
 *    → .cbs-body         .ev-finding .ev-finding-obs .comp-notes
 *                        .rwc-card-summary .gp-observation .q-question
 *                        .cell-preview .comp-evidence-item .door-desc
 *                        .dev-desc .clinic-desc .ingest-instructions
 *    → .cbs-body--muted  .rating-text .legend-item .sc-row-label
 *                        .rwc-lane-desc
 *    → .cbs-highlight    .sig-advice .sig-compliant-block .insight-banner
 *                        .sig-had-advice (--highlight-accent: var(--red))
 *    → .cbs-quote        .reg-guidance-quote .sig-had-advice text
 *    → .cbs-cite         .sig-basis .reg-guidance-quote cite
 *
 *  Deprecated aliases below (kept so existing HTML doesn't break):
 *    .cbs-meta           → .cbs-body--muted
 *    .cbs-lead           → .cbs-body--muted
 *    .ob-paraphrase-text → .cbs-body
 * ───────────────────────────────────────────────────────────────
 */

/* -- Page header (eyebrow + title + lead + rule) ------------- */
.cbs-header {
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
  padding-bottom: var(--sp5);
  border-bottom: 1px solid var(--divider);
  margin-bottom: var(--sp2);
}
.cbs-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
  color: var(--text-m);
}
.cbs-title {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--text);
  max-width: 30ch;
}
.cbs-title .cbs-accent {
  color: var(--cbs-accent);
}
/* Sub-heading: explainer paragraph below the h1. Narrow typeface + light weight
   creates a clear tonal step down from the heavy title. Max-width holds it at
   ~75% of content-max for visual breathing room. Single edit point for the
   whole platform. */
.cbs-subhead {
  font-family: var(--font-narrow);
  font-size: var(--text-md);   /* 16px */
  font-weight: 300;
  color: var(--text-f);
  line-height: 1.45;
  letter-spacing: 0;
  max-width: 75%;
}
.cbs-lead {
  font-size: var(--text-sm);
  color: var(--text-m);
  max-width: 65ch;
  line-height: 1.5;
}

/* -- Fade recipe (large chassis only) -------------------------
   Subtle tinted background + inset accent rule at the bottom.
   Apply to panels, lane heads, hero strips - NEVER to badges,
   chart strokes, pills, or anything under ~200px wide.
   Set --fade-accent on the element to control the rule colour. */
.cbs-fade {
  position: relative;
  background: color-mix(in srgb, var(--fade-accent, var(--primary)) 6%, var(--surface));
}
.cbs-fade::after {
  content: '';
  position: absolute;
  bottom: 0; left: var(--handle-inset-h); right: var(--handle-inset-h);
  height: var(--handle-thin);
  background: color-mix(in srgb, var(--fade-accent, var(--primary)) 25%, transparent);
  border-radius: var(--tile-radius);
}

/* -- Context / status strip (full-width cell row) ------------ */
.cbs-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1px;
  background: var(--divider);
  border: 1px solid var(--divider);
  border-radius: var(--cbs-radius);
  overflow: hidden;
}
.cbs-strip.cbs-strip--loud {
  background: var(--cbs-accent);
  border-color: var(--cbs-accent);
}
.cbs-strip-cell {
  background: var(--surface);
  padding: var(--sp4) var(--sp5);
  display: flex;
  flex-direction: column;
  gap: var(--sp1);
  min-width: 0;
}
.cbs-strip--loud .cbs-strip-cell {
  background: var(--cbs-accent);
  color: #fff;
}
.cbs-strip-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cbs-strip--loud .cbs-strip-label {
  color: rgba(255, 255, 255, 0.75);
}
.cbs-strip-value {
  font-size: var(--text-base);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
  line-height: 1.2;
}
.cbs-strip--loud .cbs-strip-value {
  color: #fff;
}

/* -- Bento card chassis -------------------------------------- */
.cbs-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--cbs-radius);
  padding: var(--sp5);
  box-shadow: var(--cbs-shadow);
  transition: transform var(--trans), box-shadow var(--trans);
}
.cbs-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--cbs-shadow-hover);
}
.cbs-card.cbs-card--static:hover {
  transform: none;
  box-shadow: var(--cbs-shadow);
}

/* Handle detail - inset vertical bar, card corners curve past it */
.cbs-card.cbs-handled {
  padding-left: calc(var(--sp5) + var(--handle-std) + 4px);
}
.cbs-card.cbs-handled::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--handle-inset-v);
  bottom: var(--handle-inset-v);
  width: var(--handle-std);
  background: var(--cbs-accent);
  border-radius: 0;
}

/* Dotted top border for in-development / lower fidelity cards */
.cbs-card.cbs-card--dev {
  border-top: 3px dashed var(--border);
  opacity: 0.82;
}

/* ==============================================================
   02b. OBLIGATION CARD CHASSIS (.cb-card)
   ==============================================================
   Unified collapsed-card anatomy for obligation cards across
   the Compliance Tracker, Obligations Register, and Review Log.
   Replaces the duplicated .comp-card / .ob-card patterns.

   Structure:
     .cb-card                   Outer card (top handle, mini shuffle)
       .cb-head                 Collapsed header (flex row)
         .cb-id                 ID column (left gutter, own column)
         .cb-body               Content column (flex: 1)
           .cbs-eyebrow         Section label (Governance, Emissions...)
           .cbs-card-title      Full obligation title
           .cb-meta             Metadata zone (slots below title)
         .cb-chevron            Expand/collapse arrow
       .cb-detail               Expanded content (hidden until .open)

   Set --cb-accent on the card element to control handle colour.
   ============================================================== */

/* -- Card chassis ------------------------------------------- */
.cb-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--tile-radius);
  cursor: pointer;
  transition: box-shadow var(--trans), border-color var(--trans), transform var(--trans);
  user-select: none;
  margin-bottom: var(--card-gap);
  scroll-margin-top: var(--sp8);
  padding: calc(var(--sp4) + 4px) var(--sp5) var(--sp4);
  box-shadow: var(--shadow-tile-mini);
}
/* Top handle stripe */
.cb-card::before {
  content: '';
  position: absolute;
  top: 0; left: var(--handle-inset-h); right: var(--handle-inset-h);
  height: var(--handle-bold);
  border-radius: var(--tile-radius);
  background: var(--cb-accent, var(--primary));
}
/* Hover: mini shuffle lift */
.cb-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-tile-mini-hover);
  border-color: var(--primary);
  z-index: 2;
}
/* Open state: retain accent border, suppress whole-card lift */
.cb-card.open {
  box-shadow: var(--shadow-tile-mini-hover);
  border-color: var(--cb-accent, var(--primary));
}
.cb-card.open:hover { transform: none; }
.cb-card.open .cb-head {
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background var(--trans);
}
.cb-card.open .cb-head:hover { background: var(--surface3); }
/* Inspector-active state: subtle highlight on the inspected card */
.cb-card.inspector-active {
  border-color: var(--cb-accent, var(--primary));
  background: color-mix(in srgb, var(--cb-accent, var(--primary)) 4%, var(--surface));
}

/* -- Card head (collapsed row) ------------------------------ */
.cb-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp4);
}

/* -- ID column (fixed-width left gutter) -------------------- */
.cb-id {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-xs);
  color: var(--cb-accent, var(--primary));
  letter-spacing: .08em;
  flex-shrink: 0;
  min-width: 28px;
  white-space: nowrap;
  padding-top: 1px;
}
/* Clickable ID (deep-link to other views) */
.cb-id-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: var(--tile-radius);
  transition: background var(--trans);
}
.cb-id-link:hover {
  background: color-mix(in srgb, var(--cb-accent, var(--primary)) 15%, var(--surface2));
}

/* -- Card body (content column, right of ID) ---------------- */
.cb-body { flex: 1; min-width: 0; }

/* -- Eyebrow (above title, inside .cb-body) ----------------- */
.cb-body .cbs-eyebrow {
  color: var(--cb-accent, var(--primary));
  margin-bottom: 2px;
}

/* -- Title uses .cbs-card-title ----------------------------- */

/* -- Metadata zone (below title) ---------------------------- */
/*  Fixed slot order: effort | priority | status | quick-win | ... contextual
    Empty slots collapse invisibly. Pages choose which slots to populate. */
.cb-meta {
  --cb-meta-icon-size: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--sp3);
}
/* All SVG icons in the meta strip scale to the icon size variable */
.cb-meta svg { height: var(--cb-meta-icon-size); width: auto; display: block; }
/* Contextual items pushed right */
.cb-meta-right {
  margin-left: auto;
  display: flex;
  gap: var(--sp4);
  align-items: center;
}

/* -- Chevron ------------------------------------------------ */
.cb-chevron {
  color: var(--text-f);
  flex-shrink: 0;
  transition: transform .2s ease;
}
.cb-card.open .cb-chevron { transform: rotate(180deg); }

/* -- Inspector trigger button (card header) ----------------- */
.cb-inspect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--tile-radius, 4px);
  background: transparent;
  color: var(--text-f);
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  padding: 0;
}
.cb-inspect-btn:hover {
  color: var(--cb-accent, var(--primary));
  border-color: var(--cb-accent, var(--primary));
  background: color-mix(in srgb, var(--cb-accent, var(--primary)) 8%, transparent);
}
.cb-card.inspector-active .cb-inspect-btn {
  color: var(--cb-accent, var(--primary));
  border-color: var(--cb-accent, var(--primary));
  background: color-mix(in srgb, var(--cb-accent, var(--primary)) 12%, transparent);
}

/* -- Detail (expanded content) ------------------------------ */
.cb-detail {
  display: none;
  margin-top: var(--sp4);
  padding-top: var(--sp3);
  border-top: 1px solid var(--divider);
}
.cb-card.open .cb-detail { display: block; cursor: default; user-select: auto; }

/* -- Detail shared sub-components --------------------------- */
.cb-detail-label {
  font-weight: 700;
  font-size: 10px;
  color: var(--text-f);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: var(--sp2);
}
.cb-detail-section { margin-bottom: var(--sp3); }
.cb-nav-back { margin-bottom: var(--sp3); }
.cb-nav-back a,
.cb-nav-back button {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0; border: none; border-radius: 0; background: none;
  color: var(--primary); font-family: var(--font-body);
  font-size: var(--text-xs); font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.cb-nav-back a:hover,
.cb-nav-back button:hover { text-decoration: underline; }


/* -- Section label (ALL CAPS + trailing rule) --------------- */
.cbs-section-label {
  display: flex;
  align-items: center;
  gap: var(--sp4);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-m);
  margin-bottom: var(--sp3);
}
.cbs-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--divider);
}

/* -- Door tile (prefix rule + DOOR NN + heavy stacked title) */
.cbs-door {
  display: block;
  text-decoration: none;
  color: inherit;
}
.cbs-door-num {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cbs-accent);
  margin-bottom: var(--sp4);
}
.cbs-door-num::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--cbs-accent);
}
.cbs-door-title {
  font-size: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* -- Zone colour modifiers ----------------------------------- */
.cbs-zone-teal     { --cbs-accent: var(--brand-teal); }
.cbs-zone-charcoal { --cbs-accent: var(--brand-charcoal); }
.cbs-zone-red      { --cbs-accent: var(--brand-red); }
.cbs-zone-amber    { --cbs-accent: var(--brand-amber); }

/* -- Layout utilities (Session 4 - centralising inline styles) -- */
.page-wrap {
  max-width: var(--content-max);
  display: flex;
  flex-direction: column;
  gap: var(--sp5);
}
.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp4);
}
.pill-flow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ==============================================================
   03. COMPOSITION COMPONENTS - Shared reusable composition layer
   ==============================================================
   Five .comp-* classes used across PBCCD Workbench, Signals,
   and Compliance Tracker. Each component uses --comp-accent
   (defaults to --primary) so consumers can theme per-context.

   1. .comp-thread       - Thread card (mini bento, inset handle)
   2. .comp-theme-group  - Collapsible theme container
   3. .comp-toggle       - Include/Exclude officer toggle
   4. .comp-editor       - Composition editor with provenance
   5. .comp-ai-btn       - AI synthesis stub button
   ============================================================== */

:root {
  --comp-accent: var(--primary);
}

/* -- 1. Thread Card ----------------------------------------- */

.comp-thread {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--tile-radius);
  padding: var(--sp4);
  padding-left: calc(var(--sp4) + 10px);
  box-shadow: var(--shadow-tile-mini);
  transition: transform var(--trans), box-shadow var(--trans);
}

.comp-thread::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--handle-inset-v);
  bottom: var(--handle-inset-v);
  width: var(--handle-std);
  background: var(--comp-accent, var(--primary));
  border-radius: var(--tile-radius);
}

.comp-thread:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-tile-mini-hover);
}

.comp-thread + .comp-thread {
  margin-top: var(--card-gap);
}

.comp-thread-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp2);
}

.comp-thread-date {
  font-size: 10px;
  color: var(--text-f);
  font-weight: 400;
}

/* .cbs-eyebrow - canonical definition is earlier in this file. Duplicate removed. */

/* -- Canonical card title (site-wide) ----------------------- */
.cbs-card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: var(--sp2);
}

/* -- Canonical body text (site-wide) ------------------------ */
.cbs-body {
  font-family: var(--font-body);
  font-size: var(--text-sm);   /* 14px */
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
}
.cbs-body strong { color: var(--text); font-weight: 600; }

/* Body variant: subdued / secondary - smaller + muted colour */
.cbs-body--muted { font-size: var(--text-xs); color: var(--text-m); }

/* -- Highlight panel: left border + background tint --------- */
/*  The standard callout / aside container used across the
    review log, activity page, advice blocks, insight banners.
    Set --highlight-accent to control both border and tint:
      var(--primary)   teal    general / info (default)
      var(--green)     green   compliant / positive
      var(--amber)     amber   warning / partial
      var(--red)       red     gap / issue
      var(--gold)      gold    exemplar
      var(--divider)   grey    neutral / muted aside
    Replaces: .sig-advice, .sig-compliant-block, .insight-banner,
              .sig-had-advice (set --highlight-accent to red var)  */
.cbs-highlight {
  border-left: 3px solid var(--highlight-accent, var(--primary));
  background: color-mix(in srgb, var(--highlight-accent, var(--primary)) 6%, var(--surface));
  padding: var(--sp3) var(--sp4);
  border-radius: 0 var(--tile-radius) var(--tile-radius) 0;
}
.cbs-highlight--teal  { --highlight-accent: var(--primary); }
.cbs-highlight--green { --highlight-accent: var(--green); }
.cbs-highlight--amber { --highlight-accent: var(--amber); }
.cbs-highlight--red   { --highlight-accent: var(--red); }
.cbs-highlight--gold  { --highlight-accent: var(--gold); }
.cbs-highlight--muted { --highlight-accent: var(--divider); }

/* -- Exemplar: gold trophy treatment (shared across all surfaces) --
   Apply .cbs-exemplar to any position:relative card.
   Dual gold side handles (left ::before + right ::after) like trophy
   grips. Gold-s tint, gold border. Parent must have position:relative
   and the ::before handle pattern.                                   */
.cbs-exemplar {
  background: color-mix(in srgb, #D4A017 8%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--gold) 35%, var(--border));
  padding-right: calc(var(--sp4) + var(--handle-std) + 4px);
}
.cbs-exemplar::before {
  background: var(--gold) !important;
}
.cbs-exemplar::after {
  content: '';
  position: absolute;
  right: 0; top: var(--handle-inset-v); bottom: var(--handle-inset-v);
  width: var(--handle-std);
  border-radius: var(--tile-radius);
  background: var(--gold);
}
/* Exemplar note box - commendation/reasoning. Gold tint, gold label. */
.cbs-exemplar-note {
  margin-top: var(--sp3);
  padding: var(--sp3) var(--sp4);
  background: var(--gold-s);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
  border-radius: var(--tile-radius);
  font-size: var(--text-xs);
  color: var(--text-m);
  line-height: 1.6;
}
.cbs-exemplar-note-label {
  font-weight: 600;
  color: var(--gold);
}

/* -- Icon pills: channel + action icon containers (ADR-0024 Phase 3b) --
   .cbs-icon-pill: 32x32 square, tinted bg from --ev-ch at 10%.
   .cbs-action-pill: 24x24 square, same pattern.
   Place inside any element that sets --ev-ch.                          */
.cbs-icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--tile-radius);
  background: color-mix(in srgb, var(--ev-ch) 10%, var(--surface));
  color: var(--ev-ch);
  flex-shrink: 0;
  vertical-align: middle;
}
.cbs-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--tile-radius);
  background: color-mix(in srgb, var(--ev-ch) 10%, var(--surface));
  color: var(--ev-ch);
  flex-shrink: 0;
}

/* -- Quote: inline italic text block + subtle border + tint - */
/*  Smaller than body - clearly secondary / quoted content.
    Set --quote-border to control the accent colour:
      var(--divider)             neutral aside / had-advice
      rgba(176,65,62,0.45)       counterfactual / red finding
      var(--accent)              statutory guidance quote
    Replaces: .sig-had-advice text style, .reg-guidance-quote   */
.cbs-quote {
  font-size: var(--text-xs);   /* 12px - smaller than body */
  font-style: italic;
  font-weight: 400;
  color: var(--text-m);
  line-height: 1.55;
  border-left: 2px solid var(--quote-border, var(--divider));
  background: color-mix(in srgb, var(--quote-border, var(--divider)) 5%, var(--surface));
  padding: var(--sp2) var(--sp3);
  border-radius: 0 var(--tile-radius) var(--tile-radius) 0;
  margin: 0;
}
.cbs-quote--red    { --quote-border: rgba(176,65,62,0.45); }
.cbs-quote--accent { --quote-border: var(--accent); }
.cbs-quote--teal   { --quote-border: var(--primary); }

/* -- Citation: monospace footnote --------------------------- */
/*  Legal basis, source references, obligation refs.
    Replaces: .sig-basis, .reg-guidance-quote cite             */
.cbs-cite {
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  color: var(--text-f);
  line-height: 1.5;
}

/* -- Deprecated aliases (keep until HTML is migrated) ------- */
.cbs-meta          { font-size: var(--text-sm); font-weight: 400; color: var(--text-m); line-height: 1.5; }       /* → .cbs-body--muted */
.cbs-lead          { font-size: var(--text-sm); font-weight: 400; color: var(--text-m); line-height: 1.5; max-width: 65ch; } /* → .cbs-body--muted */
.ob-paraphrase-text { font-size: var(--text-sm); font-weight: 400; color: var(--text); line-height: 1.5; }         /* → .cbs-body */

.comp-thread-foot {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp2);
}

.comp-thread-theme-tag {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border-radius: var(--tile-radius);
  background: var(--primary-s);
  color: var(--primary);
}

/* Thread states */
.comp-thread.comp-thread--excluded {
  opacity: 0.45;
  border-style: dashed;
  border-color: var(--surface3);
  box-shadow: none;
}
.comp-thread.comp-thread--excluded:hover {
  transform: none;
  box-shadow: none;
}
.comp-thread.comp-thread--excluded::before {
  background: var(--surface3);
}
.comp-thread.comp-thread--excluded .cbs-body,
.comp-thread.comp-thread--excluded .comp-thread-foot {
  filter: grayscale(1);
  pointer-events: none;
}
/* Toggle button stays interactive even when card is excluded */
.comp-thread.comp-thread--excluded .comp-toggle {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

.comp-thread.comp-thread--primary::before {
  background: var(--brand-teal);
}
.comp-thread.comp-thread--primary {
  box-shadow: var(--shadow-tile);
}

.comp-thread.comp-thread--supporting::before {
  background: var(--brand-soft);
}

.comp-thread.comp-thread--background {
  opacity: 0.7;
}
.comp-thread.comp-thread--background::before {
  background: var(--surface3);
}


/* -- 2. Theme Group ----------------------------------------- */

.comp-theme-group {
  margin-bottom: var(--sp4);
}

.comp-theme-group + .comp-theme-group {
  border-top: 1px solid var(--divider);
  padding-top: var(--sp4);
}

.comp-theme-head {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  width: 100%;
  background: none;
  border: none;
  padding: var(--sp2) 0;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.2px;
  text-align: left;
}

.comp-theme-head:hover {
  color: var(--primary);
}

.comp-theme-label {
  flex: 1;
}

.comp-theme-gap {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
  background: var(--red-s);
  padding: 1px 6px;
  border-radius: var(--tile-radius);
}

.comp-theme-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--trans);
  color: var(--text-f);
}

.comp-theme-group.open .comp-theme-chevron {
  transform: rotate(180deg);
}

.comp-theme-body {
  padding-left: var(--sp4);
  padding-top: var(--sp3);
  display: none;
}

.comp-theme-group.open .comp-theme-body {
  display: block;
}

/* Uncategorised theme variant */
.comp-theme-group.comp-theme--uncategorised .comp-theme-label {
  font-style: italic;
  color: var(--text-m);
}


/* -- 3. Include/Exclude Toggle ------------------------------ */

.comp-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp1);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-m);
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
}
.comp-toggle:hover { background: var(--surface3); }
.comp-toggle--included {
  background: rgba(50,104,122,0.15);
  color: var(--brand-teal);
  border-color: var(--brand-teal);
}
.comp-toggle--included:hover { background: rgba(50,104,122,0.25); }
.comp-toggle--excluded {
  background: var(--surface2);
  color: var(--text-f);
  border-style: dashed;
}
.comp-toggle--excluded:hover { color: var(--text-m); background: var(--surface3); }
.comp-toggle--primary  { background: rgba(50,104,122,0.2); font-weight: 800; }
.comp-toggle--supporting {
  background: rgba(107,180,177,0.15);
  color: var(--brand-soft);
  border-color: var(--brand-soft);
}
.comp-toggle--background { background: var(--surface2); color: var(--text-f); opacity: 0.7; }


/* -- 4. Composition Editor provenance footer ---------------- */
/* Base .comp-editor card is defined in pbccd-workbench.html  */

.comp-editor-prov {
  margin-top: var(--sp3);
  padding-top: var(--sp3);
  border-top: 1px solid var(--divider);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp2);
}
.comp-editor-prov-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-f);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-right: var(--sp2);
}


/* -- 5. AI Synthesis Button (stub) -------------------------- */

.comp-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp2);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--tile-radius);
  border: 1px dashed var(--border);
  background: var(--surface2);
  color: var(--text-m);
  cursor: pointer;
  transition: all var(--trans);
  letter-spacing: 0.2px;
}
.comp-ai-btn:hover:not([disabled]) {
  background: var(--surface3);
  border-color: var(--primary);
  color: var(--primary);
}
.comp-ai-btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.comp-ai-icon { width: 14px; height: 14px; }
.comp-ai-btn.comp-ai-btn--active {
  border-color: var(--primary);
  border-style: solid;
  color: var(--primary);
  background: var(--primary-s);
}


/* ==============================================================
   04. WORKBENCH TABS & QUESTION LIST
   ============================================================== */

.wb-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--divider);
}
.wb-tab {
  padding: var(--sp3) var(--sp5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-m);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color var(--trans);
}
.wb-tab:hover { color: var(--text); }
.wb-tab--active { color: var(--primary); font-weight: 700; }
.wb-tab--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--sp3);
  right: var(--sp3);
  height: 2px;
  background: var(--primary);
  border-radius: var(--tile-radius);
}
.wb-tab--dormant { opacity: 0.45; font-style: italic; }
.wb-tab-progress { font-family: var(--font-body); font-weight: 400; color: var(--text-f); margin-left: var(--sp1); font-size: 0.85em; }
.wb-tab--active .wb-tab-progress { color: var(--primary); opacity: 0.7; }

.wb-q-list { display: flex; flex-direction: column; gap: 0; }
.wb-q-row {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: var(--sp3) var(--sp4);
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background var(--trans);
}
.wb-q-row:hover { background: var(--surface2); }
.wb-q-row:last-child { border-bottom: none; }
.wb-q-summary { flex: 1; font-family: var(--font-body); font-size: var(--text-sm); color: var(--text); font-weight: 500; }
.wb-q-threads { font-family: var(--font-body); font-size: 10px; font-weight: 600; color: var(--text-m); white-space: nowrap; }
.wb-q-freshness { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wb-q-freshness--green { background: var(--green); }
.wb-q-freshness--amber { background: var(--amber); }
.wb-q-freshness--red   { background: var(--red); }


/* ==============================================================
   05. PROVENANCE STRIP & PANEL
   Shared across all four evidence surfaces. Strip is a small
   teal chip; panel slides in from the right on click.
   ============================================================== */

/* -- Evidence provenance strip --------------------------------- */
.ev-provenance-strip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp1);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-s);
  border-radius: var(--tile-radius);
  padding: 2px 7px 2px 5px;
  margin-bottom: var(--sp3);
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
  user-select: none;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-provenance-strip:hover {
  background: rgba(74, 143, 163, 0.25);
}
.ev-prov-icon {
  flex-shrink: 0;
  color: var(--primary);
  opacity: 0.8;
}
.ev-prov-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -- Source detail slide-in panel ----------------------------- */
.prov-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
/* Z-index scale: base 1-9 | sticky 10-99 | tooltips 100-199 |
   panels 200-299 | drawers 300-399 | modals 400-499 | auth 900+ */
  background: var(--surface2);
  border-left: 1px solid var(--divider);
  z-index: 250;
  transform: translateX(100%);
  transition: transform 250ms ease;
  display: flex;
  flex-direction: column;
}
.prov-panel.open {
  transform: translateX(0);
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
}

.prov-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp4) var(--sp5);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.prov-panel-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-m);
}
.prov-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-f);
  padding: var(--sp1);
  border-radius: var(--tile-radius);
  display: flex;
  align-items: center;
  transition: color var(--trans), background var(--trans);
}
.prov-panel-close:hover { color: var(--text); background: var(--surface3); }

.prov-panel-body {
  padding: var(--sp4) var(--sp5);
  overflow-y: auto;
  flex: 1;
}

.prov-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp3) 0;
  border-bottom: 1px solid var(--divider);
}
.prov-row:last-child { border-bottom: none; }
.prov-row--stub { opacity: 0.6; }

.prov-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-f);
}
.prov-value {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text);
  line-height: 1.5;
}


/* ==============================================================
   06. INSPECTOR PANEL (shared)
   Canonical side-panel for read-only obligation detail.
   Based on the Signals provenance pattern (D1).
   Used by: matrix.html (Register), future Risk Workspace retrofit.
   ============================================================== */


/* ==============================================================
   06b. CDT SLIDE-IN PANEL (canonical shared detail panel)
   Used by: matrix.html (Register), compliance.html (Tracker),
   and any future page that opens a detail panel.
   Replaces page-specific cb-inspector trigger on matrix.html.
   ============================================================== */

.cdt-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100%;
  background: var(--surface2);
  border-left: 1px solid var(--divider);
  z-index: 261;
  transform: translateX(100%);
  transition: transform 250ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cdt-panel.open {
  transform: translateX(0);
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
}

/* Width variants (matching side-panel pattern) */
.cdt-panel.wide       { width: 480px; }
.cdt-panel.extra-wide { width: 560px; }

/* -- Left stripe (MSC accent or teal default) ---------------- */
.cdt-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--handle-bold, 4px);
  height: 100%;
  background: var(--cdt-panel-accent, var(--brand-teal));
  z-index: 1;
}

/* -- Header -------------------------------------------------- */
.cdt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp4) var(--sp5);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.cdt-panel-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-m);
}
.cdt-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-f);
  padding: var(--sp1);
  border-radius: var(--tile-radius);
  display: flex;
  align-items: center;
  transition: color var(--trans), background var(--trans);
}
.cdt-panel-close:hover {
  color: var(--text);
  background: var(--surface3);
}

/* -- Scrollable body ----------------------------------------- */
.cdt-panel-body {
  padding: var(--sp5);
  overflow-y: auto;
  flex: 1;
}

/* -- Shared section typography (used by content renderers) --- */
.cdt-panel-id {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--cdt-panel-accent, var(--primary));
  margin-bottom: 2px;
}
.cdt-panel-eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-f);
  margin-bottom: var(--sp2);
}
.cdt-panel-ob-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: var(--sp3);
}
.cdt-panel-section {
  margin-bottom: var(--sp4);
}
.cdt-panel-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-f);
  margin-bottom: var(--sp2);
}
.cdt-panel-text {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text);
  line-height: 1.5;
}
.cdt-panel-actions {
  display: flex;
  gap: var(--sp2);
  flex-wrap: wrap;
  margin-top: var(--sp4);
  padding-top: var(--sp3);
  border-top: 1px solid var(--divider);
}

/* -- Verbatim quote block (guidance facet) ------------------- */
.cdt-panel-callout {
  background: var(--surface3);
  border-left: 3px solid var(--cdt-panel-accent, var(--brand-teal));
  padding: var(--sp3) var(--sp4);
  border-radius: 0 var(--tile-radius) var(--tile-radius) 0;
  font-size: var(--text-xs);
  color: var(--text);
  line-height: 1.6;
  margin-bottom: var(--sp2);
}

/* -- Verbatim toggle button ---------------------------------- */
.cdt-panel-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--primary);
  padding: 0;
  margin-bottom: var(--sp3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cdt-panel-toggle:hover { text-decoration: underline; }

/* -- Evidence tiles (compliance facet) ----------------------- */
.cdt-panel-ev-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}
.cdt-panel-ev-item {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--tile-radius);
  padding: var(--sp3) var(--sp4);
}
.cdt-panel-ev-prov {
  font-size: 10px;
  color: var(--text-f);
  margin-bottom: var(--sp1);
}
.cdt-panel-ev-text {
  font-size: var(--text-xs);
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -- Responsive ---------------------------------------------- */
@media (min-width: 641px) and (max-width: 900px) {
  .cdt-panel        { width: min(380px, 92vw); }
  .cdt-panel.wide   { width: min(480px, 92vw); }
  .cdt-panel.extra-wide { width: min(560px, 92vw); }
}
@media (max-width: 640px) {
  .cdt-panel,
  .cdt-panel.wide,
  .cdt-panel.extra-wide { width: 100vw; }
}


/* -- Shared action buttons (cdt-panel + rwc pages) ----------- */
/* Promoted from matrix.css so these work on all pages         */
.rwc-btn         { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-md); padding: 9px 12px; font-size: var(--text-xs); font-weight: 700; border: 1px solid var(--divider); cursor: pointer; font-family: var(--font-body); transition: background var(--trans), border-color var(--trans), color var(--trans); }
.rwc-btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.rwc-btn--primary:hover { background: var(--primary-hover, var(--primary)); border-color: var(--primary); }
.rwc-btn--ghost   { background: var(--surface2); color: var(--text); }
.rwc-btn:hover    { border-color: var(--border); }

/* ==============================================================
   07. PAGE HEADER + META STRIP
   Migrated from platform-header.css (session 8 May 2026).
   Used by: matrix.html, compliance.html, activity.html,
   pbccd-workbench.html, pbccd-dashboard.html
   ============================================================== */

/* -- Page header -------------------------------------------- */

.dash-header {
  position: relative;
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--primary) 4%, var(--surface));
  /* Break out of .main-content padding to span full width */
  margin-top: calc(-1 * var(--sp6));
  margin-left: calc(-1 * var(--sp6));
  margin-right: calc(-1 * var(--sp6));
  /* Left padding matches main-content left edge - content stays left-aligned.
     Right padding grows on wide screens so content never exceeds 1280px. */
  padding-top: var(--sp8);
  padding-bottom: var(--sp5);
  padding-left: var(--sp6);
  padding-right: max(var(--sp6), calc(100% - 1280px + var(--sp6)));
}
.dash-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: var(--sp6); right: var(--sp6);
  height: var(--handle-thin);
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: var(--tile-radius);
}

/* -- Canonical class layout overrides (context-specific) ----- */
.dash-header .cbs-eyebrow {
  margin-bottom: var(--sp2);
  display: flex; gap: var(--sp3);
  align-items: center; flex-wrap: wrap;
}

/* .cbs-title base lives earlier in bento-swiss.css.
   Dash-header context overrides keep page-header sizing consistent
   with the rest of the platform (--text-xl, weight 700). */
.dash-header .cbs-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--sp3) 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-family: var(--font-body);
  max-width: none;
}

.dash-header .cbs-title .cbs-accent {
  color: var(--brand-teal);
  font-weight: 700;
}

/* .cbs-lead base lives earlier in bento-swiss.css.
   Dash-header context override sets wider max-width for the page header. */
.dash-header .cbs-lead {
  font-size: var(--text-sm);
  color: var(--text-m);
  max-width: 960px;
  line-height: 1.55;
  margin: 0;
  font-family: var(--font-body);
}

/* -- Meta strip --------------------------------------------- */

.meta-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--divider);
  background: var(--surface);
  /* Break out of .main-content padding to span full width */
  margin-left: calc(-1 * var(--sp6));
  margin-right: calc(-1 * var(--sp6));
  /* Left padding aligns cells with page-section left edge.
     Right padding grows on wide screens so cells never exceed content-max. */
  padding-left: var(--sp6);
  padding-right: max(var(--sp6), calc(100% - var(--content-max) + var(--sp6)));
}

.meta-cell {
  padding: var(--sp4) var(--sp5);
  border-right: 1px solid var(--divider);
  position: relative;
  padding-left: calc(var(--sp5) + var(--handle-std));
}

.meta-cell:last-child {
  border-right: none;
}

/* Left accent stripe per cell - sm handle, inset-v spacing */
.meta-cell::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--handle-inset-v);
  bottom: var(--handle-inset-v);
  width: var(--handle-std);
  border-radius: var(--tile-radius);
  background: var(--divider);
}

.meta-cell.ac-must::before   { background: var(--deep); }
.meta-cell.ac-should::before { background: var(--mid); }
.meta-cell.ac-could::before  { background: var(--brand-soft); }
.meta-cell.ac-met::before    { background: #3a8a4e; }
.meta-cell.ac-prog::before   { background: var(--amber); }
.meta-cell.ac-gap::before    { background: var(--red); }
.meta-cell.ac-teal::before   { background: var(--brand-teal); }
.meta-cell.ac-muted::before  { background: var(--divider); }
.meta-cell.ac-green::before  { background: #3a8a4e; }
.meta-cell.ac-amber::before  { background: var(--amber); }

.meta-label {
  font-size: var(--text-xs);
  color: var(--text-m);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp1);
  font-family: var(--font-body);
}

.meta-value {
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.1;
}

/* Accent colours on values match the stripe */
.meta-cell.ac-must .meta-value   { color: var(--deep); }
.meta-cell.ac-should .meta-value { color: var(--mid); }
.meta-cell.ac-could .meta-value  { color: var(--brand-soft); }
.meta-cell.ac-met .meta-value    { color: #3a8a4e; }
.meta-cell.ac-prog .meta-value   { color: var(--amber); }
.meta-cell.ac-gap .meta-value    { color: var(--red); }
.meta-cell.ac-green .meta-value  { color: #3a8a4e; }
.meta-cell.ac-amber .meta-value  { color: var(--amber); }

.meta-value .unit {
  font-size: var(--text-xs);
  color: var(--text-m);
  margin-left: var(--sp1);
  font-weight: 400;
  font-family: var(--font-body);
}

.meta-value.ph { color: var(--text-f); font-size: var(--text-sm); }
/* -- Eyebrow separator (dash - replaces old dot spans) ------- */
.eyebrow-sep {
  color: var(--text-f);
  font-size: var(--text-xs);
  user-select: none;
}

/* ==============================================================
   08. INSIGHT COMPONENTS + PILLS AND BADGES
   Migrated from civic-swiss.css (session 8 May 2026).
   civic-swiss.css retains only tokens, reset, and app-shell rules.
   ============================================================== */

/* -- Inline body text emphasis → canonical in section 02 above -- */

/* -- Insight banner ------------------------------------------ */
.insight-banner {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--tile-radius);
  padding: var(--sp5);
  padding-left: calc(var(--sp5) + var(--handle-std) + 4px);
}
.insight-banner::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--handle-inset-v);
  bottom: var(--handle-inset-v);
  width: var(--handle-std);
  border-radius: var(--tile-radius);
  background: var(--primary);
}
.insight-banner-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--primary); margin-bottom: var(--sp3); }

/* -- Insight cards ------------------------------------------- */
.insight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: var(--sp4); }

.insight-card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--tile-radius);
  padding: var(--sp5);
}
.insight-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp3); flex-shrink: 0;
}
.insight-icon svg { width: 16px; height: 16px; }

.ii-red   { background: var(--red-s);     color: var(--red); }
.ii-green { background: var(--green-s);   color: var(--green); }
.ii-amber { background: var(--amber-s);   color: var(--amber); }
.ii-blue  { background: var(--primary-s); color: var(--primary); }

.insight-title { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--sp2); }
.insight-hl    { color: var(--text); font-weight: 600; }

/* -- Base platform pill -------------------------------------- */
.plt-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px; font-weight: 700;
  letter-spacing: .07em;
  padding: 2px 7px;
  border-radius: var(--tile-radius);
  white-space: nowrap;
  text-transform: uppercase;
}
.plt-pill-teal    { background: var(--mid-s);     color: var(--mid); }
.plt-pill-green   { background: var(--green-s);   color: var(--green); }
.plt-pill-amber   { background: var(--amber-s);   color: var(--amber); }
.plt-pill-red     { background: var(--red-s);     color: var(--red); }
.plt-pill-neutral { background: var(--surface3);  color: var(--text-f); }
.plt-pill-blue    { background: var(--primary-s); color: var(--primary); }

/* -- Compact RAG pills --------------------------------------- */
.pill-sm {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px;
  font-family: var(--font-body);
  font-size: 10px; font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--tile-radius);
  white-space: nowrap;
}
.pill-g { background: var(--green-s);  color: var(--green); }
.pill-a { background: var(--amber-s);  color: var(--amber); }
.pill-r { background: var(--red-s);    color: var(--red); }
.pill-n { background: var(--surface3); color: var(--text-f); }
.pill-x { background: var(--gold-s);   color: var(--gold); }

/* -- Compliance status pills --------------------------------- */
.status-pill {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px; font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--tile-radius);
  white-space: nowrap;
}
.sp-red   { background: var(--red-s);   color: var(--red); }
.sp-amber { background: var(--amber-s); color: var(--amber); }
.sp-green { background: var(--green-s); color: var(--green); }

/* -- MSC obligation type badges ------------------------------ */
.badge-msc {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px; font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--tile-radius);
  white-space: nowrap;
}
.badge-must   { background: var(--deep-s); color: var(--deep); }
.badge-should { background: var(--mid-s);  color: var(--mid); }
.badge-could  { background: var(--surface3); color: var(--text-m); }
/* -- Compliance status badges (shared across Register + Tracker) */
.badge-comp {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--tile-radius);
  white-space: nowrap;
}
.badge-compliant         { background: var(--green-s); color: var(--green); }
.badge-partial           { background: var(--amber-s); color: var(--amber); }
.badge-in-progress       { background: var(--heather-s); color: var(--text-m); }
.badge-not-started       { background: var(--surface3); color: var(--text-f); }
/* -- Shared meta row indicators (ObligationCard component) ---- */
/* Effort - graduated bars (monochrome, not RAG) */
.ob-effort {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-weight: 700; font-size: 10px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-m);
  white-space: nowrap; line-height: 1;
}
.ob-effort-bars {
  height: var(--cb-meta-icon-size);
  display: flex; gap: 2px; align-items: flex-end;
}
.ob-effort-bar {
  width: 4px; border-radius: 1px;
  background: var(--text-m);
}
.ob-effort-bar.off {
  background: var(--divider);
}
/* Priority indicator - numeral icon + label */
.ob-priority {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-body); font-weight: 700; font-size: 10px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-m);
  white-space: nowrap; line-height: 1;
}
.ob-priority-num {
  font-size: 14px; line-height: 1; font-weight: 700; color: var(--text-m);
}
/* Quick win indicator - lightbulb icon + label */
.ob-quickwin {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-weight: 700; font-size: 10px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-m);
  white-space: nowrap; line-height: 1;
}
/* Obligation status icon - shape-coded lifecycle indicator */
.ob-status-icon {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-weight: 700; font-size: 10px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-m);
  white-space: nowrap; line-height: 1;
}
/* Compliance progress icon - shape-coded (square/triangle/circle+tick) */
.comp-status-icon {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-weight: 700; font-size: 10px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-m);
  white-space: nowrap; line-height: 1;
}



/* Related obligation cross-links (Register expanded card) */
.ob-cross-links { display: flex; flex-direction: column; gap: var(--sp1); margin-top: var(--sp1); }
.ob-cross-link { display: flex; align-items: flex-start; gap: var(--sp2); flex-wrap: wrap; }
.ob-cross-link-type {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-f); white-space: nowrap; padding-top: 2px; flex-shrink: 0;
}
.ob-cross-link-id {
  display: inline-flex; align-items: center;
  font-size: var(--text-xs); font-weight: 700; font-family: var(--font-body);
  color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: 3px; padding: 1px 6px;
  cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.ob-cross-link-id:hover {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

/* ==============================================================
   09. TOOLTIPS
   Source .tooltip stays permanently hidden inside the trigger.
   tooltip.js clones it into document.body (escaping both
   overflow:hidden and CSS transform containing-block traps).
   The .tooltip--body class styles the visible clone.
   ============================================================== */

.has-tooltip {
  display: inline-flex;
  align-items: center;
}
/* Source tooltip - always hidden; only used as a content template */
.has-tooltip .tooltip {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  pointer-events: none;
}
/* Body-level clone created by tooltip.js */
.tooltip--body {
  background: var(--text);
  color: var(--surface);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  padding: 5px 10px;
  border-radius: var(--r-md);
  white-space: nowrap;
  pointer-events: none;
  z-index: 150;
}

/* ==============================================================
   10. PLATFORM LINKS
   ============================================================== */

/* Compact link to Compliance Tracker - used platform-wide */
.comp-tracker-link {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-body);
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--primary); text-decoration: none;
  background: var(--primary-s);
  padding: 2px 7px 2px 5px;
  border-radius: var(--r-full);
  white-space: nowrap;
  transition: background var(--trans), color var(--trans);
}
.comp-tracker-link:hover { background: var(--primary); color: #fff; }
.comp-tracker-link svg { flex-shrink: 0; }

/* == Lifecycle Panel Content (D1/D2) ======================================= */

.lc-panel-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lc-panel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.lc-panel-meta-text {
  font-size: var(--text-xs);
  color: var(--text-m);
}
.lc-panel-finding {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-d);
  padding: 10px 12px;
  background: var(--red-tint, #fdf2f2);
  border-left: 3px solid var(--red);
  border-radius: 0 4px 4px 0;
}
.lc-panel-finding-plain {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-d);
}
.lc-panel-advice {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--green-dark, #0f6e56);
  background: var(--green-tint, #e1f5ee);
  padding: 8px 10px;
  border-radius: 4px;
}
.lc-panel-advice-label {
  font-weight: 500;
  display: block;
  font-size: 10px;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.lc-panel-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lc-panel-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-m);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.lc-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-f);
}

/* Segmented pill switch */
.lc-seg-track {
  display: inline-flex;
  align-self: flex-start;
  background: var(--surface3);
  border-radius: 12px;
  padding: 2px;
  gap: 1px;
}
.lc-seg-item {
  all: unset;
  font-size: 11px;
  padding: 5px 14px;
  border-radius: 10px;
  color: var(--text-f);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.lc-seg-item:hover {
  color: var(--text-m);
  background: var(--surface2);
}
.lc-seg--selected {
  font-weight: 500;
}
.lc-seg--active.lc-seg--selected {
  background: color-mix(in srgb, var(--red) 14%, var(--surface1));
  color: var(--red);
  border: 0.5px solid color-mix(in srgb, var(--red) 30%, transparent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.lc-seg--addressed.lc-seg--selected {
  background: color-mix(in srgb, var(--green) 14%, var(--surface1));
  color: var(--green);
  border: 0.5px solid color-mix(in srgb, var(--green) 30%, transparent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.lc-seg--superseded.lc-seg--selected {
  background: var(--surface1);
  color: var(--text-d);
  border: 0.5px solid var(--divider);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Response textarea */
.lc-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  color: var(--text-d);
  background: var(--surface1);
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.lc-textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.lc-char-count {
  font-size: 10px;
  color: var(--text-f);
  text-align: right;
}

/* Nag hint */
.lc-nag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--amber);
  padding: 4px 0;
}

/* Save button */
.lc-save-btn {
  all: unset;
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 6px 20px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--primary);
  color: white;
  align-self: flex-end;
  transition: opacity 0.15s;
}
.lc-save-btn:hover {
  opacity: 0.85;
}
.lc-save-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Panel actions row */
.lc-panel-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

/* Lineage and trajectory */
.lc-lineage-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.lc-lineage-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--surface3);
  color: var(--text-m);
}
.lc-traj {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
}
.lc-traj--improving {
  background: color-mix(in srgb, var(--green) 10%, var(--surface2));
  color: var(--green);
}
.lc-traj--declining {
  background: color-mix(in srgb, var(--red) 10%, var(--surface2));
  color: var(--red);
}
.lc-traj--stable {
  background: var(--surface3);
  color: var(--text-m);
}
.lc-traj-note {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--text-m);
  font-style: italic;
  margin-top: 4px;
}

/* Previous responses */
.lc-prev-response {
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: 4px;
  margin-bottom: 6px;
  border-left: 2px solid var(--divider);
}
.lc-prev-response-meta {
  font-size: 10px;
  color: var(--text-f);
  margin-bottom: 3px;
}
.lc-prev-response-text {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text-d);
}

/* ================================================================
   Lifecycle Cascade - Compliance Tracker evidence badges
   Read-only badges showing Review Centre lifecycle state.
   ================================================================ */

.ev-lc-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.3px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}
.ev-lc-badge--addressed {
  background: color-mix(in srgb, var(--green) 14%, var(--surface1));
  color: var(--green);
  border: 0.5px solid color-mix(in srgb, var(--green) 25%, transparent);
}
.ev-lc-badge--superseded {
  background: var(--surface2);
  color: var(--text-f);
  border: 0.5px solid var(--divider);
}

/* De-emphasis for lifecycle-managed evidence items */
.ev-item-lc-addressed {
  opacity: 0.65;
}
.ev-item-lc-addressed:hover {
  opacity: 0.85;
}
.ev-item-lc-superseded {
  opacity: 0.5;
}
.ev-item-lc-superseded:hover {
  opacity: 0.7;
}
/* Sub-entries inside grouped cards */
.ev-sub-entry.ev-item-lc-addressed {
  opacity: 0.65;
}
.ev-sub-entry.ev-item-lc-addressed:hover {
  opacity: 0.85;
}
.ev-sub-entry.ev-item-lc-superseded {
  opacity: 0.5;
}
.ev-sub-entry.ev-item-lc-superseded:hover {
  opacity: 0.7;
}

/* D5 Evidence Exclusion Controls */

/* Excluded count badge in evidence trail header */
.ev-excl-count-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-f);
  background: var(--surface3);
  border: 0.5px solid var(--divider);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Exclude/reinstate action row on evidence items */
.ev-excl-row {
  display: flex;
  justify-content: flex-end;
  padding: 2px 0 0;
}

.ev-action-exclude {
  color: var(--text-f);
  border-color: var(--divider);
}
.ev-action-exclude:hover {
  color: var(--brand-amber);
  border-color: var(--brand-amber);
}
.ev-action-reinstate {
  color: var(--text-f);
  border-color: var(--divider);
}
.ev-action-reinstate:hover {
  color: var(--brand-teal);
  border-color: var(--brand-teal);
}

/* Excluded items group container */
.ev-excluded-group {
  margin-top: var(--sp2);
  border-top: 1px dashed var(--divider);
  padding-top: var(--sp2);
}

/* Toggle button for collapsed excluded group */
.ev-excluded-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  color: var(--text-f);
  padding: 2px 0;
  transition: color 0.15s;
}
.ev-excluded-toggle:hover {
  color: var(--text-m);
}
.ev-excluded-toggle svg {
  flex-shrink: 0;
  transition: transform 0.15s;
}
.ev-excluded-group--open .ev-excluded-toggle svg {
  transform: rotate(90deg);
}

/* Excluded items list */
.ev-excluded-items {
  margin-top: var(--sp2);
  display: flex;
  flex-direction: column;
  gap: var(--sp1);
}

/* Individual excluded item - greyed treatment */
.ev-item--excluded {
  opacity: 0.5;
  filter: grayscale(0.4);
  border-left-color: var(--divider) !important;
  background: var(--surface2);
  transition: opacity 0.15s;
}
.ev-item--excluded:hover {
  opacity: 0.7;
}

/* Truncated finding text in excluded items */
.ev-item-finding--excluded {
  font-size: var(--text-xs);
  color: var(--text-f);
  font-family: var(--font-body);
  margin: 2px 0;
  line-height: 1.4;
}

/* Exclusion note displayed under excluded item header */
.ev-excl-note {
  font-size: var(--text-xs);
  color: var(--text-f);
  font-style: italic;
  font-family: var(--font-body);
  margin-left: auto;
  padding-right: 4px;
}

/* Exclude popover floating panel */
.ev-excl-popover {
  position: fixed;
  z-index: 1200;
  width: 300px;
  background: var(--surface1);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  font-family: var(--font-body);
}
.ev-excl-popover-inner {
  padding: var(--sp3);
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
}
.ev-excl-popover-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-m);
  margin: 0;
}
.ev-excl-textarea {
  width: 100%;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  color: var(--text-h);
  background: var(--surface2);
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 6px 8px;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.5;
}
.ev-excl-textarea:focus {
  outline: none;
  border-color: var(--brand-teal);
}
.ev-excl-nag {
  font-size: var(--text-xs);
  color: var(--brand-amber);
  font-style: italic;
  margin: 0;
}
.ev-excl-popover-actions {
  display: flex;
  gap: var(--sp2);
  align-items: center;
}
.ev-excl-confirm-btn {
  font-size: var(--text-xs);
  font-family: var(--font-body);
  font-weight: 600;
  background: var(--brand-deep);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.ev-excl-confirm-btn:hover {
  opacity: 0.85;
}
.ev-excl-cancel-btn {
  font-size: var(--text-xs);
  font-family: var(--font-body);
  background: none;
  color: var(--text-f);
  border: 0.5px solid var(--divider);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s;
}
.ev-excl-cancel-btn:hover {
  color: var(--text-m);
}

/* D7 Not Applicable Flag */
.ob-na-banner {
  background: var(--surface3);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--text-f);
  border-radius: 4px;
  padding: var(--sp2) var(--sp3);
  margin-bottom: var(--sp3);
  font-family: var(--font-body);
}
.ob-na-banner-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-m);
}
.ob-na-banner-head svg {
  flex-shrink: 0;
  color: var(--text-f);
}
.ob-na-banner-head strong {
  flex: 1;
  font-weight: 600;
}
.ob-na-unflag-btn {
  font-size: var(--text-xs);
  font-family: var(--font-body);
  background: none;
  border: 0.5px solid var(--divider);
  border-radius: 3px;
  color: var(--text-f);
  padding: 2px 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ob-na-unflag-btn:hover {
  color: var(--text-m);
  border-color: var(--text-f);
}
.ob-na-banner-note {
  font-size: var(--text-xs);
  color: var(--text-f);
  font-style: italic;
  margin-top: 4px;
  padding-left: 20px;
  font-family: var(--font-body);
}
.ob-na-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-family: var(--font-body);
  background: none;
  border: 0.5px solid var(--divider);
  border-radius: 4px;
  color: var(--text-f);
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ob-na-flag-btn:hover {
  color: var(--text-m);
  border-color: var(--text-f);
}

/* E3 Cross-surface identity indicators */
.ev-cross-ref-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.ev-cross-ref-label {
  font-size: 10px;
  color: var(--text-f);
  font-family: var(--font-body);
  font-style: italic;
  white-space: nowrap;
}
.ev-cross-ref-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--brand-teal);
  background: transparent;
  border: 0.5px solid var(--brand-teal);
  border-radius: 3px;
  padding: 1px 5px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.ev-cross-ref-chip:hover {
  background: var(--brand-teal);
  color: #fff;
}



/* ==============================================================
   === INSPECTR ===
   Unified detail panel chassis. Three purpose sizes, no width
   modifiers. Interior content uses cdt-panel-* classes (unchanged).
   ADR: ADR-INSP-001, ADR-INSP-003
   ============================================================== */

/* -- Chassis --------------------------------------------------- */
.cdt-inspectr {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--divider);
  z-index: 261;
  transform: translateX(100%);
  transition: transform 250ms ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cdt-inspectr.open {
  transform: translateX(0);
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
}

/* -- Three purpose sizes --------------------------------------- */
/* Read (520px) is the default - no modifier class needed         */
.cdt-inspectr--peek { width: 380px; }
.cdt-inspectr--work { width: 720px; }

/* -- Left accent stripe ---------------------------------------- */
.cdt-inspectr::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--handle-bold, 4px);
  height: 100%;
  background: var(--cdt-inspectr-accent, var(--brand-teal));
  z-index: 1;
}

/* -- Header ---------------------------------------------------- */
.cdt-inspectr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp4) var(--sp5);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.cdt-inspectr-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-m);
}
.cdt-inspectr-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-f);
  padding: var(--sp1);
  border-radius: var(--tile-radius);
  display: flex;
  align-items: center;
  transition: color var(--trans), background var(--trans);
}
.cdt-inspectr-close:hover {
  color: var(--text);
  background: var(--surface3);
}

/* -- Scrollable body ------------------------------------------- */
.cdt-inspectr-body {
  padding: var(--sp5);
  overflow-y: auto;
  flex: 1;
}

/* -- Responsive ------------------------------------------------ */
@media (min-width: 641px) and (max-width: 900px) {
  .cdt-inspectr                  { width: min(520px, 92vw); }
  .cdt-inspectr--peek            { width: min(380px, 92vw); }
  .cdt-inspectr--work            { width: min(720px, 92vw); }
}
@media (max-width: 640px) {
  .cdt-inspectr,
  .cdt-inspectr--peek,
  .cdt-inspectr--work { width: 100vw; }
}

/* -- Dirty-state confirmation overlay -------------------------- */
/* Built-in Civic Swiss overlay. Never use window.confirm().      */
.cdt-inspectr-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.cdt-inspectr-confirm-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.cdt-inspectr-confirm-box {
  background: var(--surface, #fff);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 24px 28px 20px;
  max-width: 340px;
  width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.cdt-inspectr-confirm-msg {
  font-family: var(--font-body);
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 20px;
}
.cdt-inspectr-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.cdt-inspectr-confirm-btn {
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  font-weight: 600;
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid var(--divider);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cdt-inspectr-confirm-btn--discard {
  background: var(--brand-red, #B33E3D);
  color: #fff;
  border-color: var(--brand-red, #B33E3D);
}
.cdt-inspectr-confirm-btn--discard:hover {
  opacity: 0.9;
}
.cdt-inspectr-confirm-btn--cancel {
  background: var(--surface, #fff);
  color: var(--text);
  border-color: var(--divider);
}
.cdt-inspectr-confirm-btn--cancel:hover {
  background: var(--surface3, #f0f0f0);
  border-color: var(--text-f);
}

/* -- Audit line (S3) ------------------------------------------- */
/* Optional last-edit provenance strip below the panel header.    */
/* Shown when opts.auditLine is passed to CDT.Inspectr.open().    */
/* Hidden by default; admin context only.                         */
/* ADR-INSP-002                                                   */
.cdt-inspectr-auditline {
  display: none;
  padding: 5px var(--sp5) 5px calc(var(--sp5) + 4px);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-f);
  background: var(--surface2, #f6f8fa);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
  line-height: 1.4;
}
.cdt-inspectr-auditline.visible {
  display: block;
}

/* -- Dirty-state footer (S3) ----------------------------------- */
/* Appears at the panel bottom when setDirty(true) is called.    */
/* Amber dot signals pending unsaved changes to the admin.        */
/* Hidden by default; toggled by setDirty(bool).                  */
/* ADR-INSP-002                                                   */
.cdt-inspectr-footer {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px var(--sp5);
  background: var(--surface2, #f6f8fa);
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
}
.cdt-inspectr-footer.visible {
  display: flex;
}
.cdt-inspectr-footer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-amber, #E2AF47);
  flex-shrink: 0;
}
.cdt-inspectr-footer-msg {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-m);
}

/* -- Edit toggle (S4) ------------------------------------------ */
/* Pencil icon in the panel header. Injected only when CDT.isAdmin */
/* is true AND opts.onEdit is provided to CDT.Inspectr.open().     */
/* Never added to the DOM otherwise (security-through-absence).    */
/* ADR-INSP-002 S4                                                  */
.cdt-inspectr-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cdt-inspectr-edit-toggle {
  display: flex;
  align-items: center;
}
.cdt-inspectr-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-f);
  padding: var(--sp1);
  border-radius: var(--tile-radius);
  display: flex;
  align-items: center;
  transition: color var(--trans), background var(--trans);
}
.cdt-inspectr-edit-btn:hover {
  color: var(--brand-deep, #B9722D);
  background: var(--surface3);
}

/* -- Properties grid (S4) -------------------------------------- */
/* CDT.InspectrEdit interior. Two-column label/input grid for     */
/* short and medium-length fields. Rendered inside .cdt-inspectr- */
/* body at Work size. ADR-INSP-002, ADR-INSP-003                  */
.cdt-inspectr-props-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1px;
  background: var(--divider);
  border: 1px solid var(--divider);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--sp4);
}
.cdt-inspectr-props-row {
  display: contents;
}
.cdt-inspectr-props-label {
  background: var(--surface2, #f6f8fa);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-m);
  display: flex;
  align-items: flex-start;
  line-height: 1.4;
}
.cdt-inspectr-props-control {
  background: var(--surface);
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
}
.cdt-inspectr-props-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 3px 6px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
}
.cdt-inspectr-props-input:hover {
  border-color: var(--divider);
  background: var(--surface2, #f6f8fa);
}
.cdt-inspectr-props-input:focus {
  border-color: var(--brand-teal);
  background: var(--surface);
}
.cdt-inspectr-props-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 3px;
  padding: 3px 6px;
  outline: none;
}
.cdt-inspectr-props-select:focus {
  border-color: var(--brand-teal);
}
.cdt-inspectr-props-readonly {
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  color: var(--text-f);
  padding: 3px 6px;
  line-height: 1.4;
}
.cdt-inspectr-props-longform {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cdt-inspectr-props-longform-preview {
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  color: var(--text-m);
  line-height: 1.5;
}
.cdt-inspectr-props-edit-btn {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--divider);
  border-radius: 3px;
  background: var(--surface2, #f6f8fa);
  color: var(--text-m);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cdt-inspectr-props-edit-btn:hover {
  background: var(--surface3, #ebebeb);
  color: var(--text);
  border-color: var(--text-f);
}

/* -- Save bar (S4) --------------------------------------------- */
/* Sticky strip at the bottom of the scrollable body.             */
/* Contains cancel/save buttons and an optional error message.    */
.cdt-inspectr-save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 2px;
  background: var(--surface);
  border-top: 1px solid var(--divider);
  margin-top: var(--sp4);
}
.cdt-inspectr-save-msg {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--brand-red, #B33E3D);
  flex: 1;
  padding-right: var(--sp3);
  line-height: 1.4;
}
.cdt-inspectr-save-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cdt-inspectr-save-cancel,
.cdt-inspectr-save-btn {
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--divider);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cdt-inspectr-save-cancel {
  background: var(--surface);
  color: var(--text-m);
}
.cdt-inspectr-save-cancel:hover {
  background: var(--surface3, #ebebeb);
  color: var(--text);
}
.cdt-inspectr-save-btn {
  background: var(--brand-teal);
  color: #fff;
  border-color: var(--brand-teal);
}
.cdt-inspectr-save-btn:hover { opacity: 0.9; }
.cdt-inspectr-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* -- Field editor (S4) ----------------------------------------- */
/* CDT.FieldEditor standalone overlay. Floats above the inspectr. */
/* field-editor.js (CDT.FieldEditor)                              */
/* Z-index: dim 490, editor 500, confirm 510                      */
/* ADR-INSP-002, ADR-INSP-003                                     */

/* Dim backdrop */
.cdt-fe-dim {
  position: fixed;
  inset: 0;
  z-index: 490;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.cdt-fe-dim.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Editor card */
.cdt-fe-editor {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  width: min(620px, 90vw);
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.cdt-fe-editor.visible {
  display: flex;
}

/* Editor header */
.cdt-fe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.cdt-fe-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-m);
}
.cdt-fe-wordcount {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--text-f);
}

/* Editor body */
.cdt-fe-body {
  flex: 1;
  padding: 14px 18px;
  overflow-y: auto;
}
.cdt-fe-textarea {
  width: 100%;
  min-height: 200px;
  font-family: var(--font-body);
  font-size: var(--text-sm, 14px);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 4px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  line-height: 1.6;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.cdt-fe-textarea:focus {
  border-color: var(--brand-teal);
}

/* Editor footer */
.cdt-fe-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: 1px solid var(--divider);
  background: var(--surface2, #f6f8fa);
  flex-shrink: 0;
}
.cdt-fe-footer-msg {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--brand-red, #B33E3D);
  flex: 1;
}
.cdt-fe-footer-actions {
  display: flex;
  gap: 8px;
}
.cdt-fe-cancel,
.cdt-fe-save {
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--divider);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cdt-fe-cancel {
  background: var(--surface);
  color: var(--text-m);
}
.cdt-fe-cancel:hover {
  background: var(--surface3, #ebebeb);
  color: var(--text);
}
.cdt-fe-save {
  background: var(--brand-teal);
  color: #fff;
  border-color: var(--brand-teal);
}
.cdt-fe-save:hover { opacity: 0.9; }

/* Field editor discard confirm overlay */
/* Own element, independent of .cdt-inspectr-confirm-overlay       */
.cdt-fe-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 510;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.cdt-fe-confirm-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.cdt-fe-confirm-box {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 24px 28px 20px;
  max-width: 320px;
  width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.cdt-fe-confirm-msg {
  font-family: var(--font-body);
  font-size: var(--text-sm, 14px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}
.cdt-fe-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.cdt-fe-confirm-btn {
  font-family: var(--font-body);
  font-size: var(--text-xs, 13px);
  font-weight: 600;
  border-radius: 4px;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid var(--divider);
  transition: background 0.15s, border-color 0.15s;
}
.cdt-fe-confirm-discard {
  background: var(--brand-red, #B33E3D);
  color: #fff;
  border-color: var(--brand-red, #B33E3D);
}
.cdt-fe-confirm-discard:hover { opacity: 0.9; }
.cdt-fe-confirm-cancel {
  background: var(--surface);
  color: var(--text);
}
.cdt-fe-confirm-cancel:hover {
  background: var(--surface3, #f0f0f0);
}


/* ================================================================== */
/* Navigatr S2 - Tracker eye-button scan tooltip                       */
/* .cb-eye-wrap wraps .cb-inspect-btn + .cb-scan-tip                  */
/* Tooltip reveals on CSS :hover - no JS needed                       */
/* ================================================================== */

.cb-eye-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.cb-eye-wrap:hover .cb-scan-tip {
  opacity: 1;
  visibility: visible;
}

.cb-scan-tip {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  background: var(--text, #1f2328);
  color: #fff;
  border-radius: var(--tile-radius, 4px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
  z-index: var(--z-tooltip, 50);
  pointer-events: none;
}

.cb-scan-tip::before {
  content: '';
  position: absolute;
  top: -4px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--text, #1f2328);
  transform: rotate(45deg);
}

.cb-scan-tip-label {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, .5);
  margin-bottom: 4px;
}

.cb-scan-tip-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: #fff;
}

.cb-scan-tip-text {
  color: rgba(255, 255, 255, .85);
  margin-bottom: 4px;
}

.cb-scan-tip-meta {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, .7);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .15);
}
