/* Neutral stone-gray paper with deep crimson accents, a near-black aubergine
   header band and a faint dotted lattice — deliberately distinct from the
   other icarm sites: elliptic-rank (light teal), ruzsa-genus-one (dark
   indigo, amber), eq677 (blue-cast light, cobalt), additive-squares
   (lavender, violet) and matroid-correlation-constants (warm paper, teal +
   rust). Failure red is shifted toward orange so it stays distinct from the
   accent. */
:root {
  --bg: #f4f3f1;           /* neutral stone */
  --dot: #e0dcd9;
  --fg: #221d1f;
  --muted: #6b6265;
  --accent: #a3214a;       /* deep crimson */
  --accent-dark: #7f1838;
  --accent-soft: #f8e4eb;
  --border: #ddd6d5;
  --panel: #fffdfc;
  --panel-soft: #f0ecea;
  --code-bg: #ebe6e4;
  --header-bg: #23171b;    /* near-black aubergine */
  --header-fg: #f3eef0;
  --header-muted: #bba9af;
  --ok: #23703d;
  --ok-bg: #e0f0e4;
  --bad: #b93b0f;          /* orange-red, distinct from the crimson accent */
  --bad-bg: #fbe7dc;
  --warn: #7a5a00;
  --warn-bg: #f6edcf;
  --mono: "Iosevka", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; color: var(--fg); line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(var(--dot) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg);
}
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
code { font-family: var(--mono); background: var(--code-bg); padding: 0.05em 0.3em; border-radius: 3px; font-size: 0.92em; }
pre.code-block { font-family: var(--mono); background: var(--code-bg); padding: 0.8rem 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.85em; line-height: 1.45; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.small { font-size: 0.88em; }

header { background: var(--header-bg); color: var(--header-fg); border-bottom: 4px solid var(--accent); }
header .inner { max-width: 1040px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
header h1 { margin: 0; font-size: 1.3rem; font-family: var(--serif); letter-spacing: 0.01em; }
header h1 a { color: inherit; text-decoration: none; }
header nav { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; font-size: 0.95em; }
header nav a { color: var(--header-muted); text-decoration: none; }
header nav a:hover { color: #fff; }
.auth-nav { display: inline-flex; gap: 0.8rem; align-items: baseline; }
.auth-user { color: var(--header-fg) !important; }
.auth-logout { display: inline; margin: 0; }
.auth-logout button { background: none; border: none; color: var(--header-muted); cursor: pointer; font: inherit; padding: 0; }
.auth-logout button:hover { color: #fff; }

main { max-width: 1040px; margin: 0 auto; padding: 1.2rem 1.5rem 2rem; }
section { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 1.1rem 1.4rem; margin: 1.1rem 0; }
h2 { font-family: var(--serif); margin: 0 0 0.6rem; font-size: 1.35rem; }
h3 { font-family: var(--serif); margin: 1.1rem 0 0.4rem; font-size: 1.1rem; }
footer { max-width: 1040px; margin: 0 auto; padding: 1rem 1.5rem 2.5rem; color: var(--muted); font-size: 0.88em; }
footer a { color: var(--muted); }

.word { font-family: var(--mono); letter-spacing: 0.04em; white-space: nowrap; }
.word .bar { text-decoration: overline; }
.word.wrap { white-space: normal; word-break: break-all; }

.table-scroll { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 0.93em; }
table.grid th, table.grid td { border-bottom: 1px solid var(--border); padding: 0.35rem 0.55rem; text-align: left; vertical-align: top; }
table.grid thead th { font-weight: 600; background: var(--panel-soft); white-space: nowrap; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tr:hover td { background: #faf7f6; }
table.grid tr.group td { background: var(--panel-soft); font-weight: 600; color: var(--muted); }

.badge { display: inline-block; padding: 0.05em 0.5em; border-radius: 999px; font-size: 0.82em; font-weight: 600; white-space: nowrap; }
.badge.passed { background: var(--ok-bg); color: var(--ok); }
.badge.failed { background: var(--bad-bg); color: var(--bad); }
.badge.inconclusive, .badge.outdated, .badge.running, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.error { background: var(--bad-bg); color: var(--bad); }
.badge.yes { background: var(--ok-bg); color: var(--ok); }
.badge.no { background: var(--panel-soft); color: var(--muted); }

.notice { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 0.6rem 0.9rem; border-radius: 4px; margin: 0.8rem 0; }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }
ul.errors { color: var(--bad); }

.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 0.6rem; }
.tabs a { padding: 0.15rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; background: var(--panel-soft); }
.tabs a.current { background: var(--accent); color: #fff; border-color: var(--accent); }

form.stack label { display: block; font-weight: 600; margin: 0.7rem 0 0.2rem; }
form.stack input[type=text], form.stack select, form.stack textarea { width: 100%; font: inherit; padding: 0.4rem 0.55rem; border: 1px solid var(--border); border-radius: 5px; background: #fff; }
form.stack textarea { font-family: var(--mono); font-size: 0.85em; min-height: 12rem; }
button, .button { font: inherit; background: var(--accent); color: #fff; border: none; border-radius: 5px; padding: 0.4rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { background: var(--accent-dark); color: #fff; }
button.secondary { background: var(--panel-soft); color: var(--fg); border: 1px solid var(--border); }
.inline-form { display: inline; }
.login-cta { display: inline-block; padding: 0.45rem 1.1rem; border-radius: 6px; background: var(--accent); color: #fff; text-decoration: none; }
.login-cta:hover { background: var(--accent-dark); color: #fff; }

dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; margin: 0.4rem 0; }
dl.meta dt { color: var(--muted); }
dl.meta dd { margin: 0; }
.hash { font-family: var(--mono); font-size: 0.85em; word-break: break-all; }
details summary { cursor: pointer; }
.perm { font-family: var(--mono); font-size: 0.82em; }
.perm td { padding: 0 0.4rem; }
.perm .diff { color: var(--bad); font-weight: 700; }
svg.web { max-width: 100%; height: auto; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
svg.web .edge { stroke: #445; stroke-width: 1.6; fill: none; }
svg.web .edge.thick { stroke-width: 3.2; stroke: var(--accent); }
svg.web .vertex.pos { fill: #221d1f; }
svg.web .vertex.neg { fill: #fff; stroke: #221d1f; stroke-width: 1.6; }
svg.web .port { fill: var(--accent); }
svg.web text { font-family: var(--mono); font-size: 14px; fill: #333; }
svg.web text.lab { font-size: 11px; fill: var(--accent-dark); }
svg.web .overbar { stroke: #333; stroke-width: 1.2; }
svg.web .rim { stroke: var(--border); stroke-dasharray: 3 3; fill: none; }
.checklist td:first-child { width: 2.5rem; }
