/* LlamaRisk brand tokens.
 * Official: https://llamarisk.com/brand-kit (colors + fonts).
 * "site" = used on llamarisk.com but not listed in the brand kit.
 * "derived" = extension for charts/status; not on the site or in the kit.
 */

/* @import must stay first. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

/* RM Neue (CoType Foundry) is a licensed font, served from llamarisk.com (CORS open).
 * Reference it by URL only. Never copy or re-host the font files. */
@font-face { font-family: "RM Neue"; src: url(https://llamarisk.com/Fonts/rmneue-light.woff2) format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "RM Neue"; src: url(https://llamarisk.com/Fonts/rmneue-regular.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "RM Neue"; src: url(https://llamarisk.com/Fonts/rmneue-bold.woff2) format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  /* Official palette (brand kit) */
  --llama-cyan:  #0C2529; /* primary: dark surfaces, headings, logo on light */
  --llama-dune:  #F0EDE5; /* primary: logo + text on dark, warm paper */
  --llama-black: #1B1B1B; /* darkest surface, nav, top of hero gradient */
  --grey-03:     #3F4647; /* secondary text on light, dark-mode raised surface */
  --grey-02:     #7B8183; /* captions, axis labels, disabled (3.8:1 on white: large/secondary text only) */
  --grey-01:     #E5E7E8; /* hairlines, table stripes, tag backgrounds */
  --llama-white: #F9F9F9; /* light page background */

  /* Site extras (not in the brand kit) */
  --llama-ink:    #0B282D; /* site body-text color, near-identical to cyan */
  --llama-hero:   #122124; /* mid-point of the hero gradient */
  --llama-orange: #F24900; /* accent only: chart focus series, one highlight per view */

  /* Derived risk scale */
  --risk-low:      #2F7D5B;
  --risk-medium:   #D99A1E;
  --risk-high:     #F24900;
  --risk-critical: #B42318;

  /* Type (brand kit: RM Neue for headlines, Inter for body, charts and numbers) */
  --font-display: "RM Neue", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace; /* eyebrow labels on covers only */

  /* Shape: sharp corners */
  --radius: 0px;          /* cards, images, panels */
  --radius-control: 2px;  /* buttons, inputs */
  --radius-pill: 999px;   /* tags only */

  /* Semantic: light theme (default) */
  --bg: #FFFFFF;
  --bg-alt: var(--llama-white);
  --surface-subtle: #0C25290D;
  --text: var(--llama-cyan);
  --text-secondary: var(--grey-03);
  --text-muted: var(--grey-02);
  --border-subtle: var(--grey-01);
  --border: #0C252966;
  --border-strong: var(--llama-cyan);
  --accent: var(--llama-orange);
  --tag-bg: var(--grey-01);
  --tag-text: var(--llama-cyan);
}

/* Semantic: dark theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--llama-black);
    --bg-alt: var(--llama-cyan);
    --surface-subtle: #F0EDE51A;
    --text: var(--llama-dune);
    --text-secondary: #F0EDE5B3;
    --text-muted: #F0EDE580;
    --border-subtle: #F0EDE533;
    --border: #F0EDE566;
    --border-strong: var(--llama-dune);
    --tag-bg: #F0EDE526;
    --tag-text: var(--llama-dune);
  }
}
:root[data-theme="dark"] {
  --bg: var(--llama-black);
  --bg-alt: var(--llama-cyan);
  --surface-subtle: #F0EDE51A;
  --text: var(--llama-dune);
  --text-secondary: #F0EDE5B3;
  --text-muted: #F0EDE580;
  --border-subtle: #F0EDE533;
  --border: #F0EDE566;
  --border-strong: var(--llama-dune);
  --tag-bg: #F0EDE526;
  --tag-text: var(--llama-dune);
}

/* Signature hero: Llama Black fading into Llama Cyan */
.lr-hero {
  background: linear-gradient(180deg, #1B1B1B 0%, #122124 55%, #0C2529 100%);
  color: var(--llama-dune);
}
/* Signature cover: Llama Cyan with a soft glow (research and announcement covers) */
.lr-cover-bg {
  background: radial-gradient(ellipse 70% 60% at 30% 45%, #1D4A50 0%, #0F2D31 45%, #0A1F22 100%);
  color: var(--llama-dune);
}

/* =============================================================================
 * llamasentinel dashboard. One stylesheet for every page.
 * Idea: every screen reads left to right, from the headline to Aave.
 * A level rail on the left edge of each incident, the exposure line in the
 * middle of the incident page, the same hairlines and type scale everywhere.
 * ============================================================================= */

:root {
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 28px; --fs-2xl: 40px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --wrap: 1200px;
  --gutter: 16px;
  --lv-DIRECT: var(--risk-high);
  --lv-POSSIBLE: var(--risk-medium);
  --lv-UNRELATED: var(--grey-02);
  --lv-NOT_INCIDENT: var(--grey-01);
  --lv-UNSET: var(--grey-01);
  --vd-none: var(--risk-low);
  --vd-low: var(--risk-low);
  --vd-medium: var(--risk-medium);
  --vd-high: var(--risk-high);
  --ok: var(--risk-low);
  --warn: var(--risk-medium);
  --bad: var(--risk-critical);
  --panel: var(--bg-alt);
}
@media (min-width: 760px) { :root { --gutter: 32px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --panel: #F0EDE50A; --bad: #E5484D; }
}
:root[data-theme="dark"] { --panel: #F0EDE50A; --bad: #E5484D; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--fs-md); font-weight: 400; line-height: 1.6;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(28px, 4.4vw, var(--fs-2xl)); font-weight: 300; }
h2 { font-size: var(--fs-xl); font-weight: 300; }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--s3); }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[lang="zh"] { font-family: var(--font-body), "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }

/* ---------- frame ----------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.topbar { background: #1B1B1Bf2; color: var(--llama-dune); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; gap: var(--s5); min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--llama-dune); padding: var(--s3) 0; }
.wordmark { width: 112px; height: auto; display: block; }
.brand .product { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.7; padding-left: var(--s3); border-left: 1px solid #F0EDE54d; }
.nav { display: flex; gap: var(--s1); margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a, .nav button { color: #F0EDE5cc; text-decoration: none; font: 400 var(--fs-sm) var(--font-body); padding: var(--s2) var(--s3); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; }
.nav a:hover, .nav button:hover { color: var(--llama-dune); }
.nav a[aria-current="page"] { color: var(--llama-dune); border-bottom-color: var(--llama-dune); }
.nav form { margin: 0; }
@media (max-width: 640px) {
  .topbar { position: static; }
  .nav { margin-left: 0; width: 100%; justify-content: space-between; }
  .nav a, .nav button { padding: var(--s2) var(--s2); }
}
main { padding: var(--s6) 0 var(--s8); }
.footer { border-top: 1px solid var(--border-subtle); padding: var(--s5) 0; color: var(--text-muted); font-size: var(--fs-xs); }
.footer .wrap { display: flex; gap: var(--s4); justify-content: space-between; flex-wrap: wrap; }

/* ---------- page head and sections ----------------------------------------- */
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 var(--s3); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.pagehead { margin-bottom: var(--s6); }
.pagehead .lede { font-size: var(--fs-lg); font-weight: 300; color: var(--text-secondary); max-width: 72ch; margin-top: var(--s3); }
.meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-size: var(--fs-sm); color: var(--text-secondary); margin-top: var(--s4); }
.meta b { font-weight: 500; color: var(--text); }
.section { margin-top: var(--s7); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); border-bottom: 1px solid var(--border-strong); padding-bottom: var(--s3); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head .aside { font-size: var(--fs-sm); color: var(--text-secondary); }
.grid-2 { display: grid; gap: var(--s6); grid-template-columns: 1fr; }
@media (min-width: 980px) { .grid-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

/* ---------- small parts ----------------------------------------------------- */
.lvl { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; }
.lvl::before { content: ""; width: 10px; height: 10px; background: var(--lv, var(--grey-01)); flex: none; }
.lvl.NOT_INCIDENT::before, .lvl.UNSET::before { outline: 1px solid var(--border); outline-offset: -1px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--tag-bg); color: var(--tag-text); font-size: var(--fs-xs); line-height: 1.6; white-space: nowrap; }
.tag.state-failed { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.tag.state-researching { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.tag.state-researching::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; background: currentColor; vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .tag.state-researching::before { animation: none; } }
.verdict-word { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.verdict-word::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--vd, var(--grey-02)); }
.mark { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.mark svg { width: 14px; height: 14px; flex: none; }
.mark.ok { color: var(--ok); }
.mark.no { color: var(--text-secondary); }
.btn { display: inline-flex; align-items: center; gap: var(--s2); padding: 10px 16px; border-radius: var(--radius-control); background: var(--text); color: var(--bg); font: 500 var(--fs-sm) var(--font-body); border: 1px solid var(--text); cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn:hover { opacity: 0.9; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
input[type="search"], input[type="password"], input[type="text"], textarea {
  font: 400 var(--fs-md) var(--font-body); color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 10px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; font-size: var(--fs-sm); }
.hint-form { display: grid; gap: var(--s2); flex: 1 1 100%; max-width: 640px; justify-items: start; }
.hint-form label { font-weight: 600; color: var(--text); }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.notice { border: 1px solid var(--border); border-left: 4px solid var(--text); padding: var(--s3) var(--s4); font-size: var(--fs-sm); margin-bottom: var(--s5); }
.notice.bad { border-left-color: var(--bad); }
.empty { border: 1px dashed var(--border); padding: var(--s6) var(--s5); text-align: center; color: var(--text-secondary); }
.ext::after { content: "\2197"; font-size: 0.8em; margin-left: 2px; text-decoration: none; display: inline-block; color: var(--text-muted); }

/* ---------- filter bar ------------------------------------------------------ */
.filters { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); align-items: flex-end; margin-bottom: var(--s6); }
.filters .filter-group:last-child { flex: 1 1 300px; max-width: 520px; }
.filter-group { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.filter-group > .label { font-size: var(--fs-xs); color: var(--text-secondary); }
.chips { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border-subtle); width: fit-content; max-width: 100%; }
.chip { display: inline-flex; align-items: center; gap: var(--s2); padding: 6px 12px; font-size: var(--fs-sm); text-decoration: none; color: var(--text-secondary); border-right: 1px solid var(--border-subtle); white-space: nowrap; }
.chip:last-child { border-right: 0; }
.chip:hover { color: var(--text); background: var(--surface-subtle); }
.chip[aria-current="true"] { background: var(--text); color: var(--bg); }
.chip .n { font-size: var(--fs-xs); opacity: 0.7; }
.chip .sw { width: 8px; height: 8px; background: var(--lv); }
.search { display: flex; gap: var(--s2); }
.live-note { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: var(--s2); }
.live-note::before { content: ""; width: 6px; height: 6px; background: var(--ok); border-radius: 50%; }

/* ---------- incident timeline ---------------------------------------------- */
.tl-day { margin-bottom: var(--s6); }
.tl-day > .eyebrow { border-bottom: 1px solid var(--border-strong); padding-bottom: var(--s2); margin-bottom: 0; justify-content: space-between; }
.tl-row { display: grid; grid-template-columns: 4px 56px minmax(0, 1fr); gap: 0 var(--s4); border-bottom: 1px solid var(--border-subtle); text-decoration: none; color: inherit; position: relative; }
.tl-row:hover { background: var(--surface-subtle); }
.tl-row .rail { background: var(--lv); }
.tl-row .time { padding: var(--s4) 0; font-size: var(--fs-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.tl-row .body { padding: var(--s4) var(--s4) var(--s4) 0; display: grid; gap: var(--s2); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .tl-row .body { grid-template-columns: minmax(0, 1fr) 260px; gap: var(--s5); } }
.tl-row .title { font-size: var(--fs-lg); font-weight: 400; line-height: 1.3; font-family: var(--font-display); letter-spacing: -0.01em; }
.tl-row .title a { text-decoration: none; }
.tl-row .title a::after { content: ""; position: absolute; inset: 0; }
.tl-row .type { font-size: var(--fs-xs); color: var(--text-muted); }
.tl-row .title { margin-top: var(--s2); }
.tl-row .summary.bad { color: var(--bad); }
.tl-row .summary { font-size: var(--fs-sm); color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-row .tags { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
.tl-row .side { font-size: var(--fs-xs); color: var(--text-secondary); display: grid; gap: var(--s1); align-content: start; }
.tl-row .side .feeds { color: var(--text); font-size: var(--fs-sm); }

/* ---------- verdict banner -------------------------------------------------- */
.banner { display: grid; grid-template-columns: 8px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--border-subtle); margin-bottom: var(--s7); }
.banner .bar { background: var(--vd, var(--lv, var(--grey-02))); }
.banner .inner { padding: var(--s5); display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .banner .inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: var(--s6); } }
.banner .say { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.2; }
.banner .headline { font-size: var(--fs-md); margin-top: var(--s2); }
.banner .summary { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: var(--s2); max-width: 80ch; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s6); }
@media (min-width: 600px) { .kpis { grid-template-columns: repeat(4, auto); } }
.kpi .label { font-size: var(--fs-xs); color: var(--text-secondary); }
.kpi .value { font-size: var(--fs-xl); font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.kpi .value.accent { color: var(--accent); }
.banner form { margin: 0; }
.banner .actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; font-size: var(--fs-xs); color: var(--text-secondary); grid-column: 1 / -1; border-top: 1px solid var(--border-subtle); padding-top: var(--s4); }

/* ---------- exposure chain -------------------------------------------------- */
.chain-wrap { overflow-x: auto; padding-bottom: var(--s2); }
.chain { display: flex; align-items: stretch; min-width: min-content; }
.chain .col { display: flex; flex-direction: column; gap: var(--s4); justify-content: center; }
.node { position: relative; width: 156px; border: 1px solid var(--border); background: var(--bg); padding: var(--s3) var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s1); }
.node .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-secondary); display: flex; justify-content: space-between; gap: var(--s2); }
.node .lbl { font-family: var(--font-display); font-size: var(--fs-md); line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.node .lbl a { text-decoration: none; }
.node .dt { font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.5; overflow-wrap: anywhere; }
.node .amt { font-size: var(--fs-lg); font-weight: 300; font-variant-numeric: tabular-nums; }
.node .foot { margin-top: auto; padding-top: var(--s2); display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.node.news_item { border-style: solid; border-color: var(--border-subtle); background: var(--panel); }
.node.aave_asset { width: 188px; border: 1px solid var(--border-strong); box-shadow: inset 0 3px 0 var(--text); }
.node .pos { border-top: 1px solid var(--border-subtle); margin-top: var(--s2); padding-top: var(--s2); }
.node .dt.ok { color: var(--ok); font-weight: 500; }
.node.position { border-color: var(--border-strong); }
.node.position.safe .amt::after { content: " no debt"; font-size: var(--fs-xs); color: var(--ok); font-weight: 500; }
.node.end { border-style: dashed; color: var(--text-secondary); }
.edge { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; justify-content: center; align-items: stretch; padding: 0 var(--s2); }
.edge .line { height: 1px; background: var(--border-strong); position: relative; }
.edge .line::after { content: ""; position: absolute; right: -1px; top: -4px; border: 4.5px solid transparent; border-left: 7px solid var(--border-strong); border-right: 0; }
.edge .txt { font-size: 11px; line-height: 1.35; color: var(--text-secondary); text-align: center; margin-bottom: var(--s2); overflow-wrap: anywhere; }
.edge.short { width: 16px; padding: 0; }
.edge.short .line::after { display: none; }
.edge.dashed .line { background: none; border-top: 1px dashed var(--border-strong); height: 0; }
.branches { display: flex; flex-direction: column; gap: var(--s4); justify-content: center; position: relative; padding-left: var(--s4); }
.branches.many { border-left: 1px solid var(--border-strong); }
.branch { display: flex; align-items: center; position: relative; }
.branches.many .branch::before { content: ""; position: absolute; left: calc(-1 * var(--s4)); width: var(--s4); top: 50%; border-top: 1px solid var(--border-strong); }
.chain-legend { display: flex; gap: var(--s5); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-secondary); margin-top: var(--s4); }
.chain-legend .sw-dash { display: inline-block; width: 24px; border-top: 1px dashed var(--border-strong); vertical-align: middle; margin-right: 6px; }
.chain-legend .sw-line { display: inline-block; width: 24px; border-top: 1px solid var(--border-strong); vertical-align: middle; margin-right: 6px; }
@media (max-width: 1100px) {
  .chain-wrap { overflow: visible; }
  .chain, .branch { flex-direction: column; align-items: stretch; min-width: 0; }
  .chain .col { flex-direction: column; }
  .node, .node.aave_asset { width: 100%; }
  .edge { width: auto; flex-direction: row; align-items: center; gap: var(--s3); padding: var(--s2) 0 var(--s2) var(--s5); min-height: 40px; }
  .edge.short { width: auto; }
  .edge .line { width: 1px; height: 28px; order: -1; flex: none; }
  .edge.dashed .line { border-top: 0; border-left: 1px dashed var(--border-strong); width: 0; height: 28px; }
  .edge .line::after { right: auto; top: auto; bottom: -1px; left: -4px; border: 4.5px solid transparent; border-top: 7px solid var(--border-strong); border-bottom: 0; }
  .edge .txt { text-align: left; margin: 0; }
  .branches { padding-left: 0; }
  .branches.many { border-left: 0; gap: var(--s5); }
  .branches.many .branch::before { display: none; }
  .branches.many .branch { border-left: 1px solid var(--border-strong); padding-left: var(--s3); }
}

/* ---------- coverage lanes -------------------------------------------------- */
.lanes { display: grid; gap: 0; border-top: 1px solid var(--border-subtle); }
.lane { display: grid; grid-template-columns: 132px minmax(0, 1fr) 72px; gap: var(--s3); align-items: center; border-bottom: 1px solid var(--border-subtle); min-height: 36px; font-size: var(--fs-sm); }
.lane .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane .track { position: relative; height: 20px; }
.lane .track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border-subtle); }
.lane .dot { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--text); }
.lane .dot.first { background: var(--accent); width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.lane .first-at { font-size: var(--fs-xs); color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; }
.lane-axis { display: grid; grid-template-columns: 132px minmax(0, 1fr) 72px; gap: var(--s3); font-size: var(--fs-xs); color: var(--text-muted); padding-top: var(--s2); }
.lane-axis .ends { display: flex; justify-content: space-between; }
@media (max-width: 600px) { .lane, .lane-axis { grid-template-columns: 96px minmax(0, 1fr) 56px; } }

/* ---------- cluster items --------------------------------------------------- */
.items { display: grid; gap: 0; }
.item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--border-subtle); }
.item .when { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.item .when .d { display: block; font-size: var(--fs-xs); color: var(--text-secondary); }
.item .src { font-size: var(--fs-xs); color: var(--text-secondary); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-bottom: var(--s1); }
.item .orig { font-size: var(--fs-md); font-weight: 500; line-height: 1.45; }
.item .orig a { text-decoration: none; }
.item .orig a:hover { text-decoration: underline; }
.item .orig-body { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: var(--s1); }
.item .en { margin-top: var(--s3); padding-left: var(--s3); border-left: 2px solid var(--border); font-size: var(--fs-sm); }
.item .en .t { font-weight: 500; }
.item details { margin-top: var(--s2); font-size: var(--fs-xs); color: var(--text-secondary); }
.item summary { cursor: pointer; }
.ents { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.ent { font-size: var(--fs-xs); border: 1px solid var(--border-subtle); padding: 1px 8px; white-space: nowrap; }
.ent .r { color: var(--text-muted); margin-left: 4px; }
.ent.hit { border-color: var(--border-strong); }

/* ---------- sources --------------------------------------------------------- */
.sources { list-style: none; margin: 0; padding: 0; counter-reset: src; }
.sources li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-sm); align-items: start; }
.sources li::before { counter-increment: src; content: counter(src, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); padding-top: 2px; }
.sources .t { overflow-wrap: anywhere; }
.sources .u { display: block; font-size: var(--fs-xs); color: var(--text-secondary); overflow-wrap: anywhere; }
.sources .note { display: block; font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- tables ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
table.data th { text-align: left; font-weight: 500; font-size: var(--fs-xs); color: var(--text-secondary); border-bottom: 1px solid var(--border-strong); padding: var(--s2) var(--s3); white-space: nowrap; }
table.data td { border-bottom: 1px solid var(--border-subtle); padding: var(--s3); vertical-align: top; }
table.data th:first-child, table.data td:first-child { padding-left: 0; }
table.data .r { text-align: right; }
table.data tfoot td { border-top: 1px solid var(--border-strong); border-bottom: 0; font-weight: 500; }
@media (max-width: 700px) {
  table.data.stack thead { display: none; }
  table.data.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1) var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border-subtle); }
  table.data.stack td { border: 0; padding: 0; }
  table.data.stack td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-muted); }
  table.data.stack td.r { text-align: left; }
  table.data.stack tfoot tr { border-bottom: 0; }
}

/* ---------- state timeline -------------------------------------------------- */
.events { list-style: none; margin: 0; padding: 0; position: relative; }
.events::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; border-left: 1px solid var(--border); }
.events li { position: relative; padding: 0 0 var(--s4) var(--s6); font-size: var(--fs-sm); }
.events li::before { content: ""; position: absolute; left: 0; top: 6px; width: 11px; height: 11px; background: var(--bg); border: 1px solid var(--border-strong); }
.events li.state_change::before { background: var(--text); }
.events li.level_change::before { background: var(--lv, var(--text)); border-color: var(--lv, var(--text)); }
.events li.notification::before { border-radius: 50%; }
.events li.failed::before { background: var(--bad); border-color: var(--bad); }
.events .when { font-size: var(--fs-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.events .msg { overflow-wrap: anywhere; }
.events .actor { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

/* ---------- prose (model markdown) ----------------------------------------- */
.prose { font-size: var(--fs-md); max-width: 76ch; }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s3); }
.prose ul, .prose ol { padding-left: var(--s5); }
.prose li { margin-bottom: var(--s1); }
.prose h1, .prose h2, .prose h3, .prose h4 { font-size: var(--fs-lg); margin: var(--s5) 0 var(--s2); }
.prose code { background: var(--surface-subtle); padding: 1px 4px; }
.prose table { border-collapse: collapse; font-size: var(--fs-sm); }
.prose th, .prose td { border-bottom: 1px solid var(--border-subtle); padding: var(--s1) var(--s3); text-align: left; }
.prose blockquote { margin: 0 0 var(--s3); padding-left: var(--s3); border-left: 2px solid var(--border); color: var(--text-secondary); }

/* ---------- dependency map -------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--s6); }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats .kpi { padding: var(--s4) var(--s4) var(--s4) 0; }
.market { margin-bottom: var(--s6); }
.market-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); border-bottom: 1px solid var(--border-strong); padding-bottom: var(--s2); flex-wrap: wrap; }
.market-head h3 { font-size: var(--fs-lg); }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0; }
.asset-cell { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4) var(--s4) var(--s4) 0; border-bottom: 1px solid var(--border-subtle); text-decoration: none; color: inherit; min-width: 0; }
.asset-cell:hover .sym { text-decoration: underline; text-underline-offset: 3px; }
.asset-cell .row1 { display: flex; justify-content: space-between; gap: var(--s2); align-items: baseline; }
.asset-cell .sym { font-family: var(--font-display); font-size: var(--fs-lg); }
.asset-cell .sup { font-size: var(--fs-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.relbar { display: flex; gap: 2px; flex-wrap: wrap; }
.relbar span { font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 5px; border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.relbar span.on { border-color: var(--border-strong); color: var(--text); }
.flags { display: flex; gap: var(--s2); flex-wrap: wrap; }
.diffs { list-style: none; margin: 0; padding: 0; }
.diffs li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
.diffs .chg { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 3px; }
.diffs .chg.fact_added, .diffs .chg.asset_listed { color: var(--ok); }
.diffs .chg.fact_removed, .diffs .chg.asset_delisted { color: var(--bad); }
.diffs .chg.fact_changed, .diffs .chg.asset_changed { color: var(--text-secondary); }
.diffs .m { font-size: var(--fs-xs); color: var(--text-secondary); display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: 2px; }
.diffs .ba { font-size: var(--fs-xs); font-family: var(--font-mono); color: var(--text-secondary); margin-top: var(--s1); overflow-wrap: anywhere; }
.diffs .ba del { color: var(--bad); }
.diffs .ba ins { color: var(--ok); text-decoration: none; }
.facts { display: grid; gap: var(--s6); }
.fact-group h3 { font-size: var(--fs-lg); border-bottom: 1px solid var(--border-strong); padding-bottom: var(--s2); display: flex; justify-content: space-between; align-items: baseline; }
.fact { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); padding: var(--s3) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
@media (min-width: 760px) { .fact { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 160px; gap: var(--s4); } }
.fact .obj { font-weight: 500; }
.fact .obj .kind { font-weight: 400; color: var(--text-muted); font-size: var(--fs-xs); margin-left: var(--s2); }
.fact .val { color: var(--text-secondary); overflow-wrap: anywhere; }
.fact .src { font-size: var(--fs-xs); color: var(--text-secondary); display: grid; gap: 2px; }
.conf { display: inline-block; width: 48px; height: 4px; background: var(--border-subtle); vertical-align: middle; position: relative; }
.conf i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); }

/* ---------- feed health ----------------------------------------------------- */
.feeds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--s5); }
.feed { border: 1px solid var(--border-subtle); display: grid; grid-template-columns: 4px minmax(0, 1fr); }
.feed .rail { background: var(--st); }
.feed .in { padding: var(--s4) var(--s5) var(--s5); display: grid; gap: var(--s3); }
.feed .hd { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.feed .hd h3 { font-size: var(--fs-lg); }
.feed .st { font-size: var(--fs-xs); font-weight: 500; color: var(--st); white-space: nowrap; }
.feed.healthy { --st: var(--ok); }
.feed.stale, .feed.waiting { --st: var(--warn); }
.feed.failing { --st: var(--bad); }
.feed.disabled { --st: var(--grey-02); }
/* The triage stage sits above the feed grid, full width: one pipeline, read top to bottom. */
.feed.stage { margin-bottom: var(--s5); background: var(--panel); }
.feed.stage dl { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); }
.feed .url { font-size: var(--fs-xs); color: var(--text-secondary); overflow-wrap: anywhere; }
.feed dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin: 0; }
.feed dt { font-size: 11px; color: var(--text-muted); }
.feed dd { margin: 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.polls { display: flex; gap: 2px; align-items: flex-end; height: 24px; }
.polls i { flex: 1 1 0; max-width: 8px; min-width: 2px; background: var(--ok); height: 40%; }
.polls i.new { height: 100%; }
.polls i.nm { background: var(--border); height: 30%; }
.polls i.fail { background: var(--bad); height: 100%; }
.feed .err { font-size: var(--fs-xs); color: var(--bad); font-family: var(--font-mono); overflow-wrap: anywhere; border-left: 2px solid var(--bad); padding-left: var(--s2); }

/* ---------- login ----------------------------------------------------------- */
.login-page { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; }
.login-hero { display: grid; place-items: center; padding: var(--s7) var(--gutter); }
.login-card { width: 100%; max-width: 400px; display: grid; gap: var(--s5); }
.login-card .wordmark { width: 160px; color: var(--llama-dune); }
.login-card h1 { font-size: var(--fs-xl); color: var(--llama-dune); }
.login-card p { color: #F0EDE5b3; font-size: var(--fs-sm); margin: 0; }
.login-card label { font-size: var(--fs-xs); color: #F0EDE5b3; display: block; margin-bottom: var(--s2); }
.login-card input[type="password"] { background: #F0EDE50f; border-color: #F0EDE54d; color: var(--llama-dune); }
.login-card .btn { background: var(--llama-dune); color: var(--llama-cyan); border-color: var(--llama-dune); width: 100%; justify-content: center; }
.login-card .error { color: #FFB4A0; font-size: var(--fs-sm); border-left: 2px solid var(--accent); padding-left: var(--s3); }
.login-foot { color: #F0EDE580; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; padding: var(--s5) var(--gutter); text-align: center; }

/* ---------- level and verdict hooks ---------------------------------------- */
.L-DIRECT { --lv: var(--lv-DIRECT); }
.L-POSSIBLE { --lv: var(--lv-POSSIBLE); }
.L-UNRELATED { --lv: var(--lv-UNRELATED); }
.L-NOT_INCIDENT, .L-UNSET, .L- { --lv: var(--lv-NOT_INCIDENT); }
.V-none { --vd: var(--vd-none); }
.V-low { --vd: var(--vd-low); }
.V-medium { --vd: var(--vd-medium); }
.V-high { --vd: var(--vd-high); }
/* Not concluded: neutral, never a risk color. */
.V-unknown { --vd: var(--grey-02); }
.banner.V-unknown .bar { background: repeating-linear-gradient(135deg, var(--grey-02) 0 6px, transparent 6px 12px); }

/* ---------- incident page extras ------------------------------------------- */
.subhead { font-size: var(--fs-md); font-weight: 500; font-family: var(--font-body); letter-spacing: 0; margin: var(--s5) 0 var(--s2); }
.footnote { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--s2); }
details.poison { margin-top: var(--s5); border-top: 1px solid var(--border-subtle); padding-top: var(--s3); font-size: var(--fs-sm); }
details.poison summary { cursor: pointer; color: var(--text-secondary); }
dl.costs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin: var(--s5) 0 0; border-top: 1px solid var(--border-subtle); padding-top: var(--s4); }
dl.costs dt { font-size: 11px; color: var(--text-muted); }
dl.costs dd { margin: 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.section .table-wrap + .table-wrap { margin-top: var(--s5); }
.livebar { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; margin-top: var(--s4); font-size: var(--fs-sm); color: var(--text-secondary); }
.livebar b { color: var(--text); font-weight: 500; }
.note-sm { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-body); letter-spacing: 0; font-weight: 400; }
