/* platform console. Served at /console.css so the content security policy
   can say style-src 'self' and nothing more: no inline styles, so a size that
   comes from data is an SVG attribute, never a style. */

:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --sunken: #f0f1f4;
  --hover: #f6f7f9;
  --ink: #14161a;
  --muted: #565c68;
  --line: #e3e5ea;
  --line-strong: #cfd2d9;
  --accent: #2257d0;
  --ok: #17693c;
  --ok-bg: #e4f4ea;
  --warn: #7d5100;
  --warn-bg: #fcf0d3;
  --bad: #b3261e;
  --bad-bg: #fce8e6;
  --info: #2f50a0;
  --info-bg: #e6edfb;
  --neutral-bg: #eceef1;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --sidebar: 228px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #16191d;
    --sunken: #1d2126;
    --hover: #1b1f24;
    --ink: #e9eaed;
    --muted: #9ba2ae;
    --line: #262a30;
    --line-strong: #363b43;
    --accent: #8ab4f8;
    --ok: #7fd1a0;
    --ok-bg: #12301f;
    --warn: #f5cf6b;
    --warn-bg: #352a0e;
    --bad: #f7a29a;
    --bad-bg: #3d1a18;
    --info: #a8c7fa;
    --info-bg: #1a2a45;
    --neutral-bg: #252a31;
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* The frame: a sidebar, and everything else beside it. */

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 10px 24px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.stage { display: flex; flex-direction: column; min-width: 0; }

.brand { color: var(--ink); font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand small { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.sidebar .brand { display: block; padding: 0 10px 12px; font-size: 15px; }

nav.sections a {
  display: block;
  padding: 5px 10px;
  border-radius: 7px;
  color: var(--muted);
}
nav.sections a:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
nav.sections a[aria-current="page"] { background: var(--sunken); color: var(--ink); font-weight: 600; }
nav.sections .group { margin: 16px 0 4px; padding: 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; }

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 28px;
  background: var(--bg);
}
header.top .brand, .menu { display: none; }

.feed-status { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }

main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 4px 28px 40px; flex: 1; }

footer.bottom { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px 24px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

/* A page's head. */

h1 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 4px; overflow-wrap: anywhere; }
h2 { font-size: 15px; font-weight: 600; margin: 28px 0 10px; }
p.lede { margin: 0 0 12px; color: var(--muted); }
p { overflow-wrap: anywhere; }

details.about { margin: -4px 0 18px; color: var(--muted); font-size: 13px; }
details.about summary { width: fit-content; cursor: pointer; color: var(--accent); }
details.about p { max-width: 72ch; margin: 8px 0 0; }

.crumbs { margin: 0 0 2px; color: var(--muted); font-size: 13px; }

.jump { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 16px; font-size: 13px; }
/* Older and newer, under a segment's heading: links big enough to tap. */
.pager { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 0 0 12px; font-size: 14px; }
.pager a { display: inline-flex; align-items: center; min-height: 32px; }

/* Status. */

.banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: 0 0 16px;
  border: 1px solid transparent;
  overflow-wrap: anywhere;
}
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--info); border-color: var(--info); }

.verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 12px 16px;
  margin: 4px 0 8px;
  border-radius: var(--radius);
  background: var(--neutral-bg);
  color: var(--muted);
}
.verdict strong { font-size: 15px; font-weight: 650; color: var(--ink); }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.warn { background: var(--warn-bg); color: var(--warn); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.verdict.ok strong, .verdict.warn strong, .verdict.bad strong { color: inherit; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 8px 1px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  line-height: 18px;
  white-space: nowrap;
  background: var(--neutral-bg);
  color: var(--muted);
}
.badge::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }

@media (prefers-reduced-motion: no-preference) {
  .badge.pulse::before { animation: pulse 2s ease-in-out infinite; }
  .tile, nav.sections a, tbody td { transition: background-color 120ms ease, border-color 120ms ease; }
  @keyframes pulse { 50% { opacity: 0.35; } }
}

/* Surfaces. */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 8px;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--ink);
}
.tile:hover { border-color: var(--line-strong); background: var(--hover); text-decoration: none; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 26px; line-height: 1.3; font-weight: 650; letter-spacing: -0.02em; margin: 2px 0; }
.tile .detail { font-size: 13px; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.panel + .panel { margin-top: 12px; }

.rows { overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--hover); text-decoration: none; }
.row-text { display: flex; flex-direction: column; min-width: 0; }
.row-what { font-weight: 550; overflow-wrap: anywhere; }
.row-detail { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; font-weight: 550; color: var(--muted); background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; }

.mono, code { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
/* An identity or a path: broken anywhere rather than pushing the table wide. */
.id { overflow-wrap: anywhere; min-width: 16ch; }
.reason { color: var(--muted); font-size: 13px; }
.empty { margin: 0; padding: 18px 16px; color: var(--muted); }
.panel > p:not(.empty) { padding: 12px 16px 0; margin: 0; }

/* Whole in the document, for selecting and copying; clipped to read. */
.digest {
  display: inline-block;
  max-width: 21ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.digest.hex { max-width: 16ch; }

.role {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  padding: 0 6px;
  margin: 0 4px 2px 0;
  background: var(--sunken);
  border-radius: 5px;
}
.role.unadmitted { background: none; outline: 1px dashed var(--warn); outline-offset: -1px; color: var(--warn); }

svg.spark { display: block; }
svg.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }

.burn { display: inline-block; margin: 0 10px 0 0; white-space: nowrap; }

ul.health { list-style: none; margin: 4px 0 0; padding: 0; }
ul.health li { margin: 0 0 2px; }

dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; padding: 14px 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

form.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
form.filter input {
  flex: 0 1 320px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
form.filter button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
form.filter button:hover { background: var(--sunken); }

/* Signing in (ADR-0153): a card of its own, outside the shell. */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.auth-card .brand { margin: 0 0 20px; font-size: 15px; }
.auth-card h1 { margin: 0 0 8px; font-size: 22px; }
a.button, form.signout button {
  display: inline-block;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--surface);
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
a.button { width: 100%; }
a.button:hover { text-decoration: none; filter: brightness(1.08); }
form.signout { display: inline; margin-left: 8px; }
form.signout button {
  min-height: 28px;
  padding: 3px 10px;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}
form.signout button:hover { background: var(--sunken); }

/* A phone: the sidebar folds into a menu, and tables give way. */

@media (max-width: 859px) {
  .shell { display: block; }
  .sidebar { display: none; }

  header.top { padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
  header.top .brand, .menu { display: block; }

  .menu summary {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
  }
  .menu summary::-webkit-details-marker { display: none; }
  .menu nav.sections {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 6px 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line-strong);
  }
  .menu nav.sections a { display: flex; align-items: center; min-height: 44px; }

  main { padding: 16px 16px 32px; }
  footer.bottom { padding: 0 16px 20px; }

  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  dl.facts dd { margin-bottom: 10px; }

  /* A wide table scrolls, with its first column in sight. */
  table:not(.stack) th:first-child,
  table:not(.stack) td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line);
  }

  /* The lists an operator reads most become cards, each cell labelled. */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack tr { padding: 10px 16px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: none; }
  table.stack td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 3px 0;
    border: none;
    text-align: right;
    overflow-wrap: anywhere;
  }
  table.stack td::before { content: attr(data-label); flex: none; color: var(--muted); font: 14px/1.5 var(--sans); }
  table.stack .digest { max-width: 15ch; }
  table.stack td:first-child { padding-bottom: 6px; font-size: 15px; font-weight: 600; }
  table.stack td:first-child::before { content: none; }
  table.stack td > ul.health { text-align: right; }
}
