/* ============================================================
   Components
   Hierarchy comes from hairlines and spacing, not shadows or
   rounded cards.  Colour appears only to encode state.
   ============================================================ */

/* -- top bar ---------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  height: var(--topbar-h);
  padding: 0 var(--s4);
  /* Slightly deeper than the panels so the shell reads as a frame rather than
     dissolving into the first card. */
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -.02em;
  white-space: nowrap;
}
.topbar .brand .mark {
  width: 9px; height: 9px;
  background: var(--brand);
  border-radius: 1px;
  flex: 0 0 auto;
}
.topbar nav {
  display: flex;
  gap: 2px;
  flex: 1;
  height: 100%;
  overflow-x: auto;
}
.topbar nav a {
  display: flex;
  align-items: center;
  gap: var(--s1);
  padding: 0 var(--s3);
  height: 100%;
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.topbar nav a:hover {
  color: var(--text);
  background: var(--surface-3);
  text-decoration: none;
}
.topbar nav a.on {
  color: var(--text-strong);
  border-bottom-color: var(--brand);
  background: var(--surface-1);
}
.topbar .badge-n {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  padding: 0 4px;
  border-radius: 2px;
  background: var(--err-wash);
  color: var(--err);
  border: 1px solid var(--err-dim);
}

.topbar .who {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}
.topbar .mode-chip {
  font-family: var(--mono);
  font-size: var(--fs-micro);
  padding: 2px var(--s2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  color: var(--muted);
}
a.gear {
  color: var(--faint);
  font-size: var(--fs-title);
  line-height: 1;
  padding: var(--s1);
}
a.gear:hover { color: var(--text); text-decoration: none; }
a.gear.on { color: var(--brand); }

/* -- banner ----------------------------------------------------- */

.banner {
  padding: var(--s2) var(--s4);
  font-size: var(--fs-sm);
  background: var(--warn-wash);
  color: var(--warn);
  border-bottom: 1px solid var(--warn-dim);
}
.banner.err {
  background: var(--err-wash);
  color: var(--err);
  border-bottom-color: var(--err-dim);
}
.banner code { background: rgba(0, 0, 0, .25); color: inherit; }

/* -- panel ------------------------------------------------------ */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.panel-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-panel) var(--r-panel) 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
}
.panel-head .spacer { flex: 1; }
.panel-body { padding: var(--s3); }
.panel-body.flush { padding: 0; }

/* -- status band (overview) ------------------------------------- */

.band {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface-1);
  overflow: hidden;
}
.band .item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  border-right: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}
.band .item:last-child { border-right: 0; }
.band .item .k { color: var(--faint); }
.band .item .v {
  font-family: var(--mono);
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

/* -- dot: a solid square lamp, not a pill ----------------------- */

.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 1px;
  background: var(--idle);
  flex: 0 0 auto;
  vertical-align: middle;
}
.dot.ok   { background: var(--ok);   box-shadow: 0 0 0 3px var(--ok-wash); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-wash); }
.dot.err  { background: var(--err);  box-shadow: 0 0 0 3px var(--err-wash); }
.dot.info { background: var(--info); box-shadow: 0 0 0 3px var(--info-wash); }
.dot.idle { background: var(--idle); box-shadow: 0 0 0 3px var(--idle-wash); }

@media (prefers-reduced-motion: no-preference) {
  .dot.err { animation: pulse-err 2.4s ease-in-out infinite; }
}
@keyframes pulse-err {
  0%, 100% { box-shadow: 0 0 0 3px var(--err-wash); }
  50%      { box-shadow: 0 0 0 5px rgba(240, 113, 106, .04); }
}

/* -- state label: dot + word, never colour alone ---------------- */

.state {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.state.ok   { color: var(--ok); }
.state.warn { color: var(--warn); }
.state.err  { color: var(--err); }
.state.info { color: var(--info); }
.state.idle { color: var(--muted); }

/* -- tag: outlined mono, square-ish ---------------------------- */

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-micro);
  line-height: 1.6;
  padding: 0 var(--s1);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  white-space: nowrap;
}
.tag.ok   { color: var(--ok);   border-color: var(--ok-dim);   background: var(--ok-wash); }
.tag.warn { color: var(--warn); border-color: var(--warn-dim); background: var(--warn-wash); }
.tag.err  { color: var(--err);  border-color: var(--err-dim);  background: var(--err-wash); }
.tag.info { color: var(--info); border-color: var(--info-dim); background: var(--info-wash); }
.tag.idle { color: var(--idle); border-color: var(--idle-dim); background: var(--idle-wash); }

/* -- buttons ---------------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  padding: 5px var(--s3);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-focus); }
.btn:active { background: var(--surface-3); transform: translateY(.5px); }
.btn.primary {
  color: var(--brand-ink);
  background: var(--brand);
  border-color: var(--brand);
  font-weight: 600;
}
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.primary:active { background: var(--brand-hover); }
.btn.danger { color: var(--err); border-color: var(--err-dim); background: var(--surface-1); }
.btn.danger:hover { background: var(--err-wash); border-color: var(--err); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.sm { padding: 2px var(--s2); font-size: var(--fs-micro); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn:disabled:hover { background: var(--surface-1); border-color: var(--line-strong); }
.btn.primary:disabled:hover { background: var(--brand); border-color: var(--brand); }

/* -- busy state: the button that was clicked explains itself ------------
   Label swap + inline spinner.  A long acme.sh run can take minutes, so the
   button must say what is happening, not just grey out. */
.btn.is-busy {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-busy::before {
  content: "";
  position: absolute;
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: var(--text);
  animation: spin .7s linear infinite;
  opacity: .85;
}
.btn.primary.is-busy::before { color: var(--brand-ink); }
.btn.is-busy::after {
  content: attr(data-busy-label);
  position: absolute;
  left: 50%;
  transform: translateX(calc(-50% + 20px));
  color: var(--text);
  font-size: var(--fs-micro);
  white-space: nowrap;
}
.btn.primary.is-busy::after { color: var(--brand-ink); }

@keyframes spin { to { transform: rotate(360deg); } }

/* -- global progress bar: top of the viewport, indeterminate ---------- */
#progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  background: linear-gradient(90deg,
    transparent 0%, var(--brand) 22%, var(--brand) 78%, transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: slide 1.15s ease-in-out infinite;
}
#progress.on { opacity: 1; }
@keyframes slide {
  0%   { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

/* -- skeleton: placeholder rows while a slow page assembles ----------- */
.skel {
  display: inline-block;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -- tables ----------------------------------------------------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
  background: var(--surface-1);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 7px var(--s3);
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
table.data tbody td {
  padding: 7px var(--s3);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-3); }
table.data tbody tr.clickable { cursor: pointer; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); }
table.data td.actions { text-align: right; white-space: nowrap; }
/* severity encoded as a left rule on the first cell, not a row tint */
table.data tr.sev-err  td:first-child { box-shadow: inset 2px 0 0 var(--err); }
table.data tr.sev-warn td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
table.data tr.sev-info td:first-child { box-shadow: inset 2px 0 0 var(--info); }
table.data tr.dim { opacity: .5; }

/* -- key/value list (detail pages) ------------------------------ */

.kv {
  display: grid;
  grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
  gap: 6px var(--s3);
  font-size: var(--fs-sm);
  margin: 0;
}
.kv dt { color: var(--muted); }
.kv dd {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  word-break: break-all;
}

/* ============================================================
   The rail — the one memorable element.
   A fixed 60-day window: fill = remaining life, tick = renewal
   point.  Expired certs overflow past the right edge in red.
   ============================================================ */

.rail {
  --rail-h: 6px;
  position: relative;
  height: var(--rail-h);
  width: 100%;
  min-width: 90px;
  background: var(--surface-3);
  border-radius: 1px;
  /* quarter ticks */
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(25% - 1px),
    var(--line) calc(25% - 1px),
    var(--line) 25%
  );
  overflow: hidden;
}
.rail-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--ok);
  border-radius: 1px 0 0 1px;
  transition: width .2s ease;
}
.rail.warn .rail-fill { background: var(--warn); }
.rail.err  .rail-fill { background: var(--err); }
.rail.idle .rail-fill { background: var(--idle); }

/* renewal point, tick marks slightly taller than the bar */
.rail-tick {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  background: var(--text-strong);
  opacity: .8;
  transform: translateX(-1px);
}
.rail-tick.overdue { background: var(--warn); opacity: 1; }
/* right edge = expiry */
.rail-edge {
  position: absolute;
  top: -1px; bottom: -1px;
  right: 0;
  width: 1px;
  background: var(--line-strong);
}

.rail-cell {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 150px;
}
.rail-cell .rail { flex: 1; }
.rail-cell .rail-text {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--text);
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}
.rail-cell .rail-text.err  { color: var(--err); }
.rail-cell .rail-text.warn { color: var(--warn); }

/* -- metric (annunciator) --------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s3);
}
.metric {
  position: relative;
  padding: var(--s3) var(--s4) var(--s3) var(--s4);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.metric::before {
  content: "";
  position: absolute;
  left: 0; top: var(--s3); bottom: var(--s3);
  width: 2px;
  background: var(--line-strong);
  border-radius: 1px;
}
.metric.ok::before   { background: var(--ok); }
.metric.warn::before { background: var(--warn); }
.metric.err::before  { background: var(--err); }
.metric .m-v {
  font-family: var(--mono);
  font-size: var(--fs-metric);
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.metric .m-k {
  margin-top: var(--s1);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.metric .m-sub {
  margin-top: 2px;
  font-size: var(--fs-micro);
  color: var(--faint);
}

/* -- forms ------------------------------------------------------ */

/* The UA's `[hidden] { display: none }` is a plain type-agnostic rule that any
   author `display:` declaration overrides — including the `.field` rule just
   below.  Restate it with higher precedence so `hidden` always wins. */
[hidden] { display: none !important; }

.field { display: block; margin-bottom: var(--s3); }
.field > .label {
  display: block;
  margin-bottom: var(--s1);
  font-size: var(--fs-sm);
  color: var(--muted);
}
.field > .hint {
  display: block;
  margin-top: var(--s1);
  font-size: var(--fs-micro);
  color: var(--faint);
  line-height: 1.5;
}

input[type=text], input[type=password], input[type=email],
input[type=search], input[type=number], select, textarea {
  width: 100%;
  padding: 6px var(--s2);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--line-focus);
  box-shadow: 0 0 0 1px var(--line-focus);
}
input.mono { font-family: var(--mono); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 var(--s3);
}

/* -- empty state ------------------------------------------------ */

.empty {
  padding: var(--s6) var(--s5);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
  background: var(--surface-1);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-panel);
}
.empty .empty-hint {
  display: block;
  margin-top: var(--s2);
  font-size: var(--fs-micro);
  color: var(--faint);
}

/* -- toast ------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: var(--s4);
  right: var(--s4);
  z-index: 100;
  max-width: 440px;
  padding: var(--s2) var(--s4);
  font-size: var(--fs-sm);
  color: var(--text-strong);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--info);
  box-shadow: var(--shadow-float);
  border-radius: var(--r-ctl);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .16s, transform .16s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.ok  { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }

/* -- auth pages ------------------------------------------------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s5);
  background:
    radial-gradient(circle at 50% 0%, rgba(94, 211, 196, .05), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  padding: var(--s6) var(--s5) var(--s5);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.auth-card .auth-brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: var(--s1);
}
.auth-card .auth-brand .mark {
  width: 9px; height: 9px;
  background: var(--brand);
  border-radius: 1px;
}
.auth-card .auth-sub {
  margin: 0 0 var(--s5);
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.6;
}
.auth-card .btn { width: 100%; justify-content: center; margin-top: var(--s2); }
.auth-card h1 {
  font-size: var(--fs-title);
  margin-bottom: var(--s1);
}

/* -- inline error ------------------------------------------------- */

.err-note {
  padding: var(--s2) var(--s3);
  margin-bottom: var(--s3);
  font-size: var(--fs-sm);
  color: var(--err);
  background: var(--err-wash);
  border: 1px solid var(--err-dim);
  border-radius: var(--r-ctl);
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* -- modal ------------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 19, 16, .38);
  backdrop-filter: blur(1.5px);
}
.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-float);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-head h2 {
  flex: 1;
  font-size: var(--fs-title);
  font-weight: 600;
}
.modal-x {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  cursor: pointer;
}
.modal-x:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.modal-body {
  padding: var(--s3) var(--s4) var(--s4);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  background: var(--surface-2);
  border-radius: 0 0 var(--r-panel) var(--r-panel);
}
.modal-foot:empty { display: none; }
.modal-hint {
  margin: 0 0 var(--s3);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--muted);
  padding: var(--s2) var(--s3);
  background: var(--info-wash);
  border-left: 2px solid var(--info-dim);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}

/* -- snippet cards inside the modal ----------------------------- */

.snip-group-name {
  margin: var(--s4) 0 var(--s2);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}
.snip-group-name:first-of-type { margin-top: 0; }

.snip-card {
  position: relative;
  margin-bottom: var(--s3);
  padding: var(--s3);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.snip-card:hover { border-color: var(--line-strong); }
.snip-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-bottom: var(--s1);
}
.snip-head h3 {
  flex: 1;
  min-width: 140px;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text-strong);
}
.snip-acts {
  display: flex;
  gap: var(--s1);
  flex-wrap: wrap;
}
.snip-summary {
  margin: 0 0 var(--s2);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--muted);
}
.snip-code {
  margin: 0;
  padding: var(--s3);
  max-height: 280px;
  overflow: auto;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  white-space: pre;
}
.snip-notes {
  margin: var(--s2) 0 0;
  padding-left: var(--s4);
  font-size: var(--fs-micro);
  line-height: 1.6;
  color: var(--muted);
}
.snip-notes li + li { margin-top: 2px; }

@media (max-width: 640px) {
  .modal { padding: 0; }
  .modal-panel { max-height: 100vh; width: 100%; border-radius: 0; border: 0; }
  .snip-code { max-height: 200px; }
}

/* -- failure dialog ------------------------------------------------- */

.failure { font-size: var(--fs-body); }
.failure-cause {
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--err);
  padding: var(--s3) var(--s4);
  background: var(--err-wash);
  border-left: 3px solid var(--err);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}
.failure-label {
  margin: var(--s4) 0 var(--s1);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}
.failure-advice {
  margin: 0;
  line-height: 1.75;
  color: var(--text);
}
.failure-raw {
  margin-top: var(--s4);
  border-top: 1px solid var(--line);
  padding-top: var(--s3);
}
.failure-raw > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--muted);
  list-style: none;
}
.failure-raw > summary::-webkit-details-marker { display: none; }
.failure-raw > summary::before {
  content: "▸ ";
  color: var(--faint);
}
.failure-raw[open] > summary::before { content: "▾ "; }
.failure-raw > summary:hover { color: var(--text); }
.failure-raw pre.log { margin-top: var(--s2); max-height: 320px; }

/* -- checkbox row --------------------------------------------------- */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  margin: var(--s3) 0;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}
.check input[type=checkbox] {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
  cursor: pointer;
}
