/* ============================================================
   CRYPTOASSETS — Product Dashboard Token Layer  [v1 — forked from sentinel-tokens.css v5]
   site/assets/cryptoassets-tokens.css

   SOURCE: forked from asym-intel/financial-integrity:site/assets/sentinel-tokens.css
   (v5, WPM-style light default, operator override 2026-07-06). Per §2.2 operator-lock
   (FE-BRIEF-STATUS.md), cryptoassets gets its OWN token file and its OWN renderer/skin —
   this is a value-level brand fork, not a shared import. Structural token NAMES
   (--color-*, --bg, --panel, --ink, --accent, --sev-*, --jid-*, etc.) are unchanged
   from the v5 contract so sentinel-jid.css's selectors and the fleet-canonical
   drawer.css / fe-print.css work with zero edits — only VALUES are re-hexed to the
   crypto brand identity (indigo, per BRIEF-2026-07-29-FE-FLEET-FRONTEND-V2.md §4.1
   and this repo's operator override 2026-08-05, both converge on #5e47b8 with no
   conflict between sources).

   BRAND IDENTITY: deep indigo primary (#5e47b8), Instrument Serif display face
   (crypto gets Instrument Serif; DP gets Newsreader — the two consumers must not
   look identical per BRIEF v2 §4.4), IBM Plex Sans body / IBM Plex Mono — fleet-wide
   type families, unchanged from Sentinel.

   WCAG 2.1 AA — light register (default):
     --color-text #211d2b on --color-bg #f6f4fb        ~14.9:1  AAA
     --color-text #211d2b on --color-surface #f8f7fc   ~15.1:1  AAA
     --color-text-muted #6b6478 on --color-bg          ~5.1:1  AA
     --color-primary #5e47b8 on #ffffff                ~6.4:1  AA (accent text/links)
   WCAG 2.1 AA — dark register (opt-in [data-theme="dark"]):
     --color-text #ded9ef on --color-bg #14111d        ~13.1:1  AAA
     --color-primary #8370d2 on #241f38                ~5.6:1  AA
   ============================================================ */

/* ── Scale + motion tokens (register-agnostic, identical to sentinel-tokens.css v5) ── */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  2.25rem;
  --text-hero: 3.5rem;

  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --gap: var(--space-3);

  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 160ms ease-out;

  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── Cryptoassets indigo palette — DEFAULT register (light-first) ── */
:root,
[data-theme="light"] {
  /* Layered cool-paper surfaces */
  --color-bg:              #f6f4fb;
  --color-surface:         #f8f7fc;
  --color-surface-2:       #faf9fd;
  --color-surface-offset:  #efecf7;
  --color-surface-dynamic: #e4dff1;
  --color-divider:         #ddd7ec;
  --color-border:          #d0c8e4;

  /* Text palette */
  --color-text:       #211d2b;
  --color-text-muted: #6b6478;
  --color-text-faint: #a49dae;

  /* 8-colour semantic palette — each with a -highlight pair (light register) */
  --color-primary:           #5e47b8;
  --color-primary-hover:     #4c3899;
  --color-primary-highlight: #d8d2ec;
  --color-warning:           #964219;
  --color-warning-highlight: #ddcfc6;
  --color-error:             #a1272f;
  --color-error-highlight:   #eecfd0;
  --color-success:           #2f6d34;
  --color-success-highlight: #d4dfcc;
  --color-gold:              #8a6d1a;
  --color-gold-highlight:    #e7ddc2;
  --color-purple:            #7a39bb;
  --color-purple-highlight:  #dacfde;
  --color-blue:              #006494;
  --color-blue-highlight:    #c6d8e4;

  /* Surfaces */
  --bg:        var(--color-bg);
  --panel:     var(--color-surface);
  --panel2:    var(--color-surface-2);
  --line:      var(--color-border);
  --line-soft: var(--color-divider);

  /* Text */
  --ink:   var(--color-text);
  --ink-2: var(--color-text-muted);
  --muted: var(--color-text-muted);
  --faint: var(--color-text-faint);

  /* Accent — indigo in both registers */
  --accent:        var(--color-primary);
  --accent-bright: var(--color-primary-hover);
  --accent-text:   var(--color-primary);
  --accent-bg:     var(--color-primary-highlight);

  /* Fonts — Instrument Serif display (crypto's own face, distinct from DP's Newsreader) */
  --font-body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-ui:      var(--font-body);
  --font-display: 'Instrument Serif', Georgia, serif;

  /* Severity scale */
  --sev-critical:       var(--color-error);
  --sev-critical-text:  var(--color-error);
  --sev-high:           var(--color-warning);
  --sev-high-text:      var(--color-warning);
  --sev-elevated:       var(--color-gold);
  --sev-elevated-text:  var(--color-gold);
  --sev-monitored:      var(--color-primary);
  --sev-monitored-text: var(--color-primary);
  --sev-badge-ink:      #ffffff;

  /* Signal direction */
  --signal-escalating:    var(--color-error);
  --signal-stable:        var(--color-success);
  --signal-de-escalating: var(--color-primary);

  /* Freshness grammar */
  --fresh-updated:  var(--color-primary);
  --fresh-stable:   var(--color-text-muted);
  --fresh-archived: var(--color-text-faint);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(33, 29, 43, 0.06);
  --shadow-md: 0 4px 12px rgba(33, 29, 43, 0.09), 0 1px 2px rgba(33, 29, 43, 0.06);

  /* Confidence pill grammar */
  --confidence-pill-bg:   var(--color-surface-2);
  --confidence-pill-ink:  var(--color-text-muted);
  --confidence-pill-line: var(--color-border);
  --tier-annotation-ink:  var(--color-text-muted);
}

/* ── Dark register — opt-in via [data-theme="dark"] ── */
[data-theme="dark"] {
  --color-bg:              #14111d;
  --color-surface:         #191623;
  --color-surface-2:       #1e1a28;
  --color-surface-offset:  #241f30;
  --color-surface-dynamic: #2b2438;
  --color-divider:         #2d2739;
  --color-border:          #38314a;

  --color-text:       #ded9ef;
  --color-text-muted: #837c92;
  --color-text-faint: #5a5468;

  --color-primary:           #8370d2;
  --color-primary-hover:     #9583dd;
  --color-primary-highlight: #241f38;
  --color-warning:           #c47a3a;
  --color-warning-highlight: #342818;
  --color-error:             #c0566a;
  --color-error-highlight:   #321820;
  --color-success:           #5a9940;
  --color-success-highlight: #1e2e16;
  --color-gold:              #c9a030;
  --color-gold-highlight:    #2e2512;
  --color-purple:            #9a72d9;
  --color-purple-highlight:  #2a2240;
  --color-blue:              #5591c7;
  --color-blue-highlight:    #1a2d3f;

  --bg:        var(--color-bg);
  --panel:     var(--color-surface);
  --panel2:    var(--color-surface-2);
  --line:      var(--color-border);
  --line-soft: var(--color-divider);

  --ink:   var(--color-text);
  --ink-2: var(--color-text-muted);
  --muted: var(--color-text-muted);
  --faint: var(--color-text-faint);

  --accent:        var(--color-primary);
  --accent-bright: var(--color-primary-hover);
  --accent-text:   var(--color-primary);
  --accent-bg:     var(--color-primary-highlight);

  --sev-critical:       var(--color-error);
  --sev-critical-text:  var(--color-error);
  --sev-high:           var(--color-warning);
  --sev-high-text:      var(--color-warning);
  --sev-elevated:       var(--color-gold);
  --sev-elevated-text:  var(--color-gold);
  --sev-monitored:      var(--color-primary);
  --sev-monitored-text: var(--color-primary);
  --sev-badge-ink:      var(--color-surface);

  --signal-escalating:    var(--color-error);
  --signal-stable:        var(--color-success);
  --signal-de-escalating: var(--color-primary);

  --fresh-updated:  var(--color-primary);
  --fresh-stable:   var(--color-text-muted);
  --fresh-archived: var(--color-text-faint);

  --shadow-sm: 0 1px 2px rgba(8, 6, 14, 0.5);
  --shadow-md: 0 6px 24px rgba(8, 6, 14, 0.55), 0 1px 2px rgba(8, 6, 14, 0.5);

  --confidence-pill-bg:   var(--color-surface-2);
  --confidence-pill-ink:  var(--color-text-muted);
  --confidence-pill-line: var(--color-border);
  --tier-annotation-ink:  var(--color-text-muted);
}

/* Persistent regulatory-boundary chrome (D5/D10 — non-negotiable, fleet-wide). */
.boundary-strip {
  background: var(--panel);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  padding: 6px 16px;
}

/* Severity badge grammar — colour carries severity only. */
.sev-badge { border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 600; padding: 2px 8px; color: var(--sev-badge-ink); }
.sev-badge--critical  { background: var(--sev-critical); }
.sev-badge--high      { background: var(--sev-high); }
.sev-badge--elevated  { background: var(--sev-elevated); }
.sev-badge--monitored { background: var(--sev-monitored); }

/* Confidence pill grammar — deliberately neutral */
.confidence-pill {
  background: var(--confidence-pill-bg);
  border: 1px solid var(--confidence-pill-line);
  border-radius: 999px;
  color: var(--confidence-pill-ink);
  font-size: var(--text-xs);
  padding: 1px 8px;
}

/* Theme toggle */
.theme-toggle {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent-text); }

/* ── JID semantic scales — mapped onto the crypto palette (structure identical to sentinel-tokens.css v5) ── */
:root {
  --jid-confirmed: var(--color-primary);
  --jid-confirmed-bg: var(--color-primary-highlight);
  --jid-assessed: var(--color-blue);
  --jid-assessed-bg: var(--color-blue-highlight);
  --jid-emerging: var(--color-warning);
  --jid-emerging-bg: var(--color-warning-highlight);
  --jid-sentinel: var(--color-purple);
  --jid-sentinel-bg: var(--color-purple-highlight);
  --jid-inforce: var(--color-error);
  --jid-inforce-bg: var(--color-error-highlight);
  --jid-soon: var(--color-gold);
  --jid-soon-bg: var(--color-gold-highlight);
  --jid-horizon: var(--color-success);
  --jid-horizon-bg: var(--color-success-highlight);
}

/* ===== BEGIN VENDORED fe-commons/fe-print.css — DO NOT EDIT HERE ===== */
/* ==========================================================================
   fe-print.css — the print register, fleet-wide
   SSOT: asym-intel-commons:fe-commons/fe-print.css
   Vendored verbatim into each consumer between the BEGIN/END markers below.
   Edit at the SSOT, never in a vendored copy.
   ========================================================================== */
@media print {
  .paywall,
  [data-access="gated"],
  [data-access="locked"],
  [data-entitlement]:not([data-entitlement="free"]):not([data-entitlement="public"]) {
    display: none !important;
  }
  .jidlensbar,
  .viewbar,
  #viewbar,
  .lensseg,
  #lensseg,
  [data-consent-mount],
  #consent-mount,
  .drawer,
  .drawer-scrim,
  nav.site-nav,
  .site-header__util,
  .persona-row,
  .skip-link {
    display: none !important;
  }
  :where(html, body) {
    background: #fff !important;
    color: #000 !important;
  }
  details:not([open]) > *:not(summary) {
    display: revert !important;
  }
  [hidden].lens-view.on,
  .lens-view.on {
    display: block !important;
  }
  a[href^="http"]::after {
    content: " <" attr(href) ">";
    font-size: 0.85em;
    word-break: break-all;
  }
  h1, h2, h3, h4, caption, th {
    break-after: avoid-page;
    page-break-after: avoid;
  }
  table, figure, blockquote, .card, .lens-card, .role-card {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }
}
/* ===== END VENDORED fe-commons/fe-print.css ===== */
