/* Zapstore relay dashboard. Tokens follow design/DESIGN.md (v3, "Open Shelf"); the face is DM Sans. */

@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --canvas: #0b0b0c;
  --surface-1: #141415;
  --surface-2: #1b1b1d;
  --surface-3: #232325;
  --surface-4: #2c2c2f;
  --line: rgb(255 255 255 / 7%);
  --line-strong: rgb(255 255 255 / 13%);
  --highlight: rgb(255 255 255 / 3%);
  --text: #f2f2f3;
  --text-2: #a6a6ab;
  --text-3: #8e8e94;
  --action: #3065a6;
  --action-hover: #3671ba;
  --action-pressed: #275286;
  --action-text: #73aaed;
  --action-tint: rgb(48 101 166 / 16%);
  --verified: #30a66f;
  --verified-tint: rgb(48 166 111 / 12%);
  --warning: #f2b95b;
  --warning-tint: rgb(242 185 91 / 12%);
  --danger: #f0706e;
  --danger-tint: rgb(240 112 110 / 12%);
  --danger-fill: #3a1c1c;
  --danger-fill-hover: #4a2222;
  --on-danger-fill: #ffd9d8;
  --brand: #173a61;
  --float: 0 1.125rem 3rem rgb(0 0 0 / 50%), 0 0.125rem 0.5rem rgb(0 0 0 / 30%);

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fast: 140ms cubic-bezier(.2, .8, .2, 1);
  --base: 220ms cubic-bezier(.16, 1, .3, 1);

  --r-xs: 0.375rem;
  --r-sm: 0.5rem;
  --r-control: 0.625rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-full: 999px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  /* 130% grows every rem length — type, controls, and spacing — by the same amount. */
  font-size: 130%;
  background: var(--canvas);
  scrollbar-color: var(--surface-4) var(--canvas);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
  min-height: 100vh;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--action-text);
}

::selection { background: var(--action); color: #fff; }

/* Scrollbars: surface-4 on canvas, thin, visible where content scrolls. */
* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
::-webkit-scrollbar { width: 0.625rem; height: 0.625rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-4);
  border-radius: var(--r-full);
  border: 0.125rem solid var(--canvas);
}
::-webkit-scrollbar-thumb:hover { background: #3a3a3e; }
::-webkit-scrollbar-corner { background: transparent; }

:focus-visible { outline: 0.125rem solid var(--action-text); outline-offset: 0.125rem; border-radius: var(--r-xs); }

a { color: inherit; text-decoration: none; }
a.link, .prose a {
  color: var(--action-text);
  text-decoration: underline;
  text-decoration-color: rgb(115 170 237 / 40%);
  text-underline-offset: 0.1875rem;
}
a.link:hover, .prose a:hover { text-decoration-color: currentColor; }

h1, h2, h3 { font-weight: 600; text-wrap: balance; }
code, kbd { font-family: inherit; }

.i {
  width: 1.125em;
  height: 1.125em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

.skip {
  position: absolute; left: 0.75rem; top: -3rem; z-index: 50;
  background: var(--text); color: var(--canvas);
  padding: 0.5rem 0.75rem; border-radius: var(--r-sm); font-weight: 600;
}
.skip:focus { top: 0.75rem; }

/* ── Header ───────────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 20;
  background: rgb(11 11 12 / 82%);
  backdrop-filter: blur(0.875rem) saturate(1.2);
  -webkit-backdrop-filter: blur(0.875rem) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1280px; margin: 0 auto;
  height: 3.5rem; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.brand {
  display: flex; align-items: center; gap: 0.625rem;
  font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
}
.brand-mark {
  width: 1.75rem; height: 1.75rem; border-radius: 22%;
  background: var(--brand);
  display: grid; place-items: center;
}
.brand-mark img { width: 0.6875rem; height: auto; display: block; }
.brand-sub { color: var(--text-3); font-weight: 500; }

.nav { display: flex; gap: 0.125rem; }
.nav a {
  display: flex; align-items: center; gap: 0.5rem;
  height: 2.25rem; padding: 0 0.75rem;
  border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500;
  transition: background var(--fast), color var(--fast);
}
.nav a:hover { background: var(--surface-1); color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] .i { color: var(--action-text); }

.top-search { margin-left: auto; position: relative; width: min(20rem, 32vw); }
.top-search .i { position: absolute; left: 0.75rem; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.top-search input {
  width: 100%; height: 2.25rem; padding: 0 2.5rem 0 2.25rem;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-control);
  color: var(--text); font: inherit; font-size: 0.875rem;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.top-search input::placeholder { color: var(--text-3); }
.top-search input:focus { outline: none; border-color: var(--action-text); box-shadow: 0 0 0 0.1875rem var(--action-tint); }
.top-search kbd {
  position: absolute; right: 0.5rem; top: 50%; translate: 0 -50%;
  min-width: 1.375rem; height: 1.375rem; padding: 0 0.375rem; display: grid; place-items: center;
  font-size: 0.75rem; color: var(--text-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-xs);
}
.top-tools { display: flex; align-items: center; gap: 0.375rem; }

/* Progress line under the header while a request runs. */
#progress {
  position: absolute; left: 0; right: 0; bottom: -0.0625rem; height: 0.125rem;
  background: var(--action-text);
  transform-origin: left; transform: scaleX(0); opacity: 0;
}
#progress.htmx-request { opacity: 1; animation: progress 1.4s cubic-bezier(.16, 1, .3, 1) infinite; }
@keyframes progress { 0% { transform: scaleX(0); } 70% { transform: scaleX(.85); } 100% { transform: scaleX(1); opacity: 0; } }

/* ── Page ─────────────────────────────────────────── */

main { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem 6rem; }

.head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.head h1 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.025em; }
.head p { color: var(--text-2); margin-top: 0.25rem; max-width: 64ch; }
.head-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.back {
  display: inline-flex; align-items: center; gap: 0.375rem;
  color: var(--text-2); font-size: 0.875rem; margin-bottom: 1rem;
}
.back:hover { color: var(--text); }

.section { margin-top: 2.5rem; }
.section:first-child { margin-top: 0; }
.section-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding-bottom: 0.625rem; margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 1.125rem; line-height: 1.35; }
.section-head .meta, .section-head .badge { margin-left: auto; }
.section-head .meta { color: var(--text-3); font-size: 0.8125rem; }

.label {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 0.8125rem; }
.ev { font-variant-numeric: tabular-nums; font-size: 0.8125rem; font-weight: 500; color: var(--text-2); overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.ok { color: var(--verified); }
.bad { color: var(--danger); }
.warn { color: var(--warning); }

/* ── Controls ─────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: 2.5rem; padding: 0 1rem;
  border-radius: var(--r-control); border: 1px solid transparent;
  font: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1;
  color: var(--text); background: var(--surface-3);
  cursor: pointer; white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), color var(--fast), transform var(--fast);
}
.btn:hover { background: var(--surface-4); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--action); color: #fff; }
.btn.primary:hover { background: var(--action-hover); }
.btn.primary:active { background: var(--action-pressed); }
.btn.outline { background: transparent; border-color: var(--line-strong); }
.btn.outline:hover { background: var(--surface-1); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-1); color: var(--text); }
.btn.danger { background: var(--danger-fill); color: var(--on-danger-fill); border-color: rgb(240 112 110 / 30%); }
.btn.danger:hover { background: var(--danger-fill-hover); }
.btn.sm { height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn.icon { width: 2.25rem; height: 2.25rem; padding: 0; }
.btn.icon.sm { width: 1.75rem; height: 1.75rem; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--surface-2); color: var(--text-3); border-color: transparent; cursor: not-allowed; transform: none;
}
.btn .spin { display: none; }
.btn.htmx-request .spin, form.htmx-request .btn .spin { display: inline-block; }
form.htmx-request .btn .idle { display: none; }

.copy {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem; flex: none;
  border: 0; border-radius: var(--r-xs);
  background: transparent; color: var(--text-3); cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.copy:hover { background: var(--surface-3); color: var(--text); }
.copy.done { color: var(--verified); }

.field {
  height: 2.5rem; padding: 0 0.75rem;
  background: var(--surface-1); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-control);
  font: inherit; font-size: 0.875rem;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.field::placeholder { color: var(--text-3); }
.field:focus { outline: none; border-color: var(--action-text); box-shadow: 0 0 0 0.1875rem var(--action-tint); }
select.field {
  appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A6A6AB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.75rem center;
}
textarea.field { height: auto; min-height: 4.5rem; padding: 0.625rem 0.75rem; resize: vertical; line-height: 1.45; }

.search { position: relative; flex: 1; min-width: 13.75rem; max-width: 26.25rem; }
.search .i { position: absolute; left: 0.75rem; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.search .field { width: 100%; padding-left: 2.25rem; }

.chips { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  height: 1.875rem; padding: 0 0.75rem;
  border-radius: var(--r-full); border: 1px solid transparent;
  background: var(--surface-2); color: var(--text-2);
  font-size: 0.8125rem; font-weight: 500;
  transition: background var(--fast), color var(--fast);
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip[aria-current="true"] { background: var(--action-tint); color: var(--action-text); border-color: rgb(48 101 166 / 55%); }
.chip .n { font-variant-numeric: tabular-nums; color: var(--text-3); }
.chip[aria-current="true"] .n { color: inherit; }

.seg { display: inline-flex; padding: 0.1875rem; gap: 0.125rem; background: var(--surface-2); border-radius: var(--r-full); }
.seg a {
  height: 1.875rem; padding: 0 0.875rem; display: grid; place-items: center;
  border-radius: var(--r-full); color: var(--text-2); font-size: 0.8125rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.seg a:hover { color: var(--text); }
.seg a[aria-current="true"] { background: var(--surface-4); color: var(--text); box-shadow: inset 0 1px 0 var(--highlight); }

.tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  height: 1.375rem; padding: 0 0.5rem;
  border-radius: var(--r-xs); background: var(--surface-2); color: var(--text-3);
  font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}
.badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  height: 1.5rem; padding: 0 0.625rem;
  border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2);
}
.badge.ok { background: var(--verified-tint); color: var(--verified); }
.badge.warn { background: var(--warning-tint); color: var(--warning); }
.badge.bad { background: var(--danger-tint); color: var(--danger); }
.badge .i { width: 0.875rem; height: 0.875rem; }

.ver {
  display: inline-flex; align-items: center;
  height: 1.25rem; padding: 0 0.5rem;
  border-radius: var(--r-full); background: var(--brand); color: #fff;
  font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}

.dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--verified); }
.dot.bad { background: var(--danger); }
.dot.warn { background: var(--warning); }

/* Live toggle in the header */
.live {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 2rem; padding: 0 0.625rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: transparent; color: var(--text-2);
  font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.live:hover { color: var(--text); background: var(--surface-1); }
.live .dot { background: var(--text-3); }
.live[aria-pressed="true"] .dot { background: var(--verified); box-shadow: 0 0 0 0 rgb(48 166 111 / 50%); animation: beat 2.4s ease-out infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgb(48 166 111 / 45%); } 70%, 100% { box-shadow: 0 0 0 0.375rem rgb(48 166 111 / 0%); } }

.updated {
  display: inline-flex; align-items: center; gap: 0.375rem;
  color: var(--text-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums;
}

/* ── App tiles ────────────────────────────────────── */

.tile {
  position: relative; flex: none;
  width: 2.5rem; height: 2.5rem; border-radius: 22%;
  background: var(--surface-3); overflow: hidden;
  display: grid; place-items: center;
  color: var(--text-2); font-weight: 600;
  corner-shape: squircle;
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.lg { width: 4.5rem; height: 4.5rem; font-size: 1.75rem; }
.tile.sm { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }

/* ── App rows ─────────────────────────────────────── */

.rows { list-style: none; }
.row {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: 0.875rem; align-items: center;
  padding: 0.625rem 0.75rem; margin: 0 -0.75rem;
  border-radius: var(--r-md);
  transition: background var(--fast);
}
.row:hover { background: var(--surface-1); }
.row-main { display: block; min-width: 0; }
.row-sub { display: block; }
.row-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; min-width: 0; }
.row-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--text-2); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub .ev { font-size: inherit; color: var(--text-3); }
.row-side { display: flex; align-items: center; gap: 0.875rem; color: var(--text-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-side .stat { display: inline-flex; align-items: center; gap: 0.375rem; min-width: 4rem; justify-content: flex-end; }
.rows > li + li .row { box-shadow: 0 -0.0625rem 0 var(--line); }
.rows > li + li .row:hover, .rows > li:hover + li .row { box-shadow: none; }
.more { padding-top: 1rem; display: flex; justify-content: center; }

.toolbar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .spacer { flex: 1; }

/* ── Empty states ─────────────────────────────────── */

.empty {
  display: flex; gap: 0.875rem; align-items: flex-start;
  padding: 1.125rem 1.25rem; margin-top: 0.75rem;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--text-2);
}
.empty .i { width: 1.25rem; height: 1.25rem; color: var(--text-3); margin-top: 1px; }
.empty strong { display: block; color: var(--text); font-weight: 600; }

/* ── Notices ──────────────────────────────────────── */

.notice {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem 1rem; margin-bottom: 1rem;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface-1);
}
.notice .i { margin-top: 0.125rem; }
.notice.ok { background: var(--verified-tint); border-color: rgb(48 166 111 / 25%); color: #bfe8d3; }
.notice.ok .i { color: var(--verified); }
.notice.bad { background: var(--danger-tint); border-color: rgb(240 112 110 / 25%); color: var(--on-danger-fill); }
.notice.bad .i { color: var(--danger); }
.notice.warn { background: var(--warning-tint); border-color: rgb(242 185 91 / 25%); color: #f8e2bd; }
.notice.warn .i { color: var(--warning); }

/* ── Cards and definition lists ───────────────────── */

.card {
  background: var(--surface-1);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--highlight);
  padding: 1.125rem 1.25rem;
}
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 0.9375rem; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.card h2 .i { color: var(--text-3); }
.card h2 .badge { margin-left: auto; }

.dl { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 0 1rem; }
.dl dt, .dl dd { padding: 0.5rem 0; border-top: 1px solid var(--line); }
.dl dt:first-of-type, .dl dd:first-of-type { border-top: 0; padding-top: 0; }
.dl dt { color: var(--text-3); font-size: 0.8125rem; padding-top: 0.625rem; }
.dl dt:first-of-type { padding-top: 0.125rem; }
.dl dd { min-width: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.dl dd .val { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.dl dd .val > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── App page ─────────────────────────────────────── */

.app-head { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; }
.app-head h1 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.025em; }
.app-id { display: flex; align-items: center; gap: 0.375rem; margin-top: 0.25rem; }
.app-summary { color: var(--text-2); margin-top: 0.375rem; max-width: 70ch; }
.app-links { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.facts {
  display: flex; flex-wrap: wrap; gap: 0;
  margin: 1.5rem 0 0; padding: 0.875rem 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.fact { padding: 0 1.25rem; border-left: 1px solid var(--line); min-width: 0; }
.fact:first-child { padding-left: 0; border-left: 0; }
.fact dt { font-size: 0.75rem; color: var(--text-3); margin-bottom: 0.25rem; }
.fact dd { display: flex; align-items: center; gap: 0.375rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 22.5rem; gap: 2.5rem; margin-top: 2rem; align-items: start; }
.aside { position: sticky; top: 5rem; }

.prose { color: var(--text-2); max-width: 72ch; white-space: pre-line; overflow-wrap: anywhere; }
.prose.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.prose-wrap { margin-top: 0.75rem; }

.fold > summary { cursor: pointer; }
.fold > summary .chev { display: inline-flex; color: var(--text-3); transition: transform var(--fast); }
.fold[open] > summary .chev { transform: rotate(90deg); }
.fold + .fold { margin-top: 0.75rem; }
.fold .prose { margin-top: 0.75rem; }

.checks { list-style: none; display: grid; gap: 0.125rem; margin-top: 0.5rem; }
.check { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.75rem; padding: 0.625rem 0; }
.check + .check { border-top: 1px solid var(--line); }
.check > .i { width: 1.25rem; height: 1.25rem; margin-top: 1px; color: var(--text-3); }
.check.ok > .i { color: var(--verified); }
.check.bad > .i { color: var(--danger); }
.check strong { font-weight: 600; }
.check p { color: var(--text-2); font-size: 0.875rem; margin-top: 0.125rem; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.75rem, 1fr)); gap: 0 1.5rem; margin-top: 0.5rem; }
.perm { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.5rem 0; border-top: 1px solid var(--line); min-width: 0; }
.perm .i { margin-top: 0.125rem; color: var(--text-3); }
.perm-label { font-size: 0.875rem; }
.perm-id { font-size: 0.75rem; color: var(--text-3); overflow-wrap: anywhere; }
.perm-note { font-size: 0.8125rem; color: var(--text-2); margin-top: 0.125rem; }

.sub { margin-top: 1.5rem; }
.sub > .label { display: block; margin-bottom: 0.25rem; }

.release-head { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; padding: 0.875rem 0 0.625rem; }
.release-head .meta { color: var(--text-3); font-size: 0.8125rem; display: inline-flex; gap: 0.375rem; align-items: center; }
.notes { color: var(--text-2); white-space: pre-line; max-width: 72ch; font-size: 0.875rem; overflow-wrap: anywhere; }

.asset {
  margin-top: 0.75rem; padding: 0.875rem 1rem;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-md);
}
.asset-head { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }
.asset-head strong { font-weight: 600; overflow-wrap: anywhere; }
.asset-head .spacer { flex: 1; }
.asset .dl { margin-top: 0.75rem; grid-template-columns: 6.5rem minmax(0, 1fr); }

.older { margin-top: 0.5rem; }
.older > li { list-style: none; border-top: 1px solid var(--line); }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.older summary {
  display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap;
  padding: 0.75rem 0;
}
.older summary .chev { color: var(--text-3); transition: transform var(--fast); }
.older details[open] summary .chev { transform: rotate(90deg); }
.older summary .meta { color: var(--text-3); font-size: 0.8125rem; }
.older summary .spacer { flex: 1; }
.older .body { padding: 0 0 1rem 1.625rem; }

.more-link {
  display: inline-flex; align-items: center; gap: 0.375rem;
  color: var(--action-text); font-size: 0.875rem; font-weight: 600; cursor: pointer;
}

.keywords { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }

.status-list { list-style: none; }
.status-list li { display: flex; align-items: center; gap: 0.625rem; padding: 0.4375rem 0; font-size: 0.875rem; }
.status-list li + li { border-top: 1px solid var(--line); }
.status-list .i { color: var(--text-3); }
.status-list .ok .i, .status-list li .i.ok { color: var(--verified); }
.status-list .spacer { flex: 1; }

.c1s { margin-top: 1rem; display: grid; gap: 0.75rem; }
.c1 { display: grid; gap: 0.25rem; }
.c1 + .c1 { padding-top: 0.75rem; border-top: 1px solid var(--line); }

.action { padding: 0.875rem 0; }
.action + .action { border-top: 1px solid var(--line); }
.action strong { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.action p { color: var(--text-2); font-size: 0.8125rem; margin: 0.25rem 0 0.625rem; }
.action form { display: grid; gap: 0.5rem; }
.action .row-actions { display: flex; gap: 0.5rem; }

/* ── Jobs ─────────────────────────────────────────── */

.jobs { display: grid; gap: 0.625rem; margin-top: 0.75rem; }
.job {
  padding: 0.75rem 0.875rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
}
.job-head { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }
.job-head strong { font-weight: 600; }
.job-head .spacer { flex: 1; }
.job-meta { color: var(--text-3); font-size: 0.8125rem; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.job-note { color: var(--text-2); font-size: 0.8125rem; margin-top: 0.375rem; }
.job .out {
  margin-top: 0.625rem; padding: 0.625rem 0.75rem; max-height: 17.5rem; overflow: auto;
  background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: 0.8125rem; font-variant-numeric: tabular-nums; line-height: 1.5;
  color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.job .err { margin-top: 0.5rem; color: var(--danger); font-size: 0.875rem; overflow-wrap: anywhere; }
.job.running { border-color: rgb(115 170 237 / 30%); }
.spinner {
  width: 1rem; height: 1rem; flex: none; border-radius: 50%;
  border: 0.125rem solid var(--surface-4); border-top-color: var(--action-text);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tables ───────────────────────────────────────── */

.scroll-x { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left; font-weight: 600; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 0.75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--surface-1); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .id { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.table .id > span { overflow-wrap: anywhere; }
.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; }

/* ── Forms on moderation and bundles ──────────────── */

.form-card { display: grid; gap: 0.875rem; }
.form-grid { display: grid; grid-template-columns: 11.25rem minmax(0, 1fr); gap: 0.75rem; }
.form-grid .wide { grid-column: 1 / -1; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.form-foot p { color: var(--text-3); font-size: 0.8125rem; max-width: 60ch; }
.hint { color: var(--text-3); font-size: 0.8125rem; }
label.f { display: grid; gap: 0.375rem; font-size: 0.8125rem; color: var(--text-2); font-weight: 500; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 23.75rem; gap: 2.5rem; align-items: start; }

/* ── Stats ────────────────────────────────────────── */

.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9.375rem, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.strip > div { padding: 0.875rem 1.25rem; border-left: 1px solid var(--line); }
.strip > div:first-child { border-left: 0; padding-left: 0; }
.strip dt { font-size: 0.8125rem; color: var(--text-3); }
.strip dd { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; margin-top: 0.125rem; }
.strip dd a:hover { color: var(--action-text); }
.strip dd .small { font-size: 0.8125rem; font-weight: 500; color: var(--text-3); letter-spacing: 0; }

.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; }
.chart { padding: 0.5rem 0 0; min-width: 0; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.chart-head .name { color: var(--text-2); font-size: 0.875rem; }
.chart-head .total { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.chart-sub { color: var(--text-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; margin-top: 0.125rem; }
.chart-body {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 11rem auto;
  column-gap: 0.625rem; margin-top: 0.75rem;
}
.chart-y { position: relative; grid-row: 1; }
.chart-y span, .chart-x span {
  position: absolute; white-space: nowrap;
  color: var(--text-3); font-size: 0.75rem; font-variant-numeric: tabular-nums; line-height: 1;
}
.chart-y span { right: 0; top: var(--at); translate: 0 -50%; }
.chart-y span.tick-start { translate: 0 0; }
.chart-y span.tick-end { translate: 0 -100%; }
.chart-y .sizer { position: static; visibility: hidden; translate: none; }
.chart svg { grid-column: 2; grid-row: 1; display: block; width: 100%; height: 100%; overflow: visible; }
.chart line { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart rect { fill: var(--action); transition: fill var(--fast); }
.chart rect.last { fill: var(--action-text); }
.chart rect:hover { fill: var(--text); }
.chart-x { position: relative; grid-column: 2; grid-row: 2; height: 1.25rem; margin-top: 0.5rem; }
.chart-x span { top: 0; left: var(--at); translate: -50% 0; }
.chart-x span.tick-start { translate: 0 0; }
.chart-x span.tick-end { left: auto; right: 0; translate: 0 0; }

.leader td { position: relative; }
.share { position: relative; height: 0.25rem; border-radius: 0.125rem; background: var(--surface-2); min-width: 5rem; }
.share > span { position: absolute; inset: 0 auto 0 0; border-radius: 0.125rem; background: var(--text-3); }

/* ── Toast ────────────────────────────────────────── */

#toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 60;
  translate: -50% 1rem; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 0.875rem;
  max-width: min(35rem, calc(100vw - 2rem));
  padding: 0.75rem 0.875rem 0.75rem 1rem;
  background: #f3f0eb; color: var(--canvas);
  border-radius: 0.875rem; box-shadow: var(--float);
  font-size: 0.875rem; font-weight: 500;
  transition: opacity var(--base), translate var(--base);
}
#toast.show { opacity: 1; translate: -50% 0; pointer-events: auto; }
#toast .i { color: #b4302e; }
#toast a, #toast button {
  color: #275286; font-weight: 700; background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
}

/* ── Shell placeholder while the first fragment loads ─ */

.skeleton { display: grid; gap: 0.75rem; }
.skeleton i { display: block; height: 0.875rem; border-radius: 0.25rem; background: var(--surface-1); }
.skeleton i:nth-child(1) { width: 13.75rem; height: 1.75rem; margin-bottom: 0.75rem; }
.skeleton i:nth-child(2) { width: 60%; }
.skeleton i:nth-child(3) { width: 45%; }

/* ── Login ────────────────────────────────────────── */

.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 23.75rem; display: grid; gap: 1.25rem; }
.login-card .brand { justify-content: flex-start; }
.login-card h1 { font-size: 1.75rem; letter-spacing: -0.025em; line-height: 1.15; }
.login-card p { color: var(--text-2); }
.login-card .btn { width: 100%; height: 3rem; }
.login-card .fine { font-size: 0.8125rem; color: var(--text-3); }

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 1400px) {
  .layout, .split { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .aside { position: static; }
  .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-inner { flex-wrap: wrap; height: auto; padding: 0.625rem 1.5rem 0; gap: 0.625rem 0.75rem; }
  .top-search { order: 2; width: auto; flex: 1; min-width: 12rem; }
  .top-tools { order: 1; margin-left: auto; }
  .nav { order: 3; width: calc(100% + 3rem); margin: 0 -1.5rem; padding: 0 1.5rem 0.375rem; overflow-x: auto; }
  .top-search kbd { display: none; }
}

@media (max-width: 1120px) {
  .top-inner { flex-wrap: wrap; height: auto; padding: 0.625rem 1rem 0; gap: 0.625rem 0.75rem; }
  .top-search { order: 2; width: auto; flex: 1; }
  .top-tools { order: 1; margin-left: auto; }
  .nav { order: 3; width: calc(100% + 2rem); margin: 0 -1rem; padding: 0 0.75rem 0.375rem; overflow-x: auto; }
  .nav a { flex: none; height: 2.5rem; }
  .top-search kbd { display: none; }
  main { padding: 1.5rem 1rem 5rem; }
  .btn { height: 2.75rem; }
  .btn.sm { height: 2.5rem; }
  .btn.icon { width: 2.75rem; height: 2.75rem; }
  .field { height: 2.75rem; }
  .app-head { grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; }
  .app-head .tile.lg { width: 3.5rem; height: 3.5rem; font-size: 1.375rem; }
  .app-links { grid-column: 1 / -1; justify-content: flex-start; }
  .fact { padding: 0.5rem 1rem 0.5rem 0; border-left: 0; }
  .row { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .row-side { grid-column: 2; justify-content: flex-start; }
  .row-side .stat { min-width: 0; justify-content: flex-start; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .strip > div { padding-left: 0; padding-right: 0.75rem; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
