/* ===================== Appolo — Mission Control design system ===================== */

/* ── Fonts, self-hosted ───────────────────────────────────────────────────────
   These were pulled from Google Fonts with @import until 2026-09-28. That had
   to go: @import is RENDER-BLOCKING, and Firefox's Enhanced Tracking Protection
   — on by default in private windows — blocks fonts.googleapis.com as a third
   party. A blocked import that HANGS rather than failing fast means the parent
   stylesheet never applies, so the page renders COMPLETELY unstyled. Not a
   subtle degradation, and on a commercial SaaS a prospect could have hit it.

   Bricolage Grotesque and IBM Plex Sans are VARIABLE fonts — one file covers
   each family's whole weight range, which is why those two declare a range
   instead of one @font-face per weight (448 KB of downloads deduped to 164 KB
   across 5 files). IBM Plex Mono ships static instances, so it gets one file
   per weight. Both families are SIL Open Font License 1.1, which explicitly
   permits redistribution and self-hosting.

   ⛔ Adding a weight here means adding the FILE too — there is no longer a
   Google request to silently cover a weight that was never downloaded.
   Served from public/fonts/ at /fonts/*. CSP font-src is 'self'.
   ─────────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-var.woff2') format('woff2-variations');
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plexmono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/plexmono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/fonts/plexsans-var.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #08090c;
  --bg-2: #0b0d11;
  --panel: #12141a;
  --panel-2: #171a21;
  --panel-3: #1d2129;
  --line: rgba(255,255,255,0.07);
  --line-2: rgba(255,255,255,0.11);
  --ink: #f4f5f7;
  --ink-2: #b7bcc6;
  --ink-3: #7b828f;
  --gold: #e8b44a;
  --gold-dim: #b98a2f;
  --gold-glow: rgba(232,180,74,0.16);

  /* validated dark chart palette (dataviz skill) */
  --c-blue: #3987e5;
  --c-aqua: #199e70;
  --c-yellow: #c98500;
  --c-violet: #9085e9;
  --c-magenta: #d55181;

  /* status (reserved) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 40px -20px rgba(0,0,0,0.8);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --display: 'Bricolage Grotesque', var(--sans);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink);
  background:
    radial-gradient(1200px 700px at 82% -8%, rgba(232,180,74,0.06), transparent 60%),
    radial-gradient(900px 600px at 8% 108%, rgba(57,135,229,0.05), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px; line-height: 1.5;
}
::selection { background: var(--gold-glow); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #222630; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #2c313c; background-clip: content-box; }

/* ============ wordmark ============ */
.wordmark { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 9px; }
.wordmark .mark {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--gold), #f2d089); color: #1a1204; font-weight: 800;
  box-shadow: 0 0 0 1px rgba(232,180,74,0.4), 0 8px 22px -8px var(--gold-glow);
  position: relative;
}
.wordmark .mark::after { content:''; position:absolute; inset:0; border-radius:8px; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55), transparent 45%); }

/* ============================= LOGIN ============================= */
.login-wrap { min-height: 100%; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-hero {
  position: relative; overflow: hidden; padding: 54px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(700px 500px at 70% 20%, rgba(232,180,74,0.10), transparent 60%),
    linear-gradient(160deg, #0c0e13, #070809);
  border-right: 1px solid var(--line);
}
.login-hero .grid-lines { position:absolute; inset:0; opacity:.5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 60% 40%, #000 30%, transparent 78%); }
.login-hero .orbit { position:absolute; right:-120px; top:22%; width:520px; height:520px; border-radius:50%;
  border:1px solid rgba(232,180,74,0.16); box-shadow: 0 0 120px -30px var(--gold-glow) inset; }
.login-hero .orbit::before { content:''; position:absolute; inset:70px; border-radius:50%; border:1px solid rgba(255,255,255,0.05); }
.login-hero .orbit::after { content:''; position:absolute; width:12px; height:12px; border-radius:50%; top:-6px; left:50%; background:var(--gold); box-shadow:0 0 20px 4px var(--gold-glow); }
.login-hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 4vw, 52px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 16px; max-width: 15ch; }
.login-hero h1 em { font-style: normal; color: var(--gold); }
.login-hero p { color: var(--ink-2); font-size: 16px; max-width: 40ch; margin: 0; }
.login-hero .foot { color: var(--ink-3); font-size: 12.5px; position: relative; z-index: 1; }
.login-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; position: relative; z-index: 1; }
.login-badges span { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line-2); padding: 6px 11px; border-radius: 999px; background: rgba(255,255,255,0.02); }
.login-form-col { display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-family: var(--display); font-weight: 700; font-size: 25px; margin: 0 0 4px; letter-spacing: -0.02em; }
.login-card .sub { color: var(--ink-3); margin: 0 0 26px; font-size: 13.5px; }
.field { margin-bottom: 15px; }
.field label { display:block; font-size: 12px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; letter-spacing: .01em; }
.input {
  width: 100%; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 10px; font-size: 14px; font-family: var(--sans); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); padding: 11px 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { background: var(--panel-3); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(160deg, var(--gold), #dca62f); color: #1a1204; border-color: transparent; box-shadow: 0 10px 26px -12px var(--gold-glow); }
.btn.gold:hover { filter: brightness(1.05); }
.btn.block { width: 100%; padding: 12px; }
.btn.sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffb4b4; border-color: rgba(208,59,59,0.4); }
.btn.danger:hover { background: rgba(208,59,59,0.14); }
.login-err { color: #ffb4b4; font-size: 13px; min-height: 18px; margin: 4px 0 10px; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--ink-3); text-align:center; }
.login-hint code { color: var(--gold); font-family: var(--mono); }

/* ============================= APP SHELL ============================= */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, var(--bg-2), #090a0e);
  border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px;
}
.rail .brand { padding: 6px 8px 18px; font-size: 18px; }
.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-3); padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2);
  cursor: pointer; font-weight: 500; font-size: 13.5px; transition: background .12s, color .12s; position: relative;
}
.nav-item svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--ink); }
.nav-item.active { background: linear-gradient(90deg, var(--gold-glow), rgba(232,180,74,0.03)); color: var(--ink); }
.nav-item.active::before { content:''; position:absolute; left:-14px; top:8px; bottom:8px; width:3px; border-radius:0 3px 3px 0; background: var(--gold); }
.nav-item .badge { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--panel-3); color: var(--ink-2); padding: 1px 7px; border-radius: 999px; }
.nav-item.active .badge { background: var(--gold); color: #1a1204; }
.rail .spacer { flex: 1; }
.rail-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #0c0c0c; flex: none; }
.rail-user .who { min-width: 0; }
.rail-user .who b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-user .who span { font-size: 11px; color: var(--ink-3); text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 14px 26px; background: rgba(8,9,12,0.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin: 0; }
.topbar .crumb { color: var(--ink-3); font-size: 13px; }
.search { position: relative; margin-left: auto; width: 320px; max-width: 38vw; }
.search input { width: 100%; padding: 9px 12px 9px 34px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); border-radius: 10px; font-size: 13px; }
.search input:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 40; }
.search-results .sr-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); padding: 9px 13px 4px; }
.search-results a { display: flex; gap: 8px; padding: 8px 13px; font-size: 13px; cursor: pointer; }
.search-results a:hover { background: rgba(255,255,255,0.04); }

.content { padding: 26px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head .titles h2 { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.025em; margin: 0; }
.page-head .titles p { color: var(--ink-3); margin: 3px 0 0; font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; }

/* ============ cards / grid ============ */
.grid { display: grid; gap: 16px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card.pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink); text-transform: uppercase; }
.card-head .sub { color: var(--ink-3); font-size: 12px; }
.card-head .right { margin-left: auto; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 17px 18px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi .k-val { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.05; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.kpi .k-spark { position: absolute; right: 14px; bottom: 12px; opacity: .9; }
.kpi.accent-gold .k-val { color: var(--gold); }
.kpi.accent-critical .k-val { color: var(--critical); }
.kpi.accent-good .k-val { color: var(--good); }
.kpi .glow { position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; filter: blur(30px); opacity: .5; }

/* pills / chips */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; letter-spacing: .01em; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill.s-new { background: rgba(57,135,229,0.13); color: #8fbdf2; border-color: rgba(57,135,229,0.28); }
.pill.s-open { background: rgba(232,180,74,0.13); color: #f0cd82; border-color: rgba(232,180,74,0.3); }
.pill.s-pending { background: rgba(144,133,233,0.14); color: #bcb4f2; border-color: rgba(144,133,233,0.3); }
.pill.s-resolved { background: rgba(12,163,12,0.14); color: #6ed36e; border-color: rgba(12,163,12,0.3); }
.pill.s-closed { background: rgba(255,255,255,0.05); color: var(--ink-3); border-color: var(--line-2); }
.pill.p-low { color: var(--ink-2); background: rgba(255,255,255,0.04); border-color: var(--line-2); }
.pill.p-medium { color: #8fbdf2; background: rgba(57,135,229,0.1); border-color: rgba(57,135,229,0.25); }
.pill.p-high { color: var(--serious); background: rgba(236,131,90,0.12); border-color: rgba(236,131,90,0.3); }
.pill.p-critical { color: #ff9a9a; background: rgba(208,59,59,0.15); border-color: rgba(208,59,59,0.4); }
.pill.sev-info { color: var(--ink-2); background: rgba(255,255,255,0.04); border-color: var(--line-2); }
.pill.sev-warning { color: var(--warning); background: rgba(250,178,25,0.12); border-color: rgba(250,178,25,0.3); }
.pill.sev-serious { color: var(--serious); background: rgba(236,131,90,0.12); border-color: rgba(236,131,90,0.3); }
.pill.sev-critical { color: #ff9a9a; background: rgba(208,59,59,0.15); border-color: rgba(208,59,59,0.4); }
.pill.breach { color: #ff9a9a; background: rgba(208,59,59,0.16); border-color: rgba(208,59,59,0.45); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(208,59,59,0.4); } 50% { box-shadow: 0 0 0 4px rgba(208,59,59,0); } }

.dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-online { background: var(--good); box-shadow: 0 0 0 3px rgba(12,163,12,0.18); }
.dot-offline { background: var(--ink-3); }
.dot-retired { background: transparent; border: 1px solid var(--ink-3); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.025); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .mono { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.tbl .t-title { font-weight: 500; color: var(--ink); }
.tbl .muted { color: var(--ink-3); }

.meter { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; min-width: 54px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--c-blue); }
.meter.warn > i { background: var(--warning); }
.meter.crit > i { background: var(--critical); }

/* toolbar / filters */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--ink-3); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.seg button.active { background: var(--panel-3); color: var(--ink); }
.select, .toolbar .input { padding: 8px 11px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); border-radius: 9px; font-size: 12.5px; }

/* empty */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty .big { font-family: var(--display); font-size: 17px; color: var(--ink-2); margin-bottom: 6px; }

/* ============ modal ============ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4,5,7,0.66); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 24px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 40px 90px -30px rgba(0,0,0,0.9); animation: rise .18s cubic-bezier(.2,.8,.2,1); max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 900px; }
@keyframes rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--ink-3); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; }
.modal-head .x:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea.input { resize: vertical; min-height: 90px; font-family: var(--sans); }

/* toasts */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--gold); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; min-width: 220px; animation: rise .2s ease; }
.toast.ok { border-left-color: var(--good); }
.toast.err { border-left-color: var(--critical); }

/* detail layouts */
.split { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 116px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); }
.thread { display: flex; flex-direction: column; gap: 14px; }
.post { display: flex; gap: 12px; }
.post .body { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.post.internal .body { background: rgba(232,180,74,0.05); border-color: rgba(232,180,74,0.2); }
.post.event { color: var(--ink-3); font-size: 12.5px; padding-left: 42px; }
.post .body .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.post .body .meta b { color: var(--ink-2); }
.post .body .text { white-space: pre-wrap; font-size: 13.5px; }

/* gauges (device detail) */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gauge { text-align: center; padding: 16px; }
.gauge .g-val { font-family: var(--display); font-weight: 800; font-size: 30px; font-variant-numeric: tabular-nums; }
.gauge .g-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* stagger reveal */
.reveal > * { opacity: 0; animation: reveal .5s cubic-bezier(.2,.8,.2,1) forwards; }
.reveal > *:nth-child(1) { animation-delay: .02s; } .reveal > *:nth-child(2) { animation-delay: .06s; }
.reveal > *:nth-child(3) { animation-delay: .10s; } .reveal > *:nth-child(4) { animation-delay: .14s; }
.reveal > *:nth-child(5) { animation-delay: .18s; } .reveal > *:nth-child(6) { animation-delay: .22s; }
.reveal > *:nth-child(7) { animation-delay: .26s; } .reveal > *:nth-child(8) { animation-delay: .30s; }
@keyframes reveal { to { opacity: 1; transform: none; } }
.reveal > * { transform: translateY(8px); }

.row { display: flex; align-items: center; gap: 8px; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--ink-3); }
.right { margin-left: auto; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.hide-sm { }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

/* ---------- Knowledge Base: rendered Markdown ---------- */
.md-body { font-size: 14px; line-height: 1.7; color: var(--ink-2); max-width: 760px; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { font-family: var(--display); color: var(--ink); font-weight: 700; line-height: 1.25; margin: 1.2em 0 .5em; }
.md-body h1 { font-size: 24px; } .md-body h2 { font-size: 19px; } .md-body h3 { font-size: 16px; } .md-body h4 { font-size: 14px; }
.md-body h1:first-child, .md-body h2:first-child, .md-body h3:first-child { margin-top: 0; }
.md-body p { margin: .7em 0; }
.md-body ul, .md-body ol { margin: .6em 0 .6em 1.4em; }
.md-body li { margin: .3em 0; }
.md-body ul.md-check { list-style: none; margin-left: .2em; }
.md-body code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--gold); }
.md-body pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 1em 0; }
.md-body pre code { background: none; border: none; padding: 0; color: var(--ink-2); }
.md-body blockquote { border-left: 3px solid var(--gold); margin: 1em 0; padding: .3em 0 .3em 14px; color: var(--ink-3); background: linear-gradient(90deg, rgba(232,180,74,0.05), transparent); }
.md-body a { color: var(--gold); }
.md-body hr { border: none; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md-body .md-tablewrap { overflow-x: auto; margin: 1em 0; border: 1px solid var(--line); border-radius: 10px; }
.md-body table.md-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.md-body table.md-table th { text-align: left; font-weight: 600; color: var(--ink); background: var(--bg-2); padding: 9px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.md-body table.md-table td { padding: 9px 13px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.md-body table.md-table tr:last-child td { border-bottom: none; }
.md-body table.md-table td code { white-space: nowrap; }
.tbl tfoot td { border-top: 2px solid var(--line-2); padding: 12px 14px; }
