/* Zimac Paige — service styles layered on the shared kit (/zimac-ui.css).
   Paige's sub-accent is her agent red (#ef4444); the indigo spine and every
   other token comes from the kit. The Red Thread board carries the desktop
   card's signature verbatim: the thin red identity rail stays constant while
   the command signal changes by state, and the asymmetric 4px 28px 4px 4px
   radius marks anything that "belongs to the instrument". */

[hidden] { display: none !important; } /* all show/hide in this SPA uses the hidden attribute */

:root {
  --paige: #ef4444;
  --paige-2: #f87171;
  --paige-dim: rgba(239, 68, 68, 0.14);
  --paige-ink: #2a0808; /* dark ink for text sitting ON red */
  --rt-ok: #2dd4a7;
  --rt-warn: #f59e0b;
  --rt-unknown: #a78bfa;
}

.paige-page {
  /* the app surface: re-key the kit */
  --zui-accent: #ef4444;
  --zui-accent-2: #f87171;
  --zui-accent-dim: #dc2626;
  --zui-grad-accent: linear-gradient(150deg, #f87171, #ef4444 55%, #dc2626);
  --zui-glow: 0 0 0 3px rgba(239, 68, 68, 0.18);
  --zui-glow-strong: 0 6px 18px -6px rgba(239, 68, 68, 0.5);
  --zui-text-faint: #8c8f9d;
}

/* ==========================================================================
   The landing surface — fully self-contained --l-* tokens so marketing can't
   leak into the product chrome.
========================================================================== */

.paige-landing {
  --l-bg: #090b11;
  --l-bg2: #0d1018;
  --l-surface: #12151f;
  --l-surface2: #171b28;
  --l-border: #232837;
  --l-border2: #39415a;
  --l-border-soft: #1a1f2e;
  --l-text: #eef1f8;
  --l-muted: #9aa3b8;
  --l-faint: #8c8f9d;
  --l-red: #ef4444;
  --l-red2: #f87171;
  --l-crimson: #dc2626;
  --l-ink: #2a0808;
  --l-ok: #2dd4a7;
  --l-warn: #f59e0b;
  --l-indigo: #6c63ff; /* the family pair, reserved for the Zimac bridge */
  --l-pink: #f472b6;

  --l-maxw: 1180px;
  --l-gutter: 32px;
  --l-section-gap: 88px;
  --l-grid-gap: 18px;
  --l-card-pad: 26px;
  --l-hero-top: 76px;
  --l-radius: 16px;

  --l-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --l-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --l-ease: cubic-bezier(0.16, 0.84, 0.44, 1);
  --l-grad-cta: linear-gradient(145deg, #dc2626, #ef4444 58%, #f87171);
  --l-grad-text: linear-gradient(115deg, #fff 10%, #fca5a5 55%, #ef4444);

  position: relative;
  background: var(--l-bg);
  color: var(--l-text);
  font: 400 16px/1.6 var(--l-sans);
  min-height: 100vh;
  overflow-x: clip;
}

/* Fixed ambient canvas: red top-right, indigo left (the Zimac family tie),
   crimson base — plus a masked dot field. */
.paige-landing::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(55rem 55rem at 88% -12%, rgba(239, 68, 68, 0.11), transparent 60%),
    radial-gradient(45rem 45rem at 2% 0%, rgba(108, 99, 255, 0.08), transparent 60%),
    radial-gradient(60rem 40rem at 55% 115%, rgba(220, 38, 38, 0.07), transparent 65%);
}
.paige-landing::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: radial-gradient(rgba(238, 241, 248, 0.14) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70rem 45rem at 50% 0%, #000 0%, transparent 70%);
}
.paige-landing > * { position: relative; z-index: 1; }

.ln-skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--l-red);
  color: var(--l-ink);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 10;
}
.ln-skip:focus { left: 12px; top: 12px; }
.ln-noscript {
  padding: 14px 20px;
  background: var(--l-surface);
  border-bottom: 1px solid var(--l-border);
  color: var(--l-muted);
}

/* --- nav --- */
.ln-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--l-maxw);
  margin: 0 auto;
  padding: 18px var(--l-gutter);
  backdrop-filter: blur(10px);
}
.ln-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--l-text);
  font-weight: 700;
  font-size: 18px;
  margin-right: auto;
}
.ln-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  align-self: center;
  background: linear-gradient(150deg, rgba(239, 68, 68, 0.95), rgba(244, 114, 182, 0.72));
  color: var(--l-ink);
  font-size: 17px;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.32);
}
.ln-brand small { color: var(--l-faint); font-weight: 500; font-size: 12px; }
.ln-links { display: flex; align-items: center; gap: 22px; }
.ln-links a {
  color: var(--l-muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: color 150ms var(--l-ease);
}
.ln-links a:hover { color: var(--l-text); }
.ln-cta-mini {
  color: var(--l-ink) !important;
  background: var(--l-grad-cta);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600 !important;
}
.ln-nav-toggle { display: none; }

/* --- hero --- */
.ln-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  max-width: var(--l-maxw);
  margin: 0 auto;
  padding: var(--l-hero-top) var(--l-gutter) var(--l-section-gap);
}
.ln-eyebrow {
  font: 700 11px/1.4 var(--l-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--l-red2);
  margin: 0 0 14px;
}
.ln-hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 18px;
}
.ln-grad {
  background: var(--l-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ln-sub { color: var(--l-muted); font-size: 17px; max-width: 54ch; margin: 0 0 26px; }
.ln-sub strong { color: var(--l-text); }
.ln-sub em { color: var(--l-red2); font-style: normal; font-weight: 600; }
.ln-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.ln-cta {
  display: inline-block;
  background: var(--l-grad-cta);
  color: var(--l-ink);
  font-weight: 700;
  font-size: 15.5px;
  padding: 13px 26px;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px -12px rgba(239, 68, 68, 0.55);
  transition: transform 150ms var(--l-ease), box-shadow 150ms var(--l-ease);
}
.ln-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -12px rgba(239, 68, 68, 0.7); }
.ln-ghost {
  display: inline-block;
  color: var(--l-text);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border: 1px solid var(--l-border2);
  border-radius: 12px;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms var(--l-ease), background 150ms var(--l-ease);
}
.ln-ghost:hover { border-color: var(--l-red); background: rgba(239, 68, 68, 0.06); }
.ln-hero-meta { color: var(--l-faint); font-size: 13px; margin-top: 18px; }

.ln-window { min-width: 0; }
.ln-mock { pointer-events: none; }

/* --- sections --- */
.ln-section {
  max-width: var(--l-maxw);
  margin: 0 auto;
  padding: 0 var(--l-gutter) var(--l-section-gap);
}
.ln-section h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: -0.025em;
  font-weight: 750;
  margin: 0 0 12px;
}
.ln-lede { color: var(--l-muted); max-width: 68ch; margin: 0 0 28px; font-size: 16.5px; }
.ln-grid { display: grid; gap: var(--l-grid-gap); margin-top: 28px; }
.ln-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ln-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ln-card {
  background: linear-gradient(180deg, var(--l-surface2), var(--l-surface));
  border: 1px solid var(--l-border);
  border-radius: var(--l-radius);
  padding: var(--l-card-pad);
  transition: border-color 180ms var(--l-ease), transform 180ms var(--l-ease);
}
.ln-card:hover { border-color: var(--l-border2); transform: translateY(-2px); }
.ln-card h3 { font-size: 16.5px; font-weight: 650; margin: 0 0 8px; }
.ln-card p { color: var(--l-muted); font-size: 14.5px; margin: 0; }
.ln-card p b { font-weight: 700; }
.ln-card code {
  font: 500 12.5px var(--l-mono);
  background: rgba(239, 68, 68, 0.1);
  color: #f6c9c9;
  padding: 1px 6px;
  border-radius: 6px;
}
.ln-card-glyph {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px 12px 3px 3px; /* the instrument radius, small */
  background: var(--l-red);
  color: var(--l-ink);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.ln-ok { color: var(--l-ok); }
.ln-warn { color: var(--l-warn); }
.ln-alert { color: var(--l-red2); }

.ln-snippet {
  margin-top: 30px;
  background: var(--l-bg2);
  border: 1px solid var(--l-border);
  border-left: 3px solid var(--l-red);
  border-radius: 4px 16px 4px 4px;
  overflow: hidden;
}
.ln-snippet-label {
  font: 700 10px/1 var(--l-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--l-faint);
  padding: 12px 18px 0;
}
.ln-snippet pre { margin: 0; padding: 12px 18px 16px; overflow-x: auto; }
.ln-snippet code { font: 500 13px/1.7 var(--l-mono); color: #f6c9c9; }

.ln-faq {
  border: 1px solid var(--l-border);
  border-radius: 12px;
  background: var(--l-surface);
  margin-top: 12px;
  padding: 0 20px;
}
.ln-faq summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
}
.ln-faq summary::-webkit-details-marker { display: none; }
.ln-faq summary::before { content: "→ "; color: var(--l-red); }
.ln-faq[open] summary::before { content: "↓ "; }
.ln-faq p { color: var(--l-muted); font-size: 14.5px; margin: 0 0 16px; }
.ln-faq code {
  font: 500 12.5px var(--l-mono);
  background: rgba(239, 68, 68, 0.1);
  color: #f6c9c9;
  padding: 1px 6px;
  border-radius: 6px;
}

/* --- sign-in card --- */
.ln-start { display: flex; justify-content: center; }
.ln-signin-card {
  width: min(430px, 100%);
  text-align: center;
  background: linear-gradient(180deg, var(--l-surface2), var(--l-surface));
  border: 1px solid var(--l-border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 30px 80px -40px rgba(239, 68, 68, 0.25);
}
.ln-signin-mark {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  font-size: 28px;
  margin: 0 auto 18px;
}
.ln-signin-card h2 { font-size: 24px; margin: 0 0 8px; }
.ln-signin-card > p { color: var(--l-muted); font-size: 14.5px; margin: 0 0 22px; }
.ln-signin-card .ln-cta { width: 100%; }
.ln-signin-error { color: var(--l-red2); font-size: 13.5px; margin: 14px 0 0; }
.ln-token-fallback { margin-top: 18px; }
.ln-token-fallback summary {
  color: var(--l-faint);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}
.ln-token-fallback summary::-webkit-details-marker { display: none; }
.ln-token-fallback form { display: flex; gap: 10px; margin-top: 14px; }
.ln-token-fallback input {
  flex: 1;
  background: var(--l-bg2);
  border: 1px solid var(--l-border2);
  border-radius: 10px;
  color: var(--l-text);
  font: 500 14px var(--l-mono);
  padding: 11px 14px;
  min-width: 0;
}
.ln-token-fallback input:focus { outline: none; border-color: var(--l-red); }

.ln-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  max-width: var(--l-maxw);
  margin: 0 auto;
  padding: 30px var(--l-gutter) 44px;
  border-top: 1px solid var(--l-border-soft);
  color: var(--l-faint);
  font-size: 13.5px;
}
.ln-footer nav { display: flex; gap: 20px; }
.ln-footer a { color: var(--l-muted); text-decoration: none; }
.ln-footer a:hover { color: var(--l-text); }

@media (max-width: 960px) {
  .ln-hero { grid-template-columns: 1fr; padding-top: 40px; }
  .ln-grid-3, .ln-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .ln-grid-3, .ln-grid-4 { grid-template-columns: 1fr; }
  .ln-nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
  }
  .ln-nav-toggle span { width: 20px; height: 2px; background: var(--l-text); border-radius: 2px; }
  .ln-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    background: var(--l-surface);
    border: 1px solid var(--l-border);
    border-radius: 14px;
    padding: 14px;
  }
  .ln-links.open { display: flex; }
}

/* ==========================================================================
   The Red Thread board — Paige's instrument, shared by the landing mock and
   the in-app incident view. Signature values carried from the desktop card:
   the constant red identity rail, the state-driven signal color, the
   4px 28px 4px 4px radius, mono micro-labels, and the slow scanline.
========================================================================== */

.rt-card {
  --rt-red: #ef4444;    /* constant identity rail */
  --rt-signal: #ef4444; /* changes by control state */
  position: relative;
  max-width: 780px;
  border: 1px solid color-mix(in srgb, var(--rt-signal) 28%, var(--zui-border, #2a2e3a));
  border-radius: 4px 28px 4px 4px; /* the asymmetric signature */
  background:
    linear-gradient(118deg,
      color-mix(in srgb, var(--rt-red) 4%, var(--zui-surface, #1a1d27)),
      color-mix(in srgb, var(--zui-surface, #1a1d27) 92%, var(--zui-bg, #0b0d14))),
    var(--zui-surface, #1a1d27);
  box-shadow: 0 24px 70px -54px #000, inset 3px 0 0 var(--rt-red);
  overflow: hidden;
}
.rt-card.rt-held { --rt-signal: #2dd4a7; }
.rt-card.rt-drifting { --rt-signal: #f59e0b; }
.rt-card.rt-unframed { --rt-signal: #ef4444; }

/* the 1px scanline riding the identity rail */
.rt-scan {
  position: absolute;
  left: 3px;
  top: 0;
  width: 1px;
  height: 34%;
  background: linear-gradient(#fff0, #ffffffb3, #fff0);
  animation: rtScan 5.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes rtScan {
  0%, 100% { transform: translateY(-40%); opacity: 0; }
  18% { opacity: 1; }
  50% { transform: translateY(220%); opacity: 0.9; }
  82% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rt-scan { animation: none; opacity: 0; }
}

.rt-card i {
  display: block;
  font: 720 8px/1 var(--zui-mono, ui-monospace, Menlo, monospace);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--zui-text-muted, #8b8d98);
  margin-bottom: 5px;
}

.rt-head { padding: 16px 20px 12px; }
.rt-eyebrow {
  font: 720 8px/1 var(--zui-mono, ui-monospace, Menlo, monospace);
  letter-spacing: 0.13em;
  color: color-mix(in srgb, var(--rt-red) 75%, #fff);
  margin-bottom: 10px;
}
.rt-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.rt-title {
  font: 610 25px/1.08 var(--zui-font, "Inter", sans-serif);
  letter-spacing: -0.035em;
  color: var(--zui-text, #e4e4e7);
}
.rt-services { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.rt-services span {
  font: 600 10px/1 var(--zui-mono, monospace);
  color: var(--zui-text-muted, #8b8d98);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 3px 9px 3px 3px;
  padding: 4px 8px;
}
.rt-sev {
  font: 760 17px/1 var(--zui-mono, monospace);
  color: var(--paige-ink);
  background: var(--rt-red);
  border-radius: 3px 14px 3px 3px;
  padding: 7px 12px;
  flex-shrink: 0;
}
.rt-vitals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.rt-vitals > div {
  background: color-mix(in srgb, var(--zui-bg, #0b0d14) 55%, transparent);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 3px 12px 3px 3px;
  padding: 8px 10px;
}
.rt-vitals b {
  display: block;
  font: 640 12.5px/1.2 var(--zui-mono, monospace);
  color: var(--zui-text, #e4e4e7);
}
.rt-ok { color: var(--rt-ok) !important; }
.rt-warn { color: var(--rt-warn) !important; }
.rt-bad { color: var(--rt-red) !important; }

.rt-impact {
  margin: 0 20px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--rt-red) 24%, var(--zui-border, #2a2e3a));
  border-radius: 3px 12px 3px 3px;
  background: color-mix(in srgb, var(--rt-red) 5%, transparent);
  font: 500 13.5px/1.45 var(--zui-font, sans-serif);
  color: var(--zui-text, #e4e4e7);
}

.rt-roles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 20px 0;
}
.rt-roles > div {
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 3px 10px 3px 3px;
  padding: 8px 10px;
}
.rt-roles b {
  font: 600 12.5px/1.2 var(--zui-font, sans-serif);
  color: var(--zui-text, #e4e4e7);
}
.rt-roles .is-open { border-style: dashed; }
.rt-roles .is-open b { color: var(--rt-red); font-family: var(--zui-mono, monospace); font-size: 11px; letter-spacing: 0.08em; }

.rt-truth {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 20px;
}
.rt-truth > div {
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 3px 10px 3px 3px;
  padding: 9px 11px;
  font: 450 12.5px/1.45 var(--zui-font, sans-serif);
  color: var(--zui-text-muted, #b9bbc6);
}
.rt-known i { color: var(--rt-ok); }
.rt-hypothesis i { color: var(--rt-warn); }
.rt-unknown i { color: var(--rt-unknown); }
.rt-truth ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }

.rt-lower {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8px;
  padding: 0 20px 12px;
}
.rt-lower > div {
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 3px 10px 3px 3px;
  padding: 9px 11px;
}
.rt-lower ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rt-lower li {
  font: 450 12.5px/1.4 var(--zui-font, sans-serif);
  color: var(--zui-text, #e4e4e7);
}
.rt-lower li small { color: var(--zui-text-muted, #8b8d98); }
.rt-lower li.is-done { color: var(--zui-text-faint, #5e616d); text-decoration: line-through; }
.rt-next li::before { content: "› "; color: var(--rt-red); font-weight: 700; }
.rt-next li.is-clear { color: var(--rt-ok); }
.rt-decisions li { color: var(--rt-warn); }

.rt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 20px 14px;
  font: 500 10.5px/1 var(--zui-mono, monospace);
  letter-spacing: 0.04em;
  color: var(--zui-text-faint, #5e616d);
  border-top: 1px solid var(--zui-border, #2a2e3a);
}
.rt-foot button {
  font: 600 10.5px/1 var(--zui-mono, monospace);
  color: var(--zui-text, #e4e4e7);
  background: transparent;
  border: 1px solid var(--zui-border-strong, #3d4252);
  border-radius: 3px 10px 3px 3px;
  padding: 7px 12px;
  cursor: pointer;
}
.rt-foot button:hover { border-color: var(--rt-red); color: #fff; }

.rt-coverage {
  height: 3px;
  border-radius: 2px;
  background: var(--zui-border, #2a2e3a);
  margin-top: 10px;
  overflow: hidden;
}
.rt-coverage > div { height: 100%; background: var(--rt-signal); }

.rt-state-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 720 10px/1 var(--zui-mono, monospace);
  letter-spacing: 0.11em;
  color: var(--rt-signal);
  border: 1px solid color-mix(in srgb, var(--rt-signal) 45%, transparent);
  border-radius: 3px 10px 3px 3px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--rt-signal) 8%, transparent);
}
.rt-state-chip.rt-held { --rt-signal: #2dd4a7; }
.rt-state-chip.rt-drifting { --rt-signal: #f59e0b; }
.rt-state-chip.rt-unframed { --rt-signal: #ef4444; }

@media (max-width: 680px) {
  .rt-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-truth { grid-template-columns: 1fr; }
  .rt-lower { grid-template-columns: 1fr; }
  .rt-title { font-size: 21px; }
}

/* ==========================================================================
   App shell
========================================================================== */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--zui-bg, #0b0d14);
  color: var(--zui-text, #e4e4e7);
  font-family: var(--zui-font, "Inter", sans-serif);
}
.skip-link {
  position: absolute;
  left: -999px;
  background: var(--paige);
  color: var(--paige-ink);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 30;
}
.skip-link:focus { left: 12px; top: 12px; }

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--zui-border, #2a2e3a);
  background: linear-gradient(180deg, color-mix(in srgb, var(--paige) 3%, var(--zui-bg, #0b0d14)), var(--zui-bg, #0b0d14) 30%);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
#sidebar-home { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(239, 68, 68, 0.95), rgba(244, 114, 182, 0.72));
  color: var(--paige-ink);
  font-size: 18px;
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.3);
  flex-shrink: 0;
}
.brand-name { display: block; font-weight: 750; font-size: 17px; letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 10.5px; color: var(--zui-text-muted, #8b8d98); }
#mobile-nav-close { background: none; border: 0; color: var(--zui-text-muted); font-size: 16px; cursor: pointer; display: none; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 9px 9px 0;
  color: var(--zui-text-muted, #8b8d98);
  font: 550 13.5px/1 var(--zui-font, sans-serif);
  padding: 10px 12px;
  cursor: pointer;
  transition: color 130ms ease, background 130ms ease;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { color: var(--zui-text, #e4e4e7); background: var(--zui-surface, #1a1d27); }
.nav-item.active {
  color: var(--paige-2);
  background: color-mix(in srgb, var(--paige) 8%, transparent);
  border-left-color: var(--paige);
}
.nav-badge {
  margin-left: auto;
  font: 700 10.5px/1 var(--zui-mono, monospace);
  background: var(--paige);
  color: var(--paige-ink);
  border-radius: 999px;
  padding: 3px 7px;
}

.side-section.workspace { margin-top: auto; padding-top: 18px; }
#ws-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--zui-surface, #1a1d27);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 11px;
  color: inherit;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}
#ws-switch:hover { border-color: var(--zui-border-strong, #3d4252); }
#ws-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--paige-dim);
  color: var(--paige-2);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.ws-names { min-width: 0; flex: 1; }
#ws-name { display: block; font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#who { display: block; font-size: 11px; color: var(--zui-text-muted, #8b8d98); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-menu {
  margin-top: 8px;
  background: var(--zui-surface, #1a1d27);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 11px;
  overflow: hidden;
}
.ws-menu button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  color: var(--zui-text, #e4e4e7);
  font-size: 13px;
  padding: 10px 13px;
  cursor: pointer;
  text-align: left;
}
.ws-menu button:hover { background: var(--zui-surface-2, #232733); }
.ws-menu button.current { color: var(--paige-2); }
.ws-menu small { color: var(--zui-text-faint, #5e616d); }
.ws-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 0 2px; }
.ws-actions a, .ws-actions button {
  background: none;
  border: 0;
  color: var(--zui-text-muted, #8b8d98);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.ws-actions a:hover, .ws-actions button:hover { color: var(--zui-text, #e4e4e7); }

.main { padding: 0 30px 60px; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--zui-bg, #0b0d14) 82%, transparent);
  z-index: 4;
}
#mobile-nav-toggle { display: none; background: none; border: 0; color: var(--zui-text); font-size: 19px; cursor: pointer; }
.topbar-title { margin-right: auto; min-width: 0; }
#view-title { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; margin: 0; }
#view-sub { font-size: 12.5px; color: var(--zui-text-muted, #8b8d98); margin: 3px 0 0; }
#view-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- shared app components --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--zui-surface, #1a1d27);
  border: 1px solid var(--zui-border-strong, #3d4252);
  border-radius: 9px;
  color: var(--zui-text, #e4e4e7);
  font: 600 13px/1 var(--zui-font, sans-serif);
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
}
.btn:hover { border-color: var(--paige); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary {
  background: var(--zui-grad-accent);
  border-color: transparent;
  color: var(--paige-ink);
}
.btn.primary:hover { box-shadow: var(--zui-glow-strong); }
.btn.danger { color: var(--paige-2); border-color: color-mix(in srgb, var(--paige) 45%, transparent); }
.btn.small { padding: 6px 10px; font-size: 12px; }

.card {
  background: var(--zui-surface, #1a1d27);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.01em; }
.card h2 small { color: var(--zui-text-muted, #8b8d98); font-weight: 500; margin-left: 8px; }
.card-empty {
  color: var(--zui-text-muted, #8b8d98);
  font-size: 13.5px;
  padding: 18px 0;
  text-align: center;
}
.card-empty b { display: block; color: var(--zui-text); font-size: 14.5px; margin-bottom: 4px; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.stat-tile {
  background: var(--zui-surface, #1a1d27);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 3px 16px 3px 3px;
  padding: 16px 18px;
}
.stat-tile i {
  display: block;
  font: 700 9px/1 var(--zui-mono, monospace);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--zui-text-muted, #8b8d98);
  margin-bottom: 8px;
}
.stat-tile b { font: 700 24px/1 var(--zui-mono, monospace); letter-spacing: -0.02em; }
.stat-tile small { display: block; color: var(--zui-text-faint, #5e616d); font-size: 11px; margin-top: 6px; }
.stat-tile.hot { border-color: color-mix(in srgb, var(--paige) 40%, var(--zui-border)); box-shadow: inset 2px 0 0 var(--paige); }
.stat-tile.hot b { color: var(--paige-2); }
.stat-tile.calm b { color: var(--rt-ok); }

/* priority chips */
.pri {
  display: inline-block;
  font: 760 11px/1 var(--zui-mono, monospace);
  border-radius: 3px 9px 3px 3px;
  padding: 5px 8px;
  min-width: 30px;
  text-align: center;
}
.pri-P1 { background: var(--paige); color: var(--paige-ink); }
.pri-P2 { background: color-mix(in srgb, var(--paige) 72%, transparent); color: #fff; }
.pri-P3 { background: color-mix(in srgb, var(--rt-warn) 80%, transparent); color: #2a1c04; }
.pri-P4 { background: var(--zui-surface-2, #232733); color: var(--zui-text-muted, #8b8d98); border: 1px solid var(--zui-border-strong, #3d4252); }
.pri-P5 { background: transparent; color: var(--zui-text-faint, #5e616d); border: 1px solid var(--zui-border, #2a2e3a); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 650 10.5px/1 var(--zui-mono, monospace);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 5px 10px;
}
.status-open { color: var(--paige-2); background: var(--paige-dim); }
.status-acked { color: var(--rt-warn); background: rgba(245, 158, 11, 0.12); }
.status-closed { color: var(--zui-text-faint, #5e616d); background: var(--zui-surface-2, #232733); }
.status-healthy { color: var(--rt-ok); background: rgba(45, 212, 167, 0.1); }
.status-missed { color: var(--paige-2); background: var(--paige-dim); }
.status-new { color: var(--zui-text-muted, #8b8d98); background: var(--zui-surface-2, #232733); }

/* row lists (alerts, integrations, …) */
.rowlist { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--zui-border, #2a2e3a);
  cursor: pointer;
  transition: background 120ms ease;
  border-radius: 8px;
}
.row:hover { background: var(--zui-surface, #1a1d27); }
.row:last-child { border-bottom: 0; }
.row.static { cursor: default; }
.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 620; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--zui-text-muted, #8b8d98); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.row-meta { font: 500 11.5px var(--zui-mono, monospace); color: var(--zui-text-faint, #5e616d); }
.count-pill {
  font: 700 10.5px/1 var(--zui-mono, monospace);
  color: var(--zui-text-muted, #8b8d98);
  border: 1px solid var(--zui-border-strong, #3d4252);
  border-radius: 999px;
  padding: 3px 8px;
}

/* filter chips */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  background: var(--zui-surface, #1a1d27);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 999px;
  color: var(--zui-text-muted, #8b8d98);
  font: 600 12px/1 var(--zui-font, sans-serif);
  padding: 7px 13px;
  cursor: pointer;
}
.chip.active { color: var(--paige-2); border-color: var(--paige); background: var(--paige-dim); }
.filter-bar input[type="search"], .filter-bar select {
  background: var(--zui-surface, #1a1d27);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 9px;
  color: var(--zui-text, #e4e4e7);
  font-size: 13px;
  padding: 8px 12px;
}
.filter-bar input[type="search"] { flex: 1; min-width: 140px; }
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--paige); }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font: 700 9.5px/1 var(--zui-mono, monospace);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--zui-text-muted, #8b8d98);
}
.field input, .field select, .field textarea {
  background: var(--zui-bg, #0b0d14);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 9px;
  color: var(--zui-text, #e4e4e7);
  font: 450 13.5px/1.4 var(--zui-font, sans-serif);
  padding: 9px 12px;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 74px; font-family: var(--zui-mono, monospace); font-size: 12.5px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--paige); box-shadow: var(--zui-glow); }
.field small { color: var(--zui-text-faint, #5e616d); font-size: 11px; }
.form-actions { display: flex; gap: 10px; margin-top: 14px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--zui-border, #2a2e3a);
  font-size: 13px;
}
.timeline li:last-child { border-bottom: 0; }
.tl-glyph {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--zui-surface-2, #232733);
  color: var(--zui-text-muted, #8b8d98);
  font-size: 12px;
  flex-shrink: 0;
}
.tl-glyph.k-paged { background: var(--paige-dim); color: var(--paige-2); }
.tl-glyph.k-acked { background: rgba(45, 212, 167, 0.12); color: var(--rt-ok); }
.tl-glyph.k-closed { background: rgba(45, 212, 167, 0.12); color: var(--rt-ok); }
.tl-glyph.k-escalated { background: rgba(245, 158, 11, 0.12); color: var(--rt-warn); }
.tl-glyph.k-created { background: var(--paige-dim); color: var(--paige-2); }
.tl-body { flex: 1; min-width: 0; }
.tl-text { color: var(--zui-text, #e4e4e7); overflow-wrap: anywhere; }
.tl-meta { font: 500 11px var(--zui-mono, monospace); color: var(--zui-text-faint, #5e616d); margin-top: 2px; }

/* key reveal */
.key-reveal {
  background: color-mix(in srgb, var(--paige) 6%, var(--zui-bg, #0b0d14));
  border: 1px solid color-mix(in srgb, var(--paige) 35%, var(--zui-border, #2a2e3a));
  border-left: 3px solid var(--paige);
  border-radius: 4px 14px 4px 4px;
  padding: 14px 16px;
  margin: 12px 0;
}
.key-reveal code {
  display: block;
  font: 650 14px var(--zui-mono, monospace);
  color: #f6c9c9;
  word-break: break-all;
  margin: 8px 0;
}
.key-reveal p { font-size: 12px; color: var(--zui-text-muted, #8b8d98); margin: 0; }

.snippet {
  background: var(--zui-bg, #0b0d14);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  margin-top: 10px;
}
.snippet code { font: 500 12px/1.7 var(--zui-mono, monospace); color: #f6c9c9; white-space: pre; }

/* insights bars */
.bar-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; }
.bar-label { width: 130px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--zui-text-muted, #8b8d98); }
.bar-track { flex: 1; height: 8px; border-radius: 4px; background: var(--zui-surface-2, #232733); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--zui-grad-accent); }
.bar-fill.warn { background: var(--rt-warn); }
.bar-fill.ok { background: var(--rt-ok); }
.bar-val { width: 56px; text-align: right; font: 600 12px var(--zui-mono, monospace); color: var(--zui-text, #e4e4e7); }

.verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin-top: 10px;
}
.verdict.ok { background: rgba(45, 212, 167, 0.08); color: var(--rt-ok); border: 1px solid rgba(45, 212, 167, 0.25); }
.verdict.bad { background: var(--paige-dim); color: var(--paige-2); border: 1px solid color-mix(in srgb, var(--paige) 40%, transparent); }
.verdict.warn { background: rgba(245, 158, 11, 0.08); color: var(--rt-warn); border: 1px solid rgba(245, 158, 11, 0.25); }

/* postmortem score */
.pm-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.pm-score b { font: 800 42px/1 var(--zui-mono, monospace); color: var(--paige-2); letter-spacing: -0.03em; }
.pm-score.good b { color: var(--rt-ok); }
.pm-score span { font-size: 14px; color: var(--zui-text-muted, #8b8d98); }
.pm-dim { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.pm-dim .ok { color: var(--rt-ok); }
.pm-dim .miss { color: var(--paige-2); }

.inline-input {
  flex: 1;
  min-width: 0;
  background: var(--zui-bg, #0b0d14);
  border: 1px solid var(--zui-border, #2a2e3a);
  border-radius: 9px;
  color: var(--zui-text, #e4e4e7);
  font: 450 13px/1.4 var(--zui-font, sans-serif);
  padding: 9px 12px;
}
.inline-input:focus { outline: none; border-color: var(--paige); }
textarea.inline-input {
  border-radius: 10px;
  font-family: var(--zui-mono, monospace);
  font-size: 12.5px;
  resize: vertical;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--zui-surface-2, #232733);
  border: 1px solid var(--zui-border-strong, #3d4252);
  border-left: 3px solid var(--rt-ok);
  border-radius: 4px 12px 4px 4px;
  color: var(--zui-text, #e4e4e7);
  font-size: 13.5px;
  padding: 12px 18px;
  z-index: 50;
  box-shadow: 0 18px 44px -20px #000;
}
.toast.err { border-left-color: var(--paige); }

/* mobile app shell */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    background: var(--zui-bg, #0b0d14);
  }
  .sidebar.open { transform: translateX(0); }
  #mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
  }
  #mobile-nav-toggle { display: block; }
  #mobile-nav-close { display: block; }
  .main { padding: 0 16px 40px; }
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .bar-label { width: 90px; }
}
@media (max-width: 560px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .row-side .row-meta { display: none; }
}
