/* ============================================================
   ASTRAGSO · FOUNDATION
   ────────────────────────────────────────────────────────────
   Editorial design system — paper, ink, orange accent.
   Aligned with the SEO/GEO/GSO one-pager & PDF report.
   Drop-in replacement: all existing class names preserved.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..600;1,9..144,300..500&family=Bricolage+Grotesque:opsz,wght@12..96,300..700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ─────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────────────────── */
:root {
  /* ── Paper & ink (semantic surfaces) ───────────────────── */
  --paper:        #F4F1EB;   /* main bg — warm cream */
  --paper-2:      #ECE6D9;   /* sidebar, dividers, secondary surface */
  --paper-3:      #FBF8F1;   /* lightest — input fields, table rows */
  --surface:      #FFFFFF;   /* pure white card override */
  --ink:          #0F1E2C;   /* primary text, dark panels */
  --ink-2:        #2A3A4D;   /* secondary text */
  --ink-soft:     #45556A;   /* tertiary text, table cells */

  --muted:        #6B7484;   /* labels, muted UI text */
  --disabled:     #9AA2AE;   /* disabled state, captions */

  --rule:         #D8D2C5;   /* hairline borders 1px */
  --rule-2:       #C7BFAE;   /* stronger borders, separators */
  --rule-soft:    #E5E0D3;   /* very light divider */

  /* ── Accent + semantic palette ─────────────────────────── */
  --accent:       #C2410C;   /* primary orange — italic emphasis, CTAs */
  --accent-2:     #9A340A;   /* darker accent for hover */
  --accent-soft:  #F2A65A;   /* on dark backgrounds */
  --accent-bg:    #F8E8DD;   /* tinted bg surface */
  --accent-border:#E8B89A;

  --ok:           #2D6A4F;
  --ok-2:         #1B4D38;
  --ok-bg:        #E2EDE6;
  --ok-border:    #B8D4C4;

  --warn:         #B8731E;
  --warn-2:       #8E5614;
  --warn-bg:      #F4E7D2;
  --warn-border:  #E0C99A;

  --crit:         #9B2226;
  --crit-2:       #6E1518;
  --crit-bg:      #F4D9DA;
  --crit-border:  #E0A8AB;

  --info:         #1E5A8C;
  --info-bg:      #DCE5F0;
  --info-border:  #B8C8DD;

  /* Legacy compatibility — old code referencing --green/--red/--amber/--primary/--pink/--purple
     keeps working but maps to the editorial palette */
  --primary:      var(--accent);
  --green:        var(--ok);
  --red:          var(--crit);
  --amber:        var(--warn);
  --pink:         var(--accent);
  --purple:       var(--ink);
  --cyan:         var(--info);
  --bg-base:      var(--paper);
  --bg-surface:   var(--paper-3);
  --bg:           var(--paper);
  --bg-elevated:  var(--paper-2);
  --bg-card:      var(--paper-3);
  --bg-deep:      var(--ink);            /* used on auth pages for dark hero bg */
  --bg-hover:     var(--paper-2);        /* hover surface */
  --surface:      var(--paper-3);        /* generic surface alias */
  --border:       var(--rule);
  --border-2:     var(--rule-2);
  --text:         var(--ink);            /* generic text alias */
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted:   var(--muted);
  --text-disabled:var(--disabled);
  --font:         var(--font-sans);      /* generic font alias */
  --font-display: var(--font-serif);
  --font-body:    var(--font-sans);
  --gold:         var(--accent);         /* legacy "gold" tier accent → orange */
  --axis-color:   var(--accent);         /* fallback for axis-themed cards */
  --gradient-text: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  --gradient-glow: 0 4px 24px rgba(194, 65, 12, .22);

  /* Tinted dim/border alpha layers — for soft backgrounds */
  --accent-dim:    rgba(194, 65, 12, .07);
  --accent-bdr:    rgba(194, 65, 12, .22);
  --ok-dim:        rgba(45, 106, 79, .08);
  --ok-bdr:        rgba(45, 106, 79, .25);
  --warn-dim:      rgba(184, 115, 30, .08);
  --warn-bdr:      rgba(184, 115, 30, .25);
  --crit-dim:      rgba(155, 34, 38, .07);
  --crit-bdr:      rgba(155, 34, 38, .22);
  --ink-dim:       rgba(15, 30, 44, .05);
  /* Legacy aliases */
  --purple-dim:    var(--ink-dim);
  --purple-border: var(--rule-2);
  --pink-dim:      var(--accent-dim);
  --pink-border:   var(--accent-bdr);
  --pink-glow:     rgba(194, 65, 12, .18);
  --cyan-dim:      var(--info-bg);
  --cyan-border:   var(--info-border);
  --green-dim:     var(--ok-bg);
  --green-border:  var(--ok-border);
  --amber-dim:     var(--warn-bg);
  --amber-border:  var(--warn-border);
  --red-dim:       var(--crit-bg);
  --red-border:    var(--crit-border);

  /* ── Typography ─────────────────────────────────────────── */
  --font-serif:   'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-sans:    'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Compact UI scale — keeps the data density of the dashboard */
  --fs-3xs:  10px;
  --fs-2xs:  11px;
  --fs-xs:   12px;
  --fs-sm:   13px;
  --fs-base: 14px;
  --fs-md:   15px;
  --fs-lg:   17px;
  --fs-xl:   20px;
  --fs-2xl:  26px;
  --fs-3xl:  34px;
  --fs-4xl:  44px;
  --fs-5xl:  64px;
  --fs-6xl:  88px;

  /* Display headlines (serif) — Fraunces optical sizing */
  --display-tight:  -.025em;
  --display-tighter:-.035em;

  /* ── Spacing — 4pt grid ─────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  32px;
  --space-8:  40px;
  --space-9:  56px;
  --space-10: 80px;

  /* ── Radii — sharp editorial ────────────────────────────── */
  --radius-sm:   2px;
  --radius:      4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-2xl:  16px;
  --radius-pill: 999px;

  /* ── Shadows — subtle, paper-friendly ───────────────────── */
  --shadow-xs: 0 1px 2px rgba(15, 30, 44, .04);
  --shadow-sm: 0 2px 6px rgba(15, 30, 44, .06);
  --shadow:    0 4px 14px rgba(15, 30, 44, .08);
  --shadow-md: 0 8px 24px rgba(15, 30, 44, .10);
  --shadow-lg: 0 24px 48px -12px rgba(15, 30, 44, .18);
  --shadow-xl: 0 32px 64px -20px rgba(15, 30, 44, .22);
  --shadow-pink: 0 4px 16px rgba(194, 65, 12, .18); /* legacy alias */

  /* ── Motion ─────────────────────────────────────────────── */
  --ease:        cubic-bezier(.22, 1, .36, 1);
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast:      120ms;
  --t-base:      200ms;
  --t-slow:      400ms;
  --transition:      var(--t-base) var(--ease);
  --transition-slow: var(--t-slow) var(--ease);

  /* ── Layout ─────────────────────────────────────────────── */
  --sidebar-w:    220px;
  --topbar-h:     52px;
  --content-max:  1200px;
  --grid-line:    rgba(15, 30, 44, .04);
  --grid-size:    24px;
}

/* ─────────────────────────────────────────────────────────────
   RESET + BASE
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--fs-base);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "ss02";
}

a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent); }

p { line-height: 1.65; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }

::selection { background: var(--accent); color: var(--paper); }

/* ─────────────────────────────────────────────────────────────
   TYPOGRAPHY — Editorial hierarchy
   ───────────────────────────────────────────────────────────── */
.display, h1.display, .display-1 {
  font-family: var(--font-serif);
  font-weight: 380;
  font-size: var(--fs-5xl);
  line-height: .98;
  letter-spacing: var(--display-tighter);
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}
.display-2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-4xl);
  line-height: 1.05;
  letter-spacing: var(--display-tight);
}
.display em, .display-1 em, .display-2 em {
  font-style: italic;
  font-weight: 320;
  color: var(--accent);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 420;
  color: var(--ink);
  letter-spacing: -.01em;
}
h1 { font-size: var(--fs-3xl); line-height: 1.1;  letter-spacing: var(--display-tight); }
h2 { font-size: var(--fs-2xl); line-height: 1.15; }
h3 { font-size: var(--fs-xl);  line-height: 1.25; }
h4 { font-size: var(--fs-lg);  line-height: 1.3; }
h5 { font-size: var(--fs-md);  line-height: 1.35; }
h6 { font-size: var(--fs-sm);  line-height: 1.4; }

/* Mono uppercase eyebrow — used everywhere as section/category label */
.eyebrow, .mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.accent, .mono-label.accent { color: var(--accent); }
.eyebrow.ink,    .mono-label.ink    { color: var(--ink); }

/* Italic accent — the signature inline emphasis */
em.accent, .italic-accent {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent);
  font-weight: 380;
}

/* Section head — numbered + reference, like the PDF */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
  margin: var(--space-8) 0 var(--space-5);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 420;
  font-size: var(--fs-md);
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0;
}
.section-head .num {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: .18em;
  color: var(--muted);
}
.section-head .num b { color: var(--ink); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────
   APP SHELL (used by dashboard.css)
   ───────────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--paper);
}
.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 0 var(--space-6);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: sticky; top: 0; z-index: 40;
}
.page-body { padding: var(--space-7); flex: 1; min-width: 0; }

/* ─────────────────────────────────────────────────────────────
   CARDS — editorial 1px hairline
   ───────────────────────────────────────────────────────────── */
.card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  position: relative;
}
.card-flat { box-shadow: none; }
.card-bordered { border-width: 1px; border-color: var(--rule-2); }
.card-ink {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink);
}
.card-ink h1, .card-ink h2, .card-ink h3, .card-ink h4 { color: var(--paper); }

.card-processing {
  border-color: var(--accent-bdr);
  background: linear-gradient(180deg, var(--paper-3), var(--accent-dim));
}

/* Callout — recurring editorial pattern */
.callout {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-serif);
  font-weight: 380;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ink);
}
.callout em, .callout .italic-accent {
  font-style: italic; color: var(--accent); font-weight: 380;
}
.callout.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.callout.dark em { color: var(--accent-soft); }
.callout.final {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-left: 4px solid var(--ok);
}
.callout.final em { color: var(--ok); }

/* ─────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 7px var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -.005em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  line-height: 1.4;
  position: relative;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-secondary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink-2); border-color: var(--ink-2); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--rule-2);
}
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }

.btn-link {
  background: transparent; border: none; padding: 6px 4px;
  color: var(--accent); font-weight: 600;
}
.btn-link:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 4px; }

.btn-sm { padding: 4px var(--space-3); font-size: var(--fs-xs); border-radius: var(--radius); }
.btn-lg { padding: 12px var(--space-6); font-size: var(--fs-md); }

.btn.loading { color: transparent; pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  margin: -7px 0 0 -7px;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  color: inherit;
  filter: invert(1);
}

/* ─────────────────────────────────────────────────────────────
   FORMS
   ───────────────────────────────────────────────────────────── */
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 8px var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  line-height: 1.5;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--ink-dim);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--disabled);
}
select.form-input, .form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7484' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
.form-textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.form-help { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.form-error { font-size: var(--fs-xs); color: var(--crit); margin-top: 4px; }

/* ─────────────────────────────────────────────────────────────
   BADGES & PILLS
   ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
  border: 1px solid transparent;
  text-transform: uppercase;
}
.badge-green, .badge-ok    { background: var(--ok-bg);   color: var(--ok-2);   border-color: var(--ok-border); }
.badge-cyan, .badge-info   { background: var(--info-bg); color: var(--info);   border-color: var(--info-border); }
.badge-yellow, .badge-warn { background: var(--warn-bg); color: var(--warn-2); border-color: var(--warn-border); }
.badge-red, .badge-crit    { background: var(--crit-bg); color: var(--crit-2); border-color: var(--crit-border); }
.badge-purple, .badge-ink  { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge-pink, .badge-accent { background: var(--accent-bg); color: var(--accent-2); border-color: var(--accent-border); }
.badge-gray, .badge-neutral{ background: var(--paper-2); color: var(--ink-soft); border-color: var(--rule); }

/* Pill — slightly different from badge: lowercase, less aggressive */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  border: 1px solid var(--rule);
  background: var(--paper-3);
  color: var(--ink-soft);
}
.pill.accent { background: var(--accent-bg); color: var(--accent-2); border-color: var(--accent-border); }
.pill.ink    { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ─────────────────────────────────────────────────────────────
   STATUS DOTS
   ───────────────────────────────────────────────────────────── */
.status-dot, .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--disabled);
  flex-shrink: 0;
}
.status-dot.active, .dot.ok       { background: var(--ok);     box-shadow: 0 0 0 2px var(--ok-dim); }
.status-dot.processing, .dot.warn { background: var(--warn);   animation: pulse-dot 1.4s var(--ease-in-out) infinite; }
.status-dot.error, .dot.crit      { background: var(--crit);   box-shadow: 0 0 0 2px var(--crit-dim); }
.status-dot.pending               { background: var(--disabled); }
.dot.accent                        { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(.82); }
}

/* ─────────────────────────────────────────────────────────────
   SCORE BARS & DIMENSIONS
   ───────────────────────────────────────────────────────────── */
.score-bar-wrap, .dim-bar {
  height: 6px;
  background: var(--paper-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  min-width: 80px;
  border: 1px solid var(--rule-soft);
}
.dim-bar { width: 100%; }
.score-bar-fill, .dim-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--ink);
  transition: width 1s var(--ease);
}
.score-bar-fill.ok,   .dim-bar-fill.ok   { background: var(--ok); }
.score-bar-fill.warn, .dim-bar-fill.warn { background: var(--warn); }
.score-bar-fill.crit, .dim-bar-fill.crit { background: var(--crit); }
.score-bar-fill.accent, .dim-bar-fill.accent { background: var(--accent); }

.dim-row {
  display: flex; align-items: center; gap: var(--space-3);
}
.dim-label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  width: 130px;
  flex-shrink: 0;
}
.dim-score {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 400;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
  color: var(--ink);
  letter-spacing: -.02em;
}

/* ─────────────────────────────────────────────────────────────
   KPI CELLS — editorial pattern (mono label + serif number)
   ───────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  border: 1px solid var(--ink);
  background: var(--paper-3);
}
.kpi-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.kpi-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.kpi-cell {
  padding: var(--space-4) var(--space-5);
  border-right: 1px solid var(--rule);
  text-align: left;
}
.kpi-cell:last-child { border-right: none; }
.kpi-cell.crit { background: var(--crit-bg); }
.kpi-cell.warn { background: var(--warn-bg); }
.kpi-cell.ok   { background: var(--ok-bg); }
.kpi-cell.info { background: var(--info-bg); }

.kpi-label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi-number {
  font-family: var(--font-serif);
  font-size: var(--fs-3xl);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -.025em;
  font-variation-settings: "opsz" 144;
}
.kpi-number sup, .kpi-number small {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-left: 4px;
  font-weight: 400;
  vertical-align: super;
}
.kpi-hint { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 4px; }

.kpi-number.good   { color: var(--ok); }
.kpi-number.medium { color: var(--warn); }
.kpi-number.poor   { color: var(--crit); }
.kpi-number.muted  { color: var(--muted); }

/* ─────────────────────────────────────────────────────────────
   TABLES
   ───────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  border: 1px solid var(--rule);
  background: var(--paper-3);
}
.data-table th {
  padding: 8px var(--space-3);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.data-table td {
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--paper-2); }
.data-table td.k {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────────
   PIPELINE STEPS
   ───────────────────────────────────────────────────────────── */
.pipeline-steps { display: flex; flex-direction: column; gap: 0; }
.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  position: relative;
}
.pipeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 12px; top: 30px; bottom: -4px;
  width: 1px;
  background: var(--rule);
}
.pipeline-step.done::after   { background: var(--ok); }
.pipeline-step.active::after { background: var(--accent); opacity: .4; }

.step-indicator {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--rule-2);
  background: var(--paper-3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; z-index: 1;
}
.step-indicator svg { display: none; width: 12px; height: 12px; stroke: var(--ok); }
.step-num {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 600;
  color: var(--muted);
}
.pipeline-step.done .step-indicator { background: var(--ok-bg); border-color: var(--ok-border); }
.pipeline-step.done .step-indicator svg { display: block; }
.pipeline-step.done .step-indicator .step-num { display: none; }
.pipeline-step.active .step-indicator { background: var(--accent-bg); border-color: var(--accent-border); }
.pipeline-step.active .step-indicator .step-num { color: var(--accent); font-weight: 700; }

.step-body { flex: 1; padding-top: 3px; }
.step-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.pipeline-step:not(.active):not(.done) .step-label { color: var(--muted); }
.step-desc { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; line-height: 1.55; }

/* ─────────────────────────────────────────────────────────────
   PROCESS RING (loading spinner)
   ───────────────────────────────────────────────────────────── */
.process-ring {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent-bdr);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  animation: ring-pulse 2s var(--ease-in-out) infinite;
}
.process-ring-inner { color: var(--accent); display: flex; }
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, .15); }
  50%      { box-shadow: 0 0 0 8px rgba(194, 65, 12, 0); }
}

/* ─────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-left: 3px solid var(--accent);
}
.toast.success { border-left-color: var(--ok); }
.toast.error   { border-left-color: var(--crit); }
.toast.warning { border-left-color: var(--warn); }

/* ─────────────────────────────────────────────────────────────
   KANBAN
   ───────────────────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-5);
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--space-3);
  border-radius: var(--radius);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  margin-bottom: var(--space-3);
}
.kanban-col-label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────
   GEO SKILL CARDS
   ───────────────────────────────────────────────────────────── */
.geo-skill-card {
  padding: var(--space-5);
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}
.geo-skill-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────── */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.pop-in { animation: pop-in 280ms var(--ease) forwards; }

@keyframes fade-up {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 600ms var(--ease) forwards; }

[x-cloak] { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   SCROLLBAR
   ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─────────────────────────────────────────────────────────────
   UTILITIES
   ───────────────────────────────────────────────────────────── */
.font-mono   { font-family: var(--font-mono); }
.font-serif  { font-family: var(--font-serif); }
.font-sans   { font-family: var(--font-sans); }

.text-ink       { color: var(--ink); }
.text-muted     { color: var(--muted); }
.text-disabled  { color: var(--disabled); }
.text-accent    { color: var(--accent); }
.text-ok, .text-green   { color: var(--ok); }
.text-crit, .text-red   { color: var(--crit); }
.text-warn, .text-amber { color: var(--warn); }
.text-purple, .text-pink { color: var(--accent); } /* legacy aliases */
.text-cyan, .text-info   { color: var(--info); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 700; } /* editorial caps at 700, no 800 */

.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-tight  { letter-spacing: -.02em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide   { letter-spacing: .06em; }
.tracking-mono   { letter-spacing: .14em; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bg-paper    { background: var(--paper); }
.bg-paper-2  { background: var(--paper-2); }
.bg-paper-3  { background: var(--paper-3); }
.bg-ink      { background: var(--ink); color: var(--paper); }

.divider {
  height: 1px;
  background: var(--rule);
  border: none;
  margin: var(--space-5) 0;
}
.divider-strong { background: var(--ink); height: 1px; }

/* Subtle paper grid bg — used on hero/cover sections */
.paper-grid {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

/* Brand mark — circular A used in headers / logos */
.brand-mark {
  width: 28px; height: 28px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  flex-shrink: 0;
}
.brand-mark.lg { width: 40px; height: 40px; font-size: 20px; }
.brand-mark.sm { width: 22px; height: 22px; font-size: 11px; border-width: 1px; }

/* Numbered section index — for ① ② ③ in inline flow */
.idx {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 400;
  color: var(--accent);
  margin-right: 6px;
}

/* ============================================================
   DASHBOARD COMPONENTS — merged in for backward compat
   These were originally in dashboard.css (never loaded).
   Kept here so a single astragso.css covers the entire app.
   ============================================================ */

/* ─── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--rule);
}
.page-header-content { flex: 1; min-width: 0; }
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.page-title {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 380;
  color: var(--ink);
  letter-spacing: var(--display-tight);
  line-height: 1.1;
  margin-bottom: 6px;
  font-variation-settings: "opsz" 144;
}
.page-title em {
  font-style: italic;
  font-weight: 340;
  color: var(--accent);
}
.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 600px;
}

/* ─── Stat cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-base) var(--ease);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.stat-card:hover {
  border-color: var(--ink);
  background: var(--paper);
}
.stat-card:hover::before { opacity: 1; }
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 380;
  letter-spacing: -.025em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
  font-variation-settings: "opsz" 144;
}
.stat-value sup, .stat-value small {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}
.stat-change {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up      { color: var(--ok); }
.stat-change.down    { color: var(--crit); }
.stat-change.neutral { color: var(--muted); }

/* ─── Agent cards (dashboard widgets) ─────────────────────── */
.agent-card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  text-decoration: none;
  color: inherit;
  position: relative;
}
.agent-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.agent-card:hover {
  border-color: var(--ink);
  background: var(--paper);
  transform: translateY(-1px);
}
.agent-card:hover::before { opacity: 1; }
.agent-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
}
.agent-name {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  font-weight: 420;
  color: var(--ink);
  margin-bottom: 2px;
  letter-spacing: -.005em;
}
.agent-desc {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ─── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  text-align: center;
}
.empty-icon {
  width: 56px; height: 56px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--ink);
}
.empty-title {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 420;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -.005em;
}
.empty-text {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  max-width: 320px;
  margin-bottom: 20px;
  line-height: 1.65;
}

/* ─── Tabs ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 22px;
  gap: 4px;
}
.tab-item, .tab-btn {
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}
.tab-item:hover, .tab-btn:hover { color: var(--ink); }
.tab-item.active, .tab-btn.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ─── Action rows (quick wins / mid / long) ───────────────── */
.action-row {
  border: 1px solid var(--rule);
  background: var(--paper-3);
  padding: 14px 18px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  position: relative;
  transition: all var(--t-fast) var(--ease);
}
.action-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.action-row.quick::before { background: var(--crit); }
.action-row.mid::before   { background: var(--warn); }
.action-row.long::before  { background: var(--ok); }
.action-row:hover {
  border-color: var(--ink);
  background: var(--paper);
}
.action-title {
  font-family: var(--font-serif);
  font-weight: 420;
  font-size: var(--fs-md);
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -.005em;
}
.action-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.action-meta b { color: var(--ink); font-weight: 600; }
.action-why {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 380;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-bottom: 6px;
}
.action-how {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ─── Issue cards ─────────────────────────────────────────── */
.issue-card {
  border: 1px solid var(--rule);
  background: var(--paper-3);
  padding: 14px 18px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  position: relative;
  transition: all var(--t-fast) var(--ease);
}
.issue-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.issue-card.critical { background: #FBEFEF; }
.issue-card.critical::before { background: var(--crit); }
.issue-card.warning  { background: #FBF3E2; }
.issue-card.warning::before  { background: var(--warn); }
.issue-card.notice::before   { background: var(--muted); }
.issue-card:hover { border-color: var(--ink); }
.issue-title {
  font-family: var(--font-serif);
  font-weight: 420;
  font-size: var(--fs-md);
  color: var(--ink);
  margin-bottom: 4px;
}
.issue-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: .12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.issue-meta b { color: var(--ink); font-weight: 600; }
.issue-impact {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 380;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-bottom: 6px;
}
.issue-steps {
  margin: 6px 0 0 18px;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.6;
}
.issue-steps li { margin-bottom: 2px; }

/* ─── Verdict panel (big score display) ───────────────────── */
.verdict-panel {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  border: 1px solid var(--ink);
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.verdict-panel .verdict {
  background: var(--ink);
  color: var(--paper);
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
}
.verdict-panel .verdict::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 110%, rgba(194, 65, 12, .18), transparent 60%);
  pointer-events: none;
}
.verdict-panel .verdict .lbl {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: .22em;
  color: rgba(244, 241, 235, .55);
  text-transform: uppercase;
}
.verdict-panel .verdict .num {
  font-family: var(--font-serif);
  font-weight: 320;
  font-size: 5.5rem;
  line-height: .95;
  letter-spacing: -.04em;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.verdict-panel .verdict .num em {
  font-style: italic;
  color: var(--accent-soft);
}
.verdict-panel .verdict .num small {
  font-size: 1.2rem;
  color: rgba(244, 241, 235, .45);
  font-weight: 400;
  letter-spacing: -.01em;
}
.verdict-panel .verdict .level {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  color: rgba(244, 241, 235, .65);
  text-transform: uppercase;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}
.verdict-panel .verdict-side {
  background: var(--paper-3);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.verdict-panel .verdict-side .lbl {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: .22em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.verdict-panel .verdict-side .body {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--ink);
}
.verdict-panel .verdict-side em {
  font-style: italic;
  color: var(--accent);
  font-weight: 380;
}

/* ─── Notifications list ──────────────────────────────────── */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
}
.notif-item:hover { background: var(--paper-2); }
.notif-item.unread { background: var(--paper-3); }
.notif-unread-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-mark-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}
.notif-mark-btn:hover { color: var(--accent); }

/* ─── Chat bubbles ────────────────────────────────────────── */
.msg { display: flex; gap: 10px; max-width: 82%; }
.msg.user  { align-self: flex-end; flex-direction: row-reverse; }
.msg.agent { align-self: flex-start; }
.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.msg.user  .msg-avatar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}
.msg.agent .msg-avatar {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink);
}
.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.msg.user  .msg-bubble {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md) 2px var(--radius-md) var(--radius-md);
}
.msg.user  .msg-bubble em { font-style: italic; color: var(--accent-soft); }
.msg.agent .msg-bubble {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  color: var(--ink);
  border-radius: 2px var(--radius-md) var(--radius-md) var(--radius-md);
}
.msg.agent .msg-bubble em { font-style: italic; color: var(--accent); }
.chat-messages { display: flex; flex-direction: column; gap: 16px; }

/* ─── Header icons (dashboard topbar) ─────────────────────── */
.header-icon-btn {
  width: 36px; height: 36px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease);
  position: relative;
}
.header-icon-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper);
}
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 16px;
  transition: all var(--t-fast) var(--ease);
}
.mobile-menu-btn:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform var(--t-base) var(--ease); }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .app-shell { grid-template-columns: 1fr; }
  .verdict-panel { grid-template-columns: 1fr; }
  .verdict-panel .verdict-side { border-top: 1px solid var(--rule); }
}

/* ============================================================
   ALERTS, FORMS, MISC
   ============================================================ */

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border: 1px solid var(--rule);
  background: var(--paper-3);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink);
  position: relative;
  border-left: 3px solid var(--ink);
}
.alert-success {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  border-left-color: var(--ok);
  color: var(--ok-2);
}
.alert-error {
  background: var(--crit-bg);
  border-color: var(--crit-border);
  border-left-color: var(--crit);
  color: var(--crit-2);
}
.alert-warning {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  border-left-color: var(--warn);
  color: var(--warn-2);
}
.alert-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  border-left-color: var(--info);
  color: var(--info);
}

/* ─── Form alert (used in forms) ──────────────────────────── */
.form-alert {
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: var(--paper-3);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  margin-bottom: 10px;
}
.form-alert-info {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info);
}

/* ─── Form field wrapper ──────────────────────────────────── */
.form-field, .form-group {
  margin-bottom: 16px;
}
.form-errors {
  list-style: none;
  margin-top: 6px;
  padding: 0;
}
.form-errors li {
  font-size: var(--fs-xs);
  color: var(--crit);
  font-weight: 500;
}

/* ─── Progress bar ────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--paper-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--rule-soft);
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width var(--t-slow) var(--ease);
}
.progress-fill.ok { background: var(--ok); }
.progress-fill.warn { background: var(--warn); }
.progress-fill.crit { background: var(--crit); }

/* ─── Section card ────────────────────────────────────────── */
.section-card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.section-card__title {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 420;
  color: var(--ink);
  margin-bottom: var(--space-3);
  letter-spacing: -.005em;
}

/* ─── Callout card ────────────────────────────────────────── */
.callout-card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-serif);
  font-weight: 380;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ink);
}
.callout-card em {
  font-style: italic;
  color: var(--accent);
  font-weight: 380;
}

/* ─── Skeleton loader ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 0%, var(--rule-soft) 50%, var(--paper-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: var(--radius);
}

/* ─── Status chips (used in audits, projects) ─────────────── */
.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-3xs);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--t-fast);
}
.status-chip:hover { border-color: var(--ink); color: var(--ink); }
.status-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ============================================================
   DASHBOARD SHELL — sidebar, topbar, nav (CRITICAL legacy classes)
   These existed in the original astragso.css and are required by
   the dashboard/base.html template. Restored with editorial styling.
   ============================================================ */

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-logo span:not(.brand-mark) { display: none; }

.sidebar-logo {
  padding: 16px 18px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-serif);
  font-weight: 460;
  font-size: var(--fs-md);
  color: var(--ink);
  letter-spacing: -.005em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section {
  padding: var(--space-3) 0 var(--space-2);
  border-bottom: none;
}

.sidebar-label {
  padding: 8px var(--space-5) 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--muted);
}

/* ─── Nav items ───────────────────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-soft);
  border-radius: 0;
  transition: background var(--t-fast), color var(--t-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  background: var(--paper-3);
  color: var(--ink);
}
.nav-item.active {
  color: var(--ink);
  background: var(--paper-3);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
}
.nav-icon {
  font-size: var(--fs-base);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .85;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { flex: 1; min-width: 0; }

/* ─── Topbar (already exists, but reinforce) ──────────────── */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 0 var(--space-6);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  z-index: 40;
}
