/* Athene components — plain CSS, loaded after tokens.css. Every value is a token.
   Families: --font-title / --font-ui (Libre Franklin), --font-reading (Libre Baskerville), --font-mono (Syne Mono). */

/* ---------- Supplementary font faces ----------
   tokens.css declares the main files. These add the latin-ext subsets and "Athene Symbols"
   (a TeX Gyre Pagella subset) for the glyphs the three families lack: σ and other Greek, arrows, ⊣, ≤ ≥.
   Paths are relative to this file (components/), so they point at ../fonts/. */
@font-face { font-family: "Libre Franklin"; src: url("../fonts/LibreFranklin-400-800-latin-ext.50db3ad6b326.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/LibreBaskerville-400-700-latin-ext.87e83407f959.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Baskerville"; src: url("../fonts/LibreBaskerville-italic-400-700-latin-ext.c29ceef2f81e.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Syne Mono"; src: url("../fonts/SyneMono-400-latin-ext.b428b3aaf49c.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Athene Symbols"; src: url("../fonts/embed/AthenePagellaSymbols.0d1b626d207b.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; unicode-range: U+0370-03FF, U+2190-21FF, U+2200-22FF; }

/* ---------- Root ---------- */
/* Syne Mono has a single weight: never let the browser smear a fake bold (or a fake italic) over it. */
html, .ath-root { font-synthesis: none; }
.ath-root, .ath-root * { box-sizing: border-box; }
.ath-root {
  font-family: var(--font-ui); font-size: 15px; line-height: 24px;
  color: var(--ink); background: var(--surface-0);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.ath-root ::selection, .ath-root::selection { background: var(--selection); color: var(--ink); }
.ath-root h1, .ath-root h2, .ath-root h3 { text-wrap: balance; }
.ath-root p { text-wrap: pretty; }
:where(.ath-root) a { color: inherit; }
.ath-root code, .ath-code { font-family: var(--font-mono); font-size: 13px; }
.ath-root pre { font-family: var(--font-mono); font-size: 13px; line-height: 20px; background: var(--surface-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); overflow-x: auto; }
@media (max-width: 640px) { .display { font-size: 28px; line-height: 36px; } }
.ath-root [hidden] { display: none !important; }
.ath-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ath-prose { font-family: var(--font-reading); font-size: 16px; line-height: 28px; max-width: var(--measure-prose); }
.ath-prose h2, .ath-prose h3 { font-family: var(--font-title); font-weight: 800; letter-spacing: -0.02em; }
.ath-prose h2 { font-size: 22px; line-height: 28px; margin: var(--space-6) 0 var(--space-2); }
.ath-prose h3 { font-size: 18px; line-height: 24px; margin: var(--space-5) 0 var(--space-2); }

/* ---------- Motion ---------- */
.ath-btn, .ath-input, .ath-tab, .ath-icon-btn, .ath-topbar__nav a, .ath-choice, .ath-link, .ath-table tr {
  transition: background-color var(--duration-fast) var(--easing-standard), border-color var(--duration-fast) var(--easing-standard),
              color var(--duration-fast) var(--easing-standard), opacity var(--duration-fast) var(--easing-standard);
}
@media (prefers-reduced-motion: reduce) {
  .ath-root *, .ath-root *::before, .ath-root *::after { transition-duration: var(--duration-instant) !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Focus (shared) ---------- */
.ath-root :focus-visible { outline: var(--border-2) solid var(--focus-ring); outline-offset: 2px; }
.ath-tab:focus-visible { outline-offset: -2px; }

/* ---------- Theme-specific content (logos) ---------- */
[data-theme="dark"] .ath-only-light { display: none !important; }
:root:not([data-theme="dark"]) .ath-only-dark { display: none !important; }

/* ---------- Button ---------- */
.ath-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-4);
  font-family: var(--font-ui); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0.01em;
  border-radius: var(--radius-md); border: var(--border-1) solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ath-btn svg { width: 18px; height: 18px; flex: none; }
.ath-btn--primary { background: var(--stroke); color: var(--on-stroke); }
.ath-btn--primary:hover { background: var(--stroke-hover); }
.ath-btn--secondary { background: var(--surface-1); color: var(--ink); border-color: var(--line-strong); }
.ath-btn--secondary:hover { background: var(--surface-2); }
.ath-btn--ghost { background: transparent; color: var(--ink); }
.ath-btn--ghost:hover { background: var(--surface-2); }
.ath-btn--danger { background: var(--surface-1); color: var(--negative); border-color: var(--negative); }
.ath-btn--danger:hover { background: var(--surface-2); }
.ath-btn--sm { min-height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.ath-btn--block { width: 100%; }
.ath-btn:disabled, .ath-btn[aria-disabled="true"] { background: var(--surface-2); color: var(--ink-subtle); border-color: transparent; cursor: not-allowed; }
.ath-btn__cost { font-family: var(--font-mono); font-weight: 600; }

/* ---------- Link ---------- */
.ath-link { color: var(--iris); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.ath-link:hover { text-decoration-thickness: 2px; }
.ath-link--quiet { color: var(--ink); }

/* ---------- Text field, checkbox, password ---------- */
.ath-field { display: grid; gap: var(--space-1); }
.ath-field__label { font-family: var(--font-ui); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.ath-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ath-field__error { font-size: 14px; line-height: 20px; color: var(--negative); }
.ath-input {
  width: 100%; min-height: 40px; padding: var(--space-2) var(--space-3);
  font: inherit; color: var(--ink); background: var(--surface-1);
  border: var(--border-1) solid var(--line-strong); border-radius: var(--radius-md);
}
.ath-input::placeholder { color: var(--ink-subtle); }
.ath-input:hover { border-color: var(--ink-muted); }
.ath-input[aria-invalid="true"] { border-color: var(--negative); }
.ath-input:disabled { background: var(--surface-2); color: var(--ink-subtle); }
textarea.ath-input { min-height: 104px; resize: vertical; font-family: var(--font-reading); font-size: 17px; line-height: 28px; }
.ath-input--mono { font-family: var(--font-mono); font-size: 13px; }
.ath-password { position: relative; }
.ath-password .ath-input { padding-right: 72px; }
.ath-password__toggle { position: absolute; right: 4px; top: 4px; height: 32px; padding: 0 var(--space-2); border: 0; background: transparent; color: var(--ink-muted); font: 600 13px/20px var(--font-ui); border-radius: var(--radius-sm); cursor: pointer; }
.ath-password__toggle:hover { color: var(--ink); background: var(--surface-2); }
.ath-check { display: flex; gap: var(--space-2); align-items: flex-start; font-size: 15px; line-height: 24px; cursor: pointer; }
.ath-check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--stroke); flex: none; }

/* ---------- Choice cards (radio cards, never tabs) ---------- */
.ath-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }
.ath-choice { position: relative; display: grid; gap: var(--space-1); padding: var(--space-4); border: var(--border-1) solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-1); cursor: pointer; }
.ath-choice input { position: absolute; opacity: 0; }
.ath-choice__title { font-weight: 600; }
.ath-choice__text { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ath-choice:has(input:checked) { border: var(--border-2) solid var(--stroke); padding: calc(var(--space-4) - 1px); }
.ath-choice:has(input:focus-visible) { outline: var(--border-2) solid var(--focus-ring); outline-offset: 2px; }

/* ---------- Relation chip (support / attack) ---------- */
.ath-rel { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: 13px; line-height: 20px; font-weight: 600; border: var(--border-1) solid currentColor; white-space: nowrap; }
.ath-rel svg { width: 16px; height: 16px; flex: none; }
.ath-rel--support { color: var(--support); background: var(--support-soft); }
.ath-rel--attack { color: var(--attack); background: var(--attack-soft); }
.ath-rel__count { font-family: var(--font-mono); font-weight: 400; }

/* ---------- Badge ---------- */
.ath-badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); min-height: 22px; border-radius: var(--radius-sm); font-size: 12px; line-height: 20px; font-weight: 600; background: var(--surface-2); color: var(--ink); border: var(--border-1) solid var(--line); white-space: nowrap; }
.ath-badge--accepted { background: var(--surface-1); border-color: var(--stroke); }
.ath-badge--flagged { background: var(--warning-soft); border-color: var(--warning); color: var(--ink); }
.ath-badge svg { width: 14px; height: 14px; }

/* ---------- Version tag (a commit) ---------- */
.ath-version { display: inline-flex; align-items: center; gap: var(--space-2); padding: 2px var(--space-2); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink); background: var(--surface-2); border: var(--border-1) solid transparent; text-decoration: none; white-space: nowrap; }
.ath-version__eye { width: 12px; height: 12px; border-radius: var(--radius-full); flex: none; border: 3px solid var(--line-strong); background: var(--surface-1); }
.ath-version--held { background: var(--surface-1); border-color: var(--stroke); }
.ath-version--held .ath-version__eye { border-color: var(--iris); background: var(--pupil); }

/* ---------- Credits and meter ---------- */
.ath-credits { font-family: var(--font-mono); font-weight: 600; font-size: 15px; line-height: 24px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ath-credits__unit { font-weight: 400; color: var(--ink-muted); margin-left: 2px; }
.ath-credits--positive { color: var(--positive); }
.ath-credits--negative { color: var(--negative); }
.ath-meter { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 14px; line-height: 20px; color: var(--ink); white-space: nowrap; }
.ath-meter__track { width: 72px; height: 6px; border-radius: var(--radius-full); background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.ath-meter__fill { display: block; height: 100%; background: var(--stroke); border-radius: var(--radius-full); }
.ath-meter__value { font-family: var(--font-mono); font-size: 13px; }

/* ---------- Claim card ---------- */
.ath-claim { display: grid; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface-1); border: var(--border-1) solid var(--line); box-shadow: var(--shadow-1); }
.ath-claim__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ath-claim__byline { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ath-claim__text { margin: 0; font-family: var(--font-reading); font-size: 17px; line-height: 28px; color: var(--ink); max-width: var(--measure-claim); }
.ath-claim__text--seed { font-size: 20px; line-height: 32px; }
.ath-claim__target { margin: 0; font-family: var(--font-reading); font-style: italic; font-size: 15px; line-height: 24px; color: var(--ink-muted); max-width: var(--measure-claim); }
.ath-claim__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.ath-claim__spacer { flex: 1; }
.ath-claim--held { border: var(--border-2) solid var(--stroke); padding: calc(var(--space-5) - 1px); }
.ath-claim--selected { box-shadow: inset 4px 0 0 var(--line-strong), var(--shadow-1); }

/* ---------- Label (data caption only) ---------- */
.ath-label { font-family: var(--font-mono); font-size: 11px; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); font-weight: 400; }

/* =====================================================================
   App structure
   ===================================================================== */

/* ---------- Top bar ---------- */
.ath-topbar { position: sticky; top: 0; z-index: 10; background: var(--surface-1); border-bottom: var(--border-1) solid var(--line); }
.ath-topbar__inner { max-width: 1200px; margin: 0 auto; height: 56px; padding: 0 var(--space-4); display: flex; align-items: center; gap: var(--space-4); }
.ath-topbar__logo { display: flex; align-items: center; height: 32px; flex: none; }
.ath-topbar__logo img, .ath-topbar__logo svg { height: 32px; width: auto; display: block; }
.ath-topbar__nav { display: flex; gap: var(--space-1); }
.ath-topbar__nav a { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); text-decoration: none; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); }
.ath-topbar__nav a:hover { background: var(--surface-2); color: var(--ink); }
.ath-topbar__nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 calc(-1 * var(--border-2)) 0 var(--ink); border-radius: 0; }
.ath-topbar__spacer { flex: 1; }
.ath-topbar__tools { display: flex; align-items: center; gap: var(--space-2); }
.ath-topbar__search { width: 220px; min-height: 36px; padding: var(--space-1) var(--space-3); }
.ath-topbar__menu { position: relative; }
@media (max-width: 960px) { .ath-topbar__nav, .ath-topbar__search, .ath-topbar__wide { display: none; } }
@media (max-width: 520px) { .ath-topbar__inner { gap: var(--space-2); padding: 0 var(--space-3); } .ath-topbar__tools .ath-credits { display: none; } .ath-topbar__logo img { height: 28px; } }
@media (max-width: 400px) { .ath-topbar__tools { gap: var(--space-1); } .ath-topbar__tools .ath-btn--sm { padding-left: var(--space-2); padding-right: var(--space-2); } .ath-topbar__logo img, .ath-topbar__logo svg { height: 26px; } }

/* ---------- Icon button, avatar, menu ---------- */
.ath-icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); border: 0; background: transparent; color: var(--ink-muted); cursor: pointer; position: relative; flex: none; }
.ath-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.ath-icon-btn svg { width: 20px; height: 20px; }
.ath-icon-btn--sm { width: 28px; height: 28px; vertical-align: middle; }
.ath-icon-btn--sm svg { width: 16px; height: 16px; }
.ath-rel__count { font-family: var(--font-mono); }
.ath-graph__arrange { position: absolute; top: var(--space-3); left: var(--space-3); z-index: 2; box-shadow: var(--shadow-1); }
.ath-graph__matrix { position: absolute; inset: 0; overflow: auto; padding: var(--space-4) var(--space-4) var(--space-4); padding-top: 64px; background: var(--surface-1); }
.ath-icon-btn__count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-full); background: var(--stroke); color: var(--on-stroke); font: 600 10px/16px var(--font-mono); }
.ath-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--ink); font: 600 12px/1 var(--font-mono); border: var(--border-1) solid var(--line); flex: none; }
.ath-avatar--lg { width: 64px; height: 64px; font-size: 20px; }
.ath-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface-1); border: var(--border-1) solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-2); padding: var(--space-1); z-index: 20; display: grid; }
.ath-menu[hidden] { display: none; }
.ath-menu a, .ath-menu button { display: block; text-align: left; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font: 400 14px/20px var(--font-ui); background: none; border: 0; cursor: pointer; }
.ath-menu a:hover, .ath-menu button:hover { background: var(--surface-2); }
.ath-menu hr { border: 0; border-top: var(--border-1) solid var(--line); margin: var(--space-1) 0; }

/* ---------- Page layout ---------- */
.ath-page { max-width: 1200px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); }
.ath-page--narrow { max-width: 760px; }
.ath-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); align-items: start; }
.ath-split__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); min-width: 0; }
.ath-split__aside { display: grid; gap: var(--space-4); position: sticky; top: calc(56px + var(--space-4)); }
.ath-split > *, .ath-split__main > * { min-width: 0; }
.ath-stack { display: grid; gap: var(--space-4); }
.ath-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
@media (max-width: 960px) { .ath-split { grid-template-columns: minmax(0, 1fr); } .ath-split__aside { position: static; } }

/* ---------- Discussion header ---------- */
.ath-dhead { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.ath-dhead__title { margin: 0; font-family: var(--font-title); font-size: 26px; line-height: 32px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); max-width: 30ch; }
.ath-dhead__byline { margin: 0; font-size: 15px; line-height: 24px; color: var(--ink-muted); }
@media (max-width: 640px) { .ath-dhead__title { font-size: 22px; line-height: 28px; } }

/* ---------- Paper card ---------- */
.ath-paper { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border: var(--border-1) solid var(--line); border-radius: var(--radius-md); background: var(--surface-1); }
.ath-paper__text { flex: 1 1 280px; margin: 0; font-size: 15px; line-height: 24px; }
.ath-paper__title { font-family: var(--font-reading); font-style: italic; }

/* ---------- Tabs ---------- */
.ath-tabs { display: flex; gap: var(--space-1); border-bottom: var(--border-1) solid var(--line); margin-bottom: var(--space-5); overflow-x: auto; }
.ath-tab { appearance: none; background: none; border: 0; padding: var(--space-3); font-family: var(--font-ui); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); cursor: pointer; text-decoration: none; white-space: nowrap; }
.ath-tab:hover { color: var(--ink); }
.ath-tab[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 calc(-1 * var(--border-2)) 0 var(--iris); }
.ath-tab__count { font-family: var(--font-mono); font-weight: 400; color: var(--ink-muted); margin-left: var(--space-1); }

/* ---------- Panel and facts ---------- */
.ath-panel { background: var(--surface-1); border: var(--border-1) solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.ath-panel__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: var(--border-1) solid var(--line); }
.ath-panel__title { margin: 0; font-family: var(--font-title); font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.ath-panel__body { padding: var(--space-4); display: grid; gap: var(--space-3); }
.ath-panel__body--flush { padding: 0; }
.ath-panel__body p { margin: 0; }
.ath-facts { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4); margin: 0; font-size: 15px; line-height: 24px; }
.ath-facts dt { color: var(--ink-muted); }
.ath-facts dd { margin: 0; color: var(--ink); text-align: right; }
/* Long values (sentences, hashes with actions): values read left-aligned; on phones each term sits above its value. */
.ath-facts--long { grid-template-columns: minmax(140px, auto) 1fr; }
.ath-facts--long dd { text-align: left; }
@media (max-width: 600px) { .ath-facts--long { grid-template-columns: 1fr; gap: 0; } .ath-facts--long dd { margin-bottom: var(--space-2); } }
.ath-figure-big { font-family: var(--font-mono); font-size: 28px; line-height: 36px; font-weight: 600; }

/* ---------- Version bar ---------- */
.ath-versionbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface-1); border: var(--border-1) solid var(--line); border-radius: var(--radius-lg); margin-bottom: var(--space-4); }
.ath-versionbar__text { flex: 1 1 360px; margin: 0; font-size: 15px; line-height: 24px; }
.ath-versionbar__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ath-versionbar--old { border-color: var(--warning); background: var(--warning-soft); }

/* ---------- Banner (inline) ---------- */
.ath-banner { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 15px; line-height: 24px; border: var(--border-1) solid transparent; }
.ath-banner svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.ath-banner p { margin: 0; }
.ath-banner--warning { background: var(--warning-soft); color: var(--ink); border-color: var(--warning); }
.ath-banner--warning svg { color: var(--warning); }
.ath-banner--info { background: var(--surface-2); color: var(--ink); }
.ath-banner--error { background: var(--surface-1); border-color: var(--negative); }
.ath-banner--error svg { color: var(--negative); }
.ath-banner__title { font-weight: 600; display: block; }

/* ---------- Warning confirm ---------- */
.ath-warnconfirm { display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--warning-soft); border: var(--border-1) solid var(--warning); }
.ath-warnconfirm ul { margin: 0; padding-left: 1.2em; }

/* ---------- Segmented control (relation picker) ---------- */
.ath-segmented { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 3px; background: var(--surface-2); border-radius: var(--radius-md); }
.ath-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.ath-segmented label { display: inline-flex; align-items: center; gap: var(--space-1); padding: 6px var(--space-3); border-radius: calc(var(--radius-md) - 2px); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); cursor: pointer; }
.ath-segmented label svg { width: 16px; height: 16px; }
.ath-segmented input:checked + label { background: var(--surface-1); color: var(--ink); box-shadow: var(--shadow-1); }
.ath-segmented input:checked + label.is-support { color: var(--support); }
.ath-segmented input:checked + label.is-attack { color: var(--attack); }
.ath-segmented input:focus-visible + label { outline: var(--border-2) solid var(--focus-ring); outline-offset: 1px; }

/* ---------- Stake control (stepper) ---------- */
.ath-stake { display: grid; gap: var(--space-2); }
.ath-stake__row { display: flex; align-items: center; gap: var(--space-2); }
.ath-stake__value { min-width: 96px; text-align: center; font-family: var(--font-mono); font-size: 18px; line-height: 28px; font-weight: 600; }
.ath-stake__risk { margin: 0; font-size: 15px; line-height: 24px; color: var(--ink); }

/* ---------- Composer (operation composer) ---------- */
.ath-composer__steps { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.ath-composer__steps li[aria-current="step"] { color: var(--ink); font-weight: 600; }
.ath-composer__steps { flex-wrap: wrap; }
.ath-draft { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); counter-reset: d; }
.ath-draft li { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-2); align-items: start; padding: var(--space-2) var(--space-3); border: var(--border-1) solid var(--line); border-radius: var(--radius-md); background: var(--surface-1); font-size: 14px; line-height: 20px; }
.ath-draft__text { grid-column: 1 / -1; font-family: var(--font-reading); font-size: 15px; line-height: 22px; }
.ath-draft li .ath-link { grid-row: 1; grid-column: 2; justify-self: end; font-size: 13px; }
.ath-composer__target { margin: 0; padding-left: var(--space-3); border-left: var(--border-2) solid var(--line-strong); font-family: var(--font-reading); font-style: italic; font-size: 15px; line-height: 24px; }
.ath-composer__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }

/* ---------- Dialog ---------- */
.ath-scrim { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: var(--space-4); z-index: 50; }
.ath-scrim[hidden] { display: none; }
.ath-dialog { width: min(520px, 100%); max-height: calc(100vh - 2 * var(--space-4)); overflow: auto; background: var(--surface-1); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); display: grid; }
.ath-dialog__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-5) 0; }
.ath-dialog__title { margin: 0; flex: 1; font-family: var(--font-title); font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ath-dialog__body { padding: var(--space-3) var(--space-5); display: grid; gap: var(--space-3); }
.ath-dialog__body p { margin: 0; }
.ath-dialog__foot { padding: var(--space-3) var(--space-5) var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }

/* ---------- Notice (toast) ---------- */
.ath-notices { position: fixed; right: var(--space-4); bottom: var(--space-4); display: grid; gap: var(--space-2); z-index: 60; width: min(380px, calc(100% - 2 * var(--space-4))); }
.ath-notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); background: var(--surface-1); border: var(--border-1) solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-2); font-size: 15px; line-height: 24px; }
.ath-notice p { margin: 0; flex: 1; }
.ath-notice--error { border-color: var(--negative); }

/* ---------- States: loading, empty, error ---------- */
.ath-skel { display: block; background: var(--surface-2); border-radius: var(--radius-sm); height: 14px; }
.ath-skel--text { height: 18px; margin: 6px 0; }
.ath-skel--block { height: 120px; border-radius: var(--radius-lg); }
.ath-state { display: grid; gap: var(--space-3); justify-items: start; padding: var(--space-6) var(--space-5); border: var(--border-1) dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-1); }
.ath-state__title { margin: 0; font-family: var(--font-title); font-weight: 800; font-size: 18px; line-height: 24px; letter-spacing: -0.02em; }
.ath-state p { margin: 0; max-width: var(--measure-prose); }
.ath-state--error { border-style: solid; border-color: var(--negative); }

/* ---------- Data table ---------- */
.ath-table-wrap { overflow-x: auto; }
.ath-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.ath-table th { position: sticky; top: 0; text-align: left; font-family: var(--font-title); font-size: 14px; line-height: 20px; letter-spacing: -0.005em; font-weight: 700; color: var(--ink); background: var(--surface-2); padding: var(--space-2) var(--space-3); border-bottom: var(--border-2) solid var(--line-strong); }
.ath-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.ath-table th button:focus-visible { outline: var(--border-2) solid var(--focus-ring); outline-offset: 2px; }
.ath-table td { padding: var(--space-2) var(--space-3); border-top: var(--border-1) solid var(--line); color: var(--ink); vertical-align: middle; }
.ath-table tr[aria-selected="true"] td, .ath-table tr.is-mine td { background: var(--iris-soft); }
.ath-table .num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.ath-table th.num { font-family: var(--font-title); }
@media (max-width: 640px) {
  .ath-table--stack thead { display: none; }
  .ath-table--stack, .ath-table--stack tbody { display: block; width: 100%; }
  .ath-table--stack tr { display: block; padding: var(--space-2) var(--space-3); border-top: var(--border-1) solid var(--line); }
  .ath-table--stack td { display: grid; grid-template-columns: minmax(88px, 38%) minmax(0, 1fr); gap: var(--space-3); align-items: baseline; border: 0; padding: 2px 0; text-align: left; overflow-wrap: anywhere; }
  .ath-table--stack td.num { text-align: left; }
  .ath-table--stack td::before { content: attr(data-label); font-family: var(--font-ui); font-size: 13px; line-height: 20px; font-weight: 700; color: var(--ink-muted); }
  .ath-table--stack td[data-label=""]::before { content: none; }
  .ath-table--stack td[data-label=""] { display: block; }
  .ath-table--stack tr[aria-selected="true"] { background: var(--iris-soft); }
  .ath-table--stack tr[aria-selected="true"] td { background: transparent; }
}

/* ---------- Diff list ---------- */
.ath-diff { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ath-diff li { display: grid; grid-template-columns: 76px 1fr; gap: var(--space-3); align-items: start; padding: var(--space-2) 0; border-top: var(--border-1) solid var(--line); }
.ath-diff__kind { font-family: var(--font-mono); font-size: 13px; line-height: 24px; }
.ath-diff__kind--added { color: var(--positive); }
.ath-diff__kind--removed { color: var(--negative); }
.ath-diff__old { text-decoration: line-through; color: var(--ink-muted); }

/* ---------- Receipt ---------- */
.ath-receipt { display: grid; gap: var(--space-2); font-size: 15px; line-height: 24px; }
.ath-receipt__row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); padding: var(--space-2) 0; border-top: var(--border-1) solid var(--line); }
.ath-receipt__row--total { border-top: var(--border-2) solid var(--ink); font-weight: 600; }

/* ---------- Stepper ---------- */
.ath-stepper { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; counter-reset: step; }
.ath-stepper li { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); border: var(--border-1) solid var(--line); color: var(--ink-muted); font-weight: 600; font-size: 14px; }
.ath-stepper li::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-full); background: var(--surface-2); font: 600 12px/1 var(--font-mono); color: var(--ink); }
.ath-stepper li[aria-current="step"] { color: var(--ink); border-color: var(--stroke); }
.ath-stepper li[aria-current="step"]::before { background: var(--stroke); color: var(--on-stroke); }
.ath-stepper li.is-done::before { content: "✓"; }

/* ---------- File drop ---------- */
.ath-filedrop { display: grid; gap: var(--space-2); justify-items: start; padding: var(--space-5); border: var(--border-1) solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-1); }
.ath-filedrop.is-over { border: var(--border-2) solid var(--stroke); padding: calc(var(--space-5) - 1px); }
.ath-filedrop__name { font-family: var(--font-mono); font-size: 13px; }

/* ---------- Recovery codes ---------- */
.ath-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; padding: var(--space-4); list-style: none; background: var(--surface-2); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 15px; line-height: 24px; }

/* ---------- Hero ---------- */
.ath-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; padding-top: var(--space-6); }
.ath-hero__text { display: grid; gap: var(--space-4); align-content: start; }
.ath-hero__title { margin: 0; font-family: var(--font-title); font-size: 40px; line-height: 48px; font-weight: 800; letter-spacing: -0.02em; max-width: 18ch; }
.ath-hero__lede { margin: 0; font-size: 18px; line-height: 28px; max-width: 46ch; }
.ath-hero__audience { margin: 0; font-size: 15px; line-height: 24px; color: var(--ink-muted); }
@media (max-width: 960px) { .ath-hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); padding-top: var(--space-5); } .ath-hero__title { font-size: 30px; line-height: 36px; } }

/* ---------- Auth form ---------- */
.ath-auth { display: grid; gap: var(--space-3); padding: var(--space-5); background: var(--surface-1); border: var(--border-1) solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); max-width: 440px; }
.ath-auth__title { margin: 0; font-family: var(--font-title); font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ath-auth__grant { margin: 0; font-size: 15px; line-height: 24px; }
.ath-auth__alt { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; font-size: 15px; }

/* ---------- Marketing sections ---------- */
.ath-section { padding: var(--space-7) 0 0; display: grid; gap: var(--space-4); }
.ath-section__title { margin: 0; font-family: var(--font-title); font-size: 26px; line-height: 32px; font-weight: 800; letter-spacing: -0.02em; }
.ath-section__lede { margin: 0; max-width: var(--measure-prose); font-size: 16px; line-height: 28px; font-family: var(--font-reading); }
.ath-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; counter-reset: s; }
.ath-steps > li { display: grid; gap: var(--space-2); align-content: start; }
.ath-steps h3 { margin: 0; font-family: var(--font-title); font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ath-steps h3::before { counter-increment: s; content: counter(s) ". "; font-family: var(--font-mono); font-weight: 600; }
.ath-steps p { margin: 0; }
.ath-audiences { display: grid; gap: var(--space-5); }
.ath-audience { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-4); padding-top: var(--space-4); border-top: var(--border-1) solid var(--line); }
.ath-audience h3 { margin: 0; font-family: var(--font-title); font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ath-audience p { margin: 0; max-width: var(--measure-prose); }
@media (max-width: 760px) { .ath-steps { grid-template-columns: minmax(0, 1fr); } .ath-audience { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); } }

/* ---------- Discussion card (lists) ---------- */
.ath-dcard { display: grid; gap: var(--space-2); padding: var(--space-4); border-top: var(--border-1) solid var(--line); }
.ath-dcard__title { margin: 0; font-family: var(--font-title); font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ath-dcard__title a { text-decoration: none; }
.ath-dcard__title a:hover { text-decoration: underline; }
.ath-dcard p { margin: 0; font-size: 15px; line-height: 24px; color: var(--ink-muted); }

/* ---------- Notifications ---------- */
.ath-notifs { margin: 0; padding: 0; list-style: none; }
.ath-notifs li { display: grid; grid-template-columns: 12px 1fr auto; gap: var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); border-top: var(--border-1) solid var(--line); }
.ath-notifs__dot { width: 8px; height: 8px; margin-top: 8px; border-radius: var(--radius-full); }
.ath-notifs li.is-unread .ath-notifs__dot { background: var(--iris); }
.ath-notifs time { font-size: 13px; color: var(--ink-muted); white-space: nowrap; }

/* ---------- Profile ---------- */
.ath-profile { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.ath-profile__name { margin: 0; font-family: var(--font-title); font-size: 26px; line-height: 32px; font-weight: 800; letter-spacing: -0.02em; }
.ath-profile p { margin: 0; }
.ath-scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.ath-score { display: grid; gap: var(--space-1); }
.ath-score p { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
@media (max-width: 640px) { .ath-scores { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Paper viewer ---------- */
.ath-pdf { width: 100%; height: 72vh; min-height: 420px; border: var(--border-1) solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }

/* ---------- Chart (bars and lines drawn as inline SVG) ---------- */
.ath-chart { width: 100%; height: auto; font-family: var(--font-mono); font-size: 11px; }
.ath-chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.ath-chart .grid { stroke: var(--line); stroke-width: 1; }
.ath-chart .series { fill: none; stroke: var(--stroke); stroke-width: 2; }
.ath-chart .bar { fill: var(--stroke); }
.ath-chart text { fill: var(--ink-muted); }

/* ---------- Footer ---------- */
.ath-footer { border-top: var(--border-1) solid var(--line); margin-top: var(--space-8); background: var(--surface-1); }
.ath-footer__inner { max-width: 1200px; margin: 0 auto; padding: var(--space-6) var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); align-items: center; }
.ath-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.ath-footer a { color: var(--ink); font-size: 14px; }
.ath-footer p { margin: 0; font-size: 14px; color: var(--ink-muted); }

/* ---------- Graph canvas and legend ---------- */
.ath-graph { position: relative; height: 520px; background: var(--surface-1); border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.ath-graph__canvas { position: absolute; inset: 0; }
.ath-graph__tools { position: absolute; top: var(--space-3); right: var(--space-3); display: grid; gap: var(--space-1); z-index: 2; }
.ath-graph__tools .ath-icon-btn { background: var(--surface-1); border: var(--border-1) solid var(--line); box-shadow: var(--shadow-1); }
.ath-graph__note { position: absolute; left: var(--space-3); bottom: var(--space-3); z-index: 2; font-size: 13px; line-height: 20px; color: var(--ink-muted); background: var(--surface-1); padding: 2px var(--space-2); border-radius: var(--radius-sm); }
.ath-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; font-size: 14px; line-height: 20px; color: var(--ink); }
.ath-legend__item { display: inline-flex; align-items: center; gap: var(--space-2); }
.ath-legend__swatch { width: 16px; height: 16px; flex: none; }
.ath-matrix { border-collapse: collapse; font-family: var(--font-mono); font-size: 11px; }
.ath-matrix th, .ath-matrix td { width: 18px; height: 18px; padding: 0; text-align: center; border: 1px solid var(--line); }
.ath-matrix th { color: var(--ink-muted); font-weight: 400; }
.ath-matrix td.s { background: var(--support-soft); color: var(--support); }
.ath-matrix td.a { background: var(--attack-soft); color: var(--attack); }

/* Eligibility checklist (stake dialog, editor actions): each line says yes or no in words; the mark only repeats it. */
.ath-checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); font-size: 15px; line-height: 22px; }
.ath-checklist li { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-2); }
.ath-checklist li::before { font-family: var(--font-mono); font-weight: 600; }
.ath-checklist li.is-ok::before { content: "✓"; color: var(--positive); }
.ath-checklist li.is-no::before { content: "✕"; color: var(--negative); }

/* ---------- Version actions (one group everywhere; icon-only on phones) ---------- */
.ath-vactions { display: flex; flex-wrap: nowrap; gap: var(--space-2); align-items: center; }
.ath-vactions .ath-btn { white-space: nowrap; }
.ath-vactions .ath-btn svg { width: 16px; height: 16px; }
@media (max-width: 520px) {
  .ath-vactions .ath-btn { padding: 0; width: 36px; min-height: 36px; justify-content: center; }
  .ath-vactions .ath-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Hold panel with the confidence slider (inline, never a modal) ---------- */
.ath-holdpanel { margin: 0 0 var(--space-4); padding: var(--space-4); background: var(--surface-1); border: var(--border-2) solid var(--stroke); border-radius: var(--radius-lg); display: grid; gap: var(--space-3); }
.ath-holdpanel p { margin: 0; }
.ath-holdpanel__title { margin: 0; font-family: var(--font-title); font-size: 18px; line-height: 24px; font-weight: 800; letter-spacing: -0.02em; }
.ath-confidence__row { display: flex; align-items: center; gap: var(--space-3); }
.ath-confidence__range { flex: 1; min-width: 0; accent-color: var(--stroke); height: 28px; }
.ath-confidence__value { min-width: 52px; text-align: right; font-family: var(--font-mono); font-size: 18px; line-height: 28px; font-weight: 600; }
.ath-confidence__scale { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink-muted); padding-right: 64px; }
.ath-relateback { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.ath-unanswered { font-style: italic; }
.ath-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--warning); font-weight: 600; font-size: 13px; }
.ath-flag svg { width: 14px; height: 14px; }

/* ---------- Claim matrix: standalone, scrollable, selectable cells ---------- */
.ath-matrix td button { all: unset; display: grid; place-items: center; width: 100%; height: 100%; cursor: pointer; font-size: 11px; }
.ath-matrix td button:focus-visible { outline: var(--border-2) solid var(--focus-ring); outline-offset: -2px; }
.ath-matrix td.both { background: var(--surface-2); }
.ath-matrix .g-a { color: var(--attack); } .ath-matrix .g-s { color: var(--support); }
.ath-matrix td.recip { box-shadow: inset 0 0 0 2px var(--warning); }
.ath-matrix td.is-selected { outline: var(--border-2) solid var(--iris); outline-offset: -2px; }
.ath-matrix thead th, .ath-matrix th[scope="col"] { position: sticky; top: 0; background: var(--surface-1); z-index: 1; }
.ath-matrix th[scope="row"] { position: sticky; left: 0; background: var(--surface-1); z-index: 1; }
.ath-matrixview { border: var(--border-1) solid var(--line); border-radius: var(--radius-md); max-height: 70vh; overflow: auto; background: var(--surface-1); }
.ath-matrixview .ath-matrix th, .ath-matrixview .ath-matrix td { width: 24px; height: 24px; }

/* ---------- Grounded labels on claim graphs (informational) ---------- */
.ath-labelkey { display: inline-flex; gap: var(--space-3); font-size: 13px; color: var(--ink-muted); }
