/* =========================================================================
   Mindful Social — design tokens + base styles
   ========================================================================= */

:root {
  /* fonts: DM Sans body, DM Mono code, Instrument Serif as display flourish */
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "JetBrains Mono", monospace;
  --font-serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --sans: var(--font-sans);
  --mono: var(--font-mono);
  --serif: var(--font-serif);

  /* type scale */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  --container: 1080px;
  --container-wide: 1280px;
  --container-narrow: 720px;

  /* node-type hues (used to derive badge color) */
  --topic-h: 250; /* blue */
  --view-h: 22; /* red */
  --finding-h: 332; /* rose        */
  --comment-h: 145; /* teal-green  */

  /* edge-kind colors */
  --supports: oklch(72% 0.14 158);
  --opposes: oklch(68% 0.17 22);
  --refines: oklch(72% 0.12 230);
  --cites: oklch(70% 0.12 290);
  --relates: oklch(72% 0.02 250);

  --density: 1;
}

/* ---- DARK (default) ----------------------------------------------------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: oklch(18% 0.012 60);
  --bg-elev-1: oklch(22% 0.014 60);
  --bg-elev-2: oklch(26% 0.016 60);
  --bg-elev-3: oklch(31% 0.018 60);
  --bg-inset: oklch(14% 0.01 60);

  --border: oklch(100% 0 0 / 0.08);
  --border-strong: oklch(100% 0 0 / 0.14);
  --border-input: oklch(100% 0 0 / 0.12);

  --text: oklch(95% 0.012 80);
  --text-muted: oklch(74% 0.018 70);
  --text-subtle: oklch(58% 0.015 70);

  --accent: oklch(78% 0.13 215);
  --accent-strong: oklch(85% 0.14 215);
  --accent-bg: oklch(78% 0.13 215 / 0.16);
  --accent-border: oklch(78% 0.13 215 / 0.42);

  --danger: oklch(68% 0.18 22);
  --danger-bg: oklch(68% 0.18 22 / 0.12);

  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow:
    0 4px 16px -4px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  --shadow-lg:
    0 24px 48px -16px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;

  /* legacy palette aliases — many templates set inline styles using the
     pre-redesign token names; mapping them through keeps those usages
     legible under the new palette without touching every template. */
  --paper: var(--bg-elev-1);
  --ink: var(--text);
  --ink-2: var(--text);
  --ink-3: var(--text-muted);
  --ink-4: var(--text-subtle);
  --line: var(--border);
  --line-2: var(--border);
  --bg-2: var(--bg-elev-2);
  --bg-3: var(--bg-elev-3);
  --accent-deep: var(--accent-strong);
  --accent-ink: oklch(20% 0.04 215);
  --warm: oklch(75% 0.14 32);
  --warm-soft: oklch(75% 0.14 32 / 0.18);

  /* per-kind chip palette in dark mode */
  --topic-bg: oklch(75% 0.13 var(--topic-h) / 0.12);
  --topic-ink: oklch(82% 0.13 var(--topic-h));
  --view-bg: oklch(75% 0.13 var(--view-h) / 0.13);
  --view-ink: oklch(82% 0.13 var(--view-h));
  --finding-bg: oklch(72% 0.15 var(--finding-h) / 0.12);
  --finding-ink: oklch(82% 0.13 var(--finding-h));
  --comment-bg: oklch(72% 0.1 var(--comment-h) / 0.11);
  --comment-ink: oklch(80% 0.1 var(--comment-h));
}

/* ---- LIGHT -------------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: oklch(97.5% 0.014 80);
  --bg-elev-1: oklch(99% 0.008 80);
  --bg-elev-2: oklch(99% 0.008 80);
  --bg-elev-3: oklch(94% 0.014 80);
  --bg-inset: oklch(96% 0.014 80);
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.12);
  --border-input: rgba(0, 0, 0, 0.14);
  --text: #1a1a1f;
  --text-muted: #5a5a64;
  --text-subtle: #8a8a94;
  --accent: oklch(52% 0.16 250);
  --accent-strong: oklch(45% 0.18 250);
  --accent-bg: oklch(52% 0.16 250 / 0.08);
  --accent-border: oklch(52% 0.16 250 / 0.3);
  --danger: oklch(58% 0.18 22);
  --danger-bg: oklch(58% 0.18 22 / 0.08);
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.12);

  --paper: var(--bg-elev-1);
  --ink: var(--text);
  --ink-2: var(--text);
  --ink-3: var(--text-muted);
  --ink-4: var(--text-subtle);
  --line: var(--border);
  --line-2: var(--border);
  --bg-2: var(--bg-elev-3);
  --bg-3: var(--bg-elev-3);
  --accent-deep: var(--accent-strong);
  --accent-ink: oklch(98% 0.01 250);
  --warm: oklch(76% 0.16 35);
  --warm-soft: oklch(92% 0.05 35);

  --topic-bg: oklch(93% 0.05 var(--topic-h));
  --topic-ink: oklch(32% 0.1 var(--topic-h));
  --view-bg: oklch(93% 0.06 var(--view-h));
  --view-ink: oklch(36% 0.12 var(--view-h));
  --finding-bg: oklch(93% 0.06 var(--finding-h));
  --finding-ink: oklch(36% 0.1 var(--finding-h));
  --comment-bg: oklch(93% 0.04 var(--comment-h));
  --comment-ink: oklch(34% 0.08 var(--comment-h));
}

/* =========================================================================
   Base
   ========================================================================= */

* {
  box-sizing: border-box;
}
*::selection {
  background: var(--accent-bg);
  color: var(--text);
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 var(--s-3);
  line-height: 1.25;
  color: var(--text);
}
h1 {
  font-size: var(--fs-3xl);
  letter-spacing: -0.022em;
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}
h4 {
  font-size: var(--fs-md);
  font-weight: 600;
}

p {
  margin: 0 0 var(--s-3);
}
p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-8) 0;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-inset);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

button {
  font: inherit;
  color: inherit;
}

/* Serif display headings — flourish kept from the original design. */
.h-display,
.h-1,
.h-2,
.hero h1,
.auth h1,
.node header h1,
.node > header h1,
.profile-head h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.1;
}
.h-display {
  font-size: clamp(48px, 8vw, 120px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.h-display em {
  font-style: italic;
  color: var(--accent-strong);
}
.h-1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}
.h-2 {
  font-size: var(--fs-2xl);
  line-height: 1.25;
  margin: 0;
}
.h-3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-lg);
  line-height: 1.35;
  margin: 0;
  letter-spacing: -0.005em;
}

/* Section heading blocks: eyebrow + display heading + lede. Widen the
   internal gap so the display heading has breathing room above and below. */
.col.gap-12:has(.h-1),
.col.gap-12:has(.h-2),
.col.gap-12:has(.h-display),
.col.gap-16:has(.h-1),
.col.gap-16:has(.h-2),
.col.gap-16:has(.h-display) {
  gap: var(--s-5);
}
.eyebrow {
  line-height: 1.6;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}
.lede {
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 56ch;
}
.muted {
  color: var(--text-muted);
}

/* =========================================================================
   Shell — topbar + footer
   ========================================================================= */

.app {
  min-height: 100vh;
}

/* `.topbar` is the redesign name; `.nav` is what existing templates use.
   Style both — the two markup paths converge here. */
.topbar,
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner,
.nav-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--s-3) var(--s-8);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 28%,
    oklch(98% 0.04 215) 0%,
    oklch(82% 0.12 215) 35%,
    oklch(58% 0.16 215) 75%,
    oklch(38% 0.1 215) 100%
  );
  box-shadow:
    inset 0 -3px 6px oklch(40% 0.1 215 / 0.5),
    inset 0 2px 3px oklch(100% 0 0 / 0.4),
    0 4px 10px -3px oklch(58% 0.16 215 / 0.55);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  top: 14%;
  left: 22%;
  width: 38%;
  height: 28%;
  border-radius: 50%;
  background: linear-gradient(
    to bottom,
    oklch(100% 0 0 / 0.85),
    oklch(100% 0 0 / 0)
  );
  filter: blur(0.3px);
}

.nav-spacer {
  flex: 1;
}

.topnav,
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 var(--s-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  color: var(--text-muted);
  font-weight: 500;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.12s,
    color 0.12s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-elev-2);
  text-decoration: none;
}
.nav-link.is-active,
.nav-link.active {
  color: var(--text);
  background: var(--bg-elev-2);
}

.theme-toggle {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-elev-2);
}

/* topbar search — pill input with leading icon */
.topbar-search,
.nav-search {
  position: relative;
  max-width: 240px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-input);
  background: var(--bg-inset);
  border-radius: var(--radius-pill);
  padding: 0 10px;
  transition:
    border-color 0.12s,
    background 0.12s,
    box-shadow 0.12s;
}
/* The generic input[type="search"] rule further down has the same
   specificity as `.nav-search input`, so on source order it would win and
   redraw the input with its own border, padding, and background inside the
   pill — which looks like the leading icon overlapping the text. Adding
   `[type="search"]` here bumps specificity above the generic rule. */
.topbar-search input[type="search"],
.nav-search input[type="search"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  padding: 8px 0;
  border-radius: 0;
  outline: none;
  min-width: 0;
}
.topbar-search input[type="search"]::placeholder,
.nav-search input[type="search"]::placeholder {
  color: var(--text-subtle);
}
.topbar-search input[type="search"]:hover,
.nav-search input[type="search"]:hover {
  border-color: transparent;
}
.topbar-search:hover,
.nav-search:hover {
  border-color: var(--border-strong);
}
.topbar-search input[type="search"]:focus,
.nav-search input[type="search"]:focus {
  box-shadow: none;
}
.topbar-search:focus-within,
.nav-search:focus-within {
  border-color: var(--accent-border);
  background: var(--bg-elev-1);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.topbar-search input[type="search"]::-webkit-search-decoration,
.topbar-search input[type="search"]::-webkit-search-cancel-button,
.nav-search input[type="search"]::-webkit-search-decoration,
.nav-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.topbar-search svg,
.nav-search > svg {
  width: 14px;
  height: 14px;
  color: var(--text-subtle);
  flex: none;
  pointer-events: none;
}
.topbar-search kbd,
.nav-search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  pointer-events: none;
}

/* Account dropdown — supports both legacy `.user-menu` (details/summary) and
   new `.menu` (button + panel) markup. */
.user-menu,
.menu {
  position: relative;
}

.menu-trigger,
.user-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: inherit;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.menu-trigger:hover,
.user-menu > summary:hover {
  background: var(--bg-elev-3);
  border-color: var(--border-strong);
}
.user-menu > summary::-webkit-details-marker {
  display: none;
}
.user-menu > summary::marker {
  content: "";
}

.menu-name,
.user-menu-name {
  font-size: var(--fs-sm);
  font-weight: 500;
}
.menu-caret,
.user-menu-caret {
  font-size: 10px;
  color: var(--text-subtle);
  transition: transform 0.15s;
}
.user-menu[open] > summary .user-menu-caret {
  transform: rotate(180deg);
}

.menu-panel,
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  padding: 6px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-panel a,
.menu-panel button,
.user-menu-panel a,
.user-menu-panel button,
.user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.menu-panel a:hover,
.menu-panel button:hover,
.user-menu-panel a:hover,
.user-menu-panel button:hover,
.user-menu-item:hover {
  background: var(--bg-elev-3);
}
.menu-panel hr,
.user-menu-divider {
  height: 1px;
  margin: 4px 6px;
  border: 0;
  background: var(--border);
}
.user-menu-form,
.menu-form {
  margin: 0;
  display: contents;
}

/* main container — the redesign uses `main` directly, the legacy templates
   wrap content in `.page`. Both deliver the same container width. */
main {
  display: block;
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--s-10) var(--s-8) var(--s-16);
}
main.wide {
  max-width: var(--container-wide);
}

.page {
  /* legacy wrapper inside <main>; let it act as a passthrough so old
     templates render with the right gutters from <main>. */
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.page.narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
}
.page.medium {
  max-width: 880px;
  margin: 0 auto;
}

/* On the landing page the .section-paper / .section-cream / .hero / standalone
   .page bands have their own backgrounds and span the full main width — so
   the .page wrapper inside them needs horizontal gutters of its own, plus a
   centered max-width to keep line lengths readable. */
section.section-paper > .page,
section.section-cream > .page,
section.hero > .page,
section.page {
  padding-left: var(--s-8);
  padding-right: var(--s-8);
  max-width: var(--container);
  margin: 0 auto;
}

/* Footer — supports `.foot` (new) and `.site-footer` (legacy). */
.foot,
.site-footer {
  max-width: var(--container-wide);
  margin: var(--s-16) auto 0;
  padding: var(--s-6) var(--s-5);
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.site-footer {
  background: transparent;
}

/* =========================================================================
   Buttons / forms
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.12s,
    border-color 0.12s,
    transform 0.04s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-elev-3);
  border-color: var(--border-strong);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.btn.primary,
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover,
.btn.accent:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn.ghost:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}

.btn.danger {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 30%, transparent);
  background: var(--danger-bg);
}
.btn.danger:hover {
  background: color-mix(in oklab, var(--danger) 18%, transparent);
}

.btn.sm {
  padding: 5px 9px;
  font-size: var(--fs-xs);
}
.btn.lg {
  padding: 12px 18px;
  font-size: var(--fs-md);
}
/* Square icon-only button: same height as .btn.sm but no horizontal
   padding, so the SVG sits in a tidy square. Used for the admin roster
   edit/delete actions. */
.btn.icon-only {
  padding: 5px;
  width: 28px;
  height: 28px;
}
.btn.icon-only svg {
  display: block;
}

.link,
button.link {
  display: inline-block;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--accent-strong);
  cursor: pointer;
  text-underline-offset: 3px;
}
.link:hover,
button.link:hover {
  text-decoration: underline;
}

form.inline,
.inline {
  display: inline;
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}
.form label small,
.form small {
  color: var(--text-subtle);
  font-weight: 400;
  font-size: var(--fs-xs);
}

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="url"],
.form input[type="search"],
.form select,
.form textarea,
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid var(--border-input);
  background: var(--bg-inset);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-base);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.form textarea,
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
}
.input.lg,
input.input.lg {
  padding: 14px 16px;
  font-size: var(--fs-md);
}
.form input:hover,
.form select:hover,
.form textarea:hover,
.input:hover,
input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong);
}
.form input:focus,
.form select:focus,
.form textarea:focus,
.input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-border);
  background: var(--bg-elev-1);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.form input[aria-invalid="true"],
.form select[aria-invalid="true"],
.form textarea[aria-invalid="true"],
.input[aria-invalid="true"],
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"],
.EasyMDEContainer[aria-invalid="true"] .CodeMirror {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}
.form-row {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
}

.EasyMDEContainer {
  color: var(--text);
}
.EasyMDEContainer .editor-toolbar {
  border-color: var(--border-input);
  background: var(--bg-elev-1);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  opacity: 1;
}
.EasyMDEContainer .editor-toolbar button {
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.EasyMDEContainer .editor-toolbar button .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}
.EasyMDEContainer .editor-toolbar button.active,
.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button:focus-visible {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--accent);
  outline: none;
}
.EasyMDEContainer .editor-toolbar i.separator {
  border-left-color: var(--border);
  border-right-color: transparent;
}
.EasyMDEContainer .CodeMirror {
  border-color: var(--border-input);
  background: var(--bg-inset);
  color: var(--text);
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
}
.EasyMDEContainer .CodeMirror-cursor {
  border-left-color: var(--text);
}
.EasyMDEContainer .CodeMirror-gutters {
  background: var(--bg-elev-1);
  border-right-color: var(--border);
}
.EasyMDEContainer .CodeMirror-linenumber,
.EasyMDEContainer .cm-comment,
.EasyMDEContainer .cm-quote,
.EasyMDEContainer .cm-link,
.EasyMDEContainer .cm-url {
  color: var(--text-muted);
}
.EasyMDEContainer .CodeMirror-selected,
.EasyMDEContainer .CodeMirror-focused .CodeMirror-selected {
  background: var(--accent-bg);
}
.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side,
.EasyMDEContainer .editor-preview-full {
  background: var(--bg-elev-1);
  color: var(--text);
}
.EasyMDEContainer .editor-preview-side {
  border-color: var(--border-input);
}
.markdown-body {
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.65;
}
.markdown-body > :first-child {
  margin-top: 0;
}
.markdown-body > :last-child {
  margin-bottom: 0;
}
.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table {
  margin: 0 0 var(--s-3);
}
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: var(--s-5) 0 var(--s-2);
  line-height: 1.25;
  color: var(--text);
}
.markdown-body h2 {
  font-size: var(--fs-xl);
}
.markdown-body h3 {
  font-size: var(--fs-lg);
}
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: var(--fs-md);
}
.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4rem;
}
.markdown-body li + li {
  margin-top: 4px;
}
.markdown-body blockquote {
  border-left: 3px solid var(--accent-border);
  padding-left: var(--s-3);
  color: var(--text-muted);
}
.markdown-body code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.3rem;
}
.markdown-body pre {
  overflow-x: auto;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--s-3);
}
.markdown-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
}
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}
.markdown-body th {
  background: var(--bg-elev-1);
}
.markdown-body video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: var(--s-3) 0;
  background: black;
}
.markdown-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: var(--s-3) 0;
}

.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-3) var(--s-4) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  background: var(--bg-elev-1);
}
.form-fieldset[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.form-fieldset legend {
  padding: 0 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.radio {
  flex-direction: row !important;
  align-items: center;
  gap: var(--s-2) !important;
  font-weight: 400 !important;
  color: var(--text) !important;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.radio:hover {
  background: var(--bg-elev-2);
}
.radio input {
  accent-color: var(--accent);
}

/* flash banner */
.flash {
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-4);
}
.flash.danger {
  background: var(--danger-bg);
  border-color: color-mix(in oklab, var(--danger) 35%, transparent);
}

/* =========================================================================
   Badges / chips / tags
   ========================================================================= */

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--bg-elev-3);
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.4;
}
.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.badge-topic,
.chip.topic {
  color: var(--topic-ink);
  background: var(--topic-bg);
  border-color: color-mix(in oklab, var(--topic-ink) 25%, transparent);
}
.badge-view,
.chip.view {
  color: var(--view-ink);
  background: var(--view-bg);
  border-color: color-mix(in oklab, var(--view-ink) 25%, transparent);
}
.badge-finding,
.chip.finding {
  color: var(--finding-ink);
  background: var(--finding-bg);
  border-color: color-mix(in oklab, var(--finding-ink) 25%, transparent);
}
.badge-comment,
.chip.comment {
  color: var(--comment-ink);
  background: var(--comment-bg);
  border-color: color-mix(in oklab, var(--comment-ink) 25%, transparent);
}

.badge.accent {
  color: var(--accent-strong);
  background: var(--accent-bg);
  border-color: var(--accent-border);
}
.badge.danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: color-mix(in oklab, var(--danger) 35%, transparent);
}

.kind-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
}

.tag-chip,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-decoration: none;
  transition:
    background 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.tag-chip:hover,
.tag:hover {
  color: var(--text);
  background: var(--bg-elev-3);
  border-color: var(--border-strong);
  text-decoration: none;
}
.tag-chip-large {
  font-size: var(--fs-lg);
  padding: 6px 14px;
}

/* =========================================================================
   Cards / utility
   ========================================================================= */

.card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: calc(24px * var(--density));
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}
.card.interactive {
  cursor: pointer;
}
.card.interactive:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.card.flush {
  padding: 0;
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.col {
  display: flex;
  flex-direction: column;
}
.gap-4 {
  gap: var(--s-1);
}
.gap-8 {
  gap: var(--s-2);
}
.gap-12 {
  gap: var(--s-3);
}
.gap-16 {
  gap: var(--s-4);
}
.gap-24 {
  gap: var(--s-6);
}
.gap-32 {
  gap: var(--s-8);
}
.between {
  justify-content: space-between;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
}
.center {
  align-items: center;
}
.spacer-lg {
  height: var(--s-10);
}

/* =========================================================================
   Home / index
   ========================================================================= */

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: var(--s-12);
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.hero-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--text-subtle);
}
.hero h1 em {
  font-style: italic;
  color: var(--accent-strong);
  background: linear-gradient(
    110deg,
    oklch(78% 0.16 var(--topic-h)),
    oklch(78% 0.16 var(--view-h)),
    oklch(78% 0.14 var(--finding-h))
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: var(--s-6);
}
.hero-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* legacy two-column hero grid kept for landing page */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--s-12);
  align-items: center;
  margin: var(--s-8) 0 var(--s-12);
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}
.hero-graph-card {
  position: relative;
  z-index: 2;
  background: color-mix(in oklab, var(--bg-elev-1) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}
.hero-graph-inner {
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-paper {
  background: var(--bg-elev-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-cream {
  background: var(--bg-elev-2);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin: var(--s-10) 0 var(--s-4);
}
.section-head h2 {
  margin: 0;
}
.section-head .muted {
  font-size: var(--fs-sm);
}

.bloom {
  border-radius: 50%;
  pointer-events: none;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.fadein {
  animation: fadein 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(2%, -1%);
  }
}

/* =========================================================================
   Node list (browse/profile/tags/home)
   ========================================================================= */

.node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.node-list li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border-top: 1px solid var(--border);
  padding: 10px 0;
  margin: 0;
}
.node-list li:last-child {
  border-bottom: 1px solid var(--border);
}
.node-feed-top {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.node-feed-top > a:not(.node-author) {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  transition: color 0.15s;
}
.node-feed-top > a:not(.node-author):hover {
  color: var(--text);
  text-decoration: none;
}
.node-feed-body {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 7px;
}
.node-feed-excerpt {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font-size: var(--fs-base);
  color: var(--text);
  line-height: 1.6;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
}
.node-feed-excerpt:hover {
  border-color: var(--border-strong);
  text-decoration: none;
  color: var(--text);
}
.node-feed-thumb-link {
  flex: 0 0 50%;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  line-height: 0;
}
.node-feed-thumb-link:hover {
  border-color: var(--border-strong);
}
.node-feed-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.node-feed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.node-feed-stance {
  height: 5px;
  flex: 1;
  max-width: 180px;
}
.node-feed-votes {
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
  font-family: var(--font-mono);
}
.node-list .title {
  font-weight: 500;
  font-size: var(--fs-md);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-list .meta {
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.node-author {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.node-author:hover {
  color: var(--text);
  text-decoration: none;
}

/* "argument graph — coming soon" promo (home page) */
.promo {
  position: relative;
  margin-top: var(--s-12);
  padding: var(--s-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      circle at 80% 20%,
      oklch(72% 0.14 250 / 0.08),
      transparent 60%
    ),
    radial-gradient(
      circle at 10% 100%,
      oklch(75% 0.13 32 / 0.06),
      transparent 55%
    ),
    var(--bg-elev-1);
  overflow: hidden;
  isolation: isolate;
}
.promo-inner {
  position: relative;
  z-index: 2;
  max-width: 56%;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  align-items: flex-start;
}
.promo h2 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.02em;
}
.promo p {
  color: var(--text-muted);
  max-width: 38ch;
}
.promo-graph {
  position: absolute;
  top: 0;
  right: -20px;
  bottom: 0;
  width: 55%;
  pointer-events: none;
  z-index: 1;
}
.promo-graph svg {
  width: 100%;
  height: 100%;
  display: block;
}
@media (max-width: 640px) {
  .promo-inner {
    max-width: 100%;
  }
  .promo-graph {
    display: none;
  }
}

/* =========================================================================
   Argument graph
   ========================================================================= */

.graph-page {
  width: calc(100vw - 2 * var(--s-4));
  margin-left: 50%;
  transform: translateX(-50%);
}

main:has(.graph-page) {
  padding-top: var(--s-4);
  padding-bottom: var(--s-6);
}

.argument-graph-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
}

.argument-graph-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.argument-graph-stats span,
.argument-graph-current {
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  white-space: nowrap;
}

.argument-graph-tool {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-1);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.argument-graph-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}

.argument-graph-search {
  min-width: 220px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  border: 1px solid var(--border-input);
  background: var(--bg-inset);
  border-radius: var(--radius-pill);
  padding: 0 10px;
}

.argument-graph-search .material-symbols-outlined {
  color: var(--text-subtle);
}

.argument-graph-search input[type="search"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0;
}

.argument-graph-author {
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  border: 1px solid var(--border-input);
  background: var(--bg-inset);
  border-radius: var(--radius-pill);
  padding: 0 10px;
}

.argument-graph-author .material-symbols-outlined {
  color: var(--text-subtle);
}

.argument-graph-author input[type="search"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0;
  width: 100%;
}

.argument-graph-current {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  background: var(--bg-inset);
}

.argument-graph-types {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.argument-graph-types legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.argument-graph-types .chip {
  cursor: pointer;
  user-select: none;
}

.argument-graph-types input {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.argument-graph-types .chip:has(input:not(:checked)) {
  background: var(--bg-elev-3);
  border-color: var(--border);
  color: var(--text-subtle);
  opacity: 0.55;
}

.argument-graph-depth {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.argument-graph-depth-label {
  color: var(--text-muted);
}

.argument-graph-depth input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 4px;
  background: var(--bg-inset);
  border-radius: var(--radius-pill);
  outline: none;
  cursor: pointer;
}
.argument-graph-depth input[type="range"]:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 35%, transparent);
}
.argument-graph-depth input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--accent-strong, var(--accent));
  cursor: pointer;
}
.argument-graph-depth input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--accent-strong, var(--accent));
  cursor: pointer;
}

.argument-graph-depth-value {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 1.4em;
  text-align: right;
}

.argument-graph-zoom {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-left: var(--s-1);
  border-left: 1px solid var(--border);
}

.argument-graph-zoom .btn {
  width: 31px;
  height: 31px;
  padding: 0;
}

/* Second toolbar row: filter chips and toggle groups. flex-wrap lets the
   row spill onto multiple lines on narrow viewports without crushing the
   inputs. */
.argument-graph-toolbar-filters {
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: var(--bg-elev-1);
}

.argument-graph-group {
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  border: 1px solid var(--border-input);
  background: var(--bg-inset);
  border-radius: var(--radius-pill);
  padding: 0 10px;
}

.argument-graph-group .material-symbols-outlined {
  color: var(--text-subtle);
}

.argument-graph-group input[type="search"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0;
  width: 100%;
}

.argument-graph-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-1);
  border: 1px solid var(--border-input);
  background: var(--bg-inset);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  min-width: 220px;
  max-width: 380px;
}

.argument-graph-tags .material-symbols-outlined {
  color: var(--text-subtle);
}

.argument-graph-tags input[type="search"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 4px 0;
  flex: 1;
  min-width: 80px;
}

.argument-graph-tag-chips {
  display: contents;
}

.argument-graph-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
}

.argument-graph-tag-chip-remove {
  background: transparent;
  border: 0;
  padding: 0;
  margin-left: 2px;
  font-size: var(--fs-md);
  line-height: 1;
  color: var(--text-subtle);
  cursor: pointer;
}

.argument-graph-tag-chip-remove:hover {
  color: var(--text);
}

/* Per-kind palette for the edge-kind chip toggles. Mirrors the type-chip
   colour pattern: the dot picks up the same colour the edge stroke uses
   on the canvas, so the toolbar legend is unambiguous. */
.chip.kind-supports .dot { background: var(--supports); }
.chip.kind-opposes .dot { background: var(--opposes); }
.chip.kind-related .dot { background: var(--relates); }

/* Toggle-button group for single-choice server-side filters (when, source,
   visibility). Adjacent pressed-button feedback per the project's
   preference for inline button groups over dropdowns. */
.argument-graph-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  border-radius: var(--radius-pill);
}

.argument-graph-toggle-group .argument-graph-toggle-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  padding: 0 6px 0 8px;
}

.argument-graph-toggle-group .btn {
  border-radius: var(--radius-pill);
  border-color: transparent;
  padding: 4px 10px;
  font-size: var(--fs-xs);
}

.argument-graph-toggle-group .btn.is-active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-bg);
}

.argument-graph-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 560px;
}

.argument-graph-stage {
  position: relative;
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px),
    var(--bg-inset);
  background-size: 36px 36px;
  overflow: hidden;
}

.argument-graph-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-6);
  text-align: center;
  z-index: 2;
  background: color-mix(in oklab, var(--bg-inset) 88%, transparent);
}

.argument-graph-svg {
  display: block;
  width: 100%;
  height: min(80vh, 920px);
  min-height: 560px;
  cursor: grab;
  touch-action: none;
}

.argument-graph-svg:active {
  cursor: grabbing;
}

.argument-graph-stage-3d {
  background: #0d0d14;
}

.argument-graph-3d-container {
  width: 100%;
  height: min(80vh, 920px);
  min-height: 560px;
}

.argument-graph-background {
  fill: transparent;
}

.argument-graph-edge {
  fill: none;
  stroke: var(--edge, var(--relates));
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.72;
  transition: opacity 0.12s;
}

.argument-graph-edge.is-dim {
  opacity: 0.16;
}

.argument-graph-arrow.edge-supports path {
  fill: var(--supports);
}

.argument-graph-arrow.edge-opposes path {
  fill: var(--opposes);
}

.argument-graph-arrow.edge-related path {
  fill: var(--relates);
}

.argument-graph-arrow.edge-comments_on path {
  fill: var(--comment-ink);
}

.argument-graph-edge.edge-comments_on {
  --edge: var(--comment-ink);
  stroke-dasharray: 4 4;
  opacity: 0.5;
}

.argument-graph-node {
  cursor: pointer;
  outline: none;
}

.argument-graph-node circle {
  fill: var(--node-bg, var(--bg-elev-3));
  stroke: var(--node-ink, var(--text-muted));
  stroke-width: 2;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.22));
  transition:
    stroke-width 0.12s,
    opacity 0.12s,
    filter 0.12s;
}

.argument-graph-node.node-topic {
  --node-bg: var(--topic-bg);
  --node-ink: var(--topic-ink);
}

.argument-graph-node.node-view {
  --node-bg: var(--view-bg);
  --node-ink: var(--view-ink);
}

.argument-graph-node.node-finding {
  --node-bg: var(--finding-bg);
  --node-ink: var(--finding-ink);
}

.argument-graph-node.node-comment {
  --node-bg: var(--comment-bg);
  --node-ink: var(--comment-ink);
}

.argument-graph-node.is-selected circle,
.argument-graph-node:focus-visible circle {
  stroke-width: 4;
  filter: drop-shadow(0 0 18px color-mix(in oklab, var(--node-ink) 48%, transparent));
}

.argument-graph-node.is-dim {
  opacity: 0.3;
}

.argument-graph-label-box {
  fill: color-mix(in oklab, var(--bg-elev-1) 92%, transparent);
  stroke: var(--border);
}

.argument-graph-label {
  fill: var(--text);
  font: 500 13px var(--font-sans);
  pointer-events: none;
}

.argument-graph-inspector {
  border-left: 1px solid var(--border);
  background: var(--bg-elev-1);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
}

.argument-graph-inspector h2 {
  font-size: var(--fs-xl);
  margin: 0;
  overflow-wrap: anywhere;
}

.argument-graph-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.argument-graph-legend {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.argument-graph-legend > div {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.argument-graph-noscript {
  border-top: 1px solid var(--border);
  padding: var(--s-5);
}

@media (max-width: 900px) {
  .argument-graph-toolbar {
    flex-wrap: wrap;
  }
  .argument-graph-search {
    flex-basis: 100%;
  }
  .argument-graph-workspace {
    grid-template-columns: 1fr;
  }
  .argument-graph-inspector {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  .graph-page {
    width: calc(100vw - 2 * var(--s-3));
  }
  .argument-graph-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .argument-graph-types,
  .argument-graph-zoom,
  .argument-graph-depth {
    width: 100%;
    flex-wrap: wrap;
  }
  .argument-graph-depth input[type="range"] {
    flex: 1;
    min-width: 0;
  }
  .argument-graph-zoom {
    border-left: 0;
    padding-left: 0;
  }
  .argument-graph-svg {
    min-height: 480px;
  }
  .argument-graph-workspace {
    min-height: 480px;
  }
}

/* =========================================================================
   Node detail page
   ========================================================================= */

.node {
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  border-radius: var(--radius-lg);
  padding: var(--s-8) var(--s-8) var(--s-6);
  margin-bottom: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.node header {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.node header h1 {
  font-size: var(--fs-2xl);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.node .body p {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text);
  margin-bottom: var(--s-3);
}
.node .source {
  margin-top: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  word-break: break-all;
}
.node .source a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.node .source a::before {
  content: "↗";
  color: var(--text-subtle);
  font-size: 12px;
}
header.node-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s-3);
  flex-wrap: wrap;
}
header.node-header > h1 {
  flex: 1;
  min-width: 0;
}
header.node-header > .chip {
  flex: 0 0 auto;
}
.node-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--s-2) 0 0;
}
.node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
.node-actions form.inline {
  margin: 0;
}

/* pin banner */
.pin-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.pin-banner strong {
  font-weight: 600;
}
.pin-banner .link {
  margin-left: auto;
}
.pin-banner.pin-supports {
  background: color-mix(in oklab, var(--supports) 10%, var(--bg-elev-2));
  border-color: color-mix(in oklab, var(--supports) 30%, transparent);
}
.pin-banner.pin-opposes {
  background: color-mix(in oklab, var(--opposes) 10%, var(--bg-elev-2));
  border-color: color-mix(in oklab, var(--opposes) 30%, transparent);
}
.pin-banner.pin-featured {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
}

/* stance row — on-post Support / Oppose / Resonate buttons + 0-100% meter */
.stance-row {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.stance-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.stance-buttons .stance-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  line-height: 1;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.stance-buttons .stance-btn .material-symbols-outlined {
  font-size: 18px;
}
.stance-buttons .stance-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}
.stance-buttons .stance-btn:focus-visible {
  outline: 2px solid var(--focus, var(--accent));
  outline-offset: 2px;
}
.stance-buttons .stance-supports.pressed {
  background: color-mix(in oklab, var(--supports) 18%, var(--bg-elev-1));
  border-color: var(--supports);
  color: var(--supports);
}
.stance-buttons .stance-opposes.pressed {
  background: color-mix(in oklab, var(--opposes) 18%, var(--bg-elev-1));
  border-color: var(--opposes);
  color: var(--opposes);
}
.stance-buttons .stance-featured.pressed {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  color: var(--fg);
}
.stance-signed-out {
  font-size: var(--fs-sm);
  margin: 0;
}

.stance-meter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--s-1);
}
.stance-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--opposes);
  position: relative;
  border: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
}
.stance-bar .stance-fill {
  display: block;
  height: 100%;
  background: var(--supports);
  transition: width 200ms ease;
}
.stance-meter-labels {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 12px;
  color: var(--muted, var(--fg));
}
.stance-meter-labels .stance-label.supports {
  color: var(--supports);
  font-weight: 600;
}
.stance-meter-labels .stance-label.opposes {
  color: var(--opposes);
  font-weight: 600;
  margin-left: auto;
}
.stance-meter-labels .stance-label.voices {
  font-variant-numeric: tabular-nums;
}
.stance-empty {
  font-size: 12px;
  margin: 0;
}
.stance-relevance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted, var(--fg));
}
.stance-relevance .material-symbols-outlined {
  font-size: 16px;
}

/* featured / key findings */
.featured {
  margin-bottom: var(--s-8);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.featured > h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--s-2);
}
.featured-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev-1);
  padding: var(--s-5);
  position: relative;
}
.featured-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--s-5);
  bottom: var(--s-5);
  width: 3px;
  border-radius: 2px;
  background: var(--relates);
}
.featured-card.edge-supports::before {
  background: var(--supports);
}
.featured-card.edge-opposes::before {
  background: var(--opposes);
}
.featured-card.edge-refines::before {
  background: var(--refines);
}
.featured-card.edge-cites::before {
  background: var(--cites);
}
.featured-card.edge-related::before {
  background: var(--relates);
}
.featured-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
}
.featured-head h3 {
  margin: 0;
  font-size: var(--fs-md);
  flex: 1 0 auto;
  min-width: 0;
}
.featured-head h3 a {
  color: var(--text);
}
.featured-card p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin: var(--s-2) 0;
}
.featured-card .inline {
  margin-right: var(--s-3);
}

/* legend / connections */
.legend {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-1);
  padding: var(--s-5) var(--s-6) var(--s-4);
  margin-top: var(--s-6);
}
.legend > h2 {
  font-size: var(--fs-xl);
  margin: 0 0 var(--s-4);
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}
.edge-group {
  margin-bottom: var(--s-4);
  padding-left: var(--s-3);
  border-left: 2px solid var(--border);
}
.edge-group.edge-supports {
  border-left-color: var(--supports);
  --edge: var(--supports);
}
.edge-group.edge-opposes {
  border-left-color: var(--opposes);
  --edge: var(--opposes);
}
.edge-group.edge-refines {
  border-left-color: var(--refines);
  --edge: var(--refines);
}
.edge-group.edge-cites {
  border-left-color: var(--cites);
  --edge: var(--cites);
}
.edge-group.edge-relates_to,
.edge-group.edge-related {
  border-left-color: var(--relates);
  --edge: var(--relates);
}
.edge-group h4 {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--edge, var(--text-subtle));
  font-weight: 500;
  margin: 0 0 var(--s-2);
}
.edge-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.edge-group li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.edge-group li a {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  padding: 4px 0;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.edge-group li a:hover {
  color: var(--accent-strong);
}
.edge-group .title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.edge-group li a > .chip {
  flex: 0 0 auto;
}
.edge-action {
  font-size: var(--fs-xs);
}
.edge-action .link {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.edge-action .link:hover {
  color: var(--text-muted);
}

.edge-supports {
  --edge: var(--supports);
}
.edge-opposes {
  --edge: var(--opposes);
}
.edge-refines {
  --edge: var(--refines);
}
.edge-cites {
  --edge: var(--cites);
}
.edge-relates_to,
.edge-related {
  --edge: var(--relates);
}
.edge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--edge);
  display: inline-block;
}

/* topic view feed */
.topic-feed {
  margin: 0 0 var(--s-8);
}
.topic-feed .section-head {
  margin-top: 0;
}
.topic-empty {
  text-align: center;
  padding: var(--s-5);
}
.topic-view-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-1);
  overflow: hidden;
}
.topic-view-row {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.topic-view-row:last-child {
  border-bottom: 0;
}
.topic-view-row header {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  justify-content: space-between;
  min-width: 0;
}
.topic-view-title {
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-lg);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-view-title:hover {
  color: var(--accent-strong);
  text-decoration: none;
}
.topic-view-comments {
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.topic-view-meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  margin-top: 6px;
}
.topic-view-row p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.55;
  margin: var(--s-2) 0 0;
}

/* comments */
.comments {
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
}
.comments-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.comments-head h2 {
  margin: 0;
}
.comment-login,
.comments-empty {
  margin-top: var(--s-4);
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.comment-form textarea {
  min-height: 88px;
}
.comment-list,
.comment-replies {
  list-style: none;
  margin: var(--s-5) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.comment-replies {
  margin-top: var(--s-3);
  margin-left: var(--s-8);
  padding-left: var(--s-4);
  border-left: 2px solid var(--border);
}
.comment-card {
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev-1);
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text-subtle);
  font-size: var(--fs-xs);
}
.comment-meta a {
  color: var(--text-muted);
  font-weight: 500;
}
.comment-meta a:hover {
  color: var(--text);
  text-decoration: none;
}
.comment-body {
  margin-top: var(--s-3);
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.comment-removed {
  color: var(--text-subtle);
  font-style: italic;
}
.comment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.comment-reply {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-2);
}
.comment-reply > summary {
  list-style: none;
}
.comment-reply > summary::-webkit-details-marker {
  display: none;
}
.comment-reply[open] {
  display: flex;
  width: 100%;
}
.comment-reply[open] > .comment-form {
  width: 100%;
}

@media (max-width: 640px) {
  .topic-view-row header,
  .comments-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .topic-view-title {
    white-space: normal;
  }
  .comment-replies {
    margin-left: var(--s-3);
    padding-left: var(--s-3);
  }
}

/* =========================================================================
   Auth / centered form pages
   ========================================================================= */

.auth {
  max-width: 440px;
  margin: var(--s-10) auto;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-8);
  box-shadow: var(--shadow-lg);
}
.auth h1 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--s-2);
}
.auth > p.muted {
  margin-bottom: var(--s-5);
  font-size: var(--fs-sm);
}
.auth .form {
  gap: var(--s-3);
}
.auth .alt {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.oauth-row {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
  flex-wrap: wrap;
}
.oauth-row .btn {
  flex: 1;
  min-width: 140px;
}
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.oauth-buttons .btn {
  justify-content: center;
}
.divider-text {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: var(--s-4) 0;
}
.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* =========================================================================
   Profile
   ========================================================================= */

.profile {
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}
.profile-head {
  position: relative;
  overflow: hidden;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-2);
}
.profile-head h1 {
  margin: 0;
  font-size: var(--fs-2xl);
}
.profile-head .muted {
  font-size: var(--fs-sm);
}
.profile section h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
  margin: 0 0 var(--s-3);
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 20px;
  background: linear-gradient(
    135deg,
    oklch(72% 0.14 250 / 0.4),
    oklch(72% 0.14 168 / 0.4)
  );
  color: var(--text);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.identity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.identity-list li {
  font-size: var(--fs-sm);
  padding: 8px 12px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.identity-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--supports);
}
.ident-label {
  font-weight: 500;
  color: var(--text);
}

/* profile pins */
.pin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.pin-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pin-row .pin-kind {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.pin-row.pin-supports .pin-kind {
  color: var(--supports);
}
.pin-row.pin-opposes .pin-kind {
  color: var(--opposes);
}
.pin-row.pin-featured .pin-kind {
  color: var(--text-muted);
}
.pin-row .pin-node {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  text-decoration: none;
}
.pin-row .pin-node:hover {
  color: var(--accent-strong);
}
.pin-row .pin-node .title {
  font-weight: 500;
}
.pin-row .pin-finding {
  grid-column: 2;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.pin-finding a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =========================================================================
   Account / settings
   ========================================================================= */

.account-field {
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
}
.account-field:first-of-type {
  padding-top: var(--s-1);
}
.account-field:last-of-type {
  padding-bottom: var(--s-1);
  border-bottom: 0;
}
.account-field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.account-field-value {
  font-size: var(--fs-md);
  color: var(--text);
  font-weight: 500;
}
.account-field-note {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.account-media-list {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s-3);
}
.account-media-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-3) 0;
  border-top: 1px solid var(--border);
}
.account-media-row:last-child {
  border-bottom: 1px solid var(--border);
}
.account-media-preview {
  width: 92px;
  aspect-ratio: 4 / 3;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}
.account-media-preview img,
.account-media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.account-media-main {
  min-width: 0;
}
.account-media-name {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-media-meta,
.account-media-topic {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: 6px;
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
}
.account-media-topic a {
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip.media-image {
  color: var(--supports);
  background: color-mix(in oklab, var(--supports) 12%, var(--bg-elev-2));
  border-color: color-mix(in oklab, var(--supports) 28%, transparent);
}
.chip.media-video {
  color: var(--opposes);
  background: color-mix(in oklab, var(--opposes) 12%, var(--bg-elev-2));
  border-color: color-mix(in oklab, var(--opposes) 28%, transparent);
}

@media (max-width: 520px) {
  .account-media-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .account-media-preview {
    width: 72px;
  }
}

/* =========================================================================
   Search
   ========================================================================= */

.search-form {
  display: flex;
  gap: var(--s-2);
  margin: var(--s-4) 0 var(--s-6);
}
.search-form input[type="search"] {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border-input);
  background: var(--bg-inset);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-md);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color 0.12s,
    box-shadow 0.12s,
    background 0.12s;
}
.search-form input[type="search"]:focus {
  border-color: var(--accent-border);
  background: var(--bg-elev-1);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* search-input-wrap — positions the suggest dropdown relative to the input */
.search-input-wrap {
  position: relative;
  flex: 1;
}
.search-input-wrap input[type="search"] {
  width: 100%;
}

/* search-suggest-anchor — same inside the graph toolbar pills */
.search-suggest-anchor {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.search-suggest-anchor input[type="search"] {
  width: 100%;
}

/* floating suggest dropdown */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  min-width: 200px;
}
.nav-search .search-suggest {
  top: calc(100% + 8px);
}
.search-suggest-label {
  margin: 0;
  padding: 8px 12px 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.search-suggest-label:first-child {
  padding-top: 10px;
}
.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: var(--fs-sm);
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
}
.search-suggest-item:hover,
.search-suggest-item:focus-visible {
  background: var(--bg-elev-2);
  outline: none;
}
.search-suggest-title {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.search-suggest-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--bg-elev-3);
  color: var(--text-muted);
  flex: none;
}
.search-suggest-footer {
  display: block;
  padding: 7px 12px;
  font-size: var(--fs-xs);
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border);
}
.search-suggest-footer:hover {
  background: var(--bg-elev-2);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}
.search-results li {
  padding: var(--s-4) 0;
  border-top: 1px solid var(--border);
}
.search-results li:last-child {
  border-bottom: 1px solid var(--border);
}
.search-hit {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.search-hit-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--text);
  font-weight: 500;
  font-size: var(--fs-md);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.search-hit-link:hover {
  color: var(--accent-strong);
  text-decoration: none;
}
.search-hit-link .title {
  font-weight: 500;
}
.search-excerpt {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin: 4px 0 0;
}
.search-excerpt mark {
  background: oklch(75% 0.14 var(--topic-h) / 0.22);
  color: oklch(88% 0.13 var(--topic-h));
  padding: 1px 3px;
  border-radius: 3px;
}

/* =========================================================================
   Node revisions / history
   ========================================================================= */

.revision-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.revision-list-item {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.revision-list-meta {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
}
.revision-number {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.revision-number:hover {
  color: var(--accent-strong);
}
.revision-author {
  color: var(--text-muted);
}
.revision-author a {
  color: var(--text);
}
.revision-time {
  margin-left: auto;
}
.revision-title {
  font-weight: 500;
  color: var(--text);
}
.revision-summary {
  font-size: var(--fs-sm);
  font-style: italic;
}
.revision-actions {
  display: flex;
  gap: var(--s-2);
  margin-top: 4px;
}
.revision-revert-form {
  display: inline;
}
.revision-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
}

/* =========================================================================
   Tags index
   ========================================================================= */

.tag-cloud {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.tag-cloud li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tag-count {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  margin-left: -6px;
  position: relative;
  z-index: 1;
}

/* =========================================================================
   Toggle-button group (single-choice forms — node type, pin/stance, edge
   kind). Preserved & re-skinned: per project convention, single-choice form
   inputs use a row of adjacent toggle buttons rather than a select/dropdown.
   ========================================================================= */

fieldset.toggle-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
fieldset.toggle-group legend {
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 0;
  margin-bottom: 2px;
}
.toggle-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.toggle-group[aria-invalid="true"] .toggle-btns {
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.toggle-btns.toggle-btns-stack {
  flex-direction: column;
}
.toggle-btns.toggle-btns-stack .toggle-btn {
  flex: 0 0 auto;
  justify-content: flex-start;
  text-align: left;
}

.toggle-btn {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s,
    box-shadow 0.12s;
}
.toggle-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-btn:hover {
  background: var(--bg-elev-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.toggle-btn:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toggle-btn:has(input:checked) {
  background: var(--bg-elev-3);
  color: var(--text);
  border-color: var(--border-strong);
}
.visibility-public-label {
  display: inline-grid;
  grid-template-areas: "label";
}
.visibility-public-label > span {
  grid-area: label;
  transition: opacity 0.12s;
}
.visibility-label-hover {
  opacity: 0;
}
.toggle-btn[data-visibility="public"]:hover .visibility-label-default,
.toggle-btn[data-visibility="public"]:focus-within .visibility-label-default {
  opacity: 0;
}
.toggle-btn[data-visibility="public"]:hover .visibility-label-hover,
.toggle-btn[data-visibility="public"]:focus-within .visibility-label-hover {
  opacity: 1;
}
.toggle-btn[data-kind="supports"]:has(input:checked) {
  background: var(--supports);
  color: white;
  border-color: var(--supports);
}
.toggle-btn[data-kind="opposes"]:has(input:checked) {
  background: var(--opposes);
  color: white;
  border-color: var(--opposes);
}
.toggle-btn[data-kind="featured"]:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-strong);
}
.toggle-btn[data-edge-kind="supports"]:has(input:checked) {
  background: var(--supports);
  color: white;
  border-color: var(--supports);
}
.toggle-btn[data-edge-kind="opposes"]:has(input:checked) {
  background: var(--opposes);
  color: white;
  border-color: var(--opposes);
}
.toggle-btn[data-edge-kind="related"]:has(input:checked) {
  background: var(--relates);
  color: var(--text);
  border-color: var(--relates);
}
.toggle-btn[data-type="topic"]:has(input:checked) {
  background: var(--topic-bg);
  color: var(--topic-ink);
  border-color: color-mix(in oklab, var(--topic-ink) 35%, transparent);
}
.toggle-btn[data-type="view"]:has(input:checked) {
  background: var(--view-bg);
  color: var(--view-ink);
  border-color: color-mix(in oklab, var(--view-ink) 35%, transparent);
}
.toggle-btn[data-type="finding"]:has(input:checked) {
  background: var(--finding-bg);
  color: var(--finding-ink);
  border-color: color-mix(in oklab, var(--finding-ink) 35%, transparent);
}

/* Conditional fields in the post form. Each .if-X class is shown by default
   and hidden when a non-matching type is selected, so the form rearranges
   itself as the user toggles between View / Topic / Finding. */
.post-form:has(input[name="type"][value="topic"]:checked) .if-view,
.post-form:has(input[name="type"][value="finding"]:checked) .if-view {
  display: none;
}
.post-form:has(input[name="type"][value="view"]:checked) .if-topic,
.post-form:has(input[name="type"][value="finding"]:checked) .if-topic {
  display: none;
}
.post-form:has(input[name="type"][value="view"]:checked) .if-finding,
.post-form:has(input[name="type"][value="topic"]:checked) .if-finding {
  display: none;
}
/* Hide the parent picker only when creating a root topic (type=topic AND
   position=root). It stays visible for views, sub-topics, and findings —
   all of which require a parent. */
.post-form:has(input[name="type"][value="topic"]:checked):has(
    input[name="topic_parent_mode"][value="root"]:checked
  )
  .parent-picker-section {
  display: none;
}

/* Connect form: show the search picker only when target=existing, and the
   new-finding title input only when target=new. The user's selected toggle
   drives which input is visible without any JS. */
form:has(input[name="to_mode"][value="existing"]:checked) .edge-target-new {
  display: none;
}
form:has(input[name="to_mode"][value="new"]:checked) .edge-target-existing {
  display: none;
}

/* Candidate picker (edge creation) */
.candidate-list label.radio {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px var(--s-3);
  cursor: pointer;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.candidate-list label.radio:hover {
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}
.candidate-list label.radio:has(input:checked) {
  border-color: var(--accent-border);
  background: var(--accent-bg);
}

/* =========================================================================
   Modal dialog (HTMX swaps into #modal)
   ========================================================================= */

.modal-host:empty {
  display: none;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: oklch(0% 0 0 / 0.55);
  backdrop-filter: blur(4px) saturate(140%);
  -webkit-backdrop-filter: blur(4px) saturate(140%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  animation: modal-fade 120ms ease-out;
}
@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-dialog {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(560px, 100%);
  max-height: calc(100vh - 12vh - 16px);
  overflow-y: auto;
  padding: var(--s-8) var(--s-8) var(--s-6);
  position: relative;
  animation: modal-rise 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modal-rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}
.modal-dialog .form {
  max-width: none;
}

/* =========================================================================
   Admin roster
   ========================================================================= */

/* A flatter list-rows variant: no surrounding card, lighter dividers
   between rows. The roster sits directly on the page background so the
   inline controls (role dropdown + icon buttons) carry the visual
   weight. */
.admin-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.admin-roster-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.admin-roster-main {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.admin-roster-main:hover {
  text-decoration: none;
}
.admin-roster-main:hover span:first-of-type {
  text-decoration: underline;
}
.admin-roster-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* Compact, auto-width select for the inline role picker. Overrides the
   global select rule that stretches to 100%. */
.role-select {
  width: auto;
  padding: 4px 26px 4px 8px;
  font-size: var(--fs-xs);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}
.role-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================================
   Error pages (404, 403, 500, ...)
   ========================================================================= */

.error-page {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 7vw, 80px);
  margin-top: calc(var(--s-10) * -1);
}
.error-bloom-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.error-page-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  text-align: left;
}
/* Eyebrow sits over the green bloom, where the muted grey from the default
   .eyebrow rule loses contrast. Force a near-black so the label stays
   legible against the light center of the bloom. */
.error-page .eyebrow {
  color: #000;
}
.error-status {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(96px, 18vw, 200px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--accent-strong);
  margin: var(--s-3) 0 var(--s-2);
  text-shadow: 0 1px 0 var(--border);
}
.error-page .h-1 {
  margin: 0;
}
.error-page .lede {
  max-width: 60ch;
  margin: 0;
}
.error-meta {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
}
.error-meta code.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-elev-2);
  color: var(--text-muted);
}
.error-meta a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}
.error-meta a:hover {
  text-decoration-color: var(--accent);
}

@media (max-width: 520px) {
  .error-status {
    font-size: clamp(80px, 28vw, 140px);
  }
}

/* =========================================================================
   Misc / icons / scrollbar / responsive
   ========================================================================= */

.material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}
::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 720px) {
  .topbar-inner,
  .nav-inner {
    flex-wrap: wrap;
    padding: var(--s-3);
  }
  .topbar-search,
  .nav-search {
    order: 5;
    width: 100%;
    flex-basis: 100%;
  }
  main {
    padding: var(--s-6) var(--s-4) var(--s-12);
  }
  .node {
    padding: var(--s-5);
  }
  .pin-row {
    grid-template-columns: 1fr;
  }
  .pin-row .pin-finding {
    grid-column: 1;
  }
}

/* =========================================================================
   Landing — recent-nodes teaser grid
   Used by the "From the graph" section on the public landing page.
   Stretched ::after on the title turns the whole card into a click target
   for the node detail page; the author byline gets its own stacking context
   so the user-profile link still works independently.
   ========================================================================= */
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.recent-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding: 20px;
}
.recent-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.recent-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.recent-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.recent-card-title::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.recent-card-body {
  margin: 0;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
  line-clamp: 7;
  overflow: hidden;
}
.recent-card-author {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: none;
}
.recent-card-author:hover {
  color: var(--ink);
}

/* ── Notification bell ──────────────────────────────────────────────────── */
.notif-bell {
  position: relative;
  padding: 0 10px;
}
.notif-bell-icon {
  font-size: 20px;
  line-height: 1;
}
.notif-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ── Notifications page ─────────────────────────────────────────────────── */
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-1);
  transition: background 0.1s;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item.notif-unread {
  background: var(--accent-bg);
}
.notif-item:hover {
  background: var(--bg-elev-2);
}
.notif-avatar {
  flex: none;
  display: block;
  text-decoration: none;
}
.notif-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.4;
}
.notif-actor {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.notif-actor:hover {
  text-decoration: underline;
}
.notif-node-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.notif-node-link:hover {
  text-decoration: underline;
}
.notif-time {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

/* TTS player — sits under a node's body, above the stance row.
   Uses the same card vocabulary as the rest of the page so it reads
   as part of the post, not a foreign embed. */
.tts-player {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated, var(--bg-subtle, transparent));
  display: flex;
  gap: 14px;
  align-items: center;
}
.tts-player[aria-busy="true"] {
  opacity: 0.55;
}
.tts-play {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--accent);
  color: var(--accent-on);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.tts-play .material-symbols-outlined {
  font-size: 24px;
  line-height: 1;
}
.tts-play:hover {
  filter: brightness(1.05);
}
.tts-meter {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tts-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tts-progress {
  flex: 1 1 auto;
  height: 6px;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.tts-progress::-webkit-progress-bar { background: var(--border); border-radius: 3px; }
.tts-progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.tts-progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.tts-time {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  min-width: 3.5ch;
}
.tts-time-total { text-align: right; }
.tts-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.tts-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tts-label .material-symbols-outlined {
  font-size: 14px;
}
.tts-lang {
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tts-status {
  font-style: italic;
}
