/* Vigil — a quiet instrument panel for one server.
   Colour roles follow the dataviz method: validated categorical slots for series,
   reserved status colours (always with an icon + label), text in ink tokens only. */

@import url("/static/fonts/fonts.css");

/* ------------------------------------------------------------ tokens -- */
:root {
  color-scheme: light;
  --bg: #f3f3ef;
  --surface: #fcfcfb;
  --raised: #f5f5f2;
  --sunken: #ecebe6;
  --line: rgba(11, 11, 11, 0.08);
  --line-2: rgba(11, 11, 11, 0.14);
  --grid: #e8e7e1;
  --axis: #c9c8bf;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6b6964;
  --accent: #2a78d6;
  --accent-ink: #1f64b8;
  --accent-wash: rgba(42, 120, 214, 0.1);
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s1-track: #cde2fb;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good-ink: #006300;
  --warning-ink: #8a5a00;
  --serious-ink: #b4461c;
  --critical-ink: #c42f2f;
  --land: #d6d5cd;
  --land-hover: #b9b8ae;
  --attack: #eb6834;
  --home: #2a78d6;
  --shadow: 0 1px 2px rgba(20, 20, 10, 0.04), 0 6px 24px -8px rgba(20, 20, 10, 0.08);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0c10;
    --surface: #11141a;
    --raised: #171b22;
    --sunken: #0d1015;
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.12);
    --grid: #1d222a;
    --axis: #2c323c;
    --ink: #eef1f5;
    --ink-2: #aab1bd;
    --ink-3: #7f8794;
    --accent: #3987e5;
    --accent-ink: #6ea8ee;
    --accent-wash: rgba(57, 135, 229, 0.14);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s1-track: #1a2c44;
    --good-ink: #2fb52f;
    --warning-ink: #fab219;
    --serious-ink: #ec835a;
    --critical-ink: #e66767;
    --land: #252a33;
    --land-hover: #3a414d;
    --attack: #e0632f;
    --home: #6ea8ee;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c10;
  --surface: #11141a;
  --raised: #171b22;
  --sunken: #0d1015;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --grid: #1d222a;
  --axis: #2c323c;
  --ink: #eef1f5;
  --ink-2: #aab1bd;
  --ink-3: #7f8794;
  --accent: #3987e5;
  --accent-ink: #6ea8ee;
  --accent-wash: rgba(57, 135, 229, 0.14);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s1-track: #1a2c44;
  --good-ink: #2fb52f;
  --warning-ink: #fab219;
  --serious-ink: #ec835a;
  --critical-ink: #e66767;
  --land: #252a33;
  --land-hover: #3a414d;
  --attack: #e0632f;
  --home: #6ea8ee;
  --shadow: none;
}

/* -------------------------------------------------------------- base -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
code, kbd, samp, pre { font-family: var(--mono); font-size: inherit; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
/* commands and addresses must read exactly as typed: no "--" -> dash ligatures */
.mono, .cmd, code, .feed-detail, .port, .brand-host, .hero-date { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0, "dlig" 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* --------------------------------------------------------- app shell -- */
/* the sidebar column is painted on the grid itself, so it runs the full height of long pages */
.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 55%, var(--surface)) 0 239px, var(--line) 239px 240px, transparent 240px);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  z-index: 40;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand svg { width: 24px; height: 24px; color: var(--accent); }
.brand-name { font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.icon-btn.side-close { display: none; }
.side-host { padding: 4px 8px 18px; color: var(--ink-3); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-ligatures: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.side-nav a svg { width: 18px; height: 18px; flex: none; }
.side-nav a:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.side-nav a[aria-current="page"] svg { color: var(--accent); }
.nav-badge { margin-left: auto; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.nav-badge:empty { display: none; }
.nav-badge[data-level="warning"] { color: var(--warning-ink); }
.nav-badge[data-level="critical"] { color: var(--critical-ink); }
.nav-badge[data-level="good"] { color: var(--good-ink); }
.nav-label { margin: 20px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.nav-ai { margin-left: auto; font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 6px; color: var(--accent-ink); background: var(--accent-wash); }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; }
.ai-meter { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ai-meter:hover { text-decoration: none; color: var(--ink); border-color: var(--line-2); }
.ai-meter svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.side-actions { display: flex; align-items: center; gap: 4px; }
.spacer { flex: 1; }
.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.live-dot, .live-mini { width: 7px; height: 7px; border-radius: 50%; background: var(--good); position: relative; flex: none; }
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--good);
  opacity: 0;
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.live[data-state="down"] .live-dot, .live-mini[data-state="down"] { background: var(--warning); }
.live[data-state="down"] .live-dot::after { border-color: var(--warning); }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.8; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  flex: none;
}
.icon-btn:hover { background: var(--raised); color: var(--ink); border-color: var(--line); }
.icon-btn svg { width: 17px; height: 17px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.mobilebar { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 35; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 36px var(--gutter) 56px; flex: 1; }

/* ------------------------------------------------------------ layout -- */
.page > :not(.page-head) + :not(.page-head) { margin-top: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 28px; font-weight: 620; letter-spacing: -0.025em; line-height: 1.2; }
.page-sub { margin: 6px 0 0; color: var(--ink-2); max-width: 72ch; }
.grid.align-start { align-items: start; }
.svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.tile .chip { white-space: normal; max-width: 100%; }
.overline {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.card-meta { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

/* -------------------------------------------------------------- hero -- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px 28px; align-items: start; }
.hero-main > .attention-col { margin-top: 28px; }
.hero-side { display: grid; gap: 16px; align-content: start; }
.hero-date { font-family: var(--mono); font-size: 12px; color: var(--ink-3); letter-spacing: 0; text-transform: none; margin-bottom: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-title {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.04;
  font-weight: 620;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.hero-title .glyph-inline { display: inline-block; vertical-align: 0.08em; margin-right: 0.28em; }
.hero-sub { margin: 16px 0 0; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); max-width: 68ch; }
.hero-sub strong { color: var(--ink); font-weight: 560; }
.attention { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.attention-col h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.issue {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.issue:first-of-type { border-top: 0; padding-top: 2px; }
.issue > .glyph { grid-row: 1 / span 3; margin-top: 1px; }
.issue-title { font-weight: 560; letter-spacing: -0.005em; }
.issue-detail { grid-column: 2; color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.issue-foot { grid-column: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.issue-since { color: var(--ink-3); font-size: 12px; }
.note .issue-title { font-weight: 500; }
details.issue { display: block; padding: 11px 0; }
details.issue:first-of-type { padding-top: 2px; }
details.issue summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; border-radius: 8px; }
details.issue summary::-webkit-details-marker { display: none; }
details.issue summary .glyph { margin-right: 2px; }
details.issue summary::after { content: ""; flex: none; margin-left: auto; margin-right: 4px; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg) translateY(-2px); transition: transform 0.15s; }
details.issue[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
details.issue summary:hover .issue-title { color: var(--ink); }
details.issue > :not(summary) { margin-left: 34px; }
details.issue .issue-detail { margin-top: 8px; }
details.issue .ai-explain { margin-top: 10px; }
.all-clear { display: flex; gap: 12px; align-items: center; color: var(--ink-2); padding: 4px 0; }

/* ----------------------------------------------------- status glyphs -- */
.glyph {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: var(--ink-3);
}
.glyph svg { width: 12px; height: 12px; }
.glyph[data-level="good"], .glyph[data-level="ok"] { background: var(--good); }
.glyph[data-level="warning"], .glyph[data-level="warn"] { background: var(--warning); color: #3b2800; }
.glyph[data-level="serious"] { background: var(--serious); color: #3a1300; }
.glyph[data-level="critical"], .glyph[data-level="down"] { background: var(--critical); }
.glyph[data-level="note"], .glyph[data-level="info"] { background: var(--sunken); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.glyph.sm { width: 16px; height: 16px; }
.glyph.sm svg { width: 10px; height: 10px; }
.glyph.lg { width: 34px; height: 34px; }
.glyph.lg svg { width: 18px; height: 18px; }

/* -------------------------------------------------------------- chips -- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
.cmd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border-radius: 8px;
  background: var(--sunken);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}
.cmd code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cmd button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11.5px;
  font-family: var(--font);
  flex: none;
}
.cmd button:hover { color: var(--ink); background: var(--raised); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 550; background: var(--raised); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.good { color: var(--good-ink); }
.tag.warn { color: var(--warning-ink); }
.tag.bad { color: var(--critical-ink); }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-3); }

/* -------------------------------------------------------------- tiles -- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 2px; min-height: 176px; }
.tile-label { font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.tile-value { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-top: 4px; white-space: nowrap; }
.tile-value small { font-size: 15px; font-weight: 500; color: var(--ink-3); letter-spacing: -0.01em; margin-left: 0.35em; }
.tile-sub { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-viz { margin-top: auto; padding-top: 12px; }
.spark { display: block; width: 100%; height: 44px; overflow: visible; }
.spark .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .area { stroke: none; opacity: 0.1; }
.cores { display: flex; gap: 3px; align-items: flex-end; height: 14px; margin-bottom: 8px; }
.core { flex: 1; background: var(--grid); border-radius: 2px; position: relative; height: 100%; overflow: hidden; }
.core i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--s1); border-radius: 2px 2px 0 0; transition: height 0.6s ease; min-height: 1px; }
.meter { height: 8px; border-radius: 4px; background: var(--s1-track); overflow: hidden; display: flex; gap: 2px; }
.meter i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; transition: width 0.6s ease; }
.meter i.cache { background: color-mix(in srgb, var(--s1) 38%, var(--s1-track)); }
.meter[data-level="warning"] i:first-child { background: var(--warning); }
.meter[data-level="critical"] i:first-child { background: var(--critical); }
.legend-inline { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); margin-top: 8px; flex-wrap: wrap; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key::before { content: ""; width: 12px; height: 2px; border-radius: 1px; background: var(--k, var(--s1)); }
.key.box::before { width: 10px; height: 10px; border-radius: 3px; }

/* ----------------------------------------------------------- services -- */
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 10px;
}
.svc + .svc { box-shadow: 0 -1px 0 var(--line); }
.svc:hover { background: var(--raised); box-shadow: none; }
.svc:hover + .svc { box-shadow: none; }
.svc-name { font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-desc { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-stats { display: flex; gap: 14px; color: var(--ink-2); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.svc-stats span { min-width: 44px; }
.svc-stats .since { min-width: 64px; color: var(--ink-3); }

/* ---------------------------------------------------------------- vpn -- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 12px;
  padding: 0 12px 10px 0;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
table.data td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data td.r { font-variant-numeric: tabular-nums; white-space: nowrap; }
.device { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.device-name { font-weight: 560; }
.device-sub { color: var(--ink-3); font-size: 12.5px; }
.presence { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--ink-2); }
.presence i { width: 8px; height: 8px; border-radius: 50%; background: var(--axis); flex: none; }
.presence[data-s="online"] i { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.presence[data-s="online"] { color: var(--ink); }
.rate { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }
.bars14 { display: flex; align-items: flex-end; gap: 2px; height: 28px; width: 112px; }
.bars14 i { flex: 1; background: var(--s1); border-radius: 2px 2px 0 0; min-height: 1px; opacity: 0.9; }
.bars14 i.zero { background: var(--grid); opacity: 1; }
.vpn-foot { margin-top: 14px; color: var(--ink-3); font-size: 12.5px; }
.hero-date .where::before { content: "·"; margin-right: 10px; }
@media (max-width: 700px) {
  /* each device becomes a small card instead of a sideways-scrolling table */
  .vpn-table thead { display: none; }
  .vpn-table, .vpn-table tbody { display: block; }
  table.data.vpn-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.data.vpn-table tr:last-child { border-bottom: 0; }
  table.data.vpn-table td { border: 0; padding: 0; }
  table.data.vpn-table td[data-label] { display: flex; justify-content: space-between; gap: 12px; text-align: right; font-size: 12.5px; }
  table.data.vpn-table td[data-label]::before { content: attr(data-label); color: var(--ink-3); }
  table.data.vpn-table td.now, table.data.vpn-table td.where { grid-column: 1 / -1; }
  table.data.vpn-table td.bars { grid-row: 2 / span 2; grid-column: 2; align-self: center; }
  table.data.vpn-table td.now:has(.muted) { display: none; }
  table.data.vpn-table tr:first-child { padding-top: 0; }
}
@media (max-width: 560px) { .hero-date .where { display: none; } }

/* ----------------------------------------------------------- security -- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-label { color: var(--ink-2); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; margin-top: 2px; }
.stat-sub { color: var(--ink-3); font-size: 12.5px; }
.map-card { padding: 0; overflow: hidden; position: relative; }
.map-head { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; z-index: 1; }
.map-head > * { pointer-events: auto; }
.map-wrap { padding: 56px 12px 8px; }
.map { display: block; width: 100%; height: auto; }
.map .land { fill: none; stroke: var(--land); stroke-linecap: round; }
.map .land.hot { stroke: var(--land-hover); }
.map .arc { fill: none; stroke: var(--attack); stroke-width: 0.9; opacity: 0.2; }
.map .arc.live { opacity: 0.9; stroke-width: 1.5; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.6s ease-out forwards, fade 6s 1.6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 0.22; stroke-width: 1; } }
.map .pt { fill: var(--attack); stroke: var(--surface); stroke-width: 1.5; }
.map .pt.old { fill: color-mix(in srgb, var(--attack) 55%, var(--surface)); }
.map .halo { fill: var(--attack); opacity: 0.16; }
.map .hit { fill: transparent; cursor: default; }
.map .pt-hover { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.map .home { fill: var(--home); stroke: var(--surface); stroke-width: 2; }
.map .home-ring { fill: none; stroke: var(--home); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 3.2s ease-out infinite; }
.map .home-ring.b { animation-delay: 1.6s; }
@keyframes ring { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(3.2); opacity: 0; } }
.map .flash { fill: none; stroke: var(--attack); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 1.8s ease-out 2 forwards; }
.map-label { font: 500 11px var(--font); fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.map-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 20px 16px; color: var(--ink-3); font-size: 12.5px; }
.size-key { display: inline-flex; align-items: center; gap: 8px; }
.size-key svg { overflow: visible; }

.segmented { display: inline-flex; padding: 3px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; gap: 2px; }
.segmented button {
  border: 0;
  background: transparent;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, 0.08); }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 7px 0; align-items: center; }
.rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name .muted { margin-left: 6px; font-size: 12px; }
.rank-val { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.rank-bar { grid-column: 1 / -1; height: 6px; border-radius: 0 3px 3px 0; background: var(--s1); max-width: 100%; }
.rank-bar[data-kind="ssh"] { background: var(--s1); }
.rank-bar[data-kind="web"] { background: var(--s2); }
.rank-bar[data-kind="exploit"] { background: var(--s3); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 2px 14px; padding: 11px 0; border-top: 1px solid var(--line); align-items: baseline; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed-time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-what { font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-who { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-detail { grid-column: 2 / -1; color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-ban { font-size: 12px; color: var(--ink-3); white-space: nowrap; text-align: right; }
.feed li.fresh { animation: arrive 1.2s ease; }
@keyframes arrive { from { background: var(--accent-wash); } to { background: transparent; } }
.kind-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 8px; vertical-align: 0.05em; background: var(--s1); }
.kind-dot[data-kind="web"] { background: var(--s2); }
.kind-dot[data-kind="exploit"] { background: var(--s3); }

/* ------------------------------------------------------------ exposure -- */
.door { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 0 18px; position: relative; }
.door-src {
  grid-row: 1 / span 20;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 12.5px;
  border-right: 1px dashed transparent;
  position: relative;
}
.door-src svg { width: 30px; height: 30px; color: var(--ink-3); }
.door-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); position: relative; }
.door-row:first-of-type { border-top: 0; }
.door-row::before { content: ""; position: absolute; left: -18px; top: 50%; width: 12px; height: 1px; background: var(--line-2); }
.port { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--ink); }
.port small { color: var(--ink-3); font-weight: 400; }
.door-what { min-width: 0; }
.door-label { font-weight: 540; }
.door-sub { color: var(--ink-3); font-size: 12.5px; }
.vhosts { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 1px solid var(--line-2); display: grid; gap: 6px; }
.vhosts li { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.vhosts .mono { color: var(--ink); }
.fw { font-size: 12px; white-space: nowrap; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.fw i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.fw[data-fw="docker"] i { background: var(--warning); }
.fw[data-fw="open"] i { background: var(--critical); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .glyph { margin-top: 1px; }
.cert { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.cert:first-of-type { border-top: 0; padding-top: 0; }
.cert .meter { grid-column: 1 / -1; height: 6px; }

/* ------------------------------------------------------------- charts -- */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { display: flex; flex-direction: column; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.chart-value { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.chart-value small { font-size: 13px; color: var(--ink-3); font-weight: 450; margin-left: 4px; letter-spacing: 0; }
.chart { position: relative; height: 188px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--ink-3); font: 400 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { opacity: 0.1; }
.chart .ref { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.chart .ref-label { fill: var(--ink-3); font: 400 11px var(--font); }
.chart .xhair { stroke: var(--ink-3); stroke-width: 1; opacity: 0.6; shape-rendering: crispEdges; }
.chart .xdot { stroke: var(--surface); stroke-width: 2; }
.chart .col { transition: opacity 0.15s; }
.chart .col.dim { opacity: 0.45; }
.chart .gap-note { fill: var(--ink-3); font: 400 12px var(--font); }
.chart.loading { opacity: 0.55; transition: opacity 0.2s; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.chart-foot .legend-inline { margin-top: 0; }
.linkish { border: 0; background: none; padding: 2px 4px; margin: 0 -4px; color: var(--ink-3); font-size: 12px; border-radius: 6px; }
.linkish:hover { color: var(--ink); background: var(--raised); }
.table-view { margin-top: 12px; max-height: 240px; overflow: auto; border-top: 1px solid var(--line); }
.table-view table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 6px 10px 6px 0; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view th { position: sticky; top: 0; background: var(--surface); color: var(--ink-3); font-weight: 500; }

/* ------------------------------------------------------------ tooltip -- */
.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  min-width: 150px;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.35);
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s, transform 0.12s;
}
.tooltip.show { opacity: 1; transform: none; }
.tt-title { color: var(--ink-3); font-size: 11.5px; margin-bottom: 6px; }
.tt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tt-row + .tt-row { margin-top: 3px; }
.tt-key { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.tt-key.keyed::before { content: ""; width: 10px; height: 2px; border-radius: 1px; background: var(--k, var(--s1)); }
.tt-val { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.tt-text { color: var(--ink-2); }
.tt-strong { font-weight: 600; color: var(--ink); font-size: 13px; }

/* ------------------------------------------------------------ logbook -- */
.log-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
}
.filter:hover { color: var(--ink); border-color: var(--line-2); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.log { list-style: none; margin: 0; padding: 0; }
.log-day { margin: 18px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.log-day:first-child { margin-top: 0; }
.log-item { display: grid; grid-template-columns: 52px 22px minmax(0, 1fr); gap: 0 12px; padding: 9px 0; position: relative; }
.log-item::before { content: ""; position: absolute; left: 74px; top: 30px; bottom: -9px; width: 1px; background: var(--line); }
.log-item:last-child::before { display: none; }
.log-time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.log-icon { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line); color: var(--ink-2); }
.log-icon svg { width: 12px; height: 12px; }
.log-icon[data-level="good"] { color: var(--good-ink); }
.log-icon[data-level="warning"] { color: var(--warning-ink); }
.log-icon[data-level="serious"], .log-icon[data-level="critical"] { color: var(--critical-ink); }
.log-text { font-weight: 520; }
.log-count { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log-item { grid-template-columns: 84px 22px minmax(0, 1fr); }
.log-item::before { left: 106px; }
.log-detail { color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.log-empty { color: var(--ink-3); padding: 12px 0; }
.more { margin-top: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 10px;
  padding: 7px 14px;
  font-weight: 500;
  font-size: 13px;
}
.btn:hover { background: var(--raised); }

/* ----------------------------------------------------------------- ai -- */
.ai-card { border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 55%); }
.ai-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ai-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.ai-label svg { width: 17px; height: 17px; color: var(--accent); }
.ai-card-body { font-size: 14px; }
.ai-intro { margin: 0; color: var(--ink-2); line-height: 1.55; }
.ai-card-actions { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.ai-card-actions:empty { display: none; }
.ai-note { color: var(--ink-3); font-size: 12px; }
.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line-2));
  background: var(--accent-wash);
  color: var(--accent-ink);
  border-radius: 10px;
  padding: 7px 13px;
  font-weight: 560;
  font-size: 13px;
  white-space: nowrap;
}
.ai-btn svg { width: 15px; height: 15px; flex: none; }
.ai-btn:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.ai-btn:disabled { opacity: 0.55; cursor: progress; }
.ai-btn.small { padding: 3px 9px; font-size: 12px; border-radius: 8px; gap: 6px; }
.ai-btn.small svg { width: 13px; height: 13px; }
.ai-state { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; padding: 2px 0 4px; }
.ai-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
.ai-thinking { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.ai-thinking summary { cursor: pointer; width: max-content; }
.ai-thinking summary:hover { color: var(--ink-2); }
.ai-thinking-text { white-space: pre-wrap; max-height: 240px; overflow: auto; margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--sunken); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.ai-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; flex-wrap: wrap; }
.ai-foot-icon { width: 13px; height: 13px; color: var(--accent); flex: none; }
.ai-error { display: flex; gap: 8px; align-items: flex-start; color: var(--critical-ink); font-size: 13.5px; }
.ai-error.budget { color: var(--warning-ink); }
.ai-error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.ai-explain { grid-column: 2; margin-top: 10px; padding: 14px 16px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line); }
.feed .ai-explain { grid-column: 1 / -1; margin-top: 10px; }
.ai-wide .ai-card-body { max-width: 86ch; }

/* ----------------------------------------------------------- markdown -- */
.md { font-size: 14px; line-height: 1.62; color: var(--ink); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md .md-h { margin: 16px 0 6px; font-size: 14.5px; font-weight: 620; letter-spacing: -0.01em; }
.md h3.md-h { font-size: 16px; }
.md strong { font-weight: 620; }
.md .md-list { margin: 0 0 10px; padding-left: 20px; }
.md .md-list li { margin: 4px 0; }
.md .md-list li::marker { color: var(--ink-3); }
.md .md-code { font-family: var(--mono); font-size: 0.87em; padding: 1px 5px; border-radius: 5px; background: var(--sunken); border: 1px solid var(--line); font-variant-ligatures: none; }
.md-block { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--sunken); }
.md-block-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 12px; font-size: 11.5px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.md-block pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.md-block code { font-family: var(--mono); font-variant-ligatures: none; }
.code-copy { border: 0; background: transparent; color: var(--ink-3); font-size: 11.5px; border-radius: 6px; padding: 3px 7px; }
.code-copy:hover { background: var(--raised); color: var(--ink); }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 2px solid var(--line-2); color: var(--ink-2); }
.md-table { overflow-x: auto; margin: 0 0 12px; }
.md table { border-collapse: collapse; font-size: 13px; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 6px 14px 6px 0; text-align: left; vertical-align: top; }
.md th { color: var(--ink-3); font-weight: 500; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md-url { color: var(--ink-3); font-family: var(--mono); font-size: 0.85em; }

/* ------------------------------------------------------------ summary -- */
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sum-card { display: flex; flex-direction: column; gap: 12px; color: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
a.sum-card:hover { text-decoration: none; border-color: var(--line-2); }
.sum-head { display: flex; align-items: center; gap: 10px; }
.sum-head svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.sum-title { font-weight: 600; font-size: 14px; }
.sum-go { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
a.sum-card:hover .sum-go { color: var(--accent-ink); }
.sum-big { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.sum-big small { font-size: 14px; color: var(--ink-3); font-weight: 500; margin-left: 0.35em; letter-spacing: 0; }
.sum-sub { color: var(--ink-2); font-size: 13px; }
.sum-foot { margin-top: auto; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dots i { width: 13px; height: 13px; border-radius: 4px; background: var(--good); }
.dots i[data-level="warn"] { background: var(--warning); }
.dots i[data-level="down"] { background: var(--critical); }
.mini-cols { display: flex; align-items: flex-end; gap: 2px; height: 44px; }
.mini-cols i { flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; background: var(--s2); }
.mini-cols i.zero { background: var(--grid); }
.mini-axis { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.sum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 13px; }
.sum-list li { display: grid; grid-template-columns: 48px 18px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.sum-list .t { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.sum-list svg { width: 14px; height: 14px; color: var(--ink-3); align-self: center; }
.sum-list .x { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.sum-checks li { display: flex; gap: 8px; align-items: center; }
.span-2 { grid-column: span 2; }

/* ---------------------------------------------------------------- ask -- */
.ask-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.ask-main { display: flex; flex-direction: column; min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); }
.ask-empty { text-align: center; padding: 56px 12px 28px; max-width: 640px; margin: 0 auto; }
.ask-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent-wash); color: var(--accent); margin-bottom: 16px; }
.ask-mark svg { width: 28px; height: 28px; }
.ask-empty .page-sub { margin: 10px auto 0; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 26px; }
.suggestion { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink-2); }
.suggestion:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.thread { display: flex; flex-direction: column; gap: 24px; padding: 4px 0 28px; flex: 1; }
.thread:empty { display: none; }
.msg-user { align-self: flex-end; max-width: min(80%, 560px); padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-ai { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; }
.msg-avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.msg-avatar svg { width: 16px; height: 16px; }
.composer { position: sticky; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); margin-top: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 12px 12px 10px 16px; box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.45); }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); }
.composer textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; font: inherit; font-size: 15px; line-height: 1.5; max-height: 220px; color: var(--ink); }
.composer textarea::placeholder { color: var(--ink-3); }
.composer-bar { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.composer-hint { color: var(--ink-3); font-size: 12px; margin-left: auto; }
.send-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.send-btn svg { width: 18px; height: 18px; }
.send-btn:disabled { opacity: 0.4; cursor: default; }
.send-btn.stop { background: var(--ink); color: var(--surface); }
.segmented.small button { padding: 3px 9px; font-size: 12px; }
.ask-side { position: sticky; top: 24px; display: grid; gap: 16px; }
.ask-side .btn svg { width: 15px; height: 15px; }
.share-list { margin: 0 0 8px; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }
.small { font-size: 12.5px; }
.context-view { max-height: 360px; overflow: auto; margin: 10px 0 0; padding: 10px 12px; font-size: 11px; line-height: 1.5; background: var(--sunken); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-variant-ligatures: none; }
.spend-big { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; }
.feed.bans li { grid-template-columns: 86px minmax(0, 1fr) auto; }
.spend-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; }
.spend-row span:first-child { color: var(--ink-2); }
.spend-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 550; }
.spend-meter { margin: 8px 0 10px; }

/* ------------------------------------------------------------- footer -- */
.footer { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--ink-3); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------- states -- */
.empty { color: var(--ink-3); font-size: 13px; padding: 8px 0; }
.stale-note { display: inline-flex; gap: 6px; align-items: center; color: var(--warning-ink); font-size: 12.5px; }
.skeleton { color: transparent; background: var(--raised); border-radius: 6px; }

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-3, .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .ask-layout { grid-template-columns: minmax(0, 1fr); }
  .ask-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 960px) {
  :root { --gutter: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform 0.22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.35); background: var(--bg); }
  .app.nav-open .sidebar { transform: none; }
  .icon-btn.side-close { display: inline-grid; }
  .app { background: none; }
  .mobilebar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-title { font-weight: 600; font-size: 15px; flex: 1; }
  .live-mini { margin-right: 8px; }
  .content { padding-top: 22px; }
  .attention, .cols-2, .cols-3, .charts, .svc-grid { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door { grid-template-columns: minmax(0, 1fr); }
  .door-src { display: none; }
  .door-row::before { display: none; }
  .page-title { font-size: 24px; }
}
@media (max-width: 620px) {
  .tiles, .summary-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .tile { min-height: 0; }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-value { font-size: 23px; }
  .hero-sub { font-size: 15.5px; }
  .svc-stats .cpu { display: none; }
  .door-row { grid-template-columns: 72px minmax(0, 1fr); }
  .door-row .fw { grid-column: 2; }
  .feed li { grid-template-columns: minmax(0, 1fr) auto; }
  .feed-time { grid-column: 1 / -1; }
  .feed-detail { grid-column: 1 / -1; }
  .map-wrap { padding-top: 76px; }
  .ask-side { grid-template-columns: minmax(0, 1fr); }
  .composer-hint { display: none; }
  .msg-user { max-width: 92%; }
  .msg-ai { grid-template-columns: minmax(0, 1fr); }
  .msg-avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* -------------------------------------------------------------- login -- */
.login-body { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; position: relative; }
.login-map { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0.9; }
.login-map svg { width: min(1400px, 130vw); height: auto; }
.login-map .land { fill: none; stroke: var(--land); stroke-linecap: round; }
.login-card { position: relative; width: 100%; max-width: 380px; padding: 32px 28px 28px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; text-align: center; }
.login-brand svg { width: 40px; height: 40px; color: var(--accent); }
.login-brand h1 { margin: 0; font-size: 24px; font-weight: 620; letter-spacing: -0.03em; }
.login-brand p { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field input {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.btn-primary {
  width: 100%;
  height: 42px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 560;
  letter-spacing: -0.005em;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.login-error { min-height: 20px; margin: 12px 0 0; font-size: 13px; color: var(--critical-ink); text-align: center; }
.login-foot { margin-top: 20px; text-align: center; font-size: 12px; color: var(--ink-3); }
