/* Fenrir Watch — tokens come straight from the Fenrir mark: its disk, its bone wolf, its red arc.
   Healthy is quiet (bone); color is spent only on what needs the operator. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/atkinson-hyperlegible-next.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #171718;        /* the logo's disk */
  --hide: #1e1e20;         /* raised surfaces */
  --hide-2: #252527;
  --scar: #323134;         /* hairlines */
  --bone: #f4f0e8;         /* the wolf; healthy */
  --bone-2: #ede7da;
  --ash: #a8a39a;          /* secondary text */
  --dim: #75716b;          /* tertiary text */
  --blood: #ab393d;        /* the red arc; marks and fills */
  --blood-text: #e0676a;   /* red that reads as text on night */
  --ember: #d9a04a;        /* degraded */
  --frost: #8fb0c2;        /* stale, cold data */
  --focus: #f4f0e8;
  --radius: 6px;
  --gutter: clamp(16px, 3vw, 32px);
  --measure: 72ch;
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --t-xs: 0.8rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.25rem;
  --t-xl: 1.5625rem;
  --t-2xl: 1.953rem;
  --t-3xl: 2.441rem;
}

* { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--bone); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
h4 { font-size: var(--t-md); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.noscript, .boot { padding: 48px var(--gutter); color: var(--ash); }
.boot { display: flex; gap: 14px; align-items: center; min-height: 60vh; justify-content: center; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 100vh; }
.column { min-width: 0; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  padding: 18px 10px; border-right: 1px solid var(--scar); background: var(--night);
  z-index: 20;
}
[data-demo="true"] .rail { top: var(--demo-h); height: calc(100vh - var(--demo-h)); }
.rail-mark { display: grid; place-items: center; margin: 0 auto 18px; width: 56px; height: 56px; }
.rail-mark img { width: 56px; height: 56px; }
.rail-link {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: var(--radius);
  color: var(--ash); text-decoration: none; font-size: var(--t-xs); font-weight: 600;
  position: relative;
}
.rail-link svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail-link:hover { color: var(--bone); background: var(--hide); }
.rail-link[aria-current="page"] { color: var(--bone); background: var(--hide-2); }
.rail-link[aria-current="page"]::before {
  content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--blood);
}
.rail-link .badge {
  position: absolute; top: 6px; right: 14px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--blood); color: var(--bone); font-size: 11px; line-height: 16px;
  text-align: center;
}
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-user { font-size: var(--t-xs); color: var(--dim); text-align: center; word-break: break-all; }

/* One header on every page: where you are and how fresh the data is. */
.topbar {
  display: flex; align-items: center; gap: 12px; min-height: 52px;
  position: sticky; top: 0; z-index: 15; padding: 10px var(--gutter);
  background: rgba(23, 23, 24, 0.96); border-bottom: 1px solid var(--scar); backdrop-filter: blur(8px);
}
[data-demo="true"] .topbar { top: var(--demo-h); }
.topbar strong { font-size: var(--t-md); }
.topbar .topbar-logo, .topbar .topbar-signout { display: none; }
.freshness {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--t-sm); color: var(--ash); text-align: right;
}
.freshness::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.freshness[data-state="healthy"]::before { background: var(--bone-2); }
.freshness[data-state="stale"] { color: var(--ember); }
.freshness[data-state="stale"]::before { background: transparent; border: 2px solid var(--ember); }
.freshness[data-state="down"] { color: var(--blood-text); }
.freshness[data-state="down"]::before { background: var(--blood); border-radius: 1px; clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 10px; height: 10px; }

/* Fixture previews carry this band on every page; production never renders it. */
:root { --demo-h: 0px; }
[data-demo="true"] { --demo-h: 34px; }
.demo-band {
  position: sticky; top: 0; z-index: 40; height: var(--demo-h);
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px;
  background: repeating-linear-gradient(135deg, #3a2c14 0 12px, #2b2111 12px 24px);
  border-bottom: 1px solid var(--ember); color: var(--ember); font-size: var(--t-sm);
  white-space: nowrap; overflow: hidden;
}
.demo-band strong { color: #f3c77b; }

.main { min-width: 0; padding: 28px var(--gutter) 64px; }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.page-head h1 { font-size: var(--t-2xl); }
.page-head .lede { color: var(--ash); max-width: var(--measure); }
.stamp { color: var(--dim); font-size: var(--t-sm); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: auto 0 0 0; height: auto; top: auto;
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--scar);
    background: rgba(23, 23, 24, 0.97); backdrop-filter: blur(8px);
  }
  [data-demo="true"] .rail { top: auto; height: auto; }
  .rail-mark, .rail-foot, .rail-link[data-route="system"], .rail-link[data-route="products"] { display: none; }
  .rail-link { flex: 1; padding: 6px 2px; font-size: 11px; min-width: 0; }
  .rail-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-link[aria-current="page"]::before { left: 20%; right: 20%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .rail-link .badge { right: 18%; }
  .topbar { padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 10px; flex-wrap: wrap; }
  .topbar .topbar-logo { display: block; width: 28px; height: 28px; }
  .topbar .topbar-signout { display: inline-flex; margin-left: auto; }
  .headline { font-size: var(--t-2xl); }
  .freshness { order: 3; width: 100%; margin-left: 0; font-size: var(--t-xs); text-align: left; }
  .demo-band span { display: none; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .page { gap: 32px; }
  .page-head h1 { font-size: var(--t-xl); }
}

/* ---------- state marks: glyph + word, never color alone ---------- */
.state {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: var(--t-sm); font-weight: 600; color: var(--bone-2);
}
.state::before {
  content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%;
  background: var(--bone-2);
}
.state[data-state="degraded"] { color: var(--ember); }
.state[data-state="degraded"]::before { background: var(--ember); border-radius: 2px; transform: rotate(45deg); width: 8px; height: 8px; }
.state[data-state="failing"], .state[data-state="down"] { color: var(--blood-text); }
.state[data-state="failing"]::before, .state[data-state="down"]::before {
  background: var(--blood); border-radius: 1px; width: 10px; height: 10px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.state[data-state="stale"] { color: var(--frost); }
.state[data-state="stale"]::before { background: transparent; border: 2px solid var(--frost); width: 10px; height: 10px; }
.state[data-state="unknown"] { color: var(--ash); }
.state[data-state="unknown"]::before { background: repeating-linear-gradient(135deg, var(--ash) 0 2px, transparent 2px 4px); border: 1px solid var(--ash); }
.state[data-state="warming"], .state[data-state="pending"] { color: var(--ash); }
.state[data-state="warming"]::before, .state[data-state="pending"]::before { background: transparent; border: 2px dashed var(--ash); }
.state[data-state="disabled"] { color: var(--dim); font-weight: 500; }
.state[data-state="disabled"]::before { background: transparent; border: 1px solid var(--dim); }
.tone-healthy { color: var(--bone); }
.tone-degraded { color: var(--ember); }
.tone-down { color: var(--blood-text); }
.tone-unknown, .tone-disabled { color: var(--ash); }

/* ---------- brief ---------- */
.brief-page { max-width: 960px; gap: 36px; }
.verdict-block { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 28px; align-items: center; }
.verdict-block.unconfirmed { opacity: 0.55; }
.verdict-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.headline { font-size: clamp(var(--t-2xl), 4.2vw, var(--t-3xl)); font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; }
.sentence { color: var(--bone-2); font-size: var(--t-lg); max-width: 60ch; line-height: 1.4; }
.tone-healthy { color: var(--bone); }
.tone-degraded { color: var(--ember); }
.tone-down { color: var(--blood-text); }
.tone-unknown, .tone-disabled { color: var(--ash); }

/* The Fenrir ring, reduced to a supporting mark: the logo inside its own status arcs. */
.ring-wrap { position: relative; width: 112px; height: 112px; }
.ring { width: 100%; height: 100%; overflow: visible; }
.ring-logo { position: absolute; inset: 22%; width: 56%; height: 56%; }
.ring .track { stroke: var(--scar); fill: none; }
.ring .tick { stroke-linecap: butt; }
.ring .tick[data-state="healthy"] { stroke: var(--bone-2); }
.ring .tick[data-state="degraded"] { stroke: var(--ember); }
.ring .tick[data-state="failing"], .ring .tick[data-state="down"] { stroke: var(--blood); }
.ring .tick[data-state="stale"] { stroke: var(--frost); }
.ring .tick[data-state="unknown"], .ring .tick[data-state="warming"], .ring .tick[data-state="pending"] { stroke: var(--ash); stroke-dasharray: 4 3; }
.ring .pendant { fill: var(--night); stroke-width: 6; stroke: var(--ash); }
.ring .pendant[data-state="healthy"] { stroke: var(--bone-2); }
.ring .pendant[data-state="degraded"] { stroke: var(--ember); }
.ring .pendant[data-state="down"] { stroke: var(--blood); }

.indicators { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--scar); border-bottom: 1px solid var(--scar); }
.indicators li + li { border-left: 1px solid var(--scar); }
.indicators a { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; text-decoration: none; height: 100%; }
.indicators li:first-child a { padding-left: 0; }
.indicators a:hover { background: var(--hide); }
.indicators .label { color: var(--ash); font-size: var(--t-sm); font-weight: 600; }
.indicators .state { font-size: var(--t-md); white-space: normal; }
@media (max-width: 620px) {
  .indicators { grid-template-columns: minmax(0, 1fr); }
  .indicators li + li { border-left: 0; border-top: 1px solid var(--scar); }
  .indicators a { padding: 12px 0; flex-direction: row; justify-content: space-between; align-items: baseline; }
}

.attention-block, .activity { display: flex; flex-direction: column; gap: 12px; }
.attention-block h2, .activity h2 { font-size: var(--t-lg); }
.attention { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--scar); }
.attention li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--scar); }
.attention .what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attention .what > span:first-of-type { color: var(--bone-2); }
.attention .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.attention .sev { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; }
.attention .sev[data-severity="critical"] { background: var(--blood); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; width: 12px; height: 11px; }
.attention .sev[data-severity="warning"] { background: var(--ember); border-radius: 2px; transform: rotate(45deg); width: 8px; height: 8px; }
.attention .sev[data-severity="notice"] { border: 2px solid var(--ash); }
@media (max-width: 620px) {
  .attention li { grid-template-columns: 18px minmax(0, 1fr); }
  .attention .side { grid-column: 2; flex-direction: row; justify-content: space-between; align-items: center; }
}

.activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; border-top: 1px solid var(--scar); padding-top: 14px; }
.activity .window { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.activity h3 { font-size: var(--t-md); }
.counts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.counts a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius); background: var(--hide); text-decoration: none; }
.counts a:hover { background: var(--hide-2); }
.counts strong { font-size: var(--t-xl); line-height: 1.1; }
.counts span { color: var(--ash); font-size: var(--t-sm); }
@media (max-width: 760px) { .activity-grid { grid-template-columns: minmax(0, 1fr); } }

.deeper { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: var(--t-sm); color: var(--ash); border-top: 1px solid var(--scar); padding-top: 14px; }
.deeper a { color: var(--ash); }

@media (max-width: 620px) {
  .verdict-block { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: start; }
  .ring-wrap { width: 64px; height: 64px; }
  .sentence { font-size: var(--t-md); }
}

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: var(--t-sm); }
.facts dt { color: var(--ash); }
.facts dd { margin: 0; color: var(--bone-2); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .facts { grid-template-columns: minmax(0, 1fr); } .facts dd { margin-bottom: 6px; } }
.muted { color: var(--ash); }
.dim { color: var(--dim); }
.small { font-size: var(--t-sm); }
.xs { font-size: var(--t-xs); }
.nowrap { white-space: nowrap; }

/* ---------- system ---------- */
.system-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px 48px; }
.strips { display: flex; flex-direction: column; gap: 8px; }
.strip-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: center; font-size: var(--t-sm); }
.strip { display: flex; gap: 1px; height: 18px; }
.strip i { flex: 1; min-width: 1px; background: var(--scar); border-radius: 1px; }
.strip i[data-state="healthy"] { background: #4b4944; }
.strip i[data-state="degraded"] { background: var(--ember); }
.strip i[data-state="failing"], .strip i[data-state="down"] { background: var(--blood); }
.strip i[data-state="stale"] { background: var(--frost); }
.strip i[data-state="unknown"], .strip i[data-state="pending"], .strip i[data-state="warming"] { background: repeating-linear-gradient(135deg, var(--ash) 0 2px, transparent 2px 4px); }
.strip i[data-state="disabled"] { background: transparent; }
.strip-axis { display: flex; justify-content: space-between; color: var(--dim); font-size: var(--t-xs); margin-left: 142px; }
@media (max-width: 620px) {
  .strip-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .strip-axis { margin-left: 0; }
}

/* Expandable detail whose open state survives refreshes. */
details.more > summary { cursor: pointer; color: var(--ash); font-size: var(--t-sm); min-height: 36px; display: flex; align-items: center; gap: 6px; }
details.more > summary::before { content: "+"; display: inline-block; width: 1em; font-weight: 700; }
details[open].more > summary::before { content: "\2212"; }
details.more[open] { display: flex; flex-direction: column; gap: 10px; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--scar); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th { text-align: left; font-weight: 600; color: var(--ash); padding: 10px 12px 8px 0; white-space: nowrap; }
td { padding: 11px 12px 11px 0; border-top: 1px solid var(--scar); vertical-align: top; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--hide); }
td .sub { display: block; color: var(--dim); font-size: var(--t-xs); margin-top: 2px; }

.cards { display: none; }
@media (max-width: 760px) {
  .table-wrap.collapsible { display: none; }
  .cards { display: flex; flex-direction: column; border-top: 1px solid var(--scar); }
}
.card-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 2px;
  border-bottom: 1px solid var(--scar); text-decoration: none;
}
.card-row:hover { background: var(--hide); }
.card-row .title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.card-row .meta { grid-column: 1 / -1; color: var(--ash); font-size: var(--t-sm); display: flex; flex-wrap: wrap; gap: 2px 14px; }

/* ---------- controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field .label { font-size: var(--t-xs); color: var(--ash); font-weight: 600; }
input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="number"], select, textarea {
  background: var(--hide); border: 1px solid var(--scar); border-radius: var(--radius);
  padding: 9px 11px; min-height: 42px; color: var(--bone); min-width: 0;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--blood-text); }
.grow { flex: 1 1 260px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid var(--scar); background: var(--hide-2); cursor: pointer;
  font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ash); }
.btn.primary { background: var(--bone); color: var(--night); border-color: var(--bone); }
.btn.primary:hover { background: #fffaf0; }
.btn.danger { border-color: var(--blood); color: var(--blood-text); background: transparent; }
.btn.quiet { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: var(--t-sm); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--scar); background: transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: var(--t-sm); color: var(--ash); min-height: 34px;
}
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--bone); color: var(--night); border-color: var(--bone); font-weight: 600; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: var(--t-sm); cursor: pointer; min-height: 34px; }
.check input { width: 18px; height: 18px; accent-color: var(--bone); }

/* ---------- banners ---------- */
.banner { border: 1px solid var(--scar); border-left: 4px solid var(--ash); border-radius: var(--radius); padding: 12px 14px; background: var(--hide); display: flex; flex-direction: column; gap: 4px; }
.banner.warn { border-left-color: var(--ember); }
.banner.bad { border-left-color: var(--blood); }
.banner.good { border-left-color: var(--bone); }
.banner strong { font-weight: 700; }
.empty { color: var(--ash); padding: 28px 0; border-top: 1px solid var(--scar); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.skeleton { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--hide) 0, var(--hide-2) 50%, var(--hide) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- detail pages ---------- */
.crumbs { font-size: var(--t-sm); color: var(--ash); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--ash); }
.questions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--scar); }
.questions > div { padding: 16px 18px 16px 0; display: flex; flex-direction: column; gap: 6px; }
.questions > div + div { padding-left: 18px; border-left: 1px solid var(--scar); }
.questions .q { color: var(--ash); font-size: var(--t-sm); }
.questions .a { font-size: var(--t-lg); font-weight: 700; }
@media (max-width: 760px) {
  .questions { grid-template-columns: minmax(0, 1fr); }
  .questions > div, .questions > div + div { padding: 14px 0; border-left: 0; }
  .questions > div + div { border-top: 1px solid var(--scar); }
}
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px 48px; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.section { display: flex; flex-direction: column; gap: 12px; }
.section > h2 { font-size: var(--t-lg); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--scar); }
.list > li { padding: 10px 0; border-bottom: 1px solid var(--scar); display: flex; flex-direction: column; gap: 3px; }
.list .kind { font-size: var(--t-xs); color: var(--dim); }
.note { color: var(--ash); font-size: var(--t-sm); max-width: var(--measure); }

/* ---------- events timeline ---------- */
.day { font-size: var(--t-sm); color: var(--ash); font-weight: 700; padding: 18px 0 6px; }
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--scar); }
.event { display: grid; grid-template-columns: 58px 14px minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--scar); }
.event .time { color: var(--dim); font-size: var(--t-sm); }
.event .mark { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; border: 2px solid var(--ash); }
.event[data-severity="notice"] .mark { border-color: var(--bone-2); background: var(--bone-2); }
.event[data-severity="warning"] .mark { border-color: var(--ember); background: var(--ember); border-radius: 2px; transform: rotate(45deg); width: 9px; height: 9px; }
.event[data-severity="critical"] .mark { border: 0; background: var(--blood); border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.event .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.event .what { font-weight: 600; overflow-wrap: anywhere; }
.event .meta { color: var(--ash); font-size: var(--t-sm); display: flex; flex-wrap: wrap; gap: 2px 12px; }
.event.gap { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,0.025) 8px 16px); }
.prov { font-size: var(--t-xs); border: 1px solid var(--scar); border-radius: 4px; padding: 0 5px; color: var(--ash); }
.prov[data-provenance="historical"] { border-style: dashed; }
.load-more { margin-top: 16px; }
.story .story-headline { color: var(--bone); font-weight: 600; }
.event.story[data-outcome="failed"] .story-headline, .event.story[data-outcome="retrying"] .story-headline { color: var(--ember); }
.steps-list { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--scar); display: flex; flex-direction: column; gap: 6px; font-size: var(--t-sm); }
.steps-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 10px; }
.steps-list .t { color: var(--dim); grid-row: span 2; }
.steps-list li > span:not(.t):not(.prov) { color: var(--ash); }
.steps-list .prov { justify-self: start; }
.steps-list li[data-severity="warning"] strong { color: var(--ember); }
/* Counted new events float over the list instead of pushing it down. */
.new-events { position: sticky; top: calc(64px + var(--demo-h)); height: 0; z-index: 12; display: flex; justify-content: center; overflow: visible; }
.new-pill { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); background: var(--bone); color: var(--night); border-color: var(--bone); }

/* ---------- diagnosis ---------- */
.verdict { display: flex; flex-direction: column; gap: 8px; padding: 18px 0; border-top: 1px solid var(--scar); }
.verdict .headline { font-size: var(--t-2xl); max-width: none; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--scar); }
.steps li { display: grid; grid-template-columns: 26px 140px minmax(0, 1fr); gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--scar); align-items: baseline; }
.steps .icon { font-weight: 800; text-align: center; }
.steps [data-step="ok"] .icon { color: var(--bone); }
.steps [data-step="blocked"] .icon { color: var(--blood-text); }
.steps [data-step="unknown"] .icon { color: var(--frost); }
.steps [data-step="info"] .icon { color: var(--ash); }
.steps .check-name { color: var(--ash); font-size: var(--t-sm); }
@media (max-width: 620px) { .steps li { grid-template-columns: 26px minmax(0, 1fr); } .steps .detail { grid-column: 2; } }

/* ---------- configuration ---------- */
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; font-size: var(--t-sm); color: var(--dim); counter-reset: step; }
.flow li { display: flex; align-items: center; gap: 8px; counter-increment: step; }
.flow li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--scar); font-size: var(--t-xs); }
.flow li[data-done="true"] { color: var(--bone-2); }
.flow li[data-done="true"]::before { background: var(--bone); color: var(--night); border-color: var(--bone); }
.flow li[data-current="true"] { color: var(--bone); font-weight: 700; }
.flow li[data-current="true"]::before { border-color: var(--bone); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--scar); overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; text-decoration: none; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--ash); font-weight: 600; white-space: nowrap; min-height: 44px; }
.tab[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--blood); }
.editor { display: flex; flex-direction: column; gap: 16px; }
.filter-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) minmax(90px, 140px) auto; gap: 8px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--scar); }
@media (max-width: 760px) { .filter-row { grid-template-columns: minmax(0, 1fr); } }
.setting-group { display: flex; flex-direction: column; }
.setting-group > h3 { font-size: var(--t-md); padding: 16px 0 8px; }
.setting { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 6px 18px; align-items: center; padding: 10px 0; border-top: 1px solid var(--scar); }
.setting .name { font-weight: 600; min-width: 0; }
.setting .values { font-size: var(--t-xs); color: var(--ash); display: flex; flex-direction: column; gap: 1px; }
.setting .control { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.setting .control input[type="number"] { width: 96px; }
.setting .name { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.setting .hint { flex-basis: 100%; }
.setting .hint[data-blocked="true"] { color: var(--dim); }
.adoption { padding: 10px 0; border-top: 1px solid var(--scar); border-bottom: 1px solid var(--scar); }
.setting.changed { background: linear-gradient(90deg, rgba(244, 240, 232, 0.06), transparent 70%); }
@media (max-width: 760px) { .setting { grid-template-columns: minmax(0, 1fr); } }
.impact { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--scar); }
.impact li { padding: 12px 0; border-bottom: 1px solid var(--scar); display: flex; flex-direction: column; gap: 4px; }
.impact li[data-kind="warning"] strong { color: var(--ember); }
.impact li[data-kind="incomplete"] strong, .impact li .incomplete { color: var(--frost); }
.impact details { font-size: var(--t-sm); color: var(--ash); }
.errors { margin: 0; padding-left: 18px; color: var(--blood-text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(0deg, var(--night) 70%, transparent); padding: 14px 0 10px; z-index: 5; }
@media (max-width: 760px) { .sticky-actions { bottom: calc(62px + env(safe-area-inset-bottom)); } }
.revision { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--scar); }
.revision .meta { color: var(--ash); font-size: var(--t-sm); }
details.diff summary { cursor: pointer; color: var(--ash); font-size: var(--t-sm); }
details.diff pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--t-xs); color: var(--bone-2); background: var(--hide); padding: 10px; border-radius: var(--radius); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login .mark { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.login .mark img { width: 64px; height: 64px; }
.login h1 { font-size: var(--t-xl); }
.login .error { color: var(--blood-text); min-height: 1.5em; }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 60; display: flex; justify-content: flex-end; }
.drawer { width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--night); border-left: 1px solid var(--scar); padding: 24px var(--gutter); display: flex; flex-direction: column; gap: 18px; }
.drawer header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.chain { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--scar); }
.chain li { padding: 6px 0 14px 16px; position: relative; }
.chain li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--bone-2); }
.chain .t { color: var(--ash); font-size: var(--t-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .state::before, .attention .sev, .event .mark { forced-color-adjust: none; }
}

details.disabled-stores > summary { cursor: pointer; color: var(--ash); padding: 10px 0; border-top: 1px solid var(--scar); font-size: var(--t-sm); min-height: 44px; display: flex; align-items: center; }
.skeleton.w-40 { width: 40%; }
.skeleton.w-70 { width: 70%; }
.field.narrow { max-width: 220px; }
details.type-filter > summary { cursor: pointer; color: var(--ash); font-size: var(--t-sm); min-height: 36px; display: flex; align-items: center; margin-bottom: 8px; }
details.type-filter > summary::before, details.disabled-stores > summary::before { content: "+"; display: inline-block; width: 1.2em; font-weight: 700; }
details[open].type-filter > summary::before, details[open].disabled-stores > summary::before { content: "−"; }
details > summary::-webkit-details-marker { display: none; }
