/* ──────────────────────────────────────────────────────────
   ArcScan Design System v1
   Canonical atk-* classes. Loaded AFTER arcscan.css in base.html
   so its rules win any conflict with legacy styles.
   ────────────────────────────────────────────────────────── */

/* ── 1. Design tokens ─────────────────────────────────── */
:root {
  /* Spacing — 4px base scale */
  --atk-space-1: 4px; --atk-space-2: 8px;  --atk-space-3: 12px;
  --atk-space-4: 16px; --atk-space-5: 20px; --atk-space-6: 24px;
  --atk-space-7: 32px; --atk-space-8: 48px;

  /* Radius */
  --atk-radius-sm: 6px; --atk-radius-md: 10px; --atk-radius-lg: 14px;

  /* Typography scale */
  --atk-text-xs:   .72rem; --atk-text-sm:  .82rem; --atk-text-base: .92rem;
  --atk-text-lg:   1.05rem; --atk-text-xl: 1.4rem;  --atk-text-2xl:  1.8rem;

  /* Severity semantic (alias existing arcscan.css where possible) */
  --atk-sev-critical: var(--danger);
  --atk-sev-high:     #f97316;
  --atk-sev-medium:   var(--warn);
  --atk-sev-low:      #60a5fa;
  --atk-sev-info:     var(--text-dim);

  /* Feed color codes (for advisory badges) */
  --atk-feed-rhsa:   #ef4444;
  --atk-feed-usn:    #fb923c;
  --atk-feed-dsa:    #fbbf24;
  --atk-feed-ghsa:   #60a5fa;
  --atk-feed-alas:   #34d399;
  --atk-feed-alpine: #94a3b8;
  --atk-feed-generic:#94a3b8;
}

/* ── 2. Page header ───────────────────────────────────── */
.atk-page-header {
  margin-bottom: var(--atk-space-6);
}
.atk-page-header-inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--atk-space-5); flex-wrap: wrap;
}
.atk-page-header-text { flex: 1 1 auto; min-width: 0; }
.atk-page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--atk-text-2xl); font-weight: 700;
  color: var(--text-bright); margin: 0 0 var(--atk-space-2);
  display: flex; align-items: center; gap: var(--atk-space-3);
  letter-spacing: .02em;
}
.atk-page-title i { color: var(--danger); font-size: .85em; }
.atk-page-subtitle {
  font-size: var(--atk-text-sm); color: var(--text-dim);
  margin: 0; font-weight: 400;
}
.atk-version-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: var(--atk-text-xs); font-weight: 400;
  color: var(--text-dim); padding: 2px 8px;
  border: 1px solid var(--border); border-radius: var(--atk-radius-sm);
  background: rgba(255,255,255,.03);
}
.atk-page-header-actions {
  display: flex; gap: var(--atk-space-3); flex-shrink: 0;
}

/* ── 3. KPI stats grid ───────────────────────────────── */
.atk-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--atk-space-4); margin-bottom: var(--atk-space-5);
}
.atk-stat-tile {
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--atk-radius-md);
  padding: var(--atk-space-5) var(--atk-space-5);
  transition: border-color .2s;
}
.atk-stat-tile:hover { border-color: rgba(239,68,68,.25); }
.atk-stat-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--atk-text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); margin-bottom: var(--atk-space-2);
}
.atk-stat {
  font-family: 'Share Tech Mono', monospace;
  font-size: var(--atk-text-2xl); font-weight: 700;
  color: var(--text-bright); letter-spacing: .02em;
}
.atk-stat-sub {
  font-size: var(--atk-text-xs); color: var(--text-dim);
  margin-top: var(--atk-space-1);
}
.atk-stat-tile--critical .atk-stat { color: var(--atk-sev-critical); }
.atk-stat-tile--warning  .atk-stat { color: var(--atk-sev-medium); }
.atk-stat-tile--success  .atk-stat { color: #4ade80; }
.atk-stat-tile--info     .atk-stat { color: #60a5fa; }

@media (max-width: 900px) { .atk-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .atk-stats-grid { grid-template-columns: 1fr; } }

/* ── 4. Section card ─────────────────────────────────── */
.atk-section-card {
  background: linear-gradient(135deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--atk-radius-md);
  margin-bottom: var(--atk-space-5); overflow: hidden;
}
.atk-section-bar {
  display: flex; align-items: center; gap: var(--atk-space-4);
  padding: var(--atk-space-4) var(--atk-space-5);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.12);
}
.atk-section-hdr {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--atk-text-lg); font-weight: 700;
  color: var(--text-bright); letter-spacing: .02em;
  display: flex; align-items: center; gap: var(--atk-space-2);
}
.atk-section-hdr i { color: var(--danger); }
.atk-count-badge {
  font-family: 'Share Tech Mono', monospace;
  font-size: var(--atk-text-xs); font-weight: 700;
  color: var(--text-dim); padding: 2px 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255,255,255,.03);
}
.atk-section-bar-actions { margin-left: auto; display: flex; gap: var(--atk-space-2); }
.atk-section-body { padding: var(--atk-space-5); }

/* ── 5. Entity card ──────────────────────────────────── */
.atk-entity-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border); border-radius: var(--atk-radius-md);
  padding: var(--atk-space-4); position: relative;
  transition: border-color .2s, transform .25s;
}
.atk-entity-card:hover { border-color: rgba(239,68,68,.35); transform: translateY(-1px); }
.atk-entity-card__header {
  display: flex; align-items: center; gap: var(--atk-space-2);
  margin-bottom: var(--atk-space-2);
}
.atk-entity-card__title {
  font-size: var(--atk-text-base); font-weight: 700; color: var(--text-bright);
  margin: 0; display: flex; align-items: center; gap: var(--atk-space-2);
}
.atk-entity-card__desc {
  font-size: var(--atk-text-sm); color: var(--text-dim);
  margin: var(--atk-space-2) 0; line-height: 1.5;
}
.atk-entity-meta { display: flex; flex-wrap: wrap; gap: var(--atk-space-1); margin-top: var(--atk-space-2); }
.atk-entity-card__actions {
  display: flex; gap: var(--atk-space-1); margin-top: var(--atk-space-3);
}

/* ── 6. Data table ───────────────────────────────────── */
.atk-table { width: 100%; border-collapse: collapse; }
.atk-table thead tr {
  background: linear-gradient(135deg, rgba(239,68,68,.06), rgba(15,23,42,.4));
}
.atk-table thead th {
  padding: 16px 22px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--atk-text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: rgba(239,68,68,.8);
  border-bottom: 1px solid rgba(239,68,68,.15);
  text-align: left;
}
.atk-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .2s;
}
.atk-table tbody tr:hover {
  background: rgba(239,68,68,.04);
  box-shadow: inset 3px 0 0 rgba(239,68,68,.5);
}
.atk-table td {
  padding: 18px 22px;
  font-size: var(--atk-text-sm); color: var(--text);
}
.atk-table tbody tr:last-child { border-bottom: none; }

/* ── 7. Buttons ──────────────────────────────────────── */
.atk-btn, .atk-btn-primary, .atk-btn-ghost, .atk-btn-danger,
.atk-btn-green, .atk-btn-warn {
  display: inline-flex; align-items: center; gap: var(--atk-space-2);
  padding: var(--atk-space-2) var(--atk-space-5);
  font-weight: 600; font-size: var(--atk-text-sm);
  border: none; cursor: pointer; text-decoration: none;
  transition: all .2s; border-radius: var(--atk-radius-sm);
  white-space: nowrap;
}
.atk-btn, .atk-btn-primary { background: var(--accent); color: #fff; }
.atk-btn:hover, .atk-btn-primary:hover {
  filter: brightness(1.1); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,115,232,.35); color: #fff;
}
.atk-btn-ghost {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border); color: var(--text-dim);
}
.atk-btn-ghost:hover {
  border-color: var(--accent); color: var(--text-bright);
  background: rgba(26,115,232,.08); text-decoration: none;
}
.atk-btn-danger {
  background: transparent; border: 1px solid rgba(239,68,68,.4); color: var(--danger);
}
.atk-btn-danger:hover { background: rgba(239,68,68,.08); text-decoration: none; }
.atk-btn-green  { background: var(--accent2); color: #fff; }
.atk-btn-green:hover  { filter: brightness(1.1); color: #fff; }
.atk-btn-warn   { background: transparent; border: 1px solid rgba(245,158,11,.4); color: var(--warn); }
.atk-btn-warn:hover   { background: rgba(245,158,11,.08); }
.atk-btn-sm     { padding: 5px 13px; font-size: var(--atk-text-xs); }
.atk-btn-full   { width: 100%; text-align: center; justify-content: center; padding: 12px; }

a.atk-btn, a.atk-btn-primary, a.atk-btn-ghost, a.atk-btn-danger,
a.atk-btn-green, a.atk-btn-warn { text-decoration: none; }

/* ── 8. Badges ───────────────────────────────────────── */
.atk-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--atk-text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 10px; border-radius: var(--atk-radius-sm);
  white-space: nowrap;
  background: rgba(255,255,255,.05); color: var(--text-dim);
  border: 1px solid var(--border);
}
/* Severity variants */
.atk-badge--critical { background: rgba(239,68,68,.12);  color: #f87171; border-color: rgba(239,68,68,.3);  }
.atk-badge--high     { background: rgba(249,115,22,.10); color: #fb923c; border-color: rgba(249,115,22,.3); }
.atk-badge--medium   { background: rgba(251,191,36,.10); color: #fbbf24; border-color: rgba(251,191,36,.3); }
.atk-badge--low      { background: rgba(96,165,250,.10); color: #60a5fa; border-color: rgba(96,165,250,.3); }
.atk-badge--info     { background: rgba(148,163,184,.10); color: #94a3b8; border-color: rgba(148,163,184,.3); }
/* Feed variants */
.atk-badge--rhsa   { background: rgba(239,68,68,.12);  color: var(--atk-feed-rhsa);   border-color: rgba(239,68,68,.3);  }
.atk-badge--usn    { background: rgba(251,146,60,.12); color: var(--atk-feed-usn);    border-color: rgba(251,146,60,.3); }
.atk-badge--dsa    { background: rgba(251,191,36,.12); color: var(--atk-feed-dsa);    border-color: rgba(251,191,36,.3); }
.atk-badge--ghsa   { background: rgba(96,165,250,.12); color: var(--atk-feed-ghsa);   border-color: rgba(96,165,250,.3); }
.atk-badge--alas   { background: rgba(52,211,153,.12); color: var(--atk-feed-alas);   border-color: rgba(52,211,153,.3); }
.atk-badge--alpine { background: rgba(148,163,184,.10); color: var(--atk-feed-alpine); border-color: rgba(148,163,184,.3); }
.atk-badge--generic{ background: rgba(148,163,184,.10); color: var(--atk-feed-generic);border-color: rgba(148,163,184,.3); }
/* Status variants */
.atk-badge--active    { background: rgba(74,222,128,.10); color: #4ade80; border-color: rgba(74,222,128,.3); }
.atk-badge--resolved  { background: rgba(148,163,184,.10); color: #94a3b8; border-color: rgba(148,163,184,.3); }
.atk-badge--pending   { background: rgba(251,191,36,.10); color: #fbbf24; border-color: rgba(251,191,36,.3); }
.atk-badge--suppressed{ background: rgba(148,163,184,.06); color: var(--text-dim); border-color: rgba(148,163,184,.2); }

/* ── 9. Filter rail ──────────────────────────────────── */
.atk-filter-rail {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border); border-radius: var(--atk-radius-md);
  padding: var(--atk-space-4) var(--atk-space-5);
  margin-bottom: var(--atk-space-5);
  display: flex; flex-wrap: wrap; gap: var(--atk-space-5);
  align-items: flex-end;
}
.atk-filter-item { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.atk-filter-item--search { flex: 1 1 240px; }
.atk-filter-label {
  font-size: var(--atk-text-xs); text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); font-weight: 600;
}
.atk-select, .atk-input {
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--atk-radius-sm); padding: 8px 12px;
  font-size: var(--atk-text-sm); color: var(--text-bright);
  font-family: inherit;
}
.atk-select:focus, .atk-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26,115,232,.15);
}
.atk-filter-actions { display: flex; gap: var(--atk-space-2); }

/* ── 10. Empty state ─────────────────────────────────── */
.atk-empty {
  text-align: center; padding: 48px var(--atk-space-5);
  color: var(--text-dim);
}
.atk-empty__icon {
  font-size: 2.2rem; opacity: .4;
  margin-bottom: var(--atk-space-3); display: block;
}
.atk-empty__headline {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--atk-text-lg); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); margin: 0 0 var(--atk-space-2);
}
.atk-empty__hint {
  font-size: var(--atk-text-sm); color: var(--text-dim);
  max-width: 420px; margin: 0 auto var(--atk-space-4);
  line-height: 1.5;
}

/* ── Light theme overrides ───────────────────────────── */
[data-theme="light"] .atk-stat-tile,
[data-theme="light"] .atk-section-card {
  background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.4));
}

/* ──────────────────────────────────────────────────────────
   ArcScan Design System v2 — Semantic Token Layer
   --------------------------------------------------------
   Two independent theme dimensions:
     data-theme    = light | dark         (neutrals + surfaces)
     data-scheme   = cyber | forge | …    (tenant accent family)

   Composes cleanly: dark+default, dark+uf, light+default, light+uf, ...

   Tokens defined here are CONSUMED by all new primitives below
   (.ds-*) and by any template that references them. Existing
   .atk-* and legacy classes continue to work via the older tokens
   in base.html — those are aliased into the new names below.

   To add a new tenant theme:
     1. Add a [data-scheme="<name>"][data-theme="dark"] block in
        base.html with overrides for --accent, --accent2, --grid.
        (Keep neutrals tied to data-theme so accessibility holds.)
     2. Done — every component picks it up automatically.
   ────────────────────────────────────────────────────────── */

:root,
[data-theme="dark"] {
  /* Surfaces — alias to existing tokens for backwards compat */
  --bg-app:           var(--bg);
  --bg-canvas:        var(--bg);
  --bg-surface:       var(--surface);
  --bg-surface-alt:   var(--surface2);
  --bg-muted:         rgba(255,255,255,.04);

  /* Text */
  --text-primary:     var(--text-bright);
  --text-secondary:   var(--text);
  --text-muted:       var(--text-dim);

  /* Borders */
  --border-default:   var(--border);
  --border-muted:     rgba(255,255,255,.05);

  /* Accent family — layered on top of --accent from base.html */
  --accent-hover:     color-mix(in srgb, var(--accent) 88%, white);
  --accent-soft:      color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-soft-strong: color-mix(in srgb, var(--accent) 24%, transparent);
  --accent-contrast:  #ffffff;
  --focus-ring:       color-mix(in srgb, var(--accent) 38%, transparent);

  /* Semantic state */
  --success:          #22c55e;
  --warning:          var(--warn);
  --info:             #60a5fa;
  /* --danger inherited from base.html */

  /* Elevation */
  --shadow-elevated:  0 12px 32px -8px rgba(0,0,0,.5),
                      0 4px 8px -2px rgba(0,0,0,.25);

  /* Charts (palette derived from accent + semantic) */
  --chart-1:          var(--accent);
  --chart-2:          var(--accent2);
  --chart-3:          #94a3b8;
  --chart-4:          var(--warning);
  --chart-5:          var(--info);

  /* Motion budget — keep it small */
  --motion-fast:      120ms cubic-bezier(.2, .0, .2, 1);
  --motion-base:      160ms cubic-bezier(.2, .0, .2, 1);
  --motion-slow:      240ms cubic-bezier(.2, .0, .2, 1);
}

[data-theme="light"] {
  --bg-muted:         rgba(15,23,42,.04);
  --border-muted:     rgba(15,23,42,.06);
  --accent-soft:      color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-soft-strong: color-mix(in srgb, var(--accent) 18%, transparent);
  --shadow-elevated:  0 8px 24px -8px rgba(15,23,42,.18),
                      0 2px 4px -1px rgba(15,23,42,.08);
}

/* Dark UF + light UF: orange/blue accents need white contrast */
[data-scheme="uf"] {
  --accent-contrast:  #ffffff;
}

/* ── DS-v2 primitives ─────────────────────────────────── */
/* Calm enterprise primitives. Use these for new templates;
   atk-* remains supported for already-refactored screens. */

/* App shell containers */
.ds-page          { padding: var(--atk-space-7) 0; }
.ds-page-narrow   { max-width: 880px; margin: 0 auto; }

/* Page header */
.ds-header        { display:flex; align-items:flex-start; justify-content:space-between;
                    gap: var(--atk-space-5); flex-wrap: wrap;
                    margin-bottom: var(--atk-space-6);
                    padding-bottom: var(--atk-space-5);
                    border-bottom: 1px solid var(--border-muted); }
.ds-header__title { font-family:'Barlow Condensed',sans-serif;
                    font-size: var(--atk-text-2xl); font-weight: 700;
                    color: var(--text-primary); margin: 0;
                    letter-spacing: .01em; line-height: 1.15; }
.ds-header__sub   { font-size: var(--atk-text-sm); color: var(--text-muted);
                    margin: 6px 0 0; max-width: 60ch; line-height: 1.5; }
.ds-header__actions { display: flex; gap: var(--atk-space-3); flex-shrink: 0; }

/* Surface / panel — calm, no glow, no gradient */
.ds-panel         { background: var(--bg-surface);
                    border: 1px solid var(--border-default);
                    border-radius: var(--atk-radius-md);
                    overflow: hidden;
                    transition: border-color var(--motion-base); }
.ds-panel--muted  { background: var(--bg-surface-alt); }
.ds-panel__head   { display:flex; align-items:center;
                    gap: var(--atk-space-3);
                    padding: var(--atk-space-4) var(--atk-space-5);
                    border-bottom: 1px solid var(--border-muted); }
.ds-panel__title  { font-family:'Barlow Condensed',sans-serif;
                    font-size: var(--atk-text-lg); font-weight: 700;
                    color: var(--text-primary); margin: 0;
                    letter-spacing: .01em; }
.ds-panel__sub    { font-size: var(--atk-text-sm); color: var(--text-muted);
                    margin: 2px 0 0; }
.ds-panel__actions{ margin-left: auto; display: flex; gap: var(--atk-space-2); }
.ds-panel__body   { padding: var(--atk-space-5); }

/* Buttons — restrained, semantic */
.ds-btn, .ds-btn-primary, .ds-btn-ghost, .ds-btn-subtle,
.ds-btn-danger {
  display:inline-flex; align-items:center; justify-content:center;
  gap: var(--atk-space-2);
  padding: 9px var(--atk-space-4);
  font-weight: 600; font-size: var(--atk-text-sm);
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: var(--atk-radius-sm);
  cursor: pointer; text-decoration: none;
  transition: background var(--motion-base),
              border-color var(--motion-base),
              color var(--motion-base);
  white-space: nowrap;
}
.ds-btn-primary   { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.ds-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover);
                        color: var(--accent-contrast); text-decoration: none; }
.ds-btn-ghost     { background: transparent; color: var(--text-secondary);
                    border-color: var(--border-default); }
.ds-btn-ghost:hover { color: var(--text-primary); border-color: var(--accent);
                      background: var(--accent-soft); text-decoration: none; }
.ds-btn-subtle    { background: var(--bg-muted); color: var(--text-secondary);
                    border-color: transparent; }
.ds-btn-subtle:hover { background: var(--accent-soft); color: var(--text-primary);
                       text-decoration: none; }
.ds-btn-danger    { background: transparent; color: var(--danger);
                    border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.ds-btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent);
                       color: var(--danger); text-decoration: none; }
.ds-btn-block     { width: 100%; }
.ds-btn-sm        { padding: 6px 12px; font-size: var(--atk-text-xs); }

a.ds-btn, a.ds-btn-primary, a.ds-btn-ghost,
a.ds-btn-subtle, a.ds-btn-danger { text-decoration: none; }

/* Focus ring — visible without neon glow */
.ds-btn:focus-visible, .ds-btn-primary:focus-visible,
.ds-btn-ghost:focus-visible, .ds-btn-subtle:focus-visible,
.ds-btn-danger:focus-visible,
.ds-input:focus-visible, .ds-select:focus-visible,
.ds-textarea:focus-visible, .ds-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Form controls */
.ds-field         { display: flex; flex-direction: column; gap: 6px;
                    margin-bottom: var(--atk-space-4); }
.ds-label         { font-size: var(--atk-text-sm); font-weight: 600;
                    color: var(--text-secondary); letter-spacing: .002em; }
.ds-label--req::after { content: ' *'; color: var(--danger); }
.ds-help          { font-size: var(--atk-text-xs); color: var(--text-muted); }
.ds-input, .ds-select, .ds-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  border-radius: var(--atk-radius-sm);
  padding: 9px 12px;
  font-size: var(--atk-text-sm);
  font-family: inherit;
  transition: border-color var(--motion-base),
              background var(--motion-base);
}
.ds-input::placeholder, .ds-textarea::placeholder { color: var(--text-muted); }
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.ds-input[aria-invalid="true"], .ds-input.is-invalid {
  border-color: var(--danger);
}

/* Inline alert / notice */
.ds-notice        { display:flex; align-items:flex-start; gap: var(--atk-space-3);
                    padding: var(--atk-space-3) var(--atk-space-4);
                    border-radius: var(--atk-radius-sm);
                    font-size: var(--atk-text-sm); color: var(--text-primary);
                    background: var(--bg-muted);
                    border: 1px solid var(--border-muted); }
.ds-notice--danger { background: color-mix(in srgb, var(--danger) 8%, transparent);
                     border-color: color-mix(in srgb, var(--danger) 28%, transparent);
                     color: var(--danger); }
.ds-notice--warning{ background: color-mix(in srgb, var(--warning) 10%, transparent);
                     border-color: color-mix(in srgb, var(--warning) 28%, transparent);
                     color: var(--warning); }
.ds-notice--success{ background: color-mix(in srgb, var(--success) 10%, transparent);
                     border-color: color-mix(in srgb, var(--success) 28%, transparent);
                     color: var(--success); }
.ds-notice__icon  { flex-shrink: 0; margin-top: 2px; }

/* Inline informational banner — subtle blue accent, dismissible.
   Used for "honesty" copy that explains a feature's actual behavior
   (e.g. Network Sweep 3-mode dispatch). NOT a modal/alert. */
.atk-info-banner {
  display: flex; align-items: flex-start; gap: var(--atk-space-3);
  padding: var(--atk-space-3) var(--atk-space-4);
  margin-bottom: var(--atk-space-4);
  border-radius: var(--atk-radius-sm);
  background: color-mix(in srgb, #3b82f6 8%, transparent);
  border: 1px solid color-mix(in srgb, #3b82f6 32%, transparent);
  border-left: 3px solid #3b82f6;
  font-size: var(--atk-text-sm);
  color: var(--text-primary);
  line-height: 1.5;
}
.atk-info-banner__icon {
  flex-shrink: 0; margin-top: 2px;
  color: #60a5fa; font-size: 1.05rem;
}
.atk-info-banner__body { flex: 1 1 auto; min-width: 0; }
.atk-info-banner__title {
  font-weight: 600; color: var(--text-bright);
  margin-bottom: var(--atk-space-2);
  display: block;
}
.atk-info-banner__list {
  margin: 0; padding-left: var(--atk-space-5);
  color: var(--text-secondary);
}
.atk-info-banner__list li + li { margin-top: var(--atk-space-1); }
.atk-info-banner__dismiss {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; line-height: 1;
  padding: 2px 6px; border-radius: var(--atk-radius-sm);
}
.atk-info-banner__dismiss:hover { color: var(--text-primary); background: var(--bg-muted); }
.atk-info-banner__dismiss:focus-visible {
  outline: none; box-shadow: 0 0 0 2px var(--focus-ring);
}

/* Quiet metadata strip */
.ds-meta-row      { display: flex; flex-wrap: wrap; gap: var(--atk-space-4);
                    font-size: var(--atk-text-xs); color: var(--text-muted); }
.ds-meta-row > * + *::before { content: ''; }
.ds-meta-item     { display: inline-flex; align-items: center; gap: 5px; }
.ds-meta-item code, .ds-meta-item .ds-mono {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-secondary);
}

/* Mono — limit to semantically-meaningful machine-readable values */
.ds-mono          { font-family: 'Share Tech Mono', monospace;
                    color: var(--text-secondary); }

/* Divider */
.ds-divider       { height: 1px; background: var(--border-muted);
                    margin: var(--atk-space-5) 0; border: 0; }
.ds-divider--text { display:flex; align-items:center; gap: var(--atk-space-3);
                    color: var(--text-muted); font-size: var(--atk-text-xs);
                    margin: var(--atk-space-5) 0;
                    text-transform: none; letter-spacing: .01em;
                    background: none; height: auto; }
.ds-divider--text::before, .ds-divider--text::after {
  content:''; flex:1; height: 1px; background: var(--border-muted);
}

/* Accessible visually-hidden helper */
.ds-sr-only       { position:absolute; width:1px; height:1px; padding:0;
                    margin:-1px; overflow:hidden; clip:rect(0,0,0,0);
                    white-space:nowrap; border:0; }

/* Reduced motion: kill all decorative motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ──────────────────────────────────────────────────────────
   Glass + elevation primitives
   --------------------------------------------------------
   Restrained glass — subtle transparency + 8px blur, NOT
   the theatrical blur(20px) frosted look. Used for panels
   on a busy canvas where a hint of layering helps hierarchy.
   ────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --surface-glass:        color-mix(in srgb, var(--bg-surface) 88%, transparent);
  --surface-elevated:     color-mix(in srgb, var(--bg-surface-alt) 92%, transparent);
  --shadow-soft:          0 1px 0 0 color-mix(in srgb, white 4%, transparent) inset,
                          0 8px 24px -12px rgba(0,0,0,.55);
}
[data-theme="light"] {
  --surface-glass:        color-mix(in srgb, var(--bg-surface) 86%, transparent);
  --surface-elevated:     color-mix(in srgb, var(--bg-surface-alt) 92%, transparent);
  --shadow-soft:          0 1px 2px 0 rgba(15,23,42,.06),
                          0 8px 24px -12px rgba(15,23,42,.10);
}

.ds-panel-glass {
  background: var(--surface-glass);
  border: 1px solid var(--border-default);
  border-radius: var(--atk-radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ──────────────────────────────────────────────────────────
   Command center primitives — Phase 7 dashboard layout
   --------------------------------------------------------
   Matches the enterprise concept: calm overlines, sentence-
   case titles, restrained KPI tiles, evidence-first queue
   rows. Used by dashboard.html.
   ────────────────────────────────────────────────────────── */

.cmd-overline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.cmd-h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: .005em;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 0 0 8px;
}

.cmd-lede {
  font-size: var(--atk-text-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  max-width: 70ch;
}

.cmd-pageheader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--atk-space-5);
  flex-wrap: wrap;
  padding-bottom: var(--atk-space-5);
  margin-bottom: var(--atk-space-5);
}
.cmd-pageheader__actions {
  display: flex;
  gap: var(--atk-space-2);
  flex-shrink: 0;
}

/* KPI strip — 4-up tiles, calm number focus */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--atk-space-4);
  margin-bottom: var(--atk-space-5);
}
@media (max-width: 960px) { .kpi-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .kpi-strip { grid-template-columns: 1fr; } }

.kpi-tile {
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-default);
  border-radius: var(--atk-radius-md);
  padding: 18px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--motion-base);
}
.kpi-tile:hover { border-color: var(--accent-soft-strong); }
.kpi-tile__overline {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-tile__value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -.005em;
  font-variant-numeric: tabular-nums;
}
.kpi-tile__sub {
  font-size: var(--atk-text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}
.kpi-tile__delta {
  position: absolute;
  top: 18px; right: 20px;
  font-size: var(--atk-text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.kpi-tile__delta.is-up    { color: var(--success); }
.kpi-tile__delta.is-down  { color: var(--danger); }
.kpi-tile__delta.is-neutral { color: var(--text-muted); }

/* Command center 2-col grid */
.cmd-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--atk-space-5);
  align-items: start;
}
@media (max-width: 1100px) { .cmd-grid { grid-template-columns: 1fr; } }

/* Command center panel (used by Priority Queue + Integration Health) */
.cmd-panel {
  background: var(--surface-glass);
  border: 1px solid var(--border-default);
  border-radius: var(--atk-radius-md);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
}
.cmd-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--atk-space-3);
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-muted);
}
.cmd-panel__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: .005em;
}
.cmd-panel__link {
  font-size: var(--atk-text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--motion-base);
}
.cmd-panel__link:hover { color: var(--accent); }
.cmd-panel__body { padding: 8px 8px 16px; }

/* Priority queue rows */
.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--atk-space-3);
  padding: 14px 12px;
  margin: 0 4px;
  border-radius: var(--atk-radius-sm);
  transition: background var(--motion-base);
  cursor: pointer;
}
.queue-row:hover { background: var(--bg-muted); }
.queue-row__title {
  font-size: var(--atk-text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.queue-row__sub {
  font-size: var(--atk-text-xs);
  color: var(--text-muted);
  margin: 3px 0 0;
}
.queue-row__time {
  font-size: var(--atk-text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.queue-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--atk-text-sm);
}

/* Integration health rows */
.health-list { list-style: none; margin: 0; padding: 0; }
.health-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: flex-start;
  gap: var(--atk-space-3);
  padding: 14px 12px;
  margin: 0 4px;
  border-radius: var(--atk-radius-sm);
}
.health-row + .health-row {
  border-top: 1px solid var(--border-muted);
  margin-top: 0;
}
.health-row__title {
  font-size: var(--atk-text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
}
.health-row__cat {
  font-size: var(--atk-text-xs);
  color: var(--text-muted);
  margin: 0 0 4px;
}
.health-row__detail {
  font-size: var(--atk-text-xs);
  color: var(--text-secondary);
  margin: 0;
}
.health-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.health-pill--connected { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 28%, transparent); }
.health-pill--healthy   { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 28%, transparent); }
.health-pill--attention { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent); }
.health-pill--down      { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent); }

/* Severity ribbon on queue rows (left border tint by severity) */
.queue-row--critical { box-shadow: inset 3px 0 0 var(--danger); }
.queue-row--high     { box-shadow: inset 3px 0 0 var(--warning); }
.queue-row--medium   { box-shadow: inset 3px 0 0 var(--info); }

/* ── Progress tracker (canonical pattern) ─────────────────
   Used by:
     auditor/templates/auditor/ds/progress_tracker.html
     deployments/wizard.html, deployments/detail.html, ansible_deploys/detail.html
   Source of truth for vertical step list + state pill UI.
   ─────────────────────────────────────────────────────── */
.atk-progress-header,
.dep-progress-header { /* legacy alias — migrate by 2026-Q3 */
  margin: 0 0 var(--atk-space-3);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; font-size: 1.1rem;
  text-transform: uppercase; color: var(--text-bright);
}
.atk-progress-header .sub,
.dep-progress-header .sub {
  font-weight: 400; font-size: var(--atk-text-xs);
  text-transform: none; color: var(--text-dim); margin-left: var(--atk-space-2);
}
.atk-progress-list,
.dep-progress-list { /* legacy alias — migrate by 2026-Q3 */
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: var(--atk-space-2);
}
.atk-progress-list li,
.dep-progress-list li {
  display: flex; align-items: center; gap: var(--atk-space-3);
  padding: 10px 12px;
  background: var(--bg-card-deep, #0f1320);
  border: 1px solid var(--border, #2a3142);
  border-radius: var(--atk-radius-sm);
}
.atk-progress-list li .icon,
.dep-progress-list li .icon {
  width: 22px; text-align: center; color: var(--text-dim);
}
.atk-progress-list li .lbl,
.dep-progress-list li .lbl {
  color: var(--text-bright); font-size: var(--atk-text-sm);
}
.atk-progress-list li.running,
.dep-progress-list li.running { border-color: var(--accent); }
.atk-progress-list li.running .icon,
.dep-progress-list li.running .icon { color: var(--accent); }
.atk-progress-list li.done,
.dep-progress-list li.done { border-color: var(--success); }
.atk-progress-list li.done .icon,
.dep-progress-list li.done .icon { color: var(--success); }
.atk-progress-list li.failed,
.dep-progress-list li.failed { border-color: var(--danger); }
.atk-progress-list li.failed .icon,
.dep-progress-list li.failed .icon { color: var(--danger); }

/* Status pill — unified across wizard / detail pages */
.atk-deploy-status,
.deploy-status { /* legacy alias — migrate by 2026-Q3 */
  font-family: 'Share Tech Mono', monospace;
  font-size: var(--atk-text-xs);
  padding: 4px 12px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 6px;
}
.atk-deploy-status.pending,
.atk-deploy-status.connecting,
.atk-deploy-status.provisioning,
.atk-deploy-status.configuring,
.atk-deploy-status.installing,
.atk-deploy-status.verifying,
.atk-deploy-status.planning,
.atk-deploy-status.applying,
.atk-deploy-status.running,
.deploy-status.pending,
.deploy-status.connecting,
.deploy-status.provisioning,
.deploy-status.configuring,
.deploy-status.installing,
.deploy-status.verifying,
.deploy-status.planning,
.deploy-status.applying,
.deploy-status.running {
  background: rgba(96,165,250,.10);
  border: 1px solid rgba(96,165,250,.30);
  color: #60a5fa;
}
.atk-deploy-status.plan_ready,
.deploy-status.plan_ready {
  background: rgba(251,191,36,.10);
  border: 1px solid rgba(251,191,36,.30);
  color: #fbbf24;
}
.atk-deploy-status.approved,
.deploy-status.approved {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
  color: #34d399;
}
.atk-deploy-status.ready,
.atk-deploy-status.applied,
.atk-deploy-status.succeeded,
.deploy-status.ready,
.deploy-status.applied,
.deploy-status.succeeded {
  background: color-mix(in srgb, var(--success) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
  color: var(--success);
}
.atk-deploy-status.failed,
.deploy-status.failed {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
  color: var(--danger);
}
.atk-deploy-status.cancelled,
.atk-deploy-status.destroyed,
.deploy-status.cancelled,
.deploy-status.destroyed {
  background: rgba(148,163,184,.10);
  border: 1px solid rgba(148,163,184,.30);
  color: var(--text-dim);
}
.atk-deploy-spinner,
.deploy-spinner { /* legacy alias — migrate by 2026-Q3 */
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(96,165,250,.3);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: atk-progress-spin .8s linear infinite;
}
@keyframes atk-progress-spin { to { transform: rotate(360deg); } }
.queue-row--low      { box-shadow: inset 3px 0 0 var(--text-muted); }

/* ─── Detach-to-popup (DS v1) ──────────────────────────────────────────
   Used by:
     auditor/templates/auditor/ds/detach_button.html
     auditor/static/js/atk-detach.js
   Pattern doc: docs/strategy/2026-05-05-detach-pattern-analysis.md
   ──────────────────────────────────────────────────────────────────── */

/* Embed-mode body modifier — defensive belt-and-suspenders in case the
   server-side {% if %} guard around the sidebar/topbar is bypassed by an
   upstream cache. The base templates already strip the chrome; these
   rules ensure any leftover sidebar/topbar collapses to a full-bleed
   pane and breadcrumb / trial-banner clutter is hidden. */
body.is-embedded .shell {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "main";
}
body.is-embedded .shell__sidebar,
body.is-embedded .shell__topbar,
body.is-embedded nav.navbar,
body.is-embedded #trial-banner,
body.is-embedded #cookieBanner,
body.is-embedded #chatbot-btn {
  display: none !important;
}
body.is-embedded .shell__main,
body.is-embedded .wrap[id="main-content"] {
  padding: var(--atk-space-5, 20px);
  max-width: none;
}
body.is-embedded .atk-detach { display: none !important; }

/* Detach trigger button (ghost variant). Mirrors .ds-btn-ghost so it
   sits comfortably inside .atk-page-header-actions. */
.atk-detach {
  display: inline-flex;
  align-items: center;
  gap: var(--atk-space-2, 8px);
  padding: 6px 12px;
  background: transparent;
  color: var(--text-secondary, var(--text-dim));
  border: 1px solid var(--border, #2a3142);
  border-radius: var(--atk-radius-sm, 6px);
  font-size: var(--atk-text-xs, .72rem);
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.atk-detach i { font-size: .78rem; line-height: 1; }
.atk-detach:hover,
.atk-detach:focus-visible {
  color: var(--text-primary, var(--text-bright));
  border-color: var(--accent, #3b82f6);
  background: color-mix(in srgb, var(--accent, #3b82f6) 8%, transparent);
}
.atk-detach:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}
.atk-detach[disabled] { opacity: .4; cursor: not-allowed; }

/* Inline notice surfaced when the browser blocks window.open(). The JS
   places this immediately after the trigger button and auto-removes it
   after ~6s. */
.atk-detach__notice {
  display: inline-block;
  margin-left: var(--atk-space-2, 8px);
  padding: 6px 10px;
  background: color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn, #f59e0b) 36%, transparent);
  border-radius: var(--atk-radius-sm, 6px);
  color: var(--warn, #f59e0b);
  font-size: var(--atk-text-xs, .72rem);
  line-height: 1.4;
  max-width: 320px;
}

/* Mobile: phones have no real popup window — hide the affordance so the
   button does not appear on small screens. */
@media (max-width: 768px) {
  .atk-detach { display: none !important; }
}


/* ── 26. AtkToast — non-blocking notification toasts (UX audit F7) ────────
   Replaces native alert() across the app. Built/styled to match the existing
   `.arcus-toast` pattern in base_sidebar.html, but stack-aware and themed
   per-kind (success/error/info/warning). Mounted into a top-right region by
   `atk-toast.js`; positioned fixed and ignores the sidebar layout. ─── */
.atk-toast-region {
  position: fixed;
  top: 80px;          /* clear of the topbar */
  right: 24px;
  z-index: 10000;     /* above arcus-toast (9999) so app-fired toasts win */
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;   /* region is transparent; children re-enable */
  max-width: 420px;
  width: calc(100vw - 48px);
}
.atk-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  min-width: 280px;
  background: var(--bg-elevated, #1e293b);
  border: 1px solid var(--border-default, var(--border, #334155));
  border-left: 3px solid var(--accent, #3b82f6);
  border-radius: var(--atk-radius-md, 10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
  color: var(--text-primary, var(--text-bright, #f8fafc));
  font-size: var(--atk-text-base, .92rem);
  line-height: 1.4;
  cursor: pointer;
  transform: translateX(20px);
  opacity: 0;
  transition: transform .2s ease-out, opacity .2s ease-out;
}
.atk-toast.is-shown { transform: translateX(0); opacity: 1; }
.atk-toast--leaving { transform: translateX(20px); opacity: 0; }
.atk-toast:focus-visible {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: 2px;
}
.atk-toast--success { border-left-color: var(--success, #16a34a); }
.atk-toast--error   { border-left-color: var(--danger,  #dc2626); }
.atk-toast--warning { border-left-color: var(--warning, #f59e0b); }
.atk-toast--info    { border-left-color: var(--accent,  #3b82f6); }
.atk-toast__icon { font-size: 1.05rem; margin-top: 1px; flex-shrink: 0; }
.atk-toast--success .atk-toast__icon { color: var(--success, #16a34a); }
.atk-toast--error   .atk-toast__icon { color: var(--danger,  #dc2626); }
.atk-toast--warning .atk-toast__icon { color: var(--warning, #f59e0b); }
.atk-toast--info    .atk-toast__icon { color: var(--accent,  #3b82f6); }
.atk-toast__body {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  white-space: pre-wrap;
}
.atk-toast__close {
  background: transparent;
  border: 0;
  color: var(--text-secondary, var(--text, #94a3b8));
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}
.atk-toast__close:hover { color: var(--text-primary, var(--text-bright, #f8fafc)); }
@media (max-width: 640px) {
  .atk-toast-region { top: 64px; right: 12px; left: 12px; max-width: none; width: auto; }
  .atk-toast { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .atk-toast { transition: none; }
}

/* ─── atk-uncopyable: read-only watermarked code block ──────────────────
   Render-mode primitive used by the Arc Discover trial paywall to show
   the remediation playbook a paid user *would* receive without letting
   trial users select/copy/cut/right-click/drag the contents.

   This is deterrence, not security — see
     docs/strategy/2026-05-05-uncopyable-remediation.md
   and the JS guards in
     auditor/static/js/atk-uncopyable.js
   for the threat model and accepted trade-offs. ─────────────────────── */
.atk-uncopyable {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  filter: saturate(.85);
  opacity: .92;
  border: 1px solid var(--border, #1f2937);
  border-radius: 10px;
  overflow: hidden;
}
.atk-uncopyable::before {
  /* Subtle diagonal watermark behind the code block. */
  content: "TRIAL PREVIEW — UPGRADE TO COPY";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .15em;
  color: var(--accent, #1a73e8);
  opacity: .12;
  pointer-events: none;
  transform: rotate(-15deg);
  text-transform: uppercase;
  z-index: 1;
  white-space: nowrap;
}
.atk-uncopyable__overlay {
  /* Sticky banner pinned to the top of the block; calls out the gate
     and houses the upgrade CTA. */
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-elevated, var(--surface, #1e293b));
  border-bottom: 2px solid var(--accent, #1a73e8);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--atk-text-sm, .85rem);
  color: var(--text, #cbd5e1);
}
.atk-uncopyable__overlay strong { color: var(--accent, #1a73e8); }
.atk-uncopyable pre,
.atk-uncopyable code {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  position: relative;
  z-index: 0;
  /* Visible content sits above the watermark gradient but below the overlay. */
}
.atk-uncopyable pre {
  margin: 0;
  padding: 16px;
  background: var(--code-bg, #0b1220);
  font-family: 'Share Tech Mono', monospace;
  font-size: .78rem;
  color: var(--text, #cbd5e1);
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}
.atk-uncopyable:hover pre {
  /* Subtle hover blur reinforces "you can't grab this". */
  filter: blur(.25px);
}
.atk-uncopyable--active {
  /* Style hook engaged once JS guards are wired so styles can react to
     "JS is loaded" without flashing the unwatermarked block first. */
}
@media (prefers-reduced-motion: reduce) {
  .atk-uncopyable:hover pre { filter: none; }
}
