/* ==========================================================================
   sendegel-panel — operator console
   Dense by intent: operators scan hundreds of rows, so vertical rhythm is
   tight, ids and money are monospace, and colour carries status meaning only.
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e2e5eb;
  --border-strong: #cbd0d9;
  --ink: #12141a;
  --ink-2: #454b57;
  --dim: #767d8b;

  --brand: #5b4fc4;
  --brand-ink: #ffffff;
  --brand-soft: #eeecfa;

  --ok: #17794a;
  --ok-soft: #e3f4ea;
  --warn: #8a5a00;
  --warn-soft: #fdf1dc;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --info: #1a5fa8;
  --info-soft: #e6f0fb;

  --radius: 7px;
  --radius-sm: 5px;
  --row-h: 34px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow: 0 1px 2px rgba(16, 20, 28, .06), 0 1px 3px rgba(16, 20, 28, .04);
  --shadow-lg: 0 10px 30px rgba(16, 20, 28, .18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1116;
    --surface: #161920;
    --surface-2: #1b1f28;
    --border: #262b36;
    --border-strong: #39404e;
    --ink: #e8eaef;
    --ink-2: #b3b9c6;
    --dim: #838b9b;

    --brand: #8f83f0;
    --brand-ink: #12141a;
    --brand-soft: #23213c;

    --ok: #5ed39a;
    --ok-soft: #14291f;
    --warn: #e2b263;
    --warn-soft: #2c2313;
    --danger: #f08b84;
    --danger-soft: #33191a;
    --info: #7ab6f0;
    --info-soft: #14232f;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 var(--sans);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 14px; font-weight: 650; margin: 0; }
h3 { font-size: 13px; font-weight: 650; margin: 0; }
p { margin: 4px 0 0; }

.mono { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
/* A deadline already passed. Colour rather than a badge: it sits in a numeric
   column beside the times that have not, and has to read as one of them. */
.overdue { color: var(--danger); }
.nowrap { white-space: nowrap; }
.ta-r { text-align: right; }
.ta-c { text-align: center; }

/* ---------- Shell ---------- */

body.app {
  display: grid;
  grid-template-columns: 216px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
  border-radius: 6px;
  font-weight: 800; font-size: 13px;
}
.brand-name { font-weight: 700; letter-spacing: -.01em; }
.brand-sub {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--dim); font-weight: 700;
}

.nav { padding: 8px 8px 24px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-group-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--dim); font-weight: 700;
  padding: 4px 8px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav-item svg { flex: none; opacity: .85; }

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

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  height: 46px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 650; }
.topbar-spacer { flex: 1; }

.session {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--dim);
  font-size: 12px;
}
.session.warn {
  color: var(--warn);
  border-color: var(--warn);
  background: var(--warn-soft);
  font-weight: 600;
}
.session-reauth { text-decoration: underline; font-weight: 650; }

.locale-switch select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  padding: 3px 5px;
  font: inherit; font-size: 11px; font-weight: 650;
}

.whoami { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.whoami-email { font-size: 12px; font-weight: 600; }
.whoami-role {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); font-weight: 700;
}

.content { padding: 16px; min-width: 0; }

.page-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 14px;
}
.page-head-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.panel-body { padding: 12px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

/* ---------- Stats ---------- */

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: block;
}
.stat-link:hover { border-color: var(--brand); }
.stat-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--dim); font-weight: 700;
}
.stat-value {
  font: 700 22px/1.15 var(--mono);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  letter-spacing: -.02em;
}
.stat-hint { margin-top: 2px; }
.stat-warn { border-color: var(--warn); }
.stat-warn .stat-value { color: var(--warn); }
.stat-danger { border-color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.stat-ok .stat-value { color: var(--ok); }
.stat-muted .stat-value { color: var(--dim); }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; }

table.dt {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
table.dt th {
  position: sticky; top: 46px; z-index: 5;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 7px 10px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); font-weight: 700;
  white-space: nowrap;
}
table.dt td {
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  height: var(--row-h);
  vertical-align: middle;
}
/*
 * A table cell holding free text.
 *
 * `td` has no max-width, so before this a 2000-character report description —
 * the API's own limit, and an ordinary report — made its column 2000
 * characters wide and pushed the row's action buttons off screen. 48ch is
 * about a line of prose: enough to recognise what a row is about, and the
 * `title` carries the rest.
 */
.cell-clamp {
  display: block;
  max-width: 48ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.dt tbody tr:hover { background: var(--surface-2); }
table.dt tbody tr:last-child td { border-bottom: 0; }
table.dt tr.attention { background: var(--danger-soft); }
table.dt tr.attention:hover { background: var(--danger-soft); }

.cell-user { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.cell-user-name { font-weight: 600; }

.row-actions { display: flex; gap: 5px; justify-content: flex-end; }

/* The id-driven forms, folded away under the row actions that replaced them.
   Quiet by default: it is a fallback for when the catalogue cannot be read,
   not the way anyone should be editing a category. */
.fallback {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.fallback > summary {
  cursor: pointer;
  padding: 8px 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  user-select: none;
}
.fallback > summary:hover { color: var(--ink); }
.fallback > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fallback[open] > summary { border-bottom: 1px solid var(--border); }
.fallback > p,
.fallback > .stack { padding: 0 11px; }
.fallback > p { padding-top: 9px; margin: 0 0 4px; }
.fallback > .stack { padding-bottom: 12px; }

.money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.money.pos { color: var(--ok); }
.money.neg { color: var(--danger); }
.ago { color: var(--dim); }

.desc { margin: 0; display: grid; gap: 0; }
.desc-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.desc-row:last-child { border-bottom: 0; }
.desc dt { color: var(--dim); font-size: 12px; }
.desc dd { margin: 0; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px; font-weight: 650;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-neutral { background: var(--surface-2); color: var(--ink-2); border-color: var(--border); }
.badge-muted { background: transparent; color: var(--dim); border-color: var(--border); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }

/* ---------- Ids ---------- */

.id {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0;
  color: var(--ink-2); cursor: pointer;
  font: inherit;
}
.id svg { opacity: 0; transition: opacity .12s; flex: none; }
.id:hover svg { opacity: .6; }
.id.copied { color: var(--ok); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--dim); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 3px 8px; font-size: 11.5px; }
.btn.icon-only { padding: 5px; }
.btn-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.btn-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn-info { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, var(--border)); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--brand); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 3px; }
.field-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); font-weight: 700;
}
input[type="text"], input[type="search"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="email"], select, textarea {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font: inherit; font-size: 12.5px;
  min-width: 0;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
textarea { resize: vertical; min-height: 64px; font-family: inherit; }

.filterbar {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  position: sticky; top: 46px; z-index: 10;
}
.filterbar-spacer { flex: 1; }
.field-search {
  flex-direction: row; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  color: var(--dim);
}
.field-search input { border: 0; padding: 5px 0; background: none; min-width: 180px; }
.field-search input:focus-visible { outline: none; }
.field-search:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }

.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Pager ---------- */

.pager {
  display: flex; align-items: center; gap: 4px;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.pager-spacer { flex: 1; }
.pager-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pager-btn:hover:not(.disabled):not(.current) { background: var(--surface); border-color: var(--border-strong); }
.pager-btn.current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pager-btn.disabled { opacity: .35; }
.pager-gap { color: var(--dim); padding: 0 2px; }

/* ---------- Alerts, empty, toast ---------- */

.alert {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: var(--surface-2);
}
.alert + .alert { margin-top: 8px; }
.alert-title { display: block; font-weight: 650; }
.alert-ok { border-left-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.alert-warn { border-left-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.alert-danger { border-left-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.alert-info { border-left-color: var(--info); background: var(--info-soft); color: var(--info); }
.error-meta { display: flex; gap: 10px; margin-top: 3px; align-items: center; flex-wrap: wrap; }
.error-issues { margin-top: 6px; }
.error-issues ul { margin: 4px 0 0; padding-left: 18px; }

.empty { padding: 30px 16px; text-align: center; }
.empty-title { font-weight: 650; }

.toast-wrap {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  animation: toast-in .18s ease-out;
}
.toast-danger { border-left-color: var(--danger); color: var(--danger); }
.toast-warn { border-left-color: var(--warn); color: var(--warn); }
.toast-out { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Danger dialog ---------- */

dialog.danger-dialog {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  max-width: 440px; width: calc(100% - 32px);
}
dialog.danger-dialog::backdrop { background: rgba(10, 12, 18, .55); }
.danger-form { padding: 16px; display: flex; flex-direction: column; gap: 11px; }
.danger-heading { font-size: 14px; }
.danger-consequence { margin: 0; color: var(--ink-2); }
.danger-warn {
  margin: 0; color: var(--danger); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px;
}
.danger-token { font-family: var(--mono); text-transform: uppercase; }
.danger-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }

/* ---------- Bare pages (login, fatal errors) ---------- */

body.bare { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.bare-main { width: 100%; max-width: 360px; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}
.login-head { margin-bottom: 16px; }
.login-brand {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}

/* ---------- htmx ---------- */

.htmx-indicator { visibility: hidden; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { visibility: visible; }
.spinner {
  width: 13px; height: 13px; flex: none;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  display: inline-block;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Charts ----------
   Categorical slots 1 and 2, validated against this console's surfaces in both
   modes (dataviz/scripts/validate_palette.js): CVD dE 24.7 light / 26.8 dark
   against a >=8 target; normal-vision 33.6 / 31.8 against a >=15 floor.
   Dark is stepped for the dark surface, not an automatic flip. */

:root {
  --series-1: #2a78d6;
  --series-2: #eb6834;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --series-1: #3987e5;
    --series-2: #d95926;
  }
}
:root[data-theme="dark"] {
  --series-1: #3987e5;
  --series-2: #d95926;
}

.chart-figure { margin: 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
/* Hairline, solid, recessive — never dashed. */
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .tick { fill: var(--dim); font-size: 10px; font-family: var(--mono); }
.chart .end-label { fill: var(--ink-2); font-weight: 700; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { opacity: .1; stroke: none; }

/* Hover band: hit target far wider than the mark, crosshair on hover only. */
.chart .crosshair { stroke: var(--border-strong); stroke-width: 1; opacity: 0; }
.chart .hover-band:hover .crosshair { opacity: 1; }

.chart-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 8px; padding-left: 40px;
  font-size: 11.5px; color: var(--ink-2);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.sparkline { width: 96px; height: 24px; }
.sparkline .series-line { fill: none; }

/* Horizontal bars: 4px rounded data-end, square at the baseline, capped
   thickness with the band's leftover left as air, 2px surface gap between
   neighbouring rows. */
.barchart { display: flex; flex-direction: column; gap: 2px; }
.barchart-row {
  display: grid;
  grid-template-columns: 130px 1fr 84px;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.barchart-label {
  font-size: 12px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.barchart-track { background: var(--surface-2); border-radius: 3px; height: 18px; }
.barchart-bar {
  height: 18px;
  max-height: 24px;
  background: var(--series-1);
  border-radius: 0 4px 4px 0;
}
.barchart-value { text-align: right; font-weight: 650; }
.barchart-sub { grid-column: 2 / -1; }

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { border-bottom: 0; border-right: 1px solid var(--border); }
  .nav { display: flex; gap: 4px; padding: 6px; }
  .nav-group { display: flex; gap: 4px; }
  .nav-group + .nav-group { margin-top: 0; }
  .nav-group-title { display: none; }
  table.dt th { top: 0; }
  .filterbar { position: static; }
}

/* ---------- Message threads (disputes, support) ---------- */

.thread { display: flex; flex-direction: column; gap: 10px; }
.msg {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: var(--surface-2);
}
.msg-admin { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 25%, var(--border)); }
.msg-system { background: transparent; border-style: dashed; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.notes-list { margin: 5px 0 0; padding-left: 16px; }
.notes-list li { margin-bottom: 3px; }

/* ---------- Tabs ---------- */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
pre.mono { background: var(--surface-2); padding: 8px; border-radius: var(--radius-sm); overflow-x: auto; margin: 0; }

.error-explain { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* A button awaiting its response. htmx adds .htmx-request to whichever element
   triggered the request, so this covers every action without depending on a
   shared indicator element being present on the page. */
.btn.htmx-request {
  opacity: .6;
  pointer-events: none;
  position: relative;
}
.btn.htmx-request::after {
  content: "";
  width: 11px; height: 11px;
  margin-left: 6px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin .6s linear infinite;
}

/* Visible to assistive technology only. Used for headings that a sighted
   reader does not need (an actions column) but a screen reader does. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.notes-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }

/* An outbound link to something an operator is judging. Marked so it is
   obvious it leaves the console. */
a.ext { color: var(--info); text-decoration: underline; overflow-wrap: anywhere; }
a.ext:hover { text-decoration: none; }

/* The results region is focused programmatically after a swap, never by
   tabbing, so it takes no ring of its own — the operator's context is the
   queue inside it. `:focus-visible` keeps the ring if that ever changes. */
#results:focus:not(:focus-visible) { outline: none; }
