/*
 * vault-theme.css — post-login visual theme for QA Scanner.
 *
 * A slate/indigo system: one cool grey surface hue stepped by lightness, indigo
 * as the single interactive colour, cyan as the secondary signal, and the
 * conventional green/amber/red reserved exclusively for state. Indigo is chosen
 * precisely because nothing in this product is indigo-coded — brand colour can
 * never be misread as a verdict.
 *
 * This file is loaded ONLY by index.html (the authenticated app) and every rule
 * is scoped to `body.app-vault`, so /login keeps its own theme. It works by
 * re-pointing the --tk-* colour tokens that style.css reads; each of those
 * tokens carries the original colour as its var() fallback, which is what the
 * login page falls back to.
 */

/* ── Colour tokens ────────────────────────────────────────────────────────── */
body.app-vault {
  /* Slate surface stack — page, chrome, cards, borders.
     One hue (222deg) held across the whole stack, stepping in lightness only, so
     every surface reads as the same material at a different depth. Steps are
     roughly even in L* rather than in hex, which is what keeps a card visible
     against the page without a border doing the work. */
  --tk-navy-950: #080b14;
  --tk-navy-940: #0b1019;
  --tk-navy-900: #101522;
  --tk-navy-850: #151b2a;
  --tk-navy-800: #1a2130;
  --tk-navy-700: #232b3d;
  --tk-navy-650: #2b3448;
  --tk-navy-600: #333d54;
  --tk-navy-950-rgb: 8, 11, 20;
  --tk-navy-940-rgb: 11, 16, 25;
  --tk-navy-900-rgb: 16, 21, 34;
  --tk-navy-850-rgb: 21, 27, 42;
  --tk-navy-800-rgb: 26, 33, 48;
  --tk-navy-700-rgb: 35, 43, 61;
  --tk-navy-600-rgb: 51, 61, 84;
  --tk-navy-960-rgb: 7, 10, 18;
  --tk-navy-980-rgb: 5, 8, 15;
  --tk-navy-990-rgb: 4, 6, 12;

  /* Text ramp — cool grey, the same 222deg family desaturated. Four steps is
     all a UI needs: strong, muted, dim, and the two paper tones for light mode. */
  --tk-slate-500: #7d8698;
  --tk-slate-400: #949db4;
  --tk-slate-300: #c3cad8;
  --tk-slate-200: #e2e6ee;
  --tk-slate-100: #f1f3f7;
  --tk-slate-050: #f9fafc;
  --tk-slate-500-rgb: 125, 134, 152;
  --tk-slate-400-rgb: 148, 157, 180;
  --tk-slate-300-rgb: 195, 202, 216;

  /* Primary — blue. Was indigo; moved to the same single-hue blue as the login page
     (login-premium.css's --lp-accent/--lp-accent-2) so the interactive colour reads
     as one consistent brand identity across the whole app instead of switching hue
     at the login/dashboard boundary. Still sits far from every status hue (green/red/
     amber below), so brand colour can't be mistaken for pass, warn or fail.
     --tk-accent is the interactive colour; --deep is what carries white text, --light
     the focus ring. */
  --tk-accent: #2563eb;
  --tk-accent-bright: #3b82f6;
  --tk-accent-deep: #1d4ed8;
  --tk-accent-light: #93c5fd;
  --tk-accent-pale: #bfdbfe;
  --tk-accent-rgb: 37, 99, 235;
  --tk-accent-bright-rgb: 59, 130, 246;
  --tk-accent-deep-rgb: 29, 78, 216;
  --tk-accent-light-rgb: 147, 197, 253;
  --tk-accent-pale-rgb: 191, 219, 254;
  --tk-accent-soft-rgb: 59, 130, 246;
  --tk-fuchsia-rgb: 37, 99, 235;

  /* Secondary signal — cyan. Used for the reference/source side of a pair and
     for informational chrome, never for state. */
  --tk-sky: #06b6d4;
  --tk-sky-deep: #0e7490;
  --tk-sky-bright: #22d3ee;
  --tk-cyan: #67e8f9;
  --tk-sky-050: #ecfeff;
  --tk-sky-100: #a5f3fc;
  --tk-sky-rgb: 6, 182, 212;
  --tk-sky-deep-rgb: 14, 116, 144;
  --tk-sky-bright-rgb: 34, 211, 238;
  --tk-cyan-rgb: 103, 232, 249;

  /* Pass / fail / warn. Deliberately the conventional hues at conventional
     saturation: these are the only colours in the product a reader must decode
     correctly at a glance, so they are the ones that must not be "designed". */
  --tk-green: #22c55e;
  --tk-green-deep: #16a34a;
  --tk-green-dark: #15803d;
  --tk-teal: #14b8a6;
  --tk-green-050: #ecfdf5;
  --tk-teal-050: #f0fdfa;
  --tk-green-rgb: 34, 197, 94;
  --tk-green-deep-rgb: 22, 163, 74;
  --tk-green-dark-rgb: 21, 128, 61;

  --tk-red: #ef4444;
  --tk-red-alt: #ef4444;
  --tk-red-strong: #dc2626;
  --tk-red-deep: #b91c1c;
  --tk-red-soft: #f87171;
  --tk-red-pale: #fca5a5;
  --tk-rose-100: #fecdd3;
  --tk-rose-150: #fecdd3;
  --tk-rose-050: #fef2f2;
  --tk-rose-025: #fff5f5;
  --tk-red-rgb: 239, 68, 68;
  --tk-red-strong-rgb: 220, 38, 38;
  --tk-red-deep-rgb: 185, 28, 28;
  --tk-red-soft-rgb: 248, 113, 113;

  --tk-amber: #f59e0b;
  --tk-amber-bright: #fbbf24;
  --tk-orange: #f97316;
  --tk-orange-light: #fb923c;
  --tk-amber-deep: #b45309;
  --tk-amber-050: #fffbeb;
  --tk-amber-rgb: 245, 158, 11;
  --tk-amber-bright-rgb: 251, 191, 36;
  --tk-amber-bright2-rgb: 251, 191, 36;
  --tk-amber-warm-rgb: 245, 158, 11;
  --tk-orange-rgb: 249, 115, 22;

  /* Violet sits beside indigo as a near-neighbour, so the few places that need
     a second cool hue (cross-compare target, visual module) relate to the
     primary instead of introducing a sixth family. */
  --tk-purple-light: #c4b5fd;
  --tk-purple: #a78bfa;
  --tk-violet: #8b5cf6;
  --tk-violet-deep: #7c3aed;
  --tk-indigo: #818cf8;
  --tk-purple-light-rgb: 196, 181, 253;
  --tk-purple-rgb: 167, 139, 250;
  --tk-violet-rgb: 139, 92, 246;
  --tk-violet-deep-rgb: 124, 58, 237;
  --tk-indigo-rgb: 129, 140, 248;
  --tk-indigo-deep-rgb: 129, 140, 248;

  /* Shape — 8px on containers, 6px on controls. Two radii, not seven. */
  --vault-radius: 6px;
  --vault-radius-lg: 10px;

  /* Type — Inter, self-hosted as a variable face (100-900) by style.css's
     @font-face and served from /fonts. Kept from the previous theme: it is a
     neutral grotesque with a true tabular figure set, which is what this UI
     needs for columns of counts and durations. */
  --vault-font-body: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --vault-font-display: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --vault-font-figure: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Light mode: the same cool family, inverted. Paper is a faint blue-grey rather
   than pure white — white next to a saturated indigo vibrates, and a 2% tint
   removes that without reading as "grey UI". */
[data-theme="light"] body.app-vault {
  --tk-slate-100: #f4f6fa;
  --tk-slate-200: #e5e9f0;
  --tk-slate-300: #cbd2df;
  --tk-slate-500: #64708a;   /* muted ink */
  --tk-navy-850: #131a29;    /* body ink */
}

/* ── Typography ───────────────────────────────────────────────────────────── */
body.app-vault,
body.app-vault input,
body.app-vault select,
body.app-vault textarea,
body.app-vault button {
  font-family: var(--vault-font-body);
}

body.app-vault h1,
body.app-vault h2,
body.app-vault h3,
body.app-vault h4,
body.app-vault h5,
body.app-vault h6 {
  font-family: var(--vault-font-display);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* Display type: titles carry the heaviest weight the scale allows, with tight tracking. */
body.app-vault .command-title,
body.app-vault .card-title,
body.app-vault .modal-title,
body.app-vault .dock-title,
body.app-vault .section-title,
body.app-vault .module-title,
body.app-vault .mod-title,
body.app-vault .storage-title,
body.app-vault .storage-inspect-card-title,
body.app-vault .summary-deck-title,
body.app-vault .settings-section-title,
body.app-vault .settings-history-title,
body.app-vault .site-picker-title,
body.app-vault .live-running-title,
body.app-vault .hero-title {
  font-family: var(--vault-font-display);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* The wordmark deliberately carries NO override: it inherits style.css's .brand rule
   (24px / 800 / -0.2px, mixed case), which is character-for-character the same treatment
   .login-brand-name uses, so the app and the sign-in screen show an identical wordmark. */

/* Micro-labels: uppercase with open tracking, the reference's small-caps treatment. */
body.app-vault .summary-label,
body.app-vault .vp-label,
body.app-vault .profile-strip-label,
body.app-vault .cross-proj-label,
body.app-vault .storage-kpi-title {
  font-family: var(--vault-font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* The nav gets the same uppercase treatment, but six long links plus an uppercase wordmark
   overflow the topbar's `1fr auto 1fr` grid at 13px — the brand ends up touching the first
   link. Measured across 1500/1366px, 11px at this tracking and gap restores roughly the
   original breathing room on both sides. (At 1280px the topbar is tight either way — the
   original collides there too.) */
body.app-vault .topbar-nav {
  gap: 16px;
}

body.app-vault .topbar-nav a {
  font-family: var(--vault-font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

/* Figures: tabular so columns of numbers line up. */
body.app-vault .kpi-number,
body.app-vault .storage-kpi-value,
body.app-vault .nav-count-badge,
body.app-vault .live-scan-count-badge,
body.app-vault .history-count-badge,
body.app-vault .duration-badge,
body.app-vault .modal-duration-badge,
body.app-vault .storage-size-badge,
body.app-vault .schedule-countdown-badge,
body.app-vault .eta-cold-badge,
body.app-vault .eta-history-badge,
body.app-vault .pill {
  font-family: var(--vault-font-figure);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

body.app-vault .pill,
body.app-vault .profile-pill,
body.app-vault .storage-view-pill,
body.app-vault .report-pill,
body.app-vault .env-tag-badge,
body.app-vault .schedule-mod-pill {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ── Shape ────────────────────────────────────────────────────────────────── */
body.app-vault .card,
body.app-vault .command-main-panel,
body.app-vault .command-summary-panel,
body.app-vault .summary-deck,
body.app-vault .project-config-card,
body.app-vault .recent-scans-card,
body.app-vault .kpi-card-v2,
body.app-vault .storage-inspect-card,
body.app-vault .storage-kpi-card,
body.app-vault .module-card-v2,
body.app-vault .status-card,
body.app-vault .project-card,
body.app-vault .storage-card,
body.app-vault .scan-item-card,
body.app-vault .config-list,
body.app-vault .modal-content {
  border-radius: var(--vault-radius-lg);
}

body.app-vault .field,
body.app-vault input[type="text"],
body.app-vault input[type="url"],
body.app-vault input[type="number"],
body.app-vault input[type="password"],
body.app-vault select,
body.app-vault textarea,
body.app-vault .settings-btn,
body.app-vault .logout-btn,
body.app-vault .refresh-btn,
body.app-vault .rescan-btn,
body.app-vault .compare-btn,
body.app-vault .cancel-btn,
body.app-vault .danger-btn,
body.app-vault .history-btn,
body.app-vault .batch-btn {
  border-radius: var(--vault-radius);
}

/* ── Sign-in screen ───────────────────────────────────────────────────────── */

/* The Sign in CTA. style.css gives the dark default a flat `background:
   var(--tk-accent)` and only [data-theme="light"] adds a two-stop gradient, so the
   button lost its second colour in dark mode. Matched here in the new family.
   Scoped to [data-theme="dark"] rather than plain body.app-vault: this selector
   would otherwise outrank the light-theme rule (0,3,2 vs 0,3,1) and override the
   gradient in BOTH themes. White on this pair holds 5.9:1 at the light end and
   8.6:1 at the deep end, so the label stays readable across the whole sweep. */
[data-theme="dark"] body.app-vault .login-card button[type="submit"] {
  background: linear-gradient(135deg, var(--tk-accent) 0%, var(--tk-accent-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(var(--tk-accent-rgb), 0.28);
}
[data-theme="dark"] body.app-vault .login-card button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--tk-accent-bright) 0%, var(--tk-accent) 100%);
  box-shadow: 0 6px 22px rgba(var(--tk-accent-rgb), 0.4);
  transform: translateY(-1px);
}
[data-theme="dark"] body.app-vault .login-card button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════════════════
   DESIGN REFINEMENT LAYER
   ──────────────────────────────────────────────────────────────────────────
   The theme above set the palette; this section makes it behave like a design
   system. Three problems it fixes, all visible on the New Scan screen:

   1. Six fully-saturated hues competed at equal strength, so nothing read as
      primary. Indigo is now the only high-chroma brand colour; the four module
      hues are re-cut as one cool family at matched lightness, so they
      differentiate from each other without competing with it — or with the
      green/amber/red that carry actual verdicts.
   2. Depth came from coloured glow. Glow reads as "neon demo", not product,
      and it stacked with every neighbouring card's glow into haze. Elevation
      is now a two-layer neutral shadow plus a 1px top highlight; colour is
      reserved for state (selected / running / failed).
   3. Type had no scale — sizes were ad-hoc decimals (11.5px, 12.5px, 10.5px)
      and weight 900 was applied to everything from the H1 to a card title, so
      hierarchy came only from size. A 6-step scale below sets size, weight,
      tracking and line-height together; 900 is now reserved for the two
      largest steps.
   ══════════════════════════════════════════════════════════════════════════ */

body.app-vault {
  /* ── Type scale ─────────────────────────────────────────────────────────
     Ratio ~1.2 off a 14px base. Tracking tightens as size grows (large text
     needs less air per character) and micro-labels open up, which is what
     makes uppercase legible at 10px. */
  --fs-display: 26px;   --lh-display: 1.12;  --ls-display: -0.03em;
  --fs-title:   19px;   --lh-title:   1.2;   --ls-title:   -0.02em;
  --fs-section: 15px;   --lh-section: 1.3;   --ls-section: -0.01em;
  --fs-body:    13.5px; --lh-body:    1.5;   --ls-body:    0;
  --fs-small:   12px;   --lh-small:   1.45;  --ls-small:   0.005em;
  --fs-micro:   10.5px; --lh-micro:   1.3;   --ls-micro:   0.09em;

  /* ── Module hues, re-cut as one family ──────────────────────────────────
     Each is the old hue pulled toward the navy ground: same hue angle, lower
     saturation, lightness aligned so no single card jumps forward. */
  --mod-links:      #7f9cf5;   --mod-links-rgb:      127, 156, 245;
  --mod-seo:        #4bb6cf;   --mod-seo-rgb:         75, 182, 207;
  --mod-visual:     #a78bfa;   --mod-visual-rgb:     167, 139, 250;
  --mod-lighthouse: #5eb98e;   --mod-lighthouse-rgb:  94, 185, 142;

  /* ── Elevation: neutral, two-layer, no colour ───────────────────────────
     Ambient (large, soft) + key (small, tight) is what reads as a physical
     surface. The inset hairline is the light catching the top edge. */
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 6px -2px rgba(0, 0, 0, 0.35);
  --elev-2: 0 2px 4px rgba(0, 0, 0, 0.32), 0 8px 20px -6px rgba(0, 0, 0, 0.45);
  --elev-3: 0 4px 8px rgba(0, 0, 0, 0.35), 0 20px 48px -14px rgba(0, 0, 0, 0.6);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --rule: rgba(255, 255, 255, 0.07);

  /* ── Surfaces and text, as roles rather than colours ────────────────────
     Every rule below paints with these, never with a literal, so the light
     theme is a token swap instead of a parallel set of rules. Without this the
     refinements would outrank style.css's [data-theme="light"] block (they are
     equally specific but load later) and paint the light theme dark. */
  --surface-panel:  linear-gradient(180deg, #131a2a 0%, #0c1119 100%);
  --surface-card:   #121927;
  --surface-sunken: rgba(0, 0, 0, 0.28);
  --surface-raised: rgba(255, 255, 255, 0.05);
  --border-1: var(--tk-navy-700);
  --border-2: var(--tk-navy-600);
  --text-strong: var(--tk-slate-050);
  --text-muted:  var(--tk-slate-300);
  --text-dim:    var(--tk-slate-500);
}

[data-theme="light"] body.app-vault {
  --surface-panel:  #ffffff;
  --surface-card:   #ffffff;
  --surface-sunken: var(--tk-slate-100);
  --surface-raised: var(--tk-slate-100);
  --border-1: var(--tk-slate-200);
  --border-2: var(--tk-slate-300);
  --text-strong: #131a29;   /* body ink */
  --text-muted:  #46506b;
  --text-dim:    var(--tk-slate-500);
  --rule: rgba(0, 0, 0, 0.09);
  /* Shadow on paper is a fraction of the strength it needs on near-black. */
  --elev-1: 0 1px 2px rgba(19, 26, 41, 0.05);
  --elev-2: 0 1px 2px rgba(19, 26, 41, 0.06), 0 4px 12px -4px rgba(19, 26, 41, 0.1);
  --elev-3: 0 2px 4px rgba(19, 26, 41, 0.06), 0 12px 32px -12px rgba(19, 26, 41, 0.14);
  --hairline: none;

  /* The module hues are cut for a dark ground; on white they need darkening to
     hold their contrast against the card and against each other. */
  --mod-links:      #4459c7;   --mod-links-rgb:       68,  89, 199;
  --mod-seo:        #1c7f96;   --mod-seo-rgb:         28, 127, 150;
  --mod-visual:     #6d43c9;   --mod-visual-rgb:     109,  67, 201;
  --mod-lighthouse: #2f8259;   --mod-lighthouse-rgb:  47, 130,  89;
}

/* Kerning and ligatures are off by default in most browsers below 20px; at
   this UI's sizes they are exactly what stops Inter looking mechanical. */
body.app-vault {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Applying the scale ─────────────────────────────────────────────────── */

/* 900 stays here and nowhere else — one voice per screen. */
body.app-vault .hero-title,
body.app-vault .command-title {
  font-size: var(--fs-title);
  line-height: var(--lh-title);
  letter-spacing: var(--ls-title);
  font-weight: 800;
  /* Was a three-stop gradient clipped to the text. Gradient text drops all
     subpixel rendering and tinted the last word for no semantic reason; a solid
     near-white is sharper and higher contrast. */
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--text-strong);
}

body.app-vault h1 { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); font-weight: 900; }
body.app-vault h2 { font-size: var(--fs-title);   line-height: var(--lh-title);   letter-spacing: var(--ls-title);   font-weight: 800; }
body.app-vault h3,
body.app-vault h4 { font-size: var(--fs-section); line-height: var(--lh-section); letter-spacing: var(--ls-section); font-weight: 700; }

/* Card titles were 900 at 12.5px — at that size the heavy weight closes the
   counters up and the word turns into a block. 700 keeps it distinct from the
   400 description underneath without losing the letterforms. */
body.app-vault .mod-title,
body.app-vault .card-title,
body.app-vault .modal-title,
body.app-vault .section-title,
body.app-vault .module-title,
body.app-vault .storage-inspect-card-title,
body.app-vault .site-picker-title {
  font-size: var(--fs-section);
  line-height: var(--lh-section);
  letter-spacing: var(--ls-section);
  font-weight: 700;
}

body.app-vault .mod-title { font-size: var(--fs-body); }

body.app-vault .mod-desc,
body.app-vault .command-subtitle {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
  font-weight: 400;
}

/* Every uppercase micro-label on one setting, so the eye reads them as a
   single class of information rather than four near-misses. */
body.app-vault .summary-label,
body.app-vault .vp-label,
body.app-vault .profile-strip-label,
body.app-vault .cross-proj-label,
body.app-vault .storage-kpi-title,
body.app-vault .summary-deck-title {
  font-size: var(--fs-micro);
  line-height: var(--lh-micro);
  letter-spacing: var(--ls-micro);
  font-weight: 700;
  color: var(--text-dim);
}

body.app-vault .mod-chip,
body.app-vault .profile-pill,
body.app-vault .pill {
  font-size: var(--fs-small);
  font-weight: 600;
}

/* ── Surfaces: depth from shadow, not from glow ─────────────────────────── */

/* The two big panels each carried two coloured radial gradients plus a
   coloured border plus a coloured shadow. Stacked side by side that reads as
   haze rather than as two distinct planes. One flat surface, one hairline
   border, one neutral shadow — the panel now separates from the page by
   value, which survives at any zoom and in a screenshot. */
body.app-vault .command-main-panel,
body.app-vault .summary-deck {
  background: var(--surface-panel);
  border: 1px solid var(--border-1);
  box-shadow: var(--elev-3), var(--hairline);
  border-radius: 14px;
}

/* The panel's animated conic ring: a spinning rainbow outline on the primary
   work surface pulls the eye away from the controls inside it, and it repaints
   every frame for the life of the page. Replaced with a static indigo wash along
   the top edge — the same "this panel is active" cue, no motion. */
body.app-vault .command-main-panel::before {
  animation: none;
  background: linear-gradient(
    180deg,
    rgba(var(--tk-accent-rgb), 0.5) 0%,
    rgba(var(--tk-accent-rgb), 0.06) 30%,
    transparent 60%
  );
  border-radius: 13px;   /* parent 14px − 1px border; see the note on the original rule */
  opacity: 1;
}

body.app-vault .command-panel-header,
body.app-vault .summary-deck-header {
  border-bottom-color: var(--rule);
}

/* ── Module cards ───────────────────────────────────────────────────────── */

/* Unselected cards are neutral: the 4px hue bar is the only colour, at low
   opacity. This matters because all four ship checked by default — when every
   card glows, "selected" stops meaning anything. Selection now shows as a
   full-strength bar plus a lifted surface, so an unchecked card is obviously
   different at a glance. */
body.app-vault .module-card-v2 {
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-left: 3px solid var(--mod-hue, var(--border-2));
  border-radius: 10px;
  box-shadow: var(--elev-1);
  padding: 14px 16px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body.app-vault .module-card-v2.mod-links      { --mod-hue: rgba(var(--mod-links-rgb), 0.55);      --mod-hue-rgb: var(--mod-links-rgb); }
body.app-vault .module-card-v2.mod-seo        { --mod-hue: rgba(var(--mod-seo-rgb), 0.55);        --mod-hue-rgb: var(--mod-seo-rgb); }
body.app-vault .module-card-v2.mod-visual     { --mod-hue: rgba(var(--mod-visual-rgb), 0.55);     --mod-hue-rgb: var(--mod-visual-rgb); }
body.app-vault .module-card-v2.mod-lighthouse { --mod-hue: rgba(var(--mod-lighthouse-rgb), 0.55); --mod-hue-rgb: var(--mod-lighthouse-rgb); }

/* One rule for all four states, driven by the --mod-hue-rgb each card sets.
   Replaces four near-identical blocks that each hard-coded a different hue and
   had drifted apart (three used a radial gradient, one a flat fill). */
body.app-vault .module-card-v2.mod-links:hover,
body.app-vault .module-card-v2.mod-seo:hover,
body.app-vault .module-card-v2.mod-visual:hover,
body.app-vault .module-card-v2.mod-lighthouse:hover,
body.app-vault .module-card-v2.mod-links.checked,
body.app-vault .module-card-v2.mod-seo.checked,
body.app-vault .module-card-v2.mod-visual.checked,
body.app-vault .module-card-v2.mod-lighthouse.checked {
  background:
    linear-gradient(180deg, rgba(var(--mod-hue-rgb), 0.07) 0%, rgba(var(--mod-hue-rgb), 0.02) 100%),
    var(--surface-card);
  border-color: rgba(var(--mod-hue-rgb), 0.28);
  border-left-color: rgb(var(--mod-hue-rgb));
  box-shadow: var(--elev-2), var(--hairline);
}

body.app-vault .module-card-v2:hover {
  transform: translateY(-1px);
}

/* The emoji module icons were dropping a white glow, which halos them against
   the dark card and makes the row look blurry at 100%. */
body.app-vault .mod-icon {
  filter: none;
  opacity: 0.9;
}

/* Was a green tick on every card at all times, i.e. four green dots that
   never change. Tint it to the card's own hue so it reads as part of that
   module rather than as a pass/fail signal it isn't. */
body.app-vault .mod-status-indicator {
  color: rgb(var(--mod-hue-rgb, var(--tk-green-rgb)));
  background: rgba(var(--mod-hue-rgb, var(--tk-green-rgb)), 0.12);
  border-color: rgba(var(--mod-hue-rgb, var(--tk-green-rgb)), 0.3);
}

body.app-vault .mod-footer-chips { border-top-color: var(--rule); }

body.app-vault .mod-chip {
  background: var(--surface-raised);
  border-radius: var(--vault-radius);
  padding: 3px 8px;
  color: var(--text-muted);
}

/* The viewport sub-panel inherited a violet border from the visual card's old
   hue; point it at the card's own variable so the two stay in step. */
body.app-vault .mod-viewport-controls {
  background: var(--surface-sunken);
  border-color: rgba(var(--mod-hue-rgb, var(--tk-navy-600-rgb)), 0.3);
  border-radius: var(--vault-radius);
}

/* ── Controls ───────────────────────────────────────────────────────────── */

/* The selected mode pill and the selected profile pill both ran a
   two-hue gradient. Two hues inside one 11px pill is more colour than the
   element can carry, and white on the lighter end measures under the 4.5:1
   needed at this size. The deep accent is the same family and holds 8.6:1, so
   selection stays obvious and the label stays readable. */
body.app-vault .mode-pill.active,
body.app-vault .profile-pill.active {
  background: var(--tk-accent-deep);
  border-color: var(--tk-accent-deep);
  color: #fff;
  box-shadow: none;
}

body.app-vault .scan-mode-pills {
  background: var(--surface-sunken);
  border-color: var(--border-1);
  box-shadow: none;
}

body.app-vault .mode-pill,
body.app-vault .profile-pill {
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

body.app-vault .profile-pill {
  background: transparent;
  border-color: var(--border-1);
  border-radius: var(--vault-radius);
}

body.app-vault .profile-pill:hover {
  background: var(--surface-raised);
  border-color: var(--border-2);
  color: var(--text-strong);
}

body.app-vault .scan-profile-strip {
  background: var(--surface-sunken);
  border-color: var(--border-1);
  border-radius: 10px;
}

/* Reads as a quiet annotation on the strip rather than a fifth accent. */
body.app-vault .profile-estimate-badge {
  color: var(--text-muted);
  background: var(--surface-raised);
  border-color: var(--border-2);
  font-size: var(--fs-small);
  font-weight: 600;
}

/* Primary CTA. Kept as a gradient because it is the one element on the page
   that should be the loudest, but both stops are now indigo — the violet end was
   reading as a second brand colour. White on this pair holds 5.9:1 or better. */
body.app-vault .btn-launch-scan {
  background: linear-gradient(180deg, var(--tk-accent) 0%, var(--tk-accent-deep) 100%);
  box-shadow: var(--elev-2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  font-size: var(--fs-body);
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.app-vault .btn-launch-scan:hover {
  filter: none;
  background: linear-gradient(180deg, var(--tk-accent-bright) 0%, var(--tk-accent) 100%);
  box-shadow: var(--elev-3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* The sweeping white sheen crossing the button on every hover is a decoration
   that says nothing about what the button does. */
body.app-vault .btn-launch-scan::after { display: none; }

/* Fields: the label above and the control below were competing at similar
   weight. Label drops to the micro treatment, control gets a calm surface. */
body.app-vault .field,
body.app-vault input[type="text"],
body.app-vault input[type="url"],
body.app-vault input[type="number"],
body.app-vault input[type="password"],
body.app-vault select,
body.app-vault textarea {
  background: var(--surface-sunken);
  border: 1px solid var(--border-1);
  color: var(--text-strong);
  font-size: var(--fs-body);
}

body.app-vault input:focus-visible,
body.app-vault select:focus-visible,
body.app-vault textarea:focus-visible,
body.app-vault button:focus-visible,
body.app-vault a:focus-visible {
  outline: 2px solid var(--tk-accent-light);
  outline-offset: 2px;
}

/* ── Source / Target pair ───────────────────────────────────────────────── */

/* Both boxes carried a two-stop gradient bar — four hues describing a two-value
   distinction. One flat hue each is the whole signal: cyan reads as the
   reference side, indigo as the side under test, matching how the rest of the
   app already colours "baseline" versus "current". */
body.app-vault .hero-env-box::before { height: 2px; }
body.app-vault .hero-env-box.source-box::before { background: var(--tk-sky); }
body.app-vault .hero-env-box.target-box::before { background: var(--tk-accent); }

body.app-vault .hero-env-box {
  background: var(--surface-card);
  border-color: var(--border-1);
  border-radius: 10px;
  box-shadow: var(--elev-1);
}

/* The badges took their colours from the old blue/violet scheme, which no
   longer matches the bar directly above them. */
body.app-vault .env-tag-badge {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-micro);
  font-weight: 700;
  border-radius: var(--vault-radius);
}

body.app-vault .env-dev {
  background: rgba(var(--tk-sky-rgb), 0.14);
  color: var(--tk-sky-bright);
  border-color: rgba(var(--tk-sky-rgb), 0.35);
}

body.app-vault .env-stage {
  background: rgba(var(--tk-accent-rgb), 0.14);
  color: var(--tk-accent-light);
  border-color: rgba(var(--tk-accent-rgb), 0.35);
}

[data-theme="light"] body.app-vault .env-dev    { color: var(--tk-sky-deep); }
[data-theme="light"] body.app-vault .env-stage  { color: var(--tk-accent-deep); }

/* The panel's top-edge wash sits on near-black in the dark theme, where a
   50%-alpha indigo is a hairline. On the light theme's paper the same alpha
   traces a visible outline all the way round, so it drops to the weight
   style.css originally used there. */
[data-theme="light"] body.app-vault .command-main-panel::before {
  opacity: 0.45;
}

/* ══════════════════════════════════════════════════════════════════════════
   POLISH LAYER
   ──────────────────────────────────────────────────────────────────────────
   Everything above sets palette and component treatment. This last section is
   the product-wide finish: the things a reader never notices individually but
   which separate a themed app from a designed one — ground, rules, selection,
   scrollbars, link contrast, motion. All token-driven, so both themes follow.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Ground ──────────────────────────────────────────────────────────────── */

/* A flat near-black page reads as a void: nothing tells the eye where the light
   is, so every panel looks pasted on. One very wide, very low-alpha wash from
   the top establishes a light source, which is what makes the panels below read
   as sitting ON something. Fixed attachment so it does not travel on scroll and
   cost a repaint. */
body.app-vault {
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(var(--tk-accent-rgb), 0.07) 0%, transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

[data-theme="light"] body.app-vault {
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(var(--tk-accent-rgb), 0.05) 0%, transparent 60%);
}

/* ── Link contrast ───────────────────────────────────────────────────────── */

/* style.css paints in-table links with --tk-accent. At indigo-500 on a card that
   measures 3.9:1 — under the 4.5:1 body text needs, and these are the links a
   reader clicks to open a report. The bright step is the same hue at 5.8:1.
   Light mode has the opposite problem, so it takes the deep step (7.9:1). */
body.app-vault td a,
body.app-vault .link-like,
body.app-vault a.report-link {
  color: var(--tk-accent-bright);
}
body.app-vault td a:hover {
  color: var(--tk-accent-light);
}
[data-theme="light"] body.app-vault td a,
[data-theme="light"] body.app-vault .link-like,
[data-theme="light"] body.app-vault a.report-link {
  color: var(--tk-accent-deep);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */

/* Header cells join the same micro-label class as every other uppercase label,
   so a column heading and a section label are visibly the same kind of thing.
   The row rule drops to the shared hairline: at 13px row height a full-strength
   border between every row draws more ink than the data does. */
body.app-vault th {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-micro);
  line-height: var(--lh-micro);
  color: var(--text-dim);
  background: var(--surface-sunken);
}

body.app-vault td {
  border-bottom-color: var(--rule);
}

body.app-vault table {
  box-shadow: var(--elev-1);
  border-color: var(--border-1);
}

/* ── Selection ───────────────────────────────────────────────────────────── */

/* The browser default is a saturated blue that belongs to no palette in the
   app. Tinted to the brand hue at an alpha that leaves the text readable. */
body.app-vault ::selection {
  background: rgba(var(--tk-accent-rgb), 0.32);
  color: var(--text-strong);
}

/* ── Scrollbars ──────────────────────────────────────────────────────────── */

/* A default light scrollbar down the side of a dark app is the single loudest
   unthemed element on the page. Kept deliberately low-contrast: a scrollbar is
   a control you look for, not one that should announce itself. */
body.app-vault {
  scrollbar-color: var(--tk-navy-650) transparent;
  scrollbar-width: thin;
}

body.app-vault ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.app-vault ::-webkit-scrollbar-track {
  background: transparent;
}

body.app-vault ::-webkit-scrollbar-thumb {
  background: var(--tk-navy-650);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 8px;
}

body.app-vault ::-webkit-scrollbar-thumb:hover {
  background: var(--tk-navy-600);
  background-clip: padding-box;
}

[data-theme="light"] body.app-vault {
  scrollbar-color: var(--tk-slate-300) transparent;
}
[data-theme="light"] body.app-vault ::-webkit-scrollbar-thumb {
  background: var(--tk-slate-300);
  background-clip: padding-box;
}

/* ── Chrome ──────────────────────────────────────────────────────────────── */

/* The topbar already blurs what scrolls under it; the border below it was a
   solid navy line at full strength, which reads as a seam rather than an edge.
   The shared hairline plus a soft shadow lets the bar sit above the page. */
body.app-vault .topbar {
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

body.app-vault .topbar-nav a:hover {
  color: var(--text-strong);
}

/* ── Motion ──────────────────────────────────────────────────────────────── */

/* Every hover lift, spinner and progress shimmer in the app is decorative
   motion. A reader who has asked their OS for less of it should get less of it,
   and a QA tool that runs for an hour on screen is exactly where that matters. */
@media (prefers-reduced-motion: reduce) {
  body.app-vault *,
  body.app-vault *::before,
  body.app-vault *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
