/* ==========================================================================
   Dettack Docs - design system
   Ported 1:1 from the live product (platform/web/app/globals.css +
   tailwind.config.ts) so the docs render in the exact same theme, font,
   colors and component look as the real Dettack console.
   ========================================================================== */

/* Inter + JetBrains Mono, matching the app's font stack. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surfaces - Redtify neutral dark */
  --bg-base:        #0A0A0B;
  --bg-surface-1:   #111114;
  --bg-surface-2:   #1A1A1D;
  --bg-surface-3:   #1F1F23;
  --bg-overlay:     rgba(10, 10, 11, 0.74);

  /* Borders */
  --border-subtle:  #27272A;
  --border-default: #3F3F46;
  --border-strong:  #52525B;

  /* Foreground */
  --fg-default:     #FAFAFA;
  --fg-muted:       #A1A1AA;
  --fg-subtle:      #71717A;
  --fg-disabled:    #52525B;

  /* Accent - Redtify red */
  --accent:         #EF4444;
  --accent-hover:   #F87171;
  --accent-pressed: #DC2626;
  --accent-solid:   #DC2626;
  --accent-soft:    rgba(239, 68, 68, 0.10);
  --accent-soft-2:  rgba(239, 68, 68, 0.18);
  --accent-glow:    rgba(239, 68, 68, 0.32);
  --accent-ring:    rgba(239, 68, 68, 0.20);

  /* warm / amber */
  --brand-warm:        #F59E0B;
  --brand-warm-hover:  #FBBF24;
  --brand-warm-soft:   rgba(245, 158, 11, 0.12);
  --brand-warm-glow:   rgba(245, 158, 11, 0.28);

  /* Severity */
  --sev-critical:   #EF4444;
  --sev-high:       #F59E0B;
  --sev-medium:     #FBBF24;
  --sev-low:        #3B82F6;
  --sev-info:       #71717A;

  /* Status */
  --status-success: #10B981;
  --status-warning: #F59E0B;
  --status-danger:  #EF4444;
  --status-info:    #3B82F6;

  --gradient-prompt: radial-gradient(120% 80% at 12% 8%, #1A1A1D 0%, #111114 35%, #0A0A0B 75%);

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 14px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.4);
  --shadow-lg:  0 16px 36px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 0 1px var(--border-strong), 0 0 24px var(--accent-glow);

  --sidebar-w: 264px;
  --toc-w: 220px;
  --content-max: 820px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--fg-default);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

::selection { background: rgba(239, 68, 68, 0.40); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-surface-1); }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-default); }

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace; }

/* ==========================================================================
   App layout: sidebar + main, mirroring the console chrome
   ========================================================================== */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset-block: 0;
  left: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface-1);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transform: translateX(0);
  transition: transform 300ms ease;
}

.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
}
.sidebar-logo img { height: 22px; width: auto; }

.lang-toggle {
  display: flex;
  gap: 4px;
  margin: 0 14px 10px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3px;
}
.lang-btn {
  flex: 1;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 120ms ease, color 120ms ease;
}
.lang-btn:hover { color: var(--fg-default); }
.lang-btn.active { background: var(--accent-soft); color: var(--accent); }

.sidebar-search {
  margin: 0 14px 8px;
}
.sidebar-search input {
  width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--fg-default);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.sidebar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.sidebar-search input::placeholder { color: var(--fg-subtle); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 24px;
}

.nav-group-label {
  padding: 14px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  user-select: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--fg-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.nav-link:hover { background: var(--bg-surface-2); color: var(--fg-default); text-decoration: none; }
.nav-link .lucide { width: 16px; height: 16px; flex: none; color: currentColor; }
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
  font-weight: 500;
}
.nav-link.active .lucide { color: var(--accent); }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-footer .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-success); box-shadow: 0 0 8px var(--status-success); }

/* Main column */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.content-wrap {
  display: flex;
  gap: 48px;
  width: 100%;
  max-width: calc(var(--content-max) + var(--toc-w) + 48px);
  padding: 40px 48px 120px;
}

.article { flex: 1; min-width: 0; max-width: var(--content-max); }

/* Playground page uses the full width and drops the on-page contents rail. */
.content-wrap.wide { max-width: 1360px; }
.content-wrap.wide .article { max-width: none; }
.content-wrap.wide .toc { display: none; }

/* On-page table of contents */
.toc {
  width: var(--toc-w);
  flex: none;
  position: sticky;
  top: 40px;
  align-self: flex-start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  font-size: 13px;
}
.toc-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 10px;
}
.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  color: var(--fg-muted);
  border-left: 2px solid var(--border-subtle);
}
.toc a:hover { color: var(--fg-default); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc a.sub { padding-left: 24px; font-size: 12.5px; }

/* Mobile top bar (hidden on desktop) */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar img { height: 20px; }
.topbar .menu-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--fg-muted);
  cursor: pointer;
}

/* ==========================================================================
   Typography inside articles
   ========================================================================== */

.article h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.2;
}
.article .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.article .lede {
  font-size: 17px;
  color: var(--fg-muted);
  margin: 0 0 28px;
  line-height: 1.6;
}
.article h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  padding-top: 12px;
  scroll-margin-top: 24px;
}
.article h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
  scroll-margin-top: 24px;
}
.article p { margin: 0 0 14px; color: #E4E4E7; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; color: #E4E4E7; }
.article li { margin: 6px 0; }
.article li::marker { color: var(--fg-subtle); }
.article strong { color: var(--fg-default); font-weight: 600; }
.article hr { border: none; border-top: 1px solid var(--border-subtle); margin: 40px 0; }

.article code:not(pre code) {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.86em;
  color: #FCA5A5;
}

.article pre {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 18px;
  color: #D4D4D8;
}

/* Step list */
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li {
  position: relative;
  padding-left: 44px;
  margin-bottom: 20px;
  min-height: 30px;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: -2px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.steps > li strong { display: block; margin-bottom: 2px; }
.steps > li strong.inline { display: inline; margin-bottom: 0; }
.steps > li .shot { margin: 12px 0 4px; }
.steps > li p { margin: 0 0 4px; }

/* Callouts / admonitions */
.callout {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 20px;
  background: var(--bg-surface-1);
  font-size: 14px;
  color: #E4E4E7;
}
.callout .lucide { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.callout p:last-child { margin-bottom: 0; }
.callout.note    { border-left-color: var(--status-info); }
.callout.note .lucide { color: var(--status-info); }
.callout.tip     { border-left-color: var(--status-success); }
.callout.tip .lucide { color: var(--status-success); }
.callout.warn    { border-left-color: var(--status-warning); }
.callout.warn .lucide { color: var(--status-warning); }
.callout.pro     { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.pro .lucide { color: var(--accent); }
.callout-title { font-weight: 600; color: var(--fg-default); }

/* ==========================================================================
   Cards (rl-card) + UI-preview frames used as "screenshots"
   ========================================================================== */

.rl-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.rl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.rl-card-title { font-size: 14px; font-weight: 600; }
.rl-card-body { padding: 16px 18px; }

/* A fake product window that frames inline UI previews as screenshots. */
.shot {
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0 10px;
  box-shadow: var(--shadow-lg);
  background: var(--bg-base);
}
.shot-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.shot-bar .traffic { display: flex; gap: 6px; }
.shot-bar .traffic i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.shot-bar .traffic i:nth-child(1){ background:#FF5F57; }
.shot-bar .traffic i:nth-child(2){ background:#FEBC2E; }
.shot-bar .traffic i:nth-child(3){ background:#28C840; }
.shot-bar .url {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  color: var(--fg-subtle);
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-surface-1);
  border-radius: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border-subtle);
  max-width: 380px;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.shot-body { padding: 18px; background: var(--gradient-prompt); }
.shot-cap {
  font-size: 12.5px;
  color: var(--fg-subtle);
  margin: 0 0 22px;
  text-align: center;
}
.shot-cap b { color: var(--fg-muted); font-weight: 500; }

/* ==========================================================================
   Reusable product UI atoms (badges, buttons, KPIs, tables)
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sev-critical { color: var(--sev-critical); background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.35); }
.sev-high     { color: var(--sev-high);     background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.35); }
.sev-medium   { color: var(--sev-medium);   background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.35); }
.sev-low      { color: var(--sev-low);      background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.35); }
.sev-info     { color: var(--sev-info);     background: rgba(113,113,122,0.14);border-color: rgba(113,113,122,0.35); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border-subtle); color: var(--fg-muted);
  background: var(--bg-surface-1);
}
.pill.ok    { color: var(--status-success); border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.10); }
.pill.warn  { color: var(--status-warning); border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.10); }
.pill.run   { color: var(--accent); border-color: rgba(239,68,68,0.35); background: var(--accent-soft); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--fg-default);
  transition: all 120ms ease;
}
.btn:hover { background: var(--bg-surface-3); text-decoration: none; }
.btn .lucide { width: 16px; height: 16px; }
.btn-primary { background: var(--accent-solid); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-pressed); box-shadow: 0 0 20px var(--accent-glow); }
.btn-ghost { background: transparent; border-color: var(--border-subtle); color: var(--fg-muted); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--fg-muted); margin-bottom: 6px; }
.input {
  width: 100%; background: var(--bg-surface-1); border: 1px solid var(--border-default);
  color: var(--fg-default); border-radius: 10px; padding: 10px 12px; font-size: 14px;
  font-family: inherit; outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input::placeholder { color: var(--fg-subtle); }

/* KPI row */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle);
  border-radius: 14px; padding: 14px 16px;
}
/* Reserve a consistent label height (up to two lines) and bottom-align it,
   so a wrapping label never pushes its number down out of line with the
   other cards. Every KPI value starts on the same row. */
.kpi .k-label { font-size: 11.5px; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; display: flex; align-items: flex-end; gap: 6px; line-height: 1.25; min-height: 2.6em; }
.kpi .k-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .k-sub { font-size: 12px; color: var(--fg-subtle); margin-top: 3px; }
.kpi .lucide { width: 14px; height: 14px; }

/* Data table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--fg-subtle);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 9px 12px; border-bottom: 1px solid var(--border-subtle);
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); color: #E4E4E7; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.clickable:hover td { background: var(--bg-surface-3); cursor: pointer; }
.tbl .mono { font-size: 12.5px; color: var(--fg-muted); }

/* Feature grid on the home page */
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 24px 0; }
.feature-card {
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle);
  border-radius: 14px; padding: 18px; transition: border-color 150ms ease, transform 150ms ease;
  cursor: pointer; display: block; color: inherit;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.feature-card .fc-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 12px;
}
.feature-card .fc-icon .lucide { width: 20px; height: 20px; }
.feature-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--fg-default); }
.feature-card p { margin: 0; font-size: 13px; color: var(--fg-muted); }

/* Grade ring */
.grade {
  width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center; font-size: 34px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border: 3px solid currentColor;
}

/* page transitions */
.page { display: none; animation: fadeIn 160ms ease-out; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* pager (prev / next) */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a {
  flex: 1; border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px 18px;
  color: var(--fg-default); background: var(--bg-surface-2);
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .dir { font-size: 11px; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.1em; }
.pager .ttl { font-size: 15px; font-weight: 600; margin-top: 2px; }
.pager a.next { text-align: right; }

.hide-sm { display: initial; }

/* ==========================================================================
   Interactive preview controls (press-and-play, like the playground)
   ========================================================================== */
.js-opt { cursor: pointer; user-select: none; }
.pill.js-opt:hover { border-color: var(--border-strong); color: var(--fg-default); }
.pill.is-sel { color: var(--accent); border-color: rgba(239,68,68,0.35); background: var(--accent-soft); }

.feature-card.js-opt { cursor: pointer; }
.feature-card.is-sel { border-color: var(--accent); }

.radio-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 10px; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }
.radio-opt + .radio-opt { margin-top: 8px; }
.radio-opt:hover { border-color: var(--border-strong); }
.radio-dot { width: 16px; height: 16px; flex: none; margin-top: 1px; border-radius: 50%; border: 2px solid var(--fg-subtle); position: relative; }
.radio-opt.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.radio-opt.is-sel .radio-dot { border-color: var(--accent); }
.radio-opt.is-sel .radio-dot::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent); }
.radio-opt .ro-title { font-size: 13.5px; }
.radio-opt .ro-sub { font-size: 11.5px; color: var(--fg-subtle); }

.pick { cursor: pointer; }
.pick.is-sel { background: var(--bg-surface-3); }

.chk { width: 16px; height: 16px; flex: none; border: 1px solid var(--border-default); border-radius: 4px; display: inline-grid; place-items: center; cursor: pointer; background: transparent; color: var(--accent); }
.chk svg { opacity: 0; transition: opacity 100ms ease; width: 12px; height: 12px; }
.chk.on { background: var(--accent-soft); border-color: var(--accent); }
.chk.on svg { opacity: 1; }
.chk-row { cursor: pointer; }

/* ==========================================================================
   Interactive scan playground
   ========================================================================== */
.spin { animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pg {
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-surface-1);
  overflow: hidden;
}
.pg-top {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--gradient-prompt);
}
.pg-inputrow { display: flex; gap: 10px; align-items: stretch; }
.pg-inputrow .input { flex: 1; }
.pg-progress { margin-top: 16px; }
.pg-progress-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--fg-muted); margin-bottom: 6px; }
.pg-track { height: 8px; background: var(--bg-surface-3); border-radius: 999px; overflow: hidden; }
.pg-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-pressed), var(--accent-hover));
  border-radius: 999px; transition: width 120ms linear;
  box-shadow: 0 0 12px var(--accent-glow);
}
.pg-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); gap: 0; }
.pg-col { padding: 16px 18px; }
.pg-col + .pg-col { border-left: 1px solid var(--border-subtle); }
.pg-col-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-subtle); margin-bottom: 12px; }

.pg-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); transition: opacity 200ms ease; }
.pg-kpi { text-align: center; }
.pg-kpi .v { font-size: 22px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.pg-kpi .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-subtle); margin-top: 2px; }

.pg-stage { display: flex; align-items: center; gap: 10px; padding: 8px 0; opacity: 0.5; transition: opacity 200ms ease; }
.pg-stage.running, .pg-stage.done { opacity: 1; }
.pg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex: none; }
.pg-stage.running .pg-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.2s ease-out infinite; }
.pg-stage.done .pg-dot { background: var(--status-success); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.pg-stage > div { flex: 1; min-width: 0; }
.pg-stage-name { font-size: 13px; font-weight: 500; }
.pg-stage-note { font-size: 11.5px; color: var(--fg-subtle); }
.pg-stage-state { font-size: 10.5px; font-family: 'JetBrains Mono', monospace; color: var(--fg-subtle); text-transform: uppercase; }
.pg-stage.running .pg-stage-state { color: var(--accent); }
.pg-stage.done .pg-stage-state { color: var(--status-success); }

.pg-asset { padding: 9px 0; border-bottom: 1px solid var(--border-subtle); animation: rowIn 250ms ease-out; }
.pg-asset:last-child { border-bottom: none; }
.pg-asset-host { font-size: 12.5px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-asset-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 5px; }
.pg-asset-meta .pill { display: inline-flex; align-items: center; gap: 4px; }
.pg-asset-meta .pill svg { width: 12px; height: 12px; }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.pg-finding { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); animation: rowIn 250ms ease-out; }
.pg-finding:last-child { border-bottom: none; }
.pg-finding-main { min-width: 0; }
.pg-finding-title { font-size: 13.5px; }
.pg-finding-sub { font-size: 11.5px; color: var(--fg-subtle); margin-top: 1px; }
.pg-empty { font-size: 12.5px; color: var(--fg-subtle); padding: 18px 0; text-align: center; }
.pg-side { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border-subtle); background: var(--bg-surface-2); }
.pg-side .grade-mini { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; font-weight: 700; font-family: 'JetBrains Mono', monospace; border: 2px solid currentColor; }

@media (max-width: 640px) {
  .pg-grid { grid-template-columns: 1fr; }
  .pg-col + .pg-col { border-left: none; border-top: 1px solid var(--border-subtle); }
  .pg-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* small helpers */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.mt-0 { margin-top: 0; }
.muted { color: var(--fg-muted); }
.subtle { color: var(--fg-subtle); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }

/* Landing-style hero strip on the Welcome page */
.hero-strip {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 22px;
  background: var(--gradient-prompt);
}
.hero-strip-title { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.hero-strip-sub { color: var(--fg-muted); margin-top: 4px; font-size: 14px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .toc { display: none; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 280px; }
  .topbar { display: flex; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 35; }
  .backdrop.show { display: block; }
  .main { margin-left: 0; }
  .content-wrap { padding: 24px 20px 100px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
}
