/* -----------------------------------------------------------------------------
   Generated file - do not edit.
   It is overwritten at every release; a change made here is lost.
   See CONTRIBUTING.md.
   ----------------------------------------------------------------------------- */
/* ── CISO Toolbox — Shared CSS ─────────────────────────────────────
   UI v2 design system (SPEC-implementationv2.md).

   Structure:
     1. Design tokens (:root, dark, module tints)   — §1
     2. Transition aliases (old var names → new)     — §7.1  (removed at step 6)
     3. @font-face (IBM Plex — deferred, graceful)
     4. Base + primitives + chrome + print           — §9
     5. LEGACY (old classes, still emitted by shared TS + un-migrated apps)
        — removed module-by-module (steps 4-6).

   Migration status (SPEC §7): foundations + additive primitives are in.
   The 5 primitives whose NAME collides with a live shared component
   (.ct-table, .ct-badge, .ct-modal-*, .ct-bulkbar, .ct-icon) are still the
   LEGACY versions below — they migrate together with their emitting TS
   (ct_table / badge() / ct_modal / ct_bulkbar / _icon) in a later increment.
   ──────────────────────────────────────────────────────────────── */

/* ═══════════════════ 1. DESIGN TOKENS (SPEC §1) ═══════════════════ */
:root {
  /* Neutrals */
  --ct-canvas:       #f6f7f9;
  --ct-surface:      #ffffff;
  --ct-surface-2:    #fafbfc;
  --ct-line-soft:    #eef0f4;
  --ct-line:         #e3e6ec;
  --ct-line-strong:  #cbd1dc;   /* decorative separators — not a target outline */
  /* Outline of INPUT targets. --ct-line-strong sits at 1.53:1, far below the
     3:1 non-text threshold (WCAG 1.4.11): an empty field had no perceptible
     outline. A distinct token rather than raising line-strong — the requirement
     applies to controls, and raising the global token would redraw all ten
     modules at once. */
  --ct-line-field:   #8b909b;
  --ct-ink:          #12151c;
  --ct-ink-1:        #3c4453;
  /* Muted text. #6b7488 cleared 4.5:1 on the white surface only: it fell to
     4.37 on the page canvas, 4.23 on active or hovered rows (-neutral-tint),
     4.03 on selected ones (-accent-tint) and 4.00 on critical-tinted rows.
     Same hue, one step darker: 4.5:1 or more on the surfaces, the page,
     active and selected rows and the tone tints (lowest 4.55, critical). */
  --ct-ink-2:        #636b7e;
  /* NON-TEXT. At 3.09:1 it cannot carry text, and any value that
     reached 4.5:1 would blur into --ct-ink-2 (5.34:1): three text grays
     don't fit in the scale. We keep two, and ink-3 becomes the gray of
     decorative elements — 3:1 threshold, WCAG 1.4.11. The only remaining
     use is the empty-state icon; all text that used it moved to ink-2. */
  --ct-ink-3:        #8a93a4;
  --ct-ink-disabled: #798294;   /* was #9aa2b1: 2.32:1 on -neutral-tint, unreadable,
                                   while dark inherited 5.52:1. Disabled formally
                                   escapes AA, but not common sense: the same
                                   state must read the same in both themes. */

  /* Accent — action and selection ONLY */
  /* Ink laid on an ACCENT solid. White in both themes, unlike
     --ct-onsolid which inverts: the dark accent was darkened (pass 2, option B)
     precisely to keep carrying white, where the severity solids, for their
     part, genuinely lighten in dark. Two inks because two behaviors,
     not out of a taste for nuance. */
  --ct-onaccent:     #fff;
  /* Overlay veil (modal, help, history). Translucent black in both
     themes: it is the darkening of the background that makes the overlay, it
     does not invert. A token because the value is repeated in four places. */
  --ct-scrim:        rgba(0,0,0,0.45);
  /* Deeper veil, for a fullscreen image viewer: there the background must
     disappear, not merely recede. Same reasoning, one level down. */
  --ct-scrim-deep:   rgba(0,0,0,0.85);
  /* Background of code / example blocks. Dark in BOTH themes, like
     a console: it is a reading convention, not an interface surface. */
  --ct-code-bg:      #0f172a;

  --ct-accent:       #5a4bd8;
  --ct-accent-hover: #4536b4;
  --ct-accent-tint:  #eeecfd;
  --ct-accent-ink:   #3f32a8;

  /* Severity — data ONLY.
     Three grades per tone, same hues, same ink (-ink):
     -tint for a badge · -fill for a solid area (matrix cell, score
     chip) · base (solid) for an edge strip, a gauge or a destructive hover. */
  --ct-critical:      #b3261e;  --ct-critical-tint: #fbe9e7;  --ct-critical-fill: #e7bcb9;  --ct-critical-ink: #8c1d18;
  /* A deeper red than --ct-critical for the most-severe level of a scale, so a
     "critical" segment stays distinct from an "elevated" one on charts. */
  --ct-critical-strong: #7a0f16;
  --ct-high:          #c2410c;  --ct-high-tint:     #fdeee3;  --ct-high-fill:     #eecabb;  --ct-high-ink:     #8f3009;
  --ct-medium:        #a16207;  --ct-medium-tint:   #fdf4dc;  --ct-medium-fill:   #e8d8c1;  --ct-medium-ink:   #7c4a05;
  --ct-low:           #15803d;  --ct-low-tint:      #e7f4ec;  --ct-low-fill:      #c4dfce;  --ct-low-ink:      #116233;
  --ct-info:          #3f6d8c;  --ct-info-tint:     #e9f0f5;  --ct-info-fill:     #c3d2db;  --ct-info-ink:     #2f536b;
  --ct-neutral:       #6b7488;  --ct-neutral-tint:  #f2f3f7;  --ct-neutral-fill:  #d7d9df;  --ct-neutral-ink:  #4c5566;

  /* Categorical series — IDENTITY hues for multi-series charts (donut, bar
     legends), never a severity. Depth matched to the severity solids above
     (700-ish) so a chart never mixes muted theme tones with raw vivid hexes:
     that mix is what made the light theme look garish (FEAT-43 review). */
  --ct-cat-violet: #7c3aed;  --ct-cat-indigo: #4f46e5;  --ct-cat-cyan:   #0e7490;
  --ct-cat-teal:   #0f766e;  --ct-cat-pink:   #be185d;  --ct-cat-purple: #9333ea;
  --ct-cat-amber:  #b45309;

  /* Ink laid on a base-color (solid) area — inverts in dark. */
  --ct-onsolid: #fff;

  /* Typography */
  --ct-font:      'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --ct-font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --ct-text-page:    20px;
  --ct-text-section: 16px;
  --ct-text-body:    14px;
  --ct-text-ui:      13.5px;
  --ct-text-data:    13px;
  --ct-text-meta:    12px;
  --ct-text-label:   11px;

  /* Radii */
  --ct-r-sm: 4px;  --ct-r-md: 6px;  --ct-r-lg: 8px;  --ct-r-xl: 12px;  --ct-r-pill: 999px;

  /* Spacing */
  --ct-s1: 4px; --ct-s2: 8px; --ct-s3: 12px; --ct-s4: 16px;
  --ct-s5: 20px; --ct-s6: 24px; --ct-s8: 32px; --ct-s12: 48px;

  /* Control heights */
  /* xs serves dense contexts: reordering arrows in a table,
     actions on a rail card. It is a third notch on the md -> sm axis,
     not a new concept. */
  --ct-h-xs: 22px;  --ct-h-sm: 28px;  --ct-h-md: 34px;
  /* Default button height: shorter than a field (34), one notch
     above a modal button (~27). --ct-h-md stays reserved for fields. */
  --ct-h-btn: 30px;

  /* Elevation */
  --ct-shadow-card:    0 1px 2px rgba(18,21,28,0.05);
  --ct-shadow-overlay: 0 20px 48px -12px rgba(18,21,28,0.28);

  /* Chrome */
  --ct-appbar-h: 48px;
  --ct-rail-w:   232px;

  --ct-focus: 0 0 0 3px rgba(90,75,216,0.28);

  /* Complements (§1) */
  --ct-line-hover:  #aab2c0;
  --ct-focus-soft:  0 0 0 3px rgba(90,75,216,0.18);
  --ct-danger-tint: #fdeeec;
  --ct-danger-line: #e9cdc9;

  /* Module identity (§5) — background tint / ink, never a severity tone */
  --ct-mod-risk-tint:#e9edf1; --ct-mod-risk-ink:#2c3e50;
  --ct-mod-compliance-tint:#eeecfd; --ct-mod-compliance-ink:#4b3fbd;
  --ct-mod-audit-tint:#e4f2e8; --ct-mod-audit-ink:#186334;
  --ct-mod-vendor-tint:#e0f5f2; --ct-mod-vendor-ink:#0f766e;
  --ct-mod-asset-tint:#e6eefc; --ct-mod-asset-ink:#1a5cbf;
  --ct-mod-access-tint:#fce7f1; --ct-mod-access-ink:#a81259;
  --ct-mod-surface-tint:#fbeaea; --ct-mod-surface-ink:#a01818;
  --ct-mod-appsec-tint:#e2f1f5; --ct-mod-appsec-ink:#0b5d73;
  --ct-mod-scan-tint:#fdeee3; --ct-mod-scan-ink:#9a3d0a;
  --ct-mod-pilot-tint:#f6ecf6; --ct-mod-pilot-ink:#6e2a6e;
}

:root[data-theme="dark"] {
  /* Native form controls (checkbox, radio, select, scrollbars) follow the
     theme — kills the stock white widgets on dark tables. */
  color-scheme: dark;

  --ct-canvas:      #0f1218;
  --ct-surface:     #1c2029;
  --ct-surface-2:   #21252f;
  --ct-line-soft:   #262b36;
  --ct-line:        #2b313d;
  --ct-line-strong: #3a4150;   /* decorative separators */
  --ct-line-field:  #6a7182;   /* outline of input targets — see light block */
  --ct-ink:         #f2f4f8;
  --ct-ink-1:       #c3c9d4;
  --ct-ink-2:       #99a1b0;
  --ct-ink-3:       #79818f;   /* non-text — see light block */

  /* Pass 2, option B: the dark accent had been lightened to stand out from the
     surface, to the point of no longer carrying white (4.01:1, and 3.12:1 on hover).
     We darken it rather than inverting the ink: a primary button is recognized
     as much by its structure — light ink on saturated fill — as by its color, and
     inverting it from one theme to the other flips that structure. --ct-onsolid thus
     stays confined to the severity solids, which genuinely lighten in dark. */
  --ct-accent:       #6656e2;
  --ct-accent-hover: #6f60e5;
  --ct-accent-tint:  #2e2757;
  --ct-accent-ink:   #b9aefb;

  --ct-critical: #e8695f;  --ct-critical-tint: #3a1e1b;  --ct-critical-fill: #613333;  --ct-critical-ink: #f0a49c;
  /* Deeper/more saturated than --ct-critical so the most-severe level stays
     readable and distinct on a dark background. */
  --ct-critical-strong: #c62828;
  --ct-high:     #e08542;  --ct-high-tint:     #3a2415;  --ct-high-fill:     #5a3b27;  --ct-high-ink:     #efab77;
  --ct-medium:   #d9a23c;  --ct-medium-tint:   #332a12;  --ct-medium-fill:   #584625;  --ct-medium-ink:   #e2c069;
  --ct-low:      #4caf6d;  --ct-low-tint:      #16301f;  --ct-low-fill:      #244936;  --ct-low-ink:      #7ecb96;
  --ct-info:     #6aa3c4;  --ct-info-tint:     #14262f;  --ct-info-fill:     #324959;  --ct-info-ink:     #9cc8de;
  --ct-neutral:  #79818f;  --ct-neutral-tint:  #262b36;  --ct-neutral-fill:  #464c56;  --ct-neutral-ink:  #c3c9d4;

  /* Categorical series lighten in dark, like the severity solids. */
  --ct-cat-violet: #a78bfa;  --ct-cat-indigo: #818cf8;  --ct-cat-cyan:   #22d3ee;
  --ct-cat-teal:   #2dd4bf;  --ct-cat-pink:   #f472b6;  --ct-cat-purple: #c084fc;
  --ct-cat-amber:  #fbbf24;

  /* Severity solids lighten in dark: the ink laid on them inverts. */
  --ct-onsolid: #11121a;
  /* Focus halo: stays indigo (interaction state), realigned on the dark accent. */
  --ct-focus: 0 0 0 3px rgba(122,108,240,0.35);

  --ct-shadow-card:    none;
  --ct-shadow-overlay: 0 20px 48px -12px rgba(0,0,0,0.55);

  --ct-line-hover:  #4a5162;
  --ct-focus-soft:  0 0 0 3px rgba(122,108,240,0.25);
  --ct-danger-tint: #3a1e1b;
  --ct-danger-line: #5a2f2a;

  --ct-mod-risk-tint:#232c37; --ct-mod-risk-ink:#a9bacd;
  --ct-mod-compliance-tint:#2a2455; --ct-mod-compliance-ink:#b9aefb;
  --ct-mod-audit-tint:#132b1c; --ct-mod-audit-ink:#74c288;
  --ct-mod-vendor-tint:#10302c; --ct-mod-vendor-ink:#6fd0c1;
  --ct-mod-asset-tint:#141f3a; --ct-mod-asset-ink:#8fb4f5;
  --ct-mod-access-tint:#331428; --ct-mod-access-ink:#f099c4;
  --ct-mod-surface-tint:#3a1c1c; --ct-mod-surface-ink:#f0a0a0;
  --ct-mod-appsec-tint:#0f2c34; --ct-mod-appsec-ink:#77c3d4;
  --ct-mod-scan-tint:#33230f; --ct-mod-scan-ink:#efab77;
  --ct-mod-pilot-tint:#2d1b2d; --ct-mod-pilot-ink:#d8a6d8;
}

/* ═══════════ 2. LEGACY RAIL LITERAL ══════════════════════════════════
   The transition-alias block (--blue, --border, --text-muted…) is
   removed: no consumer left in the tree. Only --sidebar-bg
   remains; it is a literal, not an alias. */
:root {
  --sidebar-bg:   #0f172a;   /* legacy dark rail — stays literal until removed */
}

/* ═══════════════════ 3. @font-face (deferred) ═══════════════════
   woff2 files ship in ../fonts/, next to this stylesheet; while they load,
   or if they are absent, the stack falls back to system-ui.  */
@font-face { font-family:'IBM Plex Sans'; font-weight:400; font-display:swap; src:url('../fonts/IBMPlexSans-Regular.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans'; font-weight:500; font-display:swap; src:url('../fonts/IBMPlexSans-Medium.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Sans'; font-weight:600; font-display:swap; src:url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-weight:400; font-display:swap; src:url('../fonts/IBMPlexMono-Regular.woff2') format('woff2'); }
@font-face { font-family:'IBM Plex Mono'; font-weight:500; font-display:swap; src:url('../fonts/IBMPlexMono-Medium.woff2') format('woff2'); }

/* ═══════════════════ 4. BASE + PRIMITIVES (SPEC §9) ═══════════════════ */

/* 9.1 Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ct-font);
  font-size: var(--ct-text-body);
  line-height: 1.6;
  color: var(--ct-ink);
  background: var(--ct-canvas);
  -webkit-font-smoothing: antialiased;
}
/* Apps with the full toolbar + sidebar + internal-scroll layout add
   class="ct-app-shell" on <body> to lock the page to 100vh. */
body.ct-app-shell { overflow: hidden; height: 100vh; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.3px; }
code, .ct-mono, .ct-num { font-family: var(--ct-font-mono); }
.ct-num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--ct-focus); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ct-accent); }
.ct-icon-btn-slot { display: inline-flex; align-items: center; }
.ct-spacer { flex: 1; }

/* 9.2 .ct-btn */
.ct-btn {
  font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--ct-h-btn); min-width: 0; padding: 0 13px;
  border: 1px solid var(--ct-line-field); border-radius: var(--ct-r-md);
  background: var(--ct-surface); color: var(--ct-ink);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  cursor: pointer; transition: background 120ms, border-color 120ms, color 120ms;
}
.ct-btn:hover { background: var(--ct-canvas); border-color: var(--ct-line-hover); }
.ct-btn[data-size="sm"] { height: var(--ct-h-sm); padding: 0 11px; border-radius: var(--ct-r-sm); font-size: 12.5px; }
.ct-btn[data-size="xs"] { height: var(--ct-h-xs); padding: 0 7px; border-radius: var(--ct-r-sm); font-size: 11px; }
.ct-btn[data-icon] { width: var(--ct-h-btn); padding: 0; }
.ct-btn[data-icon][data-size="sm"] { width: var(--ct-h-sm); }
.ct-btn[data-icon][data-size="xs"] { width: var(--ct-h-xs); }
/* The spec names four variants; "neutral" is the default drawing of the
   bare .ct-btn. We declare it anyway: a caller must not have to
   know that the absence of the attribute means something. */
.ct-btn[data-variant="neutral"] { /* = .ct-btn */ }
.ct-btn[data-variant="primary"] { background: var(--ct-accent); border-color: var(--ct-accent); color: var(--ct-onaccent); }
.ct-btn[data-variant="primary"]:hover { background: var(--ct-accent-hover); border-color: var(--ct-accent-hover); }
.ct-btn[data-variant="ghost"] { background: transparent; border-color: transparent; color: var(--ct-ink-1); }
.ct-btn[data-variant="ghost"]:hover { background: var(--ct-line-soft); border-color: transparent; color: var(--ct-ink); }
.ct-btn[data-variant="danger"] { background: var(--ct-danger-tint); border-color: var(--ct-danger-line); color: var(--ct-critical-ink); }
.ct-btn[data-variant="danger"]:hover { background: var(--ct-critical); border-color: var(--ct-critical); color: var(--ct-onsolid); }
/* AI action button (star): a .ct-btn modifier. The system accent is
   already the "AI" indigo; we apply it in a tinted version to distinguish
   these actions from ordinary buttons without competing with the primary. Always
   combined with .ct-btn, never with a variant. Light/dark themed via the tokens.
   Placed after the variants to win at equal (0, 2, 0) specificity. */
.ct-btn.btn-ai { background: var(--ct-accent); border-color: var(--ct-accent); color: var(--ct-onaccent); }
.ct-btn.btn-ai:hover { background: var(--ct-accent-tint); border-color: var(--ct-accent-tint); color: var(--ct-accent-ink); }
.ct-btn:disabled, .ct-btn[aria-disabled="true"] {
  background: var(--ct-neutral-tint); border-color: var(--ct-line-field);
  color: var(--ct-ink-disabled); cursor: not-allowed;
}
.ct-btngroup { display: flex; gap: var(--ct-s2); align-items: center; flex-wrap: wrap; }

/* 9.3 .ct-ref  (.ct-badge deferred — see header) */
/* Dense variant, aligned on .ct-badge[data-size="sm"]: same 10.5px, same
   tightening. It exists for contexts where the reference accompanies a
   short content — a kanban card, a cell — and where the base size
   weighs more than what it designates. A named variant in the foundation, not a
   font-size dropped in place: that is the only form that stays true everywhere. */
.ct-ref[data-size="sm"] { height: 18px; padding: 0 7px; font-size: 10.5px; }

.ct-ref {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border: 1px solid var(--ct-line); border-radius: var(--ct-r-sm);
  background: var(--ct-neutral-tint); color: var(--ct-ink-1);
  font-family: var(--ct-font-mono); font-size: 11px; font-weight: 500; white-space: nowrap;
}
.ct-ref[data-module="risk"] { background: var(--ct-mod-risk-tint);       color: var(--ct-mod-risk-ink);       border-color: transparent; }
.ct-ref[data-module="compliance"] { background: var(--ct-mod-compliance-tint); color: var(--ct-mod-compliance-ink); border-color: transparent; }
.ct-ref[data-module="audit"] { background: var(--ct-mod-audit-tint);      color: var(--ct-mod-audit-ink);      border-color: transparent; }
.ct-ref[data-module="vendor"] { background: var(--ct-mod-vendor-tint);     color: var(--ct-mod-vendor-ink);     border-color: transparent; }
.ct-ref[data-module="asset"] { background: var(--ct-mod-asset-tint);      color: var(--ct-mod-asset-ink);      border-color: transparent; }
.ct-ref[data-module="access"] { background: var(--ct-mod-access-tint);     color: var(--ct-mod-access-ink);     border-color: transparent; }
.ct-ref[data-module="surface"] { background: var(--ct-mod-surface-tint);    color: var(--ct-mod-surface-ink);    border-color: transparent; }
.ct-ref[data-module="appsec"] { background: var(--ct-mod-appsec-tint);     color: var(--ct-mod-appsec-ink);     border-color: transparent; }
.ct-ref[data-module="scan"] { background: var(--ct-mod-scan-tint);       color: var(--ct-mod-scan-ink);       border-color: transparent; }
.ct-ref[data-module="pilot"] { background: var(--ct-mod-pilot-tint);      color: var(--ct-mod-pilot-ink);      border-color: transparent; }

/* 9.3b .ct-badge — semantic tone system (tinted by default, [data-fill] solid) */
.ct-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--ct-r-pill);
  font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  /* Default case, without data-tone: readable rather than invisible. A call with
     no tone remains a caller bug, but it must not produce a ghost badge. */
  background: var(--ct-neutral-tint); color: var(--ct-ink); }
.ct-badge[data-size="sm"] { padding: 1px 6px; font-size: 10.5px; }
/* "Running": a state, not a color. It lived in Surface as an
   animation attached to .job-running, hence invisible to the other modules
   which nevertheless have jobs in progress. Bare attribute, like data-fill. */
.ct-badge[data-live] { animation: ct-pulse 1.5s ease-in-out infinite; }
@keyframes ct-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
/* A scrollable checklist inside a modal (e.g. the measures of a remediation). */
/* Inline form feedback (modals): the list of what is missing, and the fields
   concerned. Required fields carry a marker in their label. */
.ct-form-errors { background: var(--ct-critical-tint); color: var(--ct-critical-ink); border-left: 3px solid var(--ct-critical);
  padding: 8px 10px; border-radius: var(--ct-r-sm); font-size: 12.5px; margin-bottom: 10px; }
.ct-form-errors ul { margin: 4px 0 0 16px; padding: 0; }
.ct-field-error { outline: 2px solid var(--ct-critical) !important; outline-offset: -1px; }
.ct-req { color: var(--ct-critical); margin-left: 2px; }
/* Row a navigation lands on (e.g. "see the requirement"): flashed, then plain. */
@keyframes ct-row-target { 0%, 60% { box-shadow: inset 0 0 0 2px var(--ct-accent); } 100% { box-shadow: none; } }
.ct-row-target > td { animation: ct-row-target 3s ease-out 1; }
@media (prefers-reduced-motion: reduce) {
    /* The pulsing is a reading comfort, not information: the tone
       already carries the state. We turn it off for whoever asked for that. */
    .ct-badge[data-live] { animation: none; }
}
.ct-badge[data-tone="critical"] { background: var(--ct-critical-tint); color: var(--ct-critical-ink); }
.ct-badge[data-tone="high"] { background: var(--ct-high-tint);     color: var(--ct-high-ink); }
.ct-badge[data-tone="medium"] { background: var(--ct-medium-tint);   color: var(--ct-medium-ink); }
.ct-badge[data-tone="low"] { background: var(--ct-low-tint);      color: var(--ct-low-ink); }
.ct-badge[data-tone="info"] { background: var(--ct-info-tint);     color: var(--ct-info-ink); }
.ct-badge[data-tone="neutral"] { background: var(--ct-neutral-tint);  color: var(--ct-neutral-ink); }
.ct-badge[data-tone="accent"] { background: var(--ct-accent-tint);   color: var(--ct-accent-ink); }
/* [data-fill] — solid, only when the badge IS the value (computed cells) */
.ct-badge[data-fill][data-tone="critical"] { background: var(--ct-critical); color: var(--ct-onsolid); }
.ct-badge[data-fill][data-tone="high"] { background: var(--ct-high);     color: var(--ct-onsolid); }
.ct-badge[data-fill][data-tone="medium"] { background: var(--ct-medium);   color: var(--ct-onsolid); }
.ct-badge[data-fill][data-tone="low"] { background: var(--ct-low);      color: var(--ct-onsolid); }
.ct-badge[data-fill][data-tone="info"] { background: var(--ct-info);     color: var(--ct-onsolid); }
.ct-badge[data-fill][data-tone="neutral"] { background: var(--ct-neutral);  color: var(--ct-onsolid); }
.ct-badge[data-fill][data-tone="accent"] { background: var(--ct-accent);   color: var(--ct-onaccent); }

/* 9.4 .ct-field · .ct-input */
.ct-field { display: flex; flex-direction: column; gap: 6px; }
/* The spacing BETWEEN fields was missing from the foundation: .ct-field only set
   the internal label / input gap. Surface and AppSec each compensated for it
   with a local margin-bottom — removed as a collision, which glued together the
   fields of their modals. The rule belongs to the foundation, not the modules.
   On the adjacent selector, hence no orphan margin after the last field. */
.ct-field + .ct-field { margin-top: 14px; }
/* Form container (spec §2). When the markup adopts it, the gap
   carries the spacing and the adjacent rule steps aside — a single visible
   value, never two adding up. */
.ct-form { display: flex; flex-direction: column; gap: 14px; }
.ct-form .ct-field + .ct-field { margin-top: 0; }
/* The socle form grid: two equal columns on a wide screen, one below 768 px
   (see the breakpoint further down). data-cols="3" gives three equal columns,
   data-cols="2-1" a wide field beside a narrow one (host and port). */
.ct-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* A group of fields that can be turned off as a whole (a settings section
   whose fields only apply once its toggle is on). */
.ct-settings-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.ct-settings-fields:disabled { opacity: .55; }
.ct-form-grid[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.ct-form-grid[data-cols="2-1"] { grid-template-columns: 2fr 1fr; }
.ct-form-grid .ct-field + .ct-field { margin-top: 0; }
/* Hoisted from access.css and Pilot.css, where it was declared identically. */
.ct-form-grid > .ct-form-row { margin-bottom: 0; }
.ct-form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.ct-label { font-size: var(--ct-text-label); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ct-ink-2); }
.ct-input, .ct-select, .ct-textarea {
  font-family: inherit; font-size: var(--ct-text-ui);
  height: var(--ct-h-md); width: 100%; padding: 0 11px;
  border: 1px solid var(--ct-line-field); border-radius: var(--ct-r-md);
  background: var(--ct-surface); color: var(--ct-ink);
}
.ct-select { padding: 0 10px; }
.ct-textarea { height: auto; min-height: 76px; padding: 8px 11px; line-height: 1.55; resize: vertical; }
.ct-input:focus, .ct-select:focus, .ct-textarea:focus { outline: none; border-color: var(--ct-accent); box-shadow: var(--ct-focus-soft); }
.ct-input::placeholder, .ct-textarea::placeholder { color: var(--ct-ink-disabled); }

/* .ct-filter — toolbar select, sitting above a list or a
   table. It is not a form field: it sizes to its
   content instead of taking the full width, and adopts the sm height to
   align with the buttons of the same bar. */
.ct-filter {
  font-family: inherit; font-size: var(--ct-text-meta);
  height: var(--ct-h-sm); width: auto; min-width: 110px; max-width: 240px;
  padding: 0 9px;
  border: 1px solid var(--ct-line-field); border-radius: var(--ct-r-sm);
  background: var(--ct-surface); color: var(--ct-ink); cursor: pointer;
}
.ct-filter:focus { outline: none; border-color: var(--ct-accent); box-shadow: var(--ct-focus-soft); }
.ct-input:disabled, .ct-select:disabled { background: var(--ct-neutral-tint); color: var(--ct-ink-disabled); cursor: not-allowed; }
.ct-input[data-size="sm"], .ct-select[data-size="sm"] { height: 30px; font-size: var(--ct-text-data); }
/* xs: for fields in table cells, aligned on the cell input (~24) and the xs button (22). */
.ct-input[data-size="xs"], .ct-select[data-size="xs"] { height: 24px; padding: 0 8px; font-size: var(--ct-text-meta); }
.ct-hint { font-size: var(--ct-text-meta); color: var(--ct-ink-2); line-height: 1.5; }
.ct-error { font-size: var(--ct-text-meta); color: var(--ct-critical-ink); line-height: 1.5; }
[aria-invalid="true"] { border-color: var(--ct-critical); }

.ct-tagfield {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  min-height: var(--ct-h-md); padding: 5px 7px;
  border: 1px solid var(--ct-line-field); border-radius: var(--ct-r-md); background: var(--ct-surface);
}
.ct-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px 0 9px;
  border-radius: var(--ct-r-sm); background: var(--ct-accent-tint); color: var(--ct-accent-ink);
  font-family: var(--ct-font-mono); font-size: 11.5px; font-weight: 500;
}
.ct-check { position: relative; display: flex; align-items: center; gap: 9px; font-size: var(--ct-text-ui); color: var(--ct-ink); cursor: pointer; }
.ct-check-box { width: 17px; height: 17px; border: 1px solid var(--ct-line-field); border-radius: var(--ct-r-sm); background: var(--ct-surface); display: inline-flex; align-items: center; justify-content: center; color: transparent; flex-shrink: 0; }
.ct-check input:checked + .ct-check-box { background: var(--ct-accent); border-color: var(--ct-accent); color: var(--ct-onaccent); }
.ct-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.ct-choice { display: inline-flex; gap: 6px; }
.ct-choice > button {
  font-family: inherit; height: var(--ct-h-sm); min-width: 28px; padding: 0 10px;
  border: 1px solid var(--ct-line-field); border-radius: var(--ct-r-sm);
  background: var(--ct-surface); color: var(--ct-ink-1);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.ct-choice > button[aria-pressed="true"] { background: var(--ct-accent); border-color: var(--ct-accent); color: var(--ct-onaccent); }
/* A choice can carry a judgment and not just a selection: the review
   decision is green or red. We reuse the tone vocabulary rather than
   inventing state names. The tone only applies to the selected option. */
.ct-choice > button[aria-pressed="true"][data-tone="low"] { background: var(--ct-low);      border-color: var(--ct-low);      color: var(--ct-onsolid); }
.ct-choice > button[aria-pressed="true"][data-tone="critical"] { background: var(--ct-critical); border-color: var(--ct-critical); color: var(--ct-onsolid); }
.ct-choice > button[aria-pressed="true"][data-tone="high"] { background: var(--ct-high);     border-color: var(--ct-high);     color: var(--ct-onsolid); }
.ct-choice[data-size="xs"] > button { height: var(--ct-h-xs); min-width: var(--ct-h-xs); padding: 0 6px; font-size: 11px; }
.ct-choice[data-mono] > button { font-family: var(--ct-font-mono); }

/* Hover tooltip, fed by data-tip. The pattern was duplicated in
   Pilot and Risk under .catalog-btn-sm:hover::after. */
.ct-tip { position: relative; }
.ct-tip[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%); margin-bottom: 4px;
  background: var(--ct-ink); color: var(--ct-onaccent);
  padding: 3px 8px; border-radius: var(--ct-r-sm); font-size: 11px;
  white-space: nowrap; pointer-events: none; z-index: 100;
}

/* 9.5 .ct-card · .ct-kpi · .ct-meter · .ct-empty */
.ct-card {
  background: var(--ct-surface); border: 1px solid var(--ct-line);
  border-radius: var(--ct-r-lg); box-shadow: var(--ct-shadow-card); overflow: hidden;
}
.ct-card-head { display: flex; align-items: center; gap: var(--ct-s3); padding: 13px 18px; border-bottom: 1px solid var(--ct-line); }
.ct-card-title { font-size: 14px; font-weight: 600; color: var(--ct-ink); flex: 1; }
.ct-card-body { padding: 18px; }

.ct-kpigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--ct-s3); }
.ct-kpi { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-r-lg); box-shadow: var(--ct-shadow-card); overflow: hidden; display: flex; flex-direction: column; }
.ct-kpi-tone { height: 3px; background: var(--ct-neutral); }
.ct-kpi[data-tone="critical"] .ct-kpi-tone { background: var(--ct-critical); }
.ct-kpi[data-tone="high"]     .ct-kpi-tone { background: var(--ct-high); }
.ct-kpi[data-tone="medium"]   .ct-kpi-tone { background: var(--ct-medium); }
.ct-kpi[data-tone="low"]      .ct-kpi-tone { background: var(--ct-low); }
.ct-kpi[data-tone="info"]     .ct-kpi-tone { background: var(--ct-info); }
/* "value" emphasis: the value takes the tone ink (criticality). -ink tokens, AA 6, 5-9:1. Default = neutral value + border only. (audit v2 §04) */
.ct-kpi[data-emphasis="value"][data-tone="critical"] .ct-kpi-value { color: var(--ct-critical-ink); }
.ct-kpi[data-emphasis="value"][data-tone="high"]     .ct-kpi-value { color: var(--ct-high-ink); }
.ct-kpi[data-emphasis="value"][data-tone="medium"]   .ct-kpi-value { color: var(--ct-medium-ink); }
.ct-kpi[data-emphasis="value"][data-tone="low"]      .ct-kpi-value { color: var(--ct-low-ink); }
.ct-kpi[data-emphasis="value"][data-tone="info"]     .ct-kpi-value { color: var(--ct-info-ink); }
.ct-kpi-body { padding: 14px 18px 15px; display: flex; flex-direction: column; gap: var(--ct-s3); flex: 1; }
.ct-kpi-label { font-size: var(--ct-text-label); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ct-ink-2); }
.ct-kpi-value { font-family: var(--ct-font-mono); font-size: 30px; font-weight: 500; line-height: 1; color: var(--ct-ink); font-variant-numeric: tabular-nums; margin-top: auto; }
.ct-kpi-unit { font-size: var(--ct-text-data); color: var(--ct-ink-2); }
.ct-kpi-split { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.ct-kpi[data-density="dense"] .ct-kpi-body { padding: 13px 16px 15px; gap: 7px; }
.ct-kpi[data-density="dense"] .ct-kpi-value { font-size: 26px; }

/* .ct-kpi-adv — advanced KPI tile: a superset of .ct-kpi. Adds a title, a
   source badge (Auto/Ext), a state pill, a status, thresholds on one line, an
   optional chart slot (.ct-kpi-adv-viz, e.g. .ct-meter) and a footer note
   (.ct-kpi-adv-foot). Reuses the tone border and value ink of the .ct-kpi
   system — a dashboard can mix both formats seamlessly.
   Couvre le kpi-card de pilot et les indicateurs de compliance. (audit v2 §P3) */
.ct-kpi-adv { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-r-lg); box-shadow: var(--ct-shadow-card); overflow: hidden; display: flex; flex-direction: column; }
.ct-kpi-adv.ct-clickable:hover { border-color: var(--ct-line-strong); }
.ct-kpi-adv[data-tone="critical"] .ct-kpi-tone { background: var(--ct-critical); }
.ct-kpi-adv[data-tone="high"]     .ct-kpi-tone { background: var(--ct-high); }
.ct-kpi-adv[data-tone="medium"]   .ct-kpi-tone { background: var(--ct-medium); }
.ct-kpi-adv[data-tone="low"]      .ct-kpi-tone { background: var(--ct-low); }
.ct-kpi-adv[data-tone="info"]     .ct-kpi-tone { background: var(--ct-info); }
.ct-kpi-adv-body { padding: 15px 18px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ct-kpi-adv-head { display: flex; align-items: flex-start; gap: var(--ct-s2); }
.ct-kpi-adv-title { font-size: var(--ct-text-ui); font-weight: 600; color: var(--ct-ink); line-height: 1.3; flex: 1; }
.ct-kpi-adv-src { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 1px 6px; border-radius: var(--ct-r-sm); white-space: nowrap; flex-shrink: 0; margin-top: 1px; }
.ct-kpi-adv-src[data-src="auto"] { color: var(--ct-info-ink); background: var(--ct-info-tint); }
.ct-kpi-adv-src[data-src="ext"] { color: var(--ct-medium-ink); background: var(--ct-medium-tint); }
.ct-kpi-adv-pill { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; padding: 1px 7px; border-radius: var(--ct-r-pill); white-space: nowrap; flex-shrink: 0; margin-top: 1px; color: var(--ct-neutral-ink); background: var(--ct-neutral-tint); }
.ct-kpi-adv-valrow { display: flex; align-items: baseline; gap: var(--ct-s2); margin-top: auto; flex-wrap: wrap; }
.ct-kpi-adv-value { font-family: var(--ct-font-mono); font-size: 28px; font-weight: 500; line-height: 1; color: var(--ct-ink); font-variant-numeric: tabular-nums; }
.ct-kpi-adv[data-tone="critical"] .ct-kpi-adv-value { color: var(--ct-critical-ink); }
.ct-kpi-adv[data-tone="high"]     .ct-kpi-adv-value { color: var(--ct-high-ink); }
.ct-kpi-adv[data-tone="medium"]   .ct-kpi-adv-value { color: var(--ct-medium-ink); }
.ct-kpi-adv[data-tone="low"]      .ct-kpi-adv-value { color: var(--ct-low-ink); }
.ct-kpi-adv[data-tone="info"]     .ct-kpi-adv-value { color: var(--ct-info-ink); }
.ct-kpi-adv[data-tone="neutral"]  .ct-kpi-adv-value { color: var(--ct-ink-2); }
.ct-kpi-adv-status { font-size: var(--ct-text-meta); font-weight: 600; padding: 1px 7px; border-radius: var(--ct-r-sm); }
.ct-kpi-adv-status[data-tone="critical"] { color: var(--ct-critical-ink); background: var(--ct-critical-tint); }
.ct-kpi-adv-status[data-tone="high"] { color: var(--ct-high-ink); background: var(--ct-high-tint); }
.ct-kpi-adv-status[data-tone="medium"] { color: var(--ct-medium-ink); background: var(--ct-medium-tint); }
.ct-kpi-adv-status[data-tone="low"] { color: var(--ct-low-ink); background: var(--ct-low-tint); }
.ct-kpi-adv-status[data-tone="info"] { color: var(--ct-info-ink); background: var(--ct-info-tint); }
.ct-kpi-adv-status[data-tone="neutral"] { color: var(--ct-neutral-ink); background: var(--ct-neutral-tint); }
.ct-kpi-adv-viz { margin-top: 2px; }
.ct-kpi-adv-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--ct-s1) var(--ct-s2); padding-top: 9px; border-top: 1px solid var(--ct-line-soft); }
.ct-kpi-adv-meta span { white-space: nowrap; font-size: 11px; color: var(--ct-ink-2); font-variant-numeric: tabular-nums; }
.ct-kpi-adv-meta b { color: var(--ct-ink-1); font-weight: 600; }
.ct-kpi-adv-foot { font-size: var(--ct-text-label); color: var(--ct-ink-2); }
.ct-kpi-adv[data-state="inactive"] { opacity: 0.75; background: var(--ct-surface-2); }
.ct-kpi-adv[data-state="inactive"] .ct-kpi-tone { background: var(--ct-line); }
.ct-kpi-adv[data-state="inactive"] .ct-kpi-adv-title { color: var(--ct-ink-2); }

.ct-meter { height: 6px; border-radius: var(--ct-r-pill); background: var(--ct-line-soft); overflow: hidden; }
.ct-meter > span { display: block; height: 100%; border-radius: var(--ct-r-pill); background: var(--ct-accent); }
.ct-meter[data-tone="critical"] > span { background: var(--ct-critical); }
.ct-meter[data-tone="high"]     > span { background: var(--ct-high); }
.ct-meter[data-tone="medium"]   > span { background: var(--ct-medium); }
.ct-meter[data-tone="low"]      > span { background: var(--ct-low); }
.ct-dot { width: 8px; height: 8px; border-radius: var(--ct-r-pill); background: var(--ct-neutral); }
.ct-dot[data-tone="critical"] { background: var(--ct-critical); }
.ct-dot[data-tone="medium"] { background: var(--ct-medium); }
.ct-dot[data-tone="low"] { background: var(--ct-low); }

.ct-empty { padding: 40px 20px 44px; display: flex; flex-direction: column; align-items: center; gap: var(--ct-s3); text-align: center; }
.ct-empty-icon { width: 38px; height: 38px; border-radius: var(--ct-r-pill); background: var(--ct-neutral-tint); border: 1px solid var(--ct-line); display: flex; align-items: center; justify-content: center; color: var(--ct-ink-3); }
.ct-empty-title { font-size: 14px; font-weight: 500; color: var(--ct-ink); }
.ct-empty-text { font-size: var(--ct-text-data); color: var(--ct-ink-2); max-width: 300px; line-height: 1.55; }

/* 9.6 table wrappers  (.ct-table + .ct-bulkbar deferred — see header) */
.ct-tablewrap { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-r-lg); box-shadow: var(--ct-shadow-card); overflow: hidden; }
.ct-tabletoolbar { display: flex; align-items: center; gap: var(--ct-s3); padding: 11px 16px; border-bottom: 1px solid var(--ct-line); }
.ct-tablecount { font-family: var(--ct-font-mono); font-size: 11.5px; color: var(--ct-ink-2); }
.ct-pagination { display: flex; align-items: center; gap: var(--ct-s2); padding: 10px 16px; border-top: 1px solid var(--ct-line); font-size: var(--ct-text-meta); color: var(--ct-ink-2); }
.ct-filters { display: flex; align-items: center; gap: var(--ct-s2); flex-wrap: wrap; }

/* 9.7 .ct-modal (new markup — additive; legacy .ct-modal-* kept) · .ct-tabs */
.ct-modal { width: 100%; max-width: 560px; max-height: calc(100vh - 64px); display: flex; flex-direction: column;
  background: var(--ct-surface); border-radius: var(--ct-r-xl); box-shadow: var(--ct-shadow-overlay); overflow: hidden; }
.ct-modal[data-width="sm"] { max-width: 420px; }
.ct-modal[data-width="lg"] { max-width: 860px; }
.ct-modal-head { display: flex; align-items: center; gap: var(--ct-s3); padding: 18px 22px; border-bottom: 1px solid var(--ct-line); }
.ct-modal-title { font-size: var(--ct-text-section); font-weight: 600; color: var(--ct-ink); flex: 1; }
.ct-modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--ct-line); background: var(--ct-surface-2); }
/* The modal body did not exist in the v2 family — only -head and -foot were
   defined — and the legacy version further down was limited to a
   margin-bottom. Surface and AppSec each compensated with a local rule, removed as a collision: their modals lost both the
   padding AND the scrolling at once. The shared component emits these three
   names, so the core must serve all of them.
   flex:1 + overflow-y:auto: it is the body that scrolls, never the modal —
   sinon l'en-tete et les actions sortent de l'ecran avec le contenu. */
.ct-modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.ct-modal-header { display: flex; align-items: center; gap: var(--ct-s3); padding: 18px 22px;
                   border-bottom: 1px solid var(--ct-line); font-size: var(--ct-text-section);
                   font-weight: 600; color: var(--ct-ink); }
/* Buttons that do not fit on one line go to the next one, rather than
   squeezing their labels onto two (a narrow window, a phone). */
.ct-modal-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 16px 22px;
                   border-top: 1px solid var(--ct-line); background: var(--ct-surface-2); }

.ct-tabs { display: flex; gap: var(--ct-s6); border-bottom: 1px solid var(--ct-line); }
.ct-tab {
  font-family: inherit; padding: 14px 0; border: 0; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-size: var(--ct-text-ui); font-weight: 500; color: var(--ct-ink-2);
  display: flex; align-items: center; gap: 7px; cursor: pointer;
}
.ct-tab:hover { color: var(--ct-ink); }
.ct-tab[aria-selected="true"] { color: var(--ct-ink); border-bottom-color: var(--ct-accent); font-weight: 600; }
.ct-count { font-family: var(--ct-font-mono); font-size: 11px; color: var(--ct-ink-2); background: var(--ct-neutral-tint); border-radius: var(--ct-r-pill); padding: 1px 7px; }

/* 9.8 Chrome — .ct-appbar · .ct-rail · .ct-pagehead */
.ct-app { height: 100vh; display: flex; flex-direction: column; }
.ct-appbar { position: relative;
  height: var(--ct-appbar-h); flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--ct-surface); border-bottom: 1px solid var(--ct-line); }
.ct-appbar-sep { width: 1px; height: 22px; background: var(--ct-line); }
.ct-appbar-context { display: flex; align-items: center; gap: 7px; font-size: var(--ct-text-data); color: var(--ct-ink-1); }
.ct-appbar-context .ct-sep { color: var(--ct-line-strong); }
.ct-appbar-context .ct-muted { color: var(--ct-ink-2); }
.ct-appbar-saved { font-family: var(--ct-font-mono); font-size: 11.5px; color: var(--ct-ink-2); }
.ct-appbar-saved.error { color: var(--ct-critical); }
.ct-appbar-actions { display: flex; align-items: center; gap: 4px; }
.ct-iconaction { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 0; border-radius: var(--ct-r-md); background: transparent; color: var(--ct-ink-2); cursor: pointer; }
.ct-iconaction:hover { background: var(--ct-neutral-tint); color: var(--ct-ink); }
/* Legacy injected controls (settings gear + github link) inherit dark-toolbar
   white; re-theme them to ink inside the light appbar so they stay visible. */
.ct-appbar-actions .btn-settings, .ct-appbar-actions .btn-github { color: var(--ct-ink-2); }
.ct-appbar-actions .btn-settings:hover, .ct-appbar-actions .btn-github:hover { color: var(--ct-ink); background: var(--ct-neutral-tint) !important; }
.ct-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: var(--ct-r-pill); background: var(--ct-accent-tint); color: var(--ct-accent-ink); font-size: 11.5px; font-weight: 600; }

.ct-modulepicker { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px 0 8px;
  border: 1px solid var(--ct-line); border-radius: var(--ct-r-md); background: var(--ct-surface-2);
  font-size: var(--ct-text-ui); font-weight: 600; color: var(--ct-ink); cursor: pointer; }
.ct-modulepicker:hover { border-color: var(--ct-line-field); }
.ct-modulepicker[aria-expanded="true"] { border-color: var(--ct-accent); background: var(--ct-accent-tint); color: var(--ct-accent-ink); }
.ct-modulemark { width: 18px; height: 18px; flex-shrink: 0; }
.ct-modulemenu { position: absolute; top: 44px; left: 12px; width: 640px; z-index: 900;
  background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-r-xl); box-shadow: var(--ct-shadow-overlay); overflow: hidden; }
.ct-modulemenu-search { padding: 12px 16px; border-bottom: 1px solid var(--ct-line); }
.ct-modulemenu-list { padding: 12px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ct-modulemenu-group { padding: 0 8px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: var(--ct-ink-2); }
.ct-moduleitem { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; border-radius: var(--ct-r-md); background: transparent; text-align: left; cursor: pointer; }
.ct-moduleitem:hover { background: var(--ct-neutral-tint); }
.ct-moduleitem[aria-current="true"] { background: var(--ct-accent-tint); }
.ct-moduleitem-mark { width: 26px; height: 26px; border-radius: var(--ct-r-md); background: var(--ct-neutral-tint);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ct-moduleitem-mark img { width: 17px; height: 17px; }
.ct-moduleitem-name { font-size: var(--ct-text-ui); font-weight: 500; color: var(--ct-ink); }
.ct-moduleitem-desc { font-size: var(--ct-text-meta); color: var(--ct-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ct-body { flex: 1; display: flex; min-height: 0; }
.ct-rail { width: var(--ct-rail-w); flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden;
  transition: width 160ms ease, max-height 240ms ease;
  background: var(--ct-surface-2); border-right: 1px solid var(--ct-line); }
.ct-rail-scroll { flex: 1; overflow-y: auto; padding: 12px 10px; }
.ct-rail-section { margin-top: 14px; }
.ct-rail-group { display: flex; align-items: center; gap: 6px; padding: 0 10px 6px; border: 0; background: none; width: 100%;
  font-size: 10.5px; font-weight: 600; letter-spacing: 1.1px; text-transform: uppercase; color: var(--ct-ink-2); cursor: pointer; }
.ct-rail-group .ct-icon { transition: transform 120ms; }
.ct-rail-group[aria-expanded="true"] .ct-icon { transform: rotate(90deg); }
/* collapse: hide the items following a collapsed group in the same section */
.ct-rail-group[aria-expanded="false"] ~ .ct-rail-item { display: none; }
.ct-rail-item { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 10px; border-radius: var(--ct-r-md);
  font-size: var(--ct-text-ui); font-weight: 500; color: var(--ct-ink-1); text-align: left; cursor: pointer; border: 0; background: transparent; width: 100%; }
.ct-rail-item:hover { background: var(--ct-neutral-tint); }
.ct-rail-item::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: transparent; flex-shrink: 0; }
.ct-rail-item[aria-current="page"] { background: var(--ct-accent-tint); color: var(--ct-ink); font-weight: 600; }
.ct-rail-item[aria-current="page"]::before { background: var(--ct-accent); }
.ct-rail-item-label { flex: 1; }
.ct-rail-subitem { min-height: 28px; padding-left: 22px; font-size: calc(var(--ct-text-ui) - 1px); }
.ct-rail-subitem .ct-rail-item-label { color: var(--ct-ink-2); }
.ct-rail-subitem[aria-current="page"] .ct-rail-item-label { color: var(--ct-ink); }
.ct-rail-count { font-family: var(--ct-font-mono); font-size: 11px; color: var(--ct-ink-2); }
.ct-rail-foot { border-top: 1px solid var(--ct-line); padding: 10px; }
.ct-rail-doc { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 10px; border-radius: var(--ct-r-md); cursor: pointer; }
.ct-rail-doc-name { font-size: 12.5px; font-weight: 500; color: var(--ct-ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-rail-doc-meta { font-family: var(--ct-font-mono); font-size: 10.5px; color: var(--ct-ink-2); }

.ct-content { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px 32px; background: var(--ct-canvas); }
.ct-pagehead { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.ct-pagehead-main { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.ct-crumbs { display: flex; align-items: center; gap: 7px; font-family: var(--ct-font-mono); font-size: 11.5px; color: var(--ct-ink-2); }
.ct-crumbs .ct-sep { color: var(--ct-line-strong); }
.ct-crumbs [aria-current="page"] { color: var(--ct-ink); }
.ct-pagetitle { font-size: var(--ct-text-page); font-weight: 600; color: var(--ct-ink); letter-spacing: -0.3px; }
.ct-pagesub { font-size: var(--ct-text-ui); color: var(--ct-ink-2); line-height: 1.55; max-width: 640px; }
.ct-pagehead-actions { display: flex; gap: var(--ct-s2); padding-top: 22px; }

/* 9.9 Impression (new chrome) */
@media print {
  .ct-appbar, .ct-rail, .ct-tabletoolbar, .ct-pagehead-actions, .ct-bulkbar, .ct-pagination { display: none !important; }
  .ct-content { overflow: visible; padding: 0; background: #fff; }
  .ct-card, .ct-kpi, .ct-tablewrap { box-shadow: none; break-inside: avoid; }
}

/* ═══════════════════ 5. UTILITAIRES + ATOMES ct-* ═══════════════════
   Le systeme cible : utilitaires de typographie/espacement, et atomes
   composant les combinaisons d'inline-styles les plus repetees.
   Ce bloc etait physiquement range dans la section LEGACY, ce qui donnait
   a lire l'inverse de la realite — les classes ct-* sont ce vers quoi on
   migre, pas ce dont on part.                                            */

/* ── Utility classes ── */
.hidden { display: none; }
.text-muted { color: var(--ct-ink-2); }
.flex-spacer { flex: 1; }
/* ── Utilitaires ct-* : typographie et espacement ────────────────────────
   Les tailles en em arbitraires (0.85, 0.78, 0.82, 0.9…) convergent vers
   l'echelle du socle ; l'ecart maximum est de 0.9px. Les marges convergent
   vers --ct-s1..s6, ecart maximum 2px. Le prefixe dit d'ou vient la regle. */
.ct-text-label { font-size: var(--ct-text-label); }
.ct-text-meta { font-size: var(--ct-text-meta); }
.ct-text-data { font-size: var(--ct-text-data); }
.ct-text-ui { font-size: var(--ct-text-ui); }
.ct-text-body { font-size: var(--ct-text-body); }
.ct-text-section { font-size: var(--ct-text-section); }
.ct-text-page { font-size: var(--ct-text-page); }

/* ── ct-* atoms: the most repeated combinations of the inline styles ────────
   Measured across the nine modules. They compose with .ct-text-* and
   .ct-mt-/.ct-mb-*: `font-size:…;color:…` becomes `ct-text-label ct-muted`. */
.ct-muted { color: var(--ct-ink-2); }
.ct-text-critical { color: var(--ct-critical); }
.ct-strong { font-weight: 600; }
.ct-flex-1 { flex: 1; }
.ct-w-full { width: 100%; }
.ct-m-0 { margin: 0; }
.ct-clickable { cursor: pointer; }
.ct-link { color: var(--ct-accent); text-decoration: underline dotted; text-underline-offset: 2px; }
.ct-clickable:hover .ct-link { text-decoration-style: solid; }
.ct-link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--ct-accent); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.ct-link-btn:hover { text-decoration-style: solid; }
.ct-hidden { display: none; }
.ct-row { display: flex; align-items: center; gap: var(--ct-s2); }
.ct-row-wrap { flex-wrap: wrap; }
.ct-row-between { justify-content: space-between; }

/* Presentation atoms (batch 2): they unblock the decomposition of the
   residual inline styles that carry no business meaning. Measured across the
   nine modules: display:flex 140x, the block border 108x, align-items 96x,
   gap 80x. */
.ct-flex { display: flex; }
.ct-block { display: block; }
.ct-items-center { align-items: center; }
.ct-items-baseline { align-items: baseline; }
.ct-items-end { align-items: flex-end; }
.ct-flex-wrap { flex-wrap: wrap; }
.ct-gap-1 { gap: var(--ct-s1); }
.ct-gap-2 { gap: var(--ct-s2); }
.ct-gap-3 { gap: var(--ct-s3); }
.ct-bordered { border: 1px solid var(--ct-line); }
.ct-no-border { border: none; }
.ct-r-sm { border-radius: var(--ct-r-sm); }
.ct-r-md { border-radius: var(--ct-r-md); }
.ct-ta-c { text-align: center; }
.ct-ta-r { text-align: right; }
.ct-ink-1 { color: var(--ct-ink-1); }
.ct-bg-alt { background: var(--ct-surface-2); }
.ct-mono { font-family: var(--ct-font-mono); }

/* Named padding and spacing (batch 3): the values are already expressed as
   tokens, so these classes merely give them a name. */
.ct-p-1 { padding: var(--ct-s1); }
.ct-p-2 { padding: var(--ct-s2); }
.ct-p-3 { padding: var(--ct-s3); }
.ct-p-4 { padding: var(--ct-s4); }
.ct-p-5 { padding: var(--ct-s5); }
.ct-p-6 { padding: var(--ct-s6); }
.ct-p-8 { padding: var(--ct-s8); }
.ct-px-1 { padding-left: var(--ct-s1); padding-right: var(--ct-s1); }
.ct-py-1 { padding-top: var(--ct-s1); padding-bottom: var(--ct-s1); }
.ct-px-2 { padding-left: var(--ct-s2); padding-right: var(--ct-s2); }
.ct-py-2 { padding-top: var(--ct-s2); padding-bottom: var(--ct-s2); }
.ct-px-3 { padding-left: var(--ct-s3); padding-right: var(--ct-s3); }
.ct-py-3 { padding-top: var(--ct-s3); padding-bottom: var(--ct-s3); }
.ct-px-4 { padding-left: var(--ct-s4); padding-right: var(--ct-s4); }
.ct-py-4 { padding-top: var(--ct-s4); padding-bottom: var(--ct-s4); }

/* Atoms (batch 4): measurements of the declarations that were still blocking
   the decomposition — display:grid 28x, font-weight:700 23x, the directional
   borders 27x, background:none 16x. */
.ct-grid { display: grid; }
.ct-inline-flex { display: inline-flex; }
.ct-bold { font-weight: 700; }
.ct-r-lg { border-radius: var(--ct-r-lg); }
.ct-r-xl { border-radius: var(--ct-r-xl); }
.ct-ta-l { text-align: left; }
.ct-bg-none { background: none; }
.ct-bg-surface { background: var(--ct-surface); }
.ct-upper { text-transform: uppercase; }
.ct-justify-end { justify-content: flex-end; }
.ct-justify-between { justify-content: space-between; }
.ct-ink-2 { color: var(--ct-ink-2); }
.ct-border-top { border-top: 1px solid var(--ct-line); }
.ct-border-bottom { border-bottom: 1px solid var(--ct-line); }
.ct-nowrap { white-space: nowrap; }
.ct-overflow-hidden { overflow: hidden; }
.ct-ink { color: var(--ct-ink); }
.ct-font-inherit { font-family: inherit; }
/* Two equal-column form grid: repeated inline pattern (side-by-side fields
   in the modals). The gap and data size are fixed here. */
.ct-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ct-s2) var(--ct-s3); font-size: var(--ct-text-data); }
/* Section overline: small spaced capitals. Replaces the inline
   font-size/weight/uppercase/letter-spacing repeated above the groups. */
.ct-overline { font-size: var(--ct-text-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ct-ink-1); }
.ct-px-0 { padding-left: 0; padding-right: 0; }
.ct-py-0 { padding-top: 0; padding-bottom: 0; }

/* Atoms (batch 5). .ct-truncate is the only one that carries a meaning: the
   overflow + ellipsis + nowrap triad is a pattern, not three settings. */
.ct-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-col { flex-direction: column; }
.ct-items-start { align-items: flex-start; }
.ct-scroll-y { overflow-y: auto; }
.ct-italic { font-style: italic; }
.ct-normal { font-weight: 400; }
.ct-collapse { border-collapse: collapse; }
.ct-resize-y { resize: vertical; }
.ct-grid-2 { grid-template-columns: 1fr 1fr; }
.ct-bg-accent { background: var(--ct-accent); }
.ct-bg-canvas { background: var(--ct-canvas); }
.ct-border-bottom-alt { border-bottom: 1px solid var(--ct-surface-2); }
.ct-ml-1 { margin-left: var(--ct-s1); }
.ct-ml-2 { margin-left: var(--ct-s2); }
.ct-box { box-sizing: border-box; }

/* Atoms (batch 6): generated from the remaining declarations that repeat at
   least twice. Named after the convention already in place —
   ct-text-<tone> and ct-bg-<tone>, like ct-text-critical. */
/* color */
.ct-bg-critical-fill { background: var(--ct-critical-fill); }
.ct-bg-critical-tint { background: var(--ct-critical-tint); }
.ct-bg-high-tint { background: var(--ct-high-tint); }
.ct-bg-info-tint { background: var(--ct-info-tint); }
.ct-bg-ink-2 { background: var(--ct-ink-2); }
.ct-bg-line { background: var(--ct-line); }
.ct-bg-low-tint { background: var(--ct-low-tint); }
.ct-bg-medium-tint { background: var(--ct-medium-tint); }
.ct-text-accent { color: var(--ct-accent); }
.ct-text-accent-ink { color: var(--ct-accent-ink); }
.ct-text-critical-ink { color: var(--ct-critical-ink); }
.ct-text-high { color: var(--ct-high); }
.ct-text-high-ink { color: var(--ct-high-ink); }
.ct-text-info { color: var(--ct-info); }
.ct-text-info-ink { color: var(--ct-info-ink); }
.ct-text-low { color: var(--ct-low); }
.ct-text-low-ink { color: var(--ct-low-ink); }
.ct-text-medium { color: var(--ct-medium); }
.ct-text-onsolid { color: var(--ct-onsolid); }
/* bordure */
.ct-bordered-line-strong { border: 1px solid var(--ct-line-strong); }
/* dimension */
.ct-h-14 { height: 14px; }
.ct-h-3 { height: 3px; }
.ct-h-8 { height: 8px; }
.ct-maxh-150 { max-height: 150px; }
.ct-maxw-200 { max-width: 200px; }
.ct-maxw-240 { max-width: 240px; }
.ct-maxw-250 { max-width: 250px; }
.ct-maxw-300 { max-width: 300px; }
.ct-minh-40 { min-height: 40px; }
.ct-minw-0 { min-width: 0; }
.ct-minw-120 { min-width: 120px; }
.ct-minw-140 { min-width: 140px; }
.ct-minw-150 { min-width: 150px; }
.ct-minw-160 { min-width: 160px; }
.ct-minw-180 { min-width: 180px; }
.ct-minw-200 { min-width: 200px; }
.ct-minw-220 { min-width: 220px; }
.ct-minw-320 { min-width: 320px; }
.ct-minw-80 { min-width: 80px; }
.ct-w-110 { width: 110px; }
.ct-w-120 { width: 120px; }
.ct-w-14 { width: 14px; }
.ct-w-140 { width: 140px; }
.ct-w-160 { width: 160px; }
.ct-w-170 { width: 170px; }
.ct-w-200 { width: 200px; }
.ct-w-30 { width: 30px; }
.ct-w-40 { width: 40px; }
.ct-w-50 { width: 50px; }
.ct-w-52 { width: 52px; }
.ct-w-60 { width: 60px; }
.ct-w-64 { width: 64px; }
.ct-w-70 { width: 70px; }
.ct-w-80 { width: 80px; }
.ct-w-90 { width: 90px; }
.ct-w-auto { width: auto; }
/* mise en page */
.ct-absolute { position: absolute; }
.ct-break-all { word-break: break-all; }
.ct-col-span-2 { grid-column: span 2; }
.ct-ellipsis { text-overflow: ellipsis; }
.ct-justify-center { justify-content: center; }
.ct-ml-auto { margin-left: auto; }
.ct-no-shrink { flex-shrink: 0; }
.ct-no-underline { text-decoration: none; }
.ct-scroll { overflow: auto; }
.ct-scroll-x { overflow-x: auto; }
.ct-self-center { align-self: center; }
.ct-va-middle { vertical-align: middle; }
.ct-va-top { vertical-align: top; }
.ct-gap-4 { gap: var(--ct-s4); }
.ct-gap-5 { gap: var(--ct-s5); }
.ct-gap-6 { gap: var(--ct-s6); }
.ct-mt-1 { margin-top: var(--ct-s1); }    .ct-mb-1 { margin-bottom: var(--ct-s1); }
.ct-mt-2 { margin-top: var(--ct-s2); }    .ct-mb-2 { margin-bottom: var(--ct-s2); }
.ct-mt-3 { margin-top: var(--ct-s3); }    .ct-mb-3 { margin-bottom: var(--ct-s3); }
.ct-mt-4 { margin-top: var(--ct-s4); }    .ct-mb-4 { margin-bottom: var(--ct-s4); }
.ct-mt-5 { margin-top: var(--ct-s5); }    .ct-mb-5 { margin-bottom: var(--ct-s5); }
.ct-mt-6 { margin-top: var(--ct-s6); }    .ct-mb-6 { margin-bottom: var(--ct-s6); }

.fs-sm { font-size: 0.85em; }
.fs-xs { font-size: 0.8em; }
.w-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.ta-c { text-align: center; }
.fw-600 { font-weight: 600; }
.desc-text { font-size: 0.82em; color: var(--ct-ink-2); line-height: 1.4; margin-top: 2px; }
.slider-label { font-weight: 700; font-size: 0.82em; color: var(--ct-ink-2); min-width: 20px; }
.slider-input { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--ct-line); outline: none; margin: 0; padding: 0; width: 100%; cursor: pointer; }
.slider-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ct-accent); border: 2px solid var(--ct-surface); box-shadow: 0 1px 2px rgba(0,0,0,0.25); cursor: pointer; }
.slider-input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ct-accent); border: 2px solid var(--ct-surface); box-shadow: 0 1px 2px rgba(0,0,0,0.25); cursor: pointer; }
.section-heading { margin: 24px 0 8px; color: var(--ct-ink); }

/* ═══════════════ 6. COMPOSANTS ct-* (partages) ═══════════════
   Classes de composant, conformes a la convention : elles portent le
   prefixe et appartiennent a un composant precis (journal, userpicker,
   bulkbar, modale...).

   Elles etaient rangees sous LEGACY, ce qui les faisait compter comme de
   la dette alors qu'elles sont la cible : un composant a besoin de ses
   propres classes, un menu deroulant ne s'exprime pas en utilitaires.

   Restent en section 7 les classes conformes qui partagent une regle avec
   du non conforme : les deplacer changerait l'ordre de cascade, et quatre
   d'entre elles definissent les memes proprietes des deux cotes.        */

/* Language selector (N-language dropdown, positioned fixed from JS). */
.ct-lang-menu {
    position: fixed; z-index: 600; background: var(--ct-surface);
    border: 1px solid var(--ct-line); border-radius: var(--ct-r-md);
    box-shadow: var(--ct-shadow-overlay); padding: 4px; min-width: 150px;
    display: flex; flex-direction: column;
}
.ct-lang-check { color: var(--ct-accent); }
.ct-bulkbar__count { font-weight:600; color:var(--ct-accent); font-size:0.9em; }
.ct-bulkbar__actions { display:flex; gap:8px; flex:1; }
.ct-bulkbar__btn { padding:6px 12px; border-radius:6px; border:1px solid var(--ct-line); background:var(--ct-surface); cursor:pointer; font-size:0.85em; display:inline-flex; align-items:center; gap:6px; }
.ct-bulkbar__btn:hover { background:var(--ct-surface-2); }
.ct-bulkbar__btn--danger { color: var(--ct-onsolid); background:var(--ct-critical); border-color:var(--ct-critical); }
.ct-bulkbar__btn--success { color: var(--ct-onaccent); background:var(--ct-accent); border-color:var(--ct-accent); }
.ct-bulkbar__btn--primary { color: var(--ct-onaccent); background:var(--ct-accent); border-color:var(--ct-accent); }
.ct-bulkbar__btn--warning { color: var(--ct-onsolid); background:var(--ct-high); border-color:var(--ct-high); }
.ct-bulkbar__btn--info { color: var(--ct-onaccent); background:var(--ct-accent); border-color:var(--ct-accent); }
.ct-bulkbar__btn--muted { color: var(--ct-onsolid); background:var(--ct-neutral); border-color:var(--ct-neutral); }
.ct-bulkbar__clear { color:var(--ct-ink-2); }
.ct-modal-btn { padding:4px 12px; line-height:1.4; border-radius:6px; border:1px solid var(--ct-line); background:var(--ct-surface-2); color:var(--ct-ink); cursor:pointer; font-size:0.85em; transition: background 120ms, border-color 120ms, color 120ms; }
.ct-modal-btn:hover { background:var(--ct-canvas); border-color:var(--ct-line-hover); }
.ct-modal-btn--primary { background:var(--ct-accent); color: var(--ct-onaccent); border-color:var(--ct-accent); }
.ct-modal-btn--primary:hover { background:var(--ct-accent-hover); border-color:var(--ct-accent-hover); }
/* Destructive: tinted at rest, solid red on hover (Delete button spec). */
.ct-modal-btn--danger { background:var(--ct-danger-tint); color:var(--ct-critical-ink); border-color:var(--ct-danger-line); }
.ct-modal-btn--danger:hover { background:var(--ct-critical); color:var(--ct-onsolid); border-color:var(--ct-critical); }
/* ── Donut legend (emitted by _svgDonut) ─────────────────────────
   _svgDonut is a shared helper but these classes were styled in Pilot.css
   only: any other module calling it rendered a broken legend (0×0 color
   chips, block layout). Emitted by the socle → styled by the socle. */
.ct-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ct-donut-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; font-size: 0.72em; color: var(--ct-ink-2); }
.ct-donut-legend-item { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ct-donut-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
/* ── Risk matrices (SVG generated by ctRenderMatrix) ─────────────
   The generator used to emit hard-coded colours — stroke="white", fill="#3c4453", fill="#6b7488" — and eight modules patched them in dark
   mode with selectors matching the VALUE: svg text[fill="#3c4453"].
   Those rules broke silently, with no red test, at the first hue tweak. The
   generator now emits classes, and the theme does the rest.
   The separating stroke is --ct-surface, which gives white in light mode and
   the dark surface in dark mode: the patch had not invented anything. */
.ct-matrix-cell { stroke: var(--ct-surface); }
.ct-matrix-dot { fill: var(--ct-accent); stroke: var(--ct-surface); }
.ct-matrix-axis { fill: var(--ct-ink-1); }
.ct-matrix-tick { fill: var(--ct-ink-2); }
/* ── ct_actions (legacy) ── */
.ct-actions { display:flex; gap:6px; align-items:center; }
.ct-btn-action { width:28px; height:28px; border:1px solid var(--ct-line); background:var(--ct-surface); border-radius:4px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; color:var(--ct-ink-2); transition:all 0.15s; }
.ct-btn-action:hover { color:var(--ct-accent); border-color:var(--ct-accent); }
.ct-btn-action--danger:hover { color:var(--ct-critical); border-color:var(--ct-critical); }
.ct-measure-form__row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ct-measure-journal { display:flex; flex-direction:column; gap:6px; width:100%; box-sizing:border-box; }
.ct-measure-journal .ct-journal-lbl { font-size:0.82em; font-weight:600; color:var(--ct-ink-2); }
.ct-journal-body { width:100%; }
.ct-journal-entry { font-size:0.8em; line-height:1.45; border-left:3px solid var(--ct-line); padding:1px 0 1px 8px; }
.ct-journal-entry + .ct-journal-entry { margin-top:4px; }
.ct-journal-meta { font-size:0.92em; color:var(--ct-ink-2); white-space:nowrap; }
.ct-journal-sep { color:var(--ct-ink-2); }
.ct-journal-text { white-space:pre-wrap; word-break:break-word; }
.ct-journal-empty { font-size:0.8em; color:var(--ct-ink-2); font-style:italic; }
.ct-journal-history-link { margin-top:4px; padding:0; background:none; border:none; color:var(--ct-accent); font-size:0.78em; cursor:pointer; text-decoration:underline; }
.ct-journal-add { display:flex; gap:6px; align-items:flex-start; width:100%; }
.ct-journal-add textarea { flex:1 1 auto; min-width:0; min-height:38px; }
.ct-journal-add-btn { flex:0 0 auto; align-self:stretch; padding:6px 12px; border:1px solid var(--ct-line); border-radius:6px; background:var(--ct-surface-2); font-size:0.82em; font-weight:600; cursor:pointer; white-space:nowrap; }
.ct-journal-add-btn:hover { background:var(--ct-line); }
.ct-journal-add-btn:disabled { opacity:0.5; cursor:default; }
.ct-journal-hist-overlay { position:fixed; inset:0; z-index:1100; background:var(--ct-scrim); display:flex; align-items:center; justify-content:center; padding:24px; }
.ct-journal-hist-box { background:var(--ct-surface); border-radius:12px; padding:16px 20px; max-width:520px; width:100%; max-height:80vh; overflow-y:auto; box-shadow:0 8px 32px rgba(0,0,0,0.2); }
.ct-journal-hist-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; font-size:0.9em; }
.ct-journal-hist-close { background:none; border:none; font-size:1.4em; line-height:1; cursor:pointer; color:var(--ct-ink-2); }
.ct-journal-hist-list { display:flex; flex-direction:column; gap:6px; }
.ct-measure-overdue { color:var(--ct-critical); font-weight:600; }
.ct-measure-overdue::after { content:" ⚠"; }
/* ── ct_search (legacy) ── */
.ct-search { position:relative; display:inline-flex; align-items:center; gap:6px; }
.ct-search input { padding:6px 30px 6px 30px; border:1px solid var(--ct-line); border-radius:6px; font-size:0.9em; min-width:240px; }
.ct-search__icon { position:absolute; left:8px; color:var(--ct-ink-2); pointer-events:none; }
.ct-search__clear { position:absolute; right:8px; background:none; border:none; cursor:pointer; color:var(--ct-ink-2); }
.ct-search__clear[hidden] { display:none; }
/* ── ct_filter_pills (legacy) ── */
/* ── ct_userpicker (legacy) ── */
.ct-userpicker { position: relative; }
.ct-userpicker input { width: 100%; padding: 6px 10px; border: 1px solid var(--ct-line); border-radius: 6px; font-size: 0.9em; }
.ct-userpicker-dd {
    z-index: 1100;
    background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 6px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ct-userpicker-dd[hidden] { display: none; }
.ct-userpicker-item { padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--ct-line); }
.ct-userpicker-item:hover { background: var(--ct-surface-2); }
.ct-userpicker-item:last-child { border-bottom: none; }
.ct-userpicker-create {
    padding: 8px 10px; cursor: pointer; background: var(--ct-accent-tint);
    border-top: 2px dashed var(--ct-accent); color: var(--ct-accent);
    font-size: 0.88em; display: flex; align-items: center; gap: 4px;
}
.ct-userpicker-create:hover { background: var(--ct-accent-tint); }
.ct-userpicker-empty { padding: 10px; color: var(--ct-ink-2); font-size: 0.85em; text-align: center; }
/* Several values (renderMulti): the picked ones as tags above the field. */
.ct-userpicker-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 26px; margin-bottom: 6px; }
.ct-userpicker-none { font-size: var(--ct-text-meta); color: var(--ct-ink-2); }
.ct-userpicker-tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; border-radius: var(--ct-r-pill); background: var(--ct-accent-tint); color: var(--ct-accent-ink); font-size: var(--ct-text-meta); font-weight: 500; }
.ct-userpicker-untag { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--ct-r-pill); background: transparent; color: inherit; font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.ct-userpicker-untag:hover, .ct-userpicker-untag:focus-visible { background: var(--ct-surface); }
.ct-userpicker-plain { width: 100%; padding: 6px 10px; border: 1px solid var(--ct-line); border-radius: 6px; font-size: 0.9em; }

/* ═══════════════════ 7. LEGACY (etapes 4-6, en cours) ═══════════════════
   Classes encore emises par les apps non migrees et par le TS partage.
   Elles resolvent leurs couleurs via les alias de transition ci-dessus.
   Inclut les primitives en collision (.ct-table, .ct-badge, .ct-modal-*, .ct-bulkbar, .ct-icon) tant que le TS qui les emet n'est pas migre.

   Etat mesure au 2026-08-30 — 168 classes declarees ici, dont :

     - 62 DEJA CONFORMES : elles portent le prefixe ct- et sont des classes
       de composant (ct-journal-*, ct-userpicker-*, ct-bulkbar__*,
       ct-modal-*). Rien a migrer : elles sont seulement mal classees ici.
       Un composant a besoin de ses propres classes ; les remplacer par des
       utilitaires n'aurait pas de sens.

     - 106 A RENOMMER : sans prefixe ct-. Par famille — btn-* (14), ref-* (9),
       help-* (8), pwd-* (8), sidebar-* (8), role-* (7), np-* (6),
       toolbar-* (6), puis des isolees.


   AVERTISSEMENT sur toute suppression ou renommage ici : une classe est
   emise par au moins cinq mecanismes differents — attribut class= dans du
   TS, classList.add(), HTML statique, construction dynamique
   ('ct-bulkbar__btn--' + variante), et un generateur Python. Une recherche
   qui n'en couvre que quelques-uns conclut a tort qu'une classe est morte.
   Ce piege s'est referme trois fois : 86 classes annoncees mortes, puis 45,
   27, 11, et finalement 5.                                                */

/* ── Inline SVG icon (legacy — _icon()) ── */
.ct-icon { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }

/* ── Toolbar ── */
.toolbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200; height: 40px;
    background: var(--ct-ink); padding: 0 20px;
    display: flex; gap: 10px; align-items: center;
    box-shadow: none;
}
.toolbar .app-title { color: white; font-weight: 700; font-size: 1em; margin-right: auto; }
.toolbar .app-subtitle { color: rgba(255,255,255,0.7); font-size: 0.85em; margin-right: 16px; }
.toolbar button {
    padding: 5px 14px; border: none; border-radius: 4px; cursor: pointer;
    font-weight: 600; font-size: 0.8em; transition: opacity 0.2s;
}
.toolbar button:hover { opacity: 0.85; }
.toolbar .status { color: rgba(255,255,255,0.7); font-size: 0.8em; margin-left: 8px; }
.ct-toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
/* The signed-in user block a module mounts before #toolbar-right
   (_userPillHTML): pushed to the right at every width. */
.ct-toolbar-user { display: flex; align-items: center; gap: var(--ct-s1); margin-left: auto; flex-shrink: 0; }
.ct-toolbar-user-name { color: var(--ct-ink-1); font-size: var(--ct-text-label); margin: 0 var(--ct-s1); }

.btn-settings {
    display: flex; align-items: center; justify-content: center;
    padding: 4px; background: none !important; border: none; color: rgba(255,255,255,0.5);
    cursor: pointer; transition: all 0.15s; border-radius: 50%;
}
.btn-settings:hover { color: white; background: rgba(255,255,255,0.1) !important; }
.btn-github {
    display: flex; align-items: center; justify-content: center;
    padding: 4px; color: rgba(255,255,255,0.5); border-radius: 50%; transition: all 0.15s; text-decoration: none;
}
.btn-github:hover { color: white; background: rgba(255,255,255,0.1); }

.toolbar-menu { position: relative; }
.btn-menu { padding: 5px 14px; border: 1px solid var(--ct-line); border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.8em; background: var(--ct-surface); color: var(--ct-ink); transition: background 120ms, border-color 120ms; }
.btn-menu:hover { background: var(--ct-canvas); border-color: var(--ct-line-hover); }
.btn-menu:hover { opacity: 0.9; }
.toolbar-dropdown {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--ct-surface); border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    min-width: 180px; z-index: 300; overflow: hidden;
}
.toolbar-dropdown.open { display: block; }
.toolbar-dropdown-item {
    padding: 8px 16px; cursor: pointer; font-size: 0.85em; color: var(--ct-ink);
    transition: background 0.15s;
}
.toolbar-dropdown-item:hover { background: var(--ct-neutral-tint); }
.toolbar-dropdown-sep { height: 1px; background: var(--ct-line); margin: 2px 0; }
.ct-lang-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; text-align: left; background: none; border: none;
    border-radius: var(--ct-r-sm); padding: 7px 10px; font: inherit;
    font-size: var(--ct-text-ui); color: var(--ct-ink); cursor: pointer;
}
.ct-lang-item:hover { background: var(--ct-canvas); }
.ct-lang-item.active { color: var(--ct-accent-ink); font-weight: 600; }

.btn-hamburger { display: inline-block; background: none !important; border: none; color: var(--ct-ink-1); font-size: 1.8em !important; cursor: pointer; padding: 4px 10px 4px 0 !important; }
/* ── Responsive breakpoints (shared convention) ──────────────────
   Desktop-first approach (max-width). One single set, to be respected in ALL
   modules — an @media outside this set breaks consistency
   (checked before every release):
     480px  — small mobile
     768px  — mobile / portrait tablet   (main breakpoint)
     1024px — landscape tablet / small desktop
   The values cannot go through a variable (custom properties are not resolved
   inside a media query): they stay literal. */
@media (max-width: 768px) { }

/* ── Buttons — legacy .btn family ── */
/* Unified button system — aligned with .ct-btn (neutral = outline surface +
   line border; coloured variants = solid fill + matching border). All tokens
   theme-aware so buttons never go white in dark mode. */

/* ── Restore banner ── */
.restore-banner {
    position: fixed; top: 40px; left: 0; right: 0; z-index: 190;
    background: var(--ct-neutral-tint); border-bottom: 1px solid var(--ct-accent); color: var(--ct-ink);
    padding: 8px 20px; display: flex; align-items: center; gap: 12px; font-size: 0.85em;
}
.restore-banner button { padding: 4px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.85em; font-weight: 600; }
.restore-banner .btn-restore { background: var(--ct-accent); color: var(--ct-onaccent); }
.restore-banner .btn-discard { background: var(--ct-line); color: var(--ct-ink-1); }

/* ── Layout ── */
.app-layout { display: flex; position: fixed; top: 40px; left: 0; right: 0; bottom: 0; transition: top 0.15s; }
.app-layout.with-banner { top: 80px; }

/* ── Sidebar ── */
.sidebar {
    width: 200px; min-width: 200px; background: var(--sidebar-bg); padding: 8px 0;
    overflow-y: auto; border-right: 1px solid rgba(255,255,255,0.1);
    transition: width 0.2s, min-width 0.2s, padding 0.2s;
    display: flex; flex-direction: column; position: relative;
}
.sidebar.collapsed { width: 0; min-width: 0; padding: 0; overflow: hidden; }
.sidebar-collapse {
    position: absolute; top: 6px; right: 6px;
    background: none; border: none;
    color: rgba(255,255,255,0.4); font-size: 1.1em; cursor: pointer;
    transition: color 0.15s;
}
.sidebar-collapse:hover { color: white; }
.sidebar-item {
    padding: 8px 14px; cursor: pointer; color: rgba(255,255,255,0.85);
    font-size: 0.9em; transition: all 0.15s; border-left: 3px solid transparent;
}
.sidebar-item:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-item.active { background: rgba(90,75,216,0.20); color: white; border-left-color: var(--ct-accent); font-weight: 600; }
.sidebar-section { padding: 4px 14px; color: rgba(255,255,255,0.45); font-size: 0.7em; text-transform: uppercase; letter-spacing: 1px; margin-top: 10px; }
.sidebar-expand {
    position: fixed; top: 48px; left: 0; width: 24px; height: 24px;
    background: var(--sidebar-bg); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 0 50% 50% 0; color: rgba(255,255,255,0.7); font-size: 0.8em;
    cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 10;
}
.sidebar-expand:hover { background: var(--ct-accent); color: var(--ct-onaccent); }
.sidebar.collapsed ~ .sidebar-expand { display: flex; }

/* ── Main content ── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.container { padding: 16px 20px; overflow-y: auto; flex: 1; background: var(--ct-surface); position: relative; z-index: 1; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.ct-panel-desc { background: var(--ct-neutral-tint); border-left: 4px solid var(--ct-accent); padding: 12px 16px; margin-bottom: 16px; border-radius: 0 6px 6px 0; font-size: 0.9em; color: var(--ct-ink); }

/* ── Base form controls — theme-aware + uniform shape (dark mode: no UA white) ── */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), textarea, select {
    background: var(--ct-surface); color: var(--ct-ink);
    border: 1px solid var(--ct-line); border-radius: var(--ct-r-sm);
    /* Form controls do not inherit typography: without these two lines the
       browser applies its system font to them (Arial 13.33px) instead of the
       application's. Only `td select` corrected it, hence in tables only.
       Element selector: the .ct-input / .ct-select primitives keep their own
       size. */
    font-family: inherit;
    /* `inherit` rather than a fixed value: this rule has four :not(), hence a
       specificity (0,4,1) higher than that of `td input` (0,3,2). A fixed size
       would override the cell context and inflate the table fields. Inherited,
       it resolves to --ct-text-body outside a table and to the cell size
       inside one. */
    font-size: inherit;
}

/* ── Tables (legacy nu + .ct-table) ── */
table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
th, td { padding: 6px 10px; border: 1px solid var(--ct-line); text-align: left; vertical-align: top; white-space: normal; word-wrap: break-word; }
th { background: var(--ct-surface-2); color: var(--ct-ink-2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; position: relative; }
tbody tr td { background: var(--ct-surface); }
th .col-hide { position: absolute; top: 2px; right: 2px; background: none; border: none; color: var(--ct-ink-2); cursor: pointer; font-size: 0.9em; padding: 0 3px; line-height: 1; }
th .col-hide:hover { color: var(--ct-ink); }

td > input:not([type="checkbox"]):not([type="radio"]), td > select, td input:not([type="checkbox"]):not([type="radio"]):not(.ct-ref-search), td select, /* textarea : uniquement pour la typographie. Il est ecarte de la hauteur
   imposee plus bas par sa propre regle, il doit grandir avec son contenu. */
td textarea {
    /* Enforced height: every native control computes its own (input 26px,
       date 28px, select 25px), which misaligns the rows. Relative and not
       absolute: Risk reduces its table font to 0.8em then 0.75em depending on
       the width, and a frozen height would drift there. At 11.9px, calc yields
       26px — identical to the current rendering. textarea is excluded, it must
       be able to grow. */
    height: calc(1.5em + 8px);
    border: 1px solid var(--ct-line);
    border-radius: 4px;
    padding: 3px 6px;
    background: var(--ct-surface);
    color: var(--ct-ink);
    font-size: inherit;
    font-family: inherit;
    max-width: 100%;
    box-sizing: border-box;
    transition: border-color 0.12s, box-shadow 0.12s;
}
td textarea { height: auto; min-height: calc(3em + 8px); }
td > input:not([type="checkbox"]):not([type="radio"]):hover, td > select:hover { border-color: var(--ct-line-field); }
td > input:not([type="checkbox"]):not([type="radio"]):focus, td > select:focus {
    outline: none;
    border-color: var(--ct-accent);
    box-shadow: var(--ct-focus-soft);
}
td > select:disabled { background: var(--ct-canvas); color: var(--ct-ink-2); cursor: not-allowed; }
td .ct-ref-select, td .ct-ref-select * { box-shadow: none; }

/* ── Legacy buttons ── */
/* Action buttons follow the theme accent (SPEC: accent = action/selection);
   green stays reserved for semantic status (badges, ✓ fix, progress). */
/* Destructive: tinted at rest, solid red only on hover (spec bouton Supprimer). */

/* Small icon/text button used in table rows + cards (shared, theme-aware).
   Modules may add tone modifiers (.btn-mini.btn-fix / .btn-fp). */

/* With no background declared, a white ink was written onto the surface, hence
   invisible as soon as no data-tone caught up with the rule. The default case
   must be readable; a call with no tone remains a caller bug. */
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.8em; font-weight: 600;
         background: var(--ct-neutral-tint); color: var(--ct-ink); }

/* ── Undo / Redo ──
   These used to be painted in translucent white, from the days when the rail
   was always dark. The v2 rail follows the theme (--ct-surface-2, light in
   light mode), so white-on-white made the buttons invisible while still
   clickable — the keyboard shortcuts kept working, which is what made the
   regression hard to spot. Tokens now, like every other control. */
.btn-undo, .btn-redo {
    background: var(--ct-surface); border: 1px solid var(--ct-line);
    color: var(--ct-ink-1); font-size: 1.2em; border-radius: var(--ct-r-sm);
    cursor: pointer; padding: 4px 0; transition: all 0.15s; flex: 1;
    text-align: center; line-height: 1;
}
.btn-undo:hover:not(:disabled), .btn-redo:hover:not(:disabled) { background: var(--ct-surface-2); border-color: var(--ct-line-hover); color: var(--ct-ink); opacity: 1 !important; }
.btn-undo:disabled, .btn-redo:disabled { cursor: not-allowed; }

/* ── Column show/hide popup ── */
.btn-show-cols { background: var(--ct-accent); color: var(--ct-onaccent); border: none; padding: 3px 10px; border-radius: 6px; cursor: pointer; font-size: 0.8em; margin-bottom: 6px; transition: all 0.15s; }
.btn-show-cols:hover { opacity: 0.9; }
.cols-popup { display: none; position: absolute; background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 8px; z-index: 300; max-height: 300px; overflow-y: auto; }
.cols-popup.open { display: block; }
.cols-popup label { display: block; padding: 3px 6px; font-size: 0.85em; cursor: pointer; }
.cols-popup label:hover { background: var(--ct-neutral-tint); }

/* ── Password dialog ── */
.ct-pwd-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--ct-scrim); z-index: 600;
    justify-content: center; align-items: center;
}
.ct-pwd-overlay.open { display: flex; }
.ct-pwd-panel {
    background: var(--ct-surface); border-radius: 10px; padding: 24px; width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.ct-pwd-title { font-weight: 700; font-size: 1em; margin-bottom: 16px; color: var(--ct-ink); }
.ct-pwd-input {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--ct-line); border-radius: 6px;
    font-size: 0.95em; margin-bottom: 10px; outline: none;
}
.ct-pwd-input:focus { border-color: var(--ct-accent); }
.ct-pwd-error { color: var(--ct-critical); font-size: 0.85em; margin-bottom: 10px; min-height: 1.2em; }
.ct-pwd-btn { padding: 8px 18px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9em; }
.ct-pwd-cancel { background: var(--ct-surface-2); color: var(--ct-ink-1); border: 1px solid var(--ct-line); }
.ct-pwd-cancel:hover { background: var(--ct-neutral-tint); }
.ct-pwd-ok { background: var(--ct-accent); color: var(--ct-onaccent); }
.ct-pwd-ok:hover { opacity: 0.85; }

/* ── Shared component styles (legacy) ── */
/* Subtle in both themes (the legacy translucent white of the dark rail
   vanished on the light rail). */
.sidebar-brand { display: block; text-align: center; padding: 10px 14px; font-size: 0.75em; color: var(--ct-ink-2); text-decoration: none; letter-spacing: 0.5px; }
.sidebar-brand:hover { color: var(--ct-ink-1); }
.ct-empty-state { text-align: center; padding: 40px; color: var(--ct-ink-2); font-size: 0.9em; }
.opacity-low { opacity: 0.4; }
.btn-group-sm { display: inline-flex; gap: 2px; }
.btn-group-sm button { font-size: 0.72em; padding: 2px 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
/* Metadata card (label + value). Canonical definition hoisted from the
   modules that declared it identically; the core's old flex-column was not
   used anywhere. */
.ct-meta-item { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-r-lg); padding: 10px 16px; flex: 1; min-width: 200px; }
.ct-meta-item label { font-size: 0.72em; font-weight: 600; color: var(--ct-ink-2); text-transform: uppercase; letter-spacing: 0.5px; }
/* Hoisted from Compliance.css and EBIOS_RM.css, identical in both. */
.ct-meta-item .label { font-size: 0.75em; color: var(--ct-ink-2); text-transform: uppercase; }
.ct-meta-item .value { margin-top: 2px; }
/* Shared forms & cards — hoisted from 4 modules (audit v2 §3).
   Identical base in access/asset/pilot/vendor; the modules keep only their
   own refinements (responsive, grid refinements, specific rules).
   Pilot neutralises border/padding inline on its usage — rendering unchanged. */
.ct-tprm-form { background: var(--ct-surface); padding: 16px; border: 1px solid var(--ct-line); border-radius: 8px; }
.ct-tprm-form label { display: block; font-size: 0.75em; font-weight: 600; color: var(--ct-ink-2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }
/* A label that WRAPS a checkbox or a radio is the option's text, not a field
   caption: no uppercase. Access used to say so from its own sheet, keyed on a
   `style*="inline-flex"` attribute that the markup has since dropped — the
   rule matched nothing and the labels went back to capitals (BUG-37). Keyed
   on what the label contains, it cannot go stale that way. */
.ct-tprm-form label:has(> input[type="checkbox"]), .ct-tprm-form label:has(> input[type="radio"]) { display: inline-flex; align-items: center; font-weight: 500; color: inherit; text-transform: none; letter-spacing: normal; }
/* Field inputs only: a checkbox or a radio given width:100% and a field's
   padding took the whole line and pushed its text below (BUG-37). */
.ct-tprm-form input:not([type="checkbox"]):not([type="radio"]), .ct-tprm-form select, .ct-tprm-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--ct-line); border-radius: 6px; font-size: 0.9em; font-family: inherit; box-sizing: border-box; }
.ct-tprm-form input:not([type="checkbox"]):not([type="radio"]):focus, .ct-tprm-form select:focus, .ct-tprm-form textarea:focus { border-color: var(--ct-accent); outline: none; }
/* Forms are responsive: every socle form grid is two columns on a wide screen
   and one below 768 px, where a field spanning the row stops spanning (a span
   in a one-column grid would open a phantom column and overflow). The
   breakpoint lives here only — no module or browser build re-declares it
   (BUG-40). Placed after .ct-tprm-form so the narrower padding wins. */
@media (max-width: 768px) {
    .ct-form-grid, .ct-form-grid[data-cols], .ct-form-2col, .ct-measure-form__row { grid-template-columns: 1fr; }
    .ct-form-grid > .ct-col-span-2, .ct-form-2col > .ct-col-span-2, .ct-measure-form__row > .ct-col-span-2 { grid-column: auto; }
    .ct-tprm-form { padding: 12px; }
}
.ct-form-row { margin-bottom: 10px; }
.ct-groupe-card { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 8px; padding: 12px 16px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s; }
.ct-groupe-card:hover { border-color: var(--ct-accent); }
.ct-compliance-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.72em; font-weight: 700; }
.ct-compliance-tag.ok { background: var(--ct-low-tint); color: var(--ct-low-ink); }
.ct-compliance-tag.ko { background: var(--ct-critical-tint); color: var(--ct-critical-ink); }
.ct-synth-card { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: var(--ct-r-lg); box-shadow: var(--ct-shadow-card); padding: 16px; }
/* Hoisted from Compliance.css and EBIOS_RM.css, identical in both. */
.ct-synth-card h3 { font-size: 0.9em; color: var(--ct-ink); margin-bottom: 8px; }
.ct-ref-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; font-size: 0.72em; font-weight: 600; cursor: pointer; border: 2px solid var(--ct-line); background: var(--ct-surface); transition: all 0.15s; }
.ct-ref-chip.active { border-color: var(--ct-accent); background: var(--ct-neutral-tint); color: var(--ct-accent); }
.ct-ref-chip .chip-x { font-size: 0.9em; color: var(--ct-critical); margin-left: 2px; }
.ct-ref-select { position: relative; }
.ct-ref-tags { display: flex; flex-wrap: wrap; gap: 3px; min-height: 24px; padding: 3px; border: 1px solid var(--ct-line); border-radius: 4px; cursor: pointer; font-size: 0.8em; }
.ct-ref-tags:hover { border-color: var(--ct-accent); }
.ct-ref-tag { display: inline-flex; align-items: center; gap: 3px; background: var(--ct-neutral-tint); padding: 1px 6px; border-radius: 3px; font-size: 0.85em; }
.ct-ref-tag-x { cursor: pointer; color: var(--ct-critical); font-weight: bold; margin-left: 2px; }
/* Fixed, not absolute: the dropdown must escape a scrollable ancestor (e.g.
   a modal body with overflow-y:auto) and sit above the modal overlay
   (z-index 1000). ctRefOpen computes left/top/width on open and flips it up
   when there isn't room below. */
.ct-ref-dropdown { display: none; position: fixed; z-index: 1100; background: var(--ct-surface); border: 1px solid var(--ct-accent); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-height: 220px; overflow-y: auto; }
.ct-ref-dropdown.open { display: block; }
.ct-ref-search { width: 100%; padding: 6px 8px; border: none; border-bottom: 1px solid var(--ct-line); font-size: 0.85em; outline: none; box-sizing: border-box; }
.ct-ref-options { max-height: 160px; overflow-y: auto; }
.ct-ref-option { padding: 4px 8px; cursor: pointer; font-size: 0.82em; display: flex; align-items: center; gap: 6px; }
.ct-ref-option:hover { background: var(--ct-neutral-tint); }
.ct-ref-option input { margin: 0; }
.ct-ref-create { padding: 6px 8px; cursor: pointer; font-size: 0.82em; color: var(--ct-accent); border-top: 1px solid var(--ct-line); }
.ct-ref-create:hover { background: var(--ct-neutral-tint); }
/* In a form, the selector lines up with the inputs around it. */
.ct-ref-field .ct-ref-tags { font-size: inherit; padding: 5px 8px; min-height: 0; border-radius: var(--ct-r-sm); background: var(--ct-surface); }
.ct-ref-field .ct-ref-tag { font-size: 0.9em; padding: 2px 8px; }
.ct-ref-field .ct-ref-option, .ct-ref-field .ct-ref-search, .ct-ref-field .ct-ref-create { font-size: 0.92em; }
.filters-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

/* ── ct_table (legacy — collision, migrates with ct_table.ts) ── */
.ct-table { width:100%; border-collapse:collapse; }
.ct-table thead th { text-align:left; padding:8px 10px; background:var(--ct-surface-2); border-bottom:1px solid var(--ct-line); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:0.04em; color:var(--ct-ink-2); white-space:nowrap; }
.ct-table thead th.sortable { cursor:pointer; user-select:none; }
.ct-table thead th.sortable:hover { background:var(--ct-neutral-tint); }
.ct-table thead th .sort-indicator { opacity:0.5; margin-left:4px; font-size:0.75em; }
.ct-table thead th.sort-active .sort-indicator { opacity:1; }
.ct-table tbody td { padding:6px 10px; border-bottom:1px solid var(--ct-line); font-size:0.88em; vertical-align:middle; }
.ct-table tbody tr:hover { background:var(--ct-surface-2); }
.ct-table tbody tr.selected { background:var(--ct-accent-tint); }
.ct-table .ct-bulk-col { width:32px; text-align:center; }

/* ── Help overlay (legacy) ── */
.help-overlay { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:var(--ct-scrim); z-index:400; overflow-y:auto; }
.help-overlay.open { display:flex; justify-content:center; align-items:flex-start; padding:40px 20px; }
.help-panel { --help-accent:var(--ct-accent); background:var(--ct-surface); border-radius:12px; max-width:900px; width:100%; max-height:90vh; overflow-y:auto; padding:32px; position:relative; box-shadow:0 8px 32px rgba(0,0,0,0.2); }
.close-help, .help-close { position:absolute; top:12px; right:16px; background:none; border:none; font-size:1.5em; line-height:1; cursor:pointer; color:var(--ct-ink-2); padding:4px 8px; }
.close-help:hover, .help-close:hover { color:var(--ct-ink); }
.help-tabs { display:flex; gap:0; border-bottom:2px solid var(--ct-line); margin-bottom:20px; }
.help-tab { padding:8px 16px; cursor:pointer; font-weight:600; font-size:0.85em; color:var(--ct-ink-2); border-bottom:2px solid transparent; margin-bottom:-2px; transition:all 0.15s; }
.help-tab:hover { color:var(--ct-ink); }
.help-tab.active { color:var(--help-accent); border-bottom-color:var(--help-accent); }
.help-content { display:none; }
.help-content.active { display:block; }
.help-subtitle { font-size:0.9em; color:var(--ct-ink-2); margin-bottom:16px; }
.help-panel h1 { font-size:1.3em; color:var(--ct-ink); margin:0 0 12px; }
.help-panel h2 { font-size:1.1em; color:var(--ct-ink); margin:20px 0 8px; padding-bottom:4px; border-bottom:2px solid var(--help-accent); }
.help-panel h3 { font-size:0.95em; color:var(--help-accent); margin:14px 0 6px; }
.help-panel p { margin:8px 0; font-size:0.9em; line-height:1.6; }
.help-panel ul, .help-panel ol { margin:8px 0 12px 20px; font-size:0.9em; line-height:1.6; }
.help-panel li { margin:4px 0; }
.help-panel table { width:100%; border-collapse:collapse; font-size:0.85em; margin:10px 0; }
.help-panel th { background:var(--ct-surface-2); color:var(--ct-ink-2); text-align:left; padding:6px 10px; text-transform:uppercase; font-size:11px; letter-spacing:0.04em; }
.help-panel td { padding:6px 10px; border-bottom:1px solid var(--ct-line); }
.help-panel code { background:var(--ct-neutral-tint); padding:1px 6px; border-radius:3px; font-size:0.88em; }
.help-panel strong { color:var(--ct-ink); }
.help-panel .ct-help-tip, .ct-help-tip { background:var(--ct-neutral-tint); border-left:3px solid var(--help-accent); padding:8px 12px; margin:10px 0; border-radius:0 6px 6px 0; font-size:0.85em; }

/* ── ct_bulkbar (legacy — collision, migrates with ct_bulkbar.ts) ── */
.ct-bulkbar { position:fixed; bottom:0; left:0; right:0; z-index:999; background:var(--ct-surface); border-top:1px solid var(--ct-line); box-shadow:0 -4px 12px rgba(0,0,0,0.08); padding:10px 20px; display:flex; align-items:center; gap:12px; }
.ct-bulkbar[hidden] { display:none !important; }

/* ── Sidebar accordion (legacy) ── */
.sidebar-group .sidebar-item { display: none; }
.sidebar-group.open .sidebar-item { display: block; }
.sidebar-toggle { cursor: pointer; transition: color 0.15s; }
.sidebar-toggle:hover { color: rgba(255,255,255,0.7); }
.sidebar-toggle::before { content: "›"; display: inline-block; width: 10px; font-size: 0.9em; transition: transform 0.15s; }
.sidebar-group.open .sidebar-toggle::before { transform: rotate(90deg); }
.sidebar-group .sidebar-item { padding-left: 24px; font-size: 0.82em; }

/* ── Print (legacy) ── */
@media print {
    .toolbar, .sidebar, .subtabs, .ct-btn-add, .btn-del { display: none !important; }
    .app-layout { display: block; position: static; }
    .main-content { overflow: visible; }
    .tab-panel { display: block !important; page-break-inside: avoid; }
    input, select, textarea { border: none !important; background: transparent !important; }
    body { overflow: visible; height: auto; }
}

/* ── Mobile toolbar + sidebar (legacy) ── */
@media (max-width: 768px) {
    .toolbar { flex-wrap: nowrap; height: 40px; padding: 4px 8px; }
    .toolbar .app-title { font-size: 0.85em; min-width: 0; margin-right: auto; }
    .toolbar .app-subtitle { display: none; }
    .toolbar .status { display: none; }
    .ct-toolbar-right { gap: 4px; margin-left: 4px; flex-shrink: 0; }
    .app-layout { flex-direction: column; }
    .sidebar {
        width: 100%; min-width: 100%; height: auto; max-height: 0; overflow: hidden;
        position: relative; top: 0; transition: max-height 0.3s ease;
        flex-direction: column; display: flex; z-index: 50;
    }
    .sidebar.open { max-height: 80vh; overflow-y: auto; }
    .sidebar-collapse { display: none; }
    .sidebar-item { padding: 12px 16px; font-size: 0.85em; border-left: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .sidebar-item.active { background: rgba(255,255,255,0.15); border-left-color: transparent; }
    .sidebar-section { padding: 10px 16px 4px; font-size: 0.7em; }
    .container { padding: 8px; }
}

/* ── Chrome v2 — rail collapse + responsive ──
   The v2 shell (.ct-app / .ct-body / .ct-rail) replaced .app-layout /
   .sidebar, but only the inherited responsive block above had been written.
   The JS therefore toggled .open (hamburger) and .collapsed (toggleSidebar) on
   a rail that no rule made collapsible: the classes changed, nothing moved on
   screen. And for lack of a media query on .ct-body / .ct-rail, the rail
   gardait ses 232px fixes quelle que soit la largeur de l'écran. */
.ct-rail.collapsed { width: 0; border-right-width: 0; }

/* A single control for both layouts — see _toggleSidebarMobile().
   Visibility is carried by the base declaration, not by a second block of the
   same selector. */

@media (max-width: 768px) {
    .ct-appbar { height: auto; min-height: 44px; gap: 8px; padding: 4px 8px; flex-wrap: wrap; }
    .ct-appbar-context, .ct-appbar-saved { display: none; }
    .ct-modulepicker { height: 28px; padding: 0 8px; font-size: var(--ct-text-meta); }
    .ct-modulemenu { width: calc(100vw - 24px); left: 12px; }
    .ct-modulemenu-list { grid-template-columns: 1fr; }

    /* Below 768px the rail stops being a column: it becomes a drawer that
       slides open under the bar, as .sidebar did before v2. */
    .ct-body { flex-direction: column; }
    /* .ct-content only carries min-width:0, which is enough while .ct-body is
       a row. In a column min-height governs: without it the flex item keeps
       min-height:auto, refuses to shrink below its content height and so never
       becomes the scrollable area. It then overflows .ct-app's 100vh, which
       the shell's overflow:hidden clips — the top of the page shows, and
       everything below becomes invisible AND unreachable. */
    .ct-content { min-height: 0; padding: 12px 12px 20px; }
    .ct-rail { width: 100%; max-height: 0;
               border-right: 0; border-bottom: 1px solid var(--ct-line); }
    .ct-rail.open { max-height: 70vh; overflow-y: auto; }
    /* .collapsed is the desktop state; left as-is it would shrink to nothing
       a drawer the user just opened after narrowing the window. */
    .ct-rail.collapsed { width: 100%; }
}

/* ── ct_modal (legacy — collision, migrates with ct_modal.ts) ── */
.ct-modal-overlay { position:fixed; inset:0; z-index:1000; background:var(--ct-scrim); display:flex; align-items:center; justify-content:center; padding:24px; }
.ct-modal-overlay[hidden] { display:none !important; }
/* No padding on the box: .ct-modal-header, -body and -footer each carry their
   own. Stacking them doubled the spacing. */
.ct-modal-box { background:var(--ct-surface); border-radius:12px; max-width:500px; width:100%; max-height:90vh; overflow-y:auto; box-shadow:0 8px 32px rgba(0,0,0,0.2); }
/* The sizes asked through ct_modal.open({ size }): after the base rule, which
   they override at the same specificity. Still width:100%, so a phone keeps
   the whole screen. */
.ct-modal-box--sm { max-width:360px; }
.ct-modal-box--lg { max-width:800px; }

/* ── ct_status (legacy — .ct-badge collision, migrates with badge()) ── */
/* The legacy .ct-badge that lived here redefined the v2 primitive word for
   word — same selector, further down the file, hence winning. The primitive
   was dead: its font, its radius and its display were never used.
   The default case (badge with no data-tone) has moved up into the
   primitive. */

/* .ct-empty-state (legacy) removed: a 3rd empty-state version, with no
   caller, and its opacity:0.4 icon violated §9.12. .ct-empty is the only
   reference. (audit v2 §05) */

/* ── ct_measure editor (legacy) ── */
.ct-measure-form { display:flex; flex-direction:column; gap:10px; }
.ct-measure-form label { display:flex; flex-direction:column; gap:4px; font-size:0.82em; font-weight:600; color:var(--ct-ink-2); }
/* A refselect extra field: label on top, the socle ref-select below — same
   shape as the modal's other labelled fields. */
.ct-measure-ref-field { display:flex; flex-direction:column; gap:4px; }
.ct-measure-ref-label { font-size:0.82em; font-weight:600; color:var(--ct-ink-2); }
/* Filterable search-select used for a refselect extra field: a plain input
   that filters a (fixed, so never clipped) dropdown of options. */
.ctm-ss { position:relative; }
.ctm-ss-input { width:100%; padding:6px 10px; border:1px solid var(--ct-line); border-radius:6px; font-size:0.9em; font-family:inherit; box-sizing:border-box; }
.ctm-ss-input:focus { outline:none; border-color:var(--ct-accent); box-shadow:var(--ct-focus-soft); }
.ctm-ss-drop { display:none; position:fixed; z-index:1100; background:var(--ct-surface); border:1px solid var(--ct-accent); border-radius:6px; box-shadow:0 4px 12px rgba(0,0,0,0.15); max-height:220px; overflow-y:auto; }
.ctm-ss-drop.open { display:block; }
.ctm-ss-opt { padding:6px 10px; cursor:pointer; font-size:0.85em; }
.ctm-ss-opt:hover { background:var(--ct-accent-tint); }

/* ── ct_datepicker: typed date field + calendar (FEAT-64) ──
   The native date input stays in the page, hidden, and holds the value; the
   text field before it takes its classes. The element selector with the
   base rule's :not() list outranks its `background` shorthand. */
.ct-date-native { display: none !important; }
input.ct-date-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238a909c' stroke-width='1.4'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5'/%3E%3Cpath d='M2 6.5h12M5.5 1.5v3M10.5 1.5v3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px 14px;
  cursor: text;
}
/* The :not() list outranks the base and table-cell field rules (and a
   module's own border on the field). */
input.ct-date-input[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) { border-color: var(--ct-critical); }
.ct-date-error { display: block; flex-basis: 100%; margin-top: 2px; }
.ct-date-pop {
  position: fixed; z-index: 1200; width: 272px; max-width: calc(100vw - 16px); box-sizing: border-box;
  padding: 10px; background: var(--ct-surface); color: var(--ct-ink);
  border: 1px solid var(--ct-line); border-radius: var(--ct-r-lg); box-shadow: var(--ct-shadow-overlay);
  font-size: var(--ct-text-ui);
}
.ct-date-pop__head { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; }
.ct-date-pop__head select { flex: 1 1 auto; min-width: 0; height: var(--ct-h-sm); padding: 0 4px; font-size: var(--ct-text-data); }
.ct-date-pop__head .ct-date-pop__year { flex: 0 0 76px; }
.ct-date-pop__nav {
  flex: 0 0 28px; height: var(--ct-h-sm); border: 1px solid var(--ct-line); border-radius: var(--ct-r-sm);
  background: var(--ct-surface); color: var(--ct-ink); font-size: 16px; line-height: 1; cursor: pointer;
}
.ct-date-pop__nav:hover:not(:disabled) { border-color: var(--ct-accent); }
.ct-date-pop__nav:disabled { color: var(--ct-ink-disabled); cursor: default; }
.ct-date-pop__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ct-date-pop__wd { text-align: center; font-size: var(--ct-text-label); color: var(--ct-ink-2); padding: 2px 0 4px; text-transform: capitalize; }
.ct-date-pop__day {
  height: 32px; border: 1px solid transparent; border-radius: var(--ct-r-sm); background: transparent;
  color: var(--ct-ink); font: inherit; font-size: var(--ct-text-data); cursor: pointer;
}
.ct-date-pop__day:hover:not(:disabled) { background: var(--ct-accent-tint); }
.ct-date-pop__day:focus-visible { outline: none; border-color: var(--ct-accent); box-shadow: var(--ct-focus-soft); }
.ct-date-pop__day.is-today { border-color: var(--ct-line-field); font-weight: 700; }
.ct-date-pop__day.is-selected { background: var(--ct-accent); color: var(--ct-onsolid); font-weight: 700; }
.ct-date-pop__day:disabled { color: var(--ct-ink-disabled); cursor: default; }
.ct-date-pop__time { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: var(--ct-text-data); color: var(--ct-ink-2); }
.ct-date-pop__time-input { width: 110px; height: var(--ct-h-sm); padding: 0 6px; }
.ct-date-pop__foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ct-line); }
.ct-date-pop__link { border: 0; background: none; padding: 4px 6px; color: var(--ct-accent); font: inherit; font-size: var(--ct-text-data); font-weight: 600; cursor: pointer; border-radius: var(--ct-r-sm); }
.ct-date-pop__link:hover:not(:disabled) { background: var(--ct-accent-tint); }
.ct-date-pop__link:disabled { color: var(--ct-ink-disabled); cursor: default; }
@media (pointer: coarse) {
  .ct-date-pop__day { height: 40px; }
}

/* ── Three-state filter pills (ct_pillfilter) ──────────────────
   Included pills reuse the module's .filter-pill.active colours; an
   excluded one is struck through on a dashed border. */
.filter-pill.is-excluded { border-style: dashed; border-color: var(--ct-ink-2); color: var(--ct-ink-2); text-decoration: line-through; }
.filter-pill-mark { margin-right: 4px; font-weight: 700; text-decoration: none; display: inline-block; }
.filter-pills-howto { display: block; margin-bottom: 6px; }
/* Three taps on one pill: a target a finger hits. */
@media (max-width: 768px) {
  .filter-pills-row .filter-pill { min-height: 36px; padding-left: 12px; padding-right: 12px; }
}

.ct-measure-form input, .ct-measure-form select, .ct-measure-form textarea { padding:6px 10px; border:1px solid var(--ct-line); border-radius:6px; font-size:0.9em; font-family:inherit; }
.ct-measure-form textarea { resize:vertical; min-height:60px; }

/* ── Role-based UI gating ── */
body:not(.ct-role-admin) .ct-admin-only { display: none !important; }
body:not(.ct-role-admin):not(.ct-role-editor):not(.ct-role-manager):not(.ct-role-contributor) .editor-up { display: none !important; }
body.ct-role-viewer [data-click^="delete"], body.ct-role-reader [data-click^="delete"], body.ct-role-triager [data-click^="delete"], body.ct-role-viewer [data-click^="remove"], body.ct-role-reader [data-click^="remove"], body.ct-role-triager [data-click^="remove"], body.ct-role-viewer [data-click^="add"], body.ct-role-reader [data-click^="add"], body.ct-role-triager [data-click^="add"], body.ct-role-viewer [data-click^="create"], body.ct-role-reader [data-click^="create"], body.ct-role-triager [data-click^="create"], body.ct-role-viewer [data-click^="new"], body.ct-role-reader [data-click^="new"], body.ct-role-triager [data-click^="new"], body.ct-role-viewer [data-click^="save"], body.ct-role-reader [data-click^="save"], body.ct-role-triager [data-click^="save"], body.ct-role-viewer [data-click^="edit"], body.ct-role-reader [data-click^="edit"], body.ct-role-triager [data-click^="edit"], body.ct-role-viewer [data-click^="import"], body.ct-role-reader [data-click^="import"], body.ct-role-triager [data-click^="import"], body.ct-role-viewer [data-write], body.ct-role-reader [data-write], body.ct-role-triager [data-write] { display: none !important; }

/* ── ct_notifprefs — Notifications preferences modal (FEAT-34/35) ── */
.ct-notifprefs-form .ct-form-row { margin-bottom: 14px; }
.ct-notifprefs-form .ct-form-row > label[for], .ct-notifprefs-form .ct-notifprefs-label {
    display: block; font-size: 0.78em; font-weight: 600;
    color: var(--ct-ink-2); margin-bottom: 5px;
}
.ct-notifprefs-form input[type="text"], .ct-notifprefs-form select {
    width: 100%; padding: 7px 10px; box-sizing: border-box;
    border: 1px solid var(--ct-line); border-radius: 6px;
    font-family: inherit; font-size: 0.9em;
    background: var(--ct-surface); color: var(--ct-ink-1);
}
.ct-notifprefs-form input[type="text"]:focus, .ct-notifprefs-form select:focus {
    border-color: var(--ct-accent); outline: none;
}
.ct-notifprefs-form .ct-notifprefs-group {
    border: 1px solid var(--ct-line); border-radius: 8px;
    padding: 14px 16px 4px; margin-bottom: 16px;
    background: var(--ct-surface);
}
.ct-notifprefs-form .ct-notifprefs-section {
    margin: 0 0 12px; padding-bottom: 6px; font-size: 0.82em;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--ct-ink-2); border-bottom: 1px solid var(--ct-line);
}
.ct-notifprefs-form details.ct-notifprefs-group > summary.ct-notifprefs-section {
    cursor: pointer; list-style: none; user-select: none; margin-bottom: 0;
}
.ct-notifprefs-form details.ct-notifprefs-group[open] > summary.ct-notifprefs-section { margin-bottom: 12px; }
.ct-notifprefs-form details.ct-notifprefs-group > summary.ct-notifprefs-section::before {
    content: "\25B8"; display: inline-block; margin-right: 6px;
    transition: transform 0.15s;
}
.ct-notifprefs-form details.ct-notifprefs-group[open] > summary.ct-notifprefs-section::before { transform: rotate(90deg); }
.ct-notifprefs-form details.ct-notifprefs-group { padding-bottom: 12px; }
.ct-notifprefs-form details.ct-notifprefs-group[open] { padding-bottom: 4px; }
.ct-notifprefs-form .ct-notifprefs-modhint { margin: 0 0 12px; }
.ct-notifprefs-form .ct-notifprefs-help {
    margin-top: 4px; font-size: 0.78em; color: var(--ct-ink-2);
}
