/* Sociograph. Every colour, font and shape comes from the theme tokens below: Lab notebook is the
   default (:root), the others override it under <html data-theme="...">, and "auto" takes Lab notebook
   or Night synapse from the device's light or dark mode. Fonts are self-hosted in /fonts (fonts.sh);
   until they are there, each falls back to a system font. */

@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage-grotesque.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(/fonts/ibm-plex-sans.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/ibm-plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/ibm-plex-mono-500.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Sora"; src: url(/fonts/sora.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Manrope"; src: url(/fonts/manrope.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(/fonts/instrument-serif-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(/fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

/* Lab notebook (default): light, graph paper, ink lines, one orange accent. */
:root {
  color-scheme: light;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-meta: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display-weight: 800;
  --display-tracking: -.02em;
  --h2-font: var(--font-body);
  --h2-weight: 600;
  --kicker-font: var(--font-meta);
  --kicker-case: uppercase;
  --kicker-spacing: .08em;
  --kicker-size: .75rem;

  --bg: #f6f7f4;
  --bg-image: linear-gradient(#e7eae3 1px, transparent 1px), linear-gradient(90deg, #e7eae3 1px, transparent 1px);
  --bg-size: 28px 28px;
  --surface: #fff;
  --surface-2: #f3f5f1;
  --input-bg: #f9faf8;
  --text: #16181d;
  --text-soft: #3d424b;
  --muted: #565c66;
  --border: #cfd3cb;
  --border-strong: #16181d;
  --header-bg: #fff;
  --header-line: #16181d;
  --stripe: none;

  --accent: #c2410c;
  --accent-text: #fff;
  --link: #9a330a;
  --nav-link: var(--text);
  --nav-active-text: var(--text);
  --nav-active-bg: transparent;
  --nav-active-line: var(--accent);
  --nav-line: 2px;
  --nav-pad: 0;
  --nav-gap: 1.5rem;
  --button-bg: #c2410c;
  --button-text: #fff;
  --badge-bg: #c2410c;
  --badge-text: #fff;
  --focus: #c2410c;

  --radius: 6px;
  --radius-sm: 4px;
  --pill: 4px;
  --card-shadow: none;

  --avatar-s: 55%;
  --avatar-l: 87%;
  --avatar-text-s: 50%;
  --avatar-text-l: 24%;
  --avatar-radius: 4px;

  --mark-line: #16181d;
  --mark-node: #fff;
  --mark-n1: var(--mark-node); --mark-n2: var(--mark-node); --mark-n3: var(--mark-node); --mark-n4: var(--mark-node);
  --mark-node-stroke: #16181d;
  --mark-hub: #c2410c;

  --error: #b42318;
  --pro: #2e7d32;
  --con: #c2410c;

  --sky-hi: #e3f4ff;
  --sky-lo: #86c8f2;
  --dendrite: rgba(255, 255, 255, .8);
  --neuron: #fff;
  --terminal: #fff6d8;
  --glow: #fff;
  --spark: #ffb703;
  --label: #0a3250;
  --label-halo: rgba(235, 247, 255, .9);
}

/* Night synapse: dark navy, glowing cyan and amber, rounded. The block is repeated for "auto" in dark mode. */
[data-theme="synapse"] {
  color-scheme: dark;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-meta: var(--font-body);
  --display-weight: 600;
  --display-tracking: -.01em;
  --h2-font: var(--font-display);
  --h2-weight: 600;
  --kicker-font: var(--font-display);
  --kicker-case: none;
  --kicker-spacing: 0;
  --kicker-size: .875rem;
  --bg: #07111f;
  --bg-image: radial-gradient(ellipse 70% 420px at 50% -60px, #123e66, rgba(18, 62, 102, 0));
  --bg-size: auto;
  --surface: #111f33;
  --surface-2: #0b182b;
  --input-bg: #0a1729;
  --text: #e4eef8;
  --text-soft: #dce8f4;
  --muted: #8fa6bf;
  --border: #1f3757;
  --border-strong: #2c4b74;
  --header-bg: transparent;
  --header-line: rgba(140, 205, 255, .14);
  --stripe: none;
  --accent: #7ef9ff;
  --accent-text: #04212a;
  --link: #8fd8ff;
  --nav-link: #c9dcef;
  --nav-active-text: #7ef9ff;
  --nav-active-bg: rgba(126, 249, 255, .12);
  --nav-active-line: transparent;
  --nav-line: 0px;
  --nav-pad: .7rem;
  --nav-gap: .1rem;
  --button-bg: #7ef9ff;
  --button-text: #04212a;
  --badge-bg: #ffb703;
  --badge-text: #2a1a00;
  --focus: #7ef9ff;
  --radius: 16px;
  --radius-sm: 10px;
  --pill: 999px;
  --card-shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --avatar-s: 50%;
  --avatar-l: 30%;
  --avatar-text-s: 60%;
  --avatar-text-l: 94%;
  --avatar-radius: 50%;
  --mark-line: rgba(140, 205, 255, .6);
  --mark-node: #e6f6ff;
  --mark-n1: var(--mark-node); --mark-n2: var(--mark-node); --mark-n3: var(--mark-node); --mark-n4: var(--mark-node);
  --mark-node-stroke: transparent;
  --mark-hub: #7ef9ff;
  --error: #ff8a8a;
  --pro: #6fcf73;
  --con: #fb923c;
  --sky-hi: #123e66;
  --sky-lo: #06172a;
  --dendrite: rgba(140, 205, 255, .45);
  --neuron: #e6f6ff;
  --terminal: #b8f1ff;
  --glow: #9fe3ff;
  --spark: #7ef9ff;
  --label: #dff1ff;
  --label-halo: rgba(6, 23, 42, .85);
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    color-scheme: dark;
    --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-meta: var(--font-body);
    --display-weight: 600;
    --display-tracking: -.01em;
    --h2-font: var(--font-display);
    --h2-weight: 600;
    --kicker-font: var(--font-display);
    --kicker-case: none;
    --kicker-spacing: 0;
    --kicker-size: .875rem;
    --bg: #07111f;
    --bg-image: radial-gradient(ellipse 70% 420px at 50% -60px, #123e66, rgba(18, 62, 102, 0));
    --bg-size: auto;
    --surface: #111f33;
    --surface-2: #0b182b;
    --input-bg: #0a1729;
    --text: #e4eef8;
    --text-soft: #dce8f4;
    --muted: #8fa6bf;
    --border: #1f3757;
    --border-strong: #2c4b74;
    --header-bg: transparent;
    --header-line: rgba(140, 205, 255, .14);
    --stripe: none;
    --accent: #7ef9ff;
    --accent-text: #04212a;
    --link: #8fd8ff;
    --nav-link: #c9dcef;
    --nav-active-text: #7ef9ff;
    --nav-active-bg: rgba(126, 249, 255, .12);
    --nav-active-line: transparent;
    --nav-line: 0px;
    --nav-pad: .7rem;
    --nav-gap: .1rem;
    --button-bg: #7ef9ff;
    --button-text: #04212a;
    --badge-bg: #ffb703;
    --badge-text: #2a1a00;
    --focus: #7ef9ff;
    --radius: 16px;
    --radius-sm: 10px;
    --pill: 999px;
    --card-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    --avatar-s: 50%;
    --avatar-l: 30%;
    --avatar-text-s: 60%;
    --avatar-text-l: 94%;
    --avatar-radius: 50%;
    --mark-line: rgba(140, 205, 255, .6);
    --mark-node: #e6f6ff;
    --mark-n1: var(--mark-node); --mark-n2: var(--mark-node); --mark-n3: var(--mark-node); --mark-n4: var(--mark-node);
    --mark-node-stroke: transparent;
    --mark-hub: #7ef9ff;
    --error: #ff8a8a;
    --pro: #6fcf73;
    --con: #fb923c;
    --sky-hi: #123e66;
    --sky-lo: #06172a;
    --dendrite: rgba(140, 205, 255, .45);
    --neuron: #e6f6ff;
    --terminal: #b8f1ff;
    --glow: #9fe3ff;
    --spark: #7ef9ff;
    --label: #dff1ff;
    --label-halo: rgba(6, 23, 42, .85);
  }
}

/* Quadra: light and editorial, serif headings, the four quadra colours as a stripe and in the logo. */
[data-theme="quadra"] {
  color-scheme: light;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-meta: var(--font-body);
  --display-weight: 400;
  --display-tracking: -.01em;
  --h2-font: var(--font-display);
  --h2-weight: 400;
  --kicker-font: var(--font-body);
  --kicker-case: none;
  --kicker-spacing: 0;
  --kicker-size: .875rem;
  --bg: #f4f4f2;
  --bg-image: none;
  --surface: #fff;
  --surface-2: #f0f5f2;
  --input-bg: #f8f8f6;
  --text: #1d1d27;
  --text-soft: #3a3a46;
  --muted: #5c5c68;
  --border: #e3e2dd;
  --border-strong: #cfcdc6;
  --header-bg: #fff;
  --header-line: #e3e2dd;
  --stripe: linear-gradient(90deg, #d9623c 0 25%, #e0a21c 0 50%, #1f9e78 0 75%, #3a7bd5 0);
  --accent: #3a7bd5;
  --accent-text: #fff;
  --link: #2f63b0;
  --nav-link: #4a4a57;
  --nav-active-text: #1d1d27;
  --nav-active-bg: transparent;
  --nav-active-line: #3a7bd5;
  --nav-line: 3px;
  --nav-pad: 0;
  --nav-gap: 1.5rem;
  --button-bg: #1d1d27;
  --button-text: #fff;
  --badge-bg: #b8492a;
  --badge-text: #fff;
  --focus: #3a7bd5;
  --radius: 14px;
  --radius-sm: 10px;
  --pill: 999px;
  --card-shadow: 0 1px 3px rgba(20, 20, 30, .05);
  --avatar-s: 55%;
  --avatar-l: 36%;
  --avatar-text-s: 0%;
  --avatar-text-l: 100%;
  --avatar-radius: 50%;
  --mark-line: #1d1d27;
  --mark-n1: #d9623c; --mark-n2: #e0a21c; --mark-n3: #1f9e78; --mark-n4: #3a7bd5;
  --mark-node-stroke: transparent;
  --mark-hub: #1d1d27;
  --error: #b42318;
  --pro: #17795c;
  --con: #b8492a;
}

/* Base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; color: var(--text); background-color: var(--bg); background-image: var(--bg-image); background-size: var(--bg-size); background-repeat: repeat; font: 16px/1.55 var(--font-body); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0 0 1rem; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 2rem; line-height: 1.15; letter-spacing: var(--display-tracking); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kicker { display: block; font-family: var(--kicker-font); font-size: var(--kicker-size); font-weight: 600; letter-spacing: var(--kicker-spacing); text-transform: var(--kicker-case); color: var(--muted); }
p.lead { max-width: 60ch; margin: -.25rem 0 1.25rem; color: var(--text-soft); text-wrap: pretty; }

/* Header and footer */
header.site, footer.site { position: relative; background: var(--header-bg); }
header.site { border-bottom: 1px solid var(--header-line); }
header.site::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--stripe); pointer-events: none; }
footer.site { margin-top: auto; border-top: 1px solid var(--header-line); color: var(--muted); font-size: .9rem; }
.site .bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 2rem; max-width: 1180px; margin: 0 auto; padding: .75rem 1.5rem; }
footer.site .bar { justify-content: space-between; gap: .5rem 1.5rem; padding-block: 1rem; }
footer.site nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
footer.site nav a { padding: .5rem 0; color: var(--text); }
footer.site .bar > span { font-family: var(--font-meta); font-size: .82rem; }
header.site .brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.45rem; letter-spacing: var(--display-tracking); line-height: 1; }
[data-theme="quadra"] header.site .brand { font-size: 1.9rem; }
header.site .brand:hover { text-decoration: none; }
.mark { flex: none; }
.mark .line { fill: none; stroke: var(--mark-line); stroke-width: 1.3; stroke-linecap: round; }
.mark .node { stroke: var(--mark-node-stroke); stroke-width: 1.4; }
.mark .n1 { fill: var(--mark-n1); } .mark .n2 { fill: var(--mark-n2); } .mark .n3 { fill: var(--mark-n3); } .mark .n4 { fill: var(--mark-n4); }
.mark .hub { fill: var(--mark-hub); }
header.site nav.main { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem var(--nav-gap); flex: 1 1 auto; font-size: .95rem; font-weight: 500; }
header.site nav.main a { padding: .45rem var(--nav-pad) calc(.45rem - var(--nav-line)); border-bottom: var(--nav-line) solid transparent; border-radius: var(--nav-pad); color: var(--nav-link); white-space: nowrap; }
[data-theme="synapse"] header.site nav.main a { border-radius: 999px; font-weight: 600; }
header.site nav.main a:hover { text-decoration: none; color: var(--text); }
header.site nav.main a[aria-current] { color: var(--nav-active-text); background: var(--nav-active-bg); border-bottom-color: var(--nav-active-line); }
header.site form { margin: 0; }
.me { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.me .icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); color: var(--text); }
.me .icon:hover { background: var(--surface-2); }
.me .icon[aria-current] { color: var(--accent); }
.me .icon .badge { position: absolute; top: 5px; right: 3px; }
details.menu { position: relative; margin-left: .35rem; }
details.menu summary { display: flex; align-items: center; gap: .4rem; height: 44px; padding: 0 .6rem 0 .35rem; list-style: none; cursor: pointer; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--pill); }
details.menu summary::-webkit-details-marker { display: none; }
details.menu summary .avatar { width: 32px; height: 32px; font-size: .9rem; }
details.menu summary .handle { font-family: var(--font-meta); font-size: .85rem; }
details.menu[open] summary { border-color: var(--border-strong); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; display: flex; flex-direction: column; min-width: 12rem; padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
.menu-panel a, .menu-panel button.link { display: block; width: 100%; padding: .6rem .75rem; color: var(--text); text-align: left; border-radius: var(--radius-sm); font-weight: 500; }
.menu-panel a:hover, .menu-panel button.link:hover { text-decoration: none; background: var(--surface-2); }
.menu-panel form { border-top: 1px solid var(--border); margin-top: .25rem; padding-top: .25rem; }
@media (max-width: 640px) {
  .site .bar { gap: .5rem 1rem; padding-inline: 1rem; }
  header.site nav.main { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
  details.menu summary .handle { display: none; }
}

/* Layout and cards */
main { width: 100%; max-width: 760px; margin: 2.5rem auto 4rem; padding: 0 1.25rem; flex: 1 0 auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 1.5rem; margin-bottom: 1rem; }
.card.emphasis, form.compose { border-color: var(--border-strong); }
.muted { color: var(--muted); }
.error { color: var(--error); }
.card h2 { margin: 0 0 .5rem; font-family: var(--h2-font); font-weight: var(--h2-weight); font-size: 1.2rem; }
[data-theme="quadra"] .card h2, [data-theme="quadra"] main > h2 { font-size: 1.6rem; line-height: 1.15; }
.card h3 { font-size: 1rem; margin: 1.25rem 0 .75rem; }
main > h2 { font-family: var(--h2-font); font-weight: var(--h2-weight); font-size: 1.2rem; margin: 1.5rem 0 .75rem; }

/* Forms and buttons */
label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
input, textarea, select { width: 100%; min-height: 44px; padding: .55rem .75rem; font: inherit; color: var(--text); background: var(--input-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: -1px; }
input[type="radio"], input[type="checkbox"] { min-height: 0; accent-color: var(--accent); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.3rem; font: inherit; font-weight: 600; color: var(--button-text); background: var(--button-bg); border: 1px solid transparent; border-radius: var(--pill); cursor: pointer; text-align: center; }
[data-theme="synapse"] button:not(.link):not(.secondary):not(.danger), [data-theme="synapse"] .button:not(.secondary) { box-shadow: 0 0 22px rgba(126, 249, 255, .25); }
.button:hover { text-decoration: none; }
button.secondary, .button.secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.wide { display: flex; width: 100%; margin-top: 1rem; }
form.card > button { margin-top: 1.25rem; width: 100%; }
button.link { display: inline; min-height: 0; padding: 0; color: var(--link); background: none; border: 0; border-radius: 0; font-weight: 400; box-shadow: none; }
button.link.muted { color: var(--muted); font-size: .9rem; }
button.link:hover { text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
button.danger { color: #fff; background: var(--error); }
[data-theme="synapse"] button.danger { color: #2a0606; }
form.inline { display: inline; margin: 0; }
label.check { display: flex; gap: .7rem; align-items: baseline; font-weight: 400; margin: .6rem 0 0; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
label.check input { width: auto; flex: none; }
fieldset.group { margin: 1.25rem 0 0; padding: 1rem; border: 0; border-radius: var(--radius-sm); background: var(--surface-2); }
fieldset.group legend { float: left; width: 100%; padding: 0; font-weight: 600; }
fieldset.group legend + p { clear: both; margin: .25rem 0 .25rem; font-size: .9rem; }
fieldset.group label.check { background: var(--surface); }

/* Feed and posts */
form.compose { display: flex; flex-direction: column; gap: .6rem; padding: 1.15rem 1.25rem; }
form.compose label { margin: 0; }
form.compose > button { width: auto; align-self: flex-end; margin-top: .15rem; }
.post { padding: 1.1rem 1.25rem; }
.post header { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; }
.post header > a { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); }
.post header > a:hover { text-decoration: none; }
.post header > a:hover b { text-decoration: underline; }
.post header .muted { font-family: var(--font-meta); font-size: .85rem; }
.post p { margin: .6rem 0 .1rem; white-space: normal; overflow-wrap: anywhere; text-wrap: pretty; }
.post form { margin: 0; }
.tools { float: right; font-size: .85rem; }
.post header .tools { float: none; margin-left: auto; display: flex; gap: .75rem; font-family: var(--font-body); }
.older { text-align: center; }

/* Avatars: initials coloured by --hue, shaped and shaded per theme. */
.avatar { display: inline-grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--avatar-radius); object-fit: cover; vertical-align: middle; font-weight: 700; color: hsl(var(--hue, 220) var(--avatar-text-s) var(--avatar-text-l)); background: hsl(var(--hue, 220) var(--avatar-s) var(--avatar-l)); }
.avatar.big { width: 6rem; height: 6rem; font-size: 2.5rem; font-family: var(--font-display); }
.avatar.small { width: 1.4rem; height: 1.4rem; font-size: .7rem; }
.profile h1 { margin-bottom: 0; }
.profile > .avatar.big { margin-bottom: .75rem; }
.card h1 .avatar { margin-right: .25rem; }

/* Lists, search and actions */
.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search input { flex: 1; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.actions input { flex: 1; min-width: 10rem; width: auto; }
.actions > span { flex: 1; }
.actions > .avatar { flex: none; }
.actions select { flex: 1; width: auto; min-width: 10rem; }
form.actions > button { width: auto; margin-top: 0; }
blockquote.quoted { margin: .75rem 0; padding: .5rem .75rem; background: var(--surface-2); border-radius: var(--radius-sm); color: var(--muted); overflow-wrap: anywhere; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; font-family: var(--font-meta); font-size: .72rem; font-weight: 700; line-height: 1.45; text-align: center; color: var(--badge-text); background: var(--badge-bg); border-radius: var(--pill); }
.unseen { box-shadow: inset 3px 0 0 var(--accent), var(--card-shadow); }
.crumbs { margin-bottom: .5rem; font-family: var(--font-meta); font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* Debates and Q&A */
details.card summary { cursor: pointer; font-weight: 600; }
.debate-row { display: block; color: var(--text); }
.debate-row:hover { text-decoration: none; border-color: var(--border-strong); }
.debate-row b { display: block; }
.sides { display: flex; gap: .5rem; margin: 1rem 0; }
.sides button { flex: 1; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.columns h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.argument { padding: 1rem; }
.argument p { margin: 0 0 .5rem; overflow-wrap: anywhere; }
.argument footer { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.argument footer form.vote { margin: 0 0 0 auto; }
button.voted { font-weight: 700; }
.accepted { color: var(--pro); font-weight: 700; }
p.accepted { margin: 0 0 .5rem; font-size: .9rem; }
.argument.is-accepted { border-color: var(--pro); }
.reply { margin: .75rem 0 0; padding: .5rem .75rem; background: var(--surface-2); border-radius: var(--radius-sm); font-size: .95rem; }
.reply p { margin: 0 0 .15rem; overflow-wrap: anywhere; }
.reply .muted { font-size: .85rem; }
.side-pro, .side-con { font-weight: 600; }
.side-pro { color: var(--pro); }
.side-con { color: var(--con); }
.reply-form summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-top: .75rem; }
.reply-form form { margin-top: .5rem; }
.reply-form button { margin-top: .5rem; }

/* Trees: bookmarks and the directory, drawn as neurons on a sky by bookmarks.js */
main.full { max-width: 1200px; }
.trees { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.tree ul { list-style: none; margin: .25rem 0 0; padding-left: 1.1rem; border-left: 1px solid var(--border); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: .4rem 0; overflow-wrap: anywhere; }
.tree summary { cursor: pointer; font-weight: 600; }
.tree .tools { float: none; margin-left: .4rem; font-weight: 400; }
.tree li > .muted { font-size: .85rem; }
.tree .note { margin: .1rem 0 0; color: var(--muted); font-size: .9rem; }
.view-bar { margin: 0 0 .75rem; }
.view-bar button { min-height: 36px; padding: .35rem .8rem; font-size: .9rem; }
.synapse { position: relative; height: 72vh; min-height: 420px; margin-bottom: 1rem; border-radius: var(--radius); overflow: hidden; background: radial-gradient(ellipse at 50% 40%, var(--sky-hi), var(--sky-lo)); }
.synapse svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
.synapse svg.dragging { cursor: grabbing; }
.synapse .glow { stop-color: var(--glow); }
.synapse .edge { fill: none; stroke: var(--dendrite); stroke-linecap: round; }
.synapse .edge.lit { stroke: var(--spark); stroke-dasharray: 3 9; animation: fire .6s linear infinite; }
.synapse .node { cursor: pointer; outline: none; }
.synapse .halo { fill: url(#glow); animation: breathe 6s ease-in-out infinite; }
.synapse .core { fill: var(--neuron); }
.synapse .link .core { fill: var(--terminal); }
.synapse .closed .core { fill: none; stroke: var(--neuron); stroke-width: 3px; }
.synapse .node:hover .core, .synapse .node:focus-visible .core { stroke: var(--spark); stroke-width: 3px; }
.synapse .target .halo { animation: none; transform: scale(1.8); }
.synapse .label { font-size: 13px; fill: var(--label); paint-order: stroke; stroke: var(--label-halo); stroke-width: 3px; stroke-linejoin: round; }
.synapse .folder .label { font-weight: 600; }
.synapse .hub .label { font-size: 17px; font-weight: 700; }
.synapse .panel, .synapse .toast { position: absolute; left: .75rem; bottom: .75rem; max-width: min(420px, calc(100% - 1.5rem)); padding: .75rem 1rem; color: var(--text); background: var(--surface); border-radius: var(--radius-sm); box-shadow: 0 4px 20px rgba(0, 0, 0, .2); overflow-wrap: anywhere; }
.synapse .panel p { margin: .4rem 0 0; }
.synapse .panel .tools { display: block; float: none; margin-top: .4rem; }
.synapse .toast { top: .75rem; bottom: auto; color: var(--error); }

/* Stats */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .75rem; margin: .75rem 0 0; }
.tile { padding: .75rem .9rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.tile b { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: var(--display-weight); line-height: 1.2; }
[data-theme="quadra"] .tile b { font-size: 2rem; }
.tile span, .tile small { display: block; color: var(--muted); font-size: .9rem; }
.tile small { margin-top: .2rem; font-size: .8rem; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); height: 8rem; margin-top: 1.75rem; border-bottom: 1px solid var(--border); }
.month { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; cursor: default; }
.month i { display: block; width: min(24px, 70%); background: var(--accent); border-radius: 4px 4px 0 0; }
.month:hover i, .month:focus-visible i { opacity: .75; }
.month:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; }
.month .peak { font-size: .8rem; font-weight: 600; }
.month:hover::after, .month:focus-visible::after, .fn:hover::after, .fn:focus-within::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 1; padding: .2rem .5rem; font-size: .8rem; white-space: nowrap; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); pointer-events: none; }
.month:nth-child(-n+2)::after { left: 0; transform: none; }
.month:nth-last-child(-n+2)::after { left: auto; right: 0; transform: none; }
.month-labels { display: grid; grid-template-columns: repeat(12, 1fr); margin-top: .25rem; font-size: .7rem; color: var(--muted); text-align: center; }
.table-view { margin-top: .75rem; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.table-view table { margin-top: .5rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: .15rem 1.5rem .15rem 0; text-align: left; }
.table-view p { margin: .4rem 0; }
.synapse.sociogram { height: auto; min-height: 0; max-height: 70vh; aspect-ratio: var(--ratio); margin: 1rem 0 0; }
.sociogram svg { touch-action: auto; cursor: default; }
.sociogram .edge { stroke-width: 1.5px; opacity: .7; }
.sociogram .edge.mutual { stroke-width: 3px; opacity: 1; }
.sociogram .node > .wires { display: none; }
.sociogram .node:hover > .wires, .sociogram .node:focus-visible > .wires { display: inline; }
.sociogram .edge.lit { opacity: 1; }

/* Types, the test and its results */
.glossary dt { margin-top: .75rem; font-weight: 600; scroll-margin-top: 1rem; }
.glossary dt:target { color: var(--accent); }
.glossary dd { margin: .1rem 0 0; }
.type-name { display: block; margin: 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: var(--display-weight); line-height: 1.15; letter-spacing: var(--display-tracking); }
a.type-name { color: var(--text); }
.functions { margin-top: .5rem; }
.fn { position: relative; display: grid; grid-template-columns: 4rem 1fr; gap: .75rem; align-items: center; }
.fn-bar { position: relative; height: 1.4rem; }
.fn-bar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.fn-bar i { position: absolute; top: .35rem; bottom: .35rem; background: var(--accent); }
.fn-bar .up { left: 50%; border-radius: 0 4px 4px 0; }
.fn-bar .down { right: 50%; border-radius: 4px 0 0 4px; }
.fn:hover i, .fn:focus-within i { opacity: .75; }
.fn-axis { display: grid; grid-template-columns: 4.75rem 1fr 1fr; margin-top: .25rem; font-size: .75rem; color: var(--muted); }
.fn-axis span:nth-child(2) { padding-right: .5rem; text-align: right; }
.fn-axis span:nth-child(3) { padding-left: .5rem; }
.functions.compact { margin: 0; font-family: var(--font-meta); font-size: .8rem; }
.functions.compact .fn { grid-template-columns: 2rem 1fr; gap: .5rem; }
.functions.compact .fn-bar { height: 1rem; }
.functions.compact .fn-bar i { top: .25rem; bottom: .25rem; background: var(--text); opacity: .55; }
.functions.compact .fn-bar i.leading { background: var(--accent); opacity: 1; }
.functions.compact .fn-axis { grid-template-columns: 2.5rem 1fr 1fr; font-family: var(--font-body); }

fieldset.scale { margin: 0; padding: 1.25rem 0; border: 0; border-top: 1px solid var(--border); }
.scale legend { float: left; width: 100%; padding: 0; margin-bottom: .75rem; font-size: 1.05rem; text-wrap: pretty; }
.scale legend .num, .test .num { margin-right: .4rem; font-family: var(--font-meta); font-size: .82rem; color: var(--muted); }
.choices { clear: both; display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; max-width: 26rem; }
.choices label { position: relative; display: grid; place-items: center; min-height: 44px; margin: 0; font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.choices label:hover { border-color: var(--border-strong); }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; }
.choices label:has(:checked) { color: var(--surface); background: var(--text); border-color: var(--text); }
.choices label:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choices .muted { grid-column: span 2; font-size: .8rem; font-weight: 400; }
.choices .end { grid-column: 4 / 6; text-align: right; }
#test > button { max-width: 16rem; margin-left: auto; display: flex; }

/* Personality test overview */
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; padding: .8rem 1rem; font-size: .95rem; }
.notice svg { flex: none; }
.notice span { flex: 1 1 18rem; }
.notice a { font-weight: 600; }
.test header { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .75rem 1.25rem; }
.test header > div { flex: 1 1 18rem; }
.test header .num { padding-top: .3rem; }
.test header h2 { font-size: 1.3rem; margin: 0 0 .2rem; }
.test header p { margin: 0 0 .2rem; color: var(--text-soft); text-wrap: pretty; }
.test .meta { font-family: var(--font-meta); font-size: .78rem; color: var(--muted); }
.test .status { padding: .15rem .65rem; font-family: var(--kicker-font); font-size: .75rem; font-weight: 600; letter-spacing: var(--kicker-spacing); text-transform: var(--kicker-case); color: var(--muted); border: 1px solid var(--border); border-radius: var(--pill); }
.test.done .status { color: var(--pro); border-color: currentColor; }
.test .result { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1rem 2rem; margin: 1.25rem 0; padding: 1.1rem 1.25rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.test .result > div:first-child { display: flex; flex-direction: column; gap: .3rem; }
.test .result .muted { font-size: .9rem; }
.test .actions { margin-top: 1.25rem; }
.test .result + .actions { margin-top: 0; }

/* Settings: theme picker */
fieldset.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9.5rem, 100%), 1fr)); gap: .75rem; margin: .75rem 0 0; padding: 0; border: 0; }
.theme-option { display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: .6rem .6rem .75rem; font-weight: 400; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.theme-option:has(:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.theme-option:has(:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-option .pick { display: flex; align-items: center; gap: .5rem; }
.theme-option input { width: 18px; height: 18px; margin: 0; flex: none; }
.theme-option small { font-size: .82rem; line-height: 1.4; }
.preview { display: flex; flex-direction: column; gap: 6px; height: 88px; padding-bottom: 8px; overflow: hidden; border: 1px solid rgba(128, 128, 128, .25); border-radius: 4px; }
.preview i { display: block; height: 22px; margin: 0 10px; border-radius: 2px; }
.preview i:first-child { height: 18px; margin: 0; border-radius: 0; }
.preview-lab { background: linear-gradient(#e2e5de 1px, transparent 1px) 0 0 / 10px 10px, linear-gradient(90deg, #e2e5de 1px, transparent 1px) 0 0 / 10px 10px, #f6f7f4; }
.preview-lab i { background: #fff; border: 1px solid #16181d; }
.preview-lab i:first-child { border-width: 0 0 1px; }
.preview-lab i:last-child { border-color: #cfd3cb; }
.preview-synapse { background: #07111f radial-gradient(ellipse 80% 50px at 50% -10px, #123e66, rgba(18, 62, 102, 0)); }
.preview-synapse i { background: #111f33; border: 1px solid #1f3757; border-radius: 6px; }
.preview-synapse i:first-child { background: none; border-width: 0 0 1px; border-color: rgba(140, 205, 255, .2); border-radius: 0; }
.preview-quadra { background: #f4f4f2; }
.preview-quadra i { background: #fff; border: 1px solid #e3e2dd; border-radius: 6px; }
.preview-quadra i:first-child { border-width: 4px 0 1px; border-image: linear-gradient(90deg, #d9623c 0 25%, #e0a21c 0 50%, #1f9e78 0 75%, #3a7bd5 0) 1; border-radius: 0; }
.preview-auto { background: linear-gradient(90deg, #f6f7f4 50%, #07111f 50%); }
.preview-auto i { background: linear-gradient(90deg, #fff 50%, #111f33 50%); border: 1px solid #8a8f88; }
.preview-auto i:first-child { background: linear-gradient(90deg, #fff 50%, transparent 50%); border-width: 0 0 1px; }

/* Face verification: the front camera shown like a mirror, with an oval for the face that turns solid while
   the frame would make a good photo, and verify.js's hint across the bottom. */
.camera { position: relative; max-width: 22rem; aspect-ratio: 3 / 4; margin: 1rem auto 0; overflow: hidden; background: var(--surface-2); border-radius: var(--radius); }
.camera video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera::after { content: ""; position: absolute; inset: 12% 17%; border: 3px dashed var(--surface); border-radius: 50%; }
.camera.good::after { border-style: solid; border-color: var(--pro); }
.camera .hint { position: absolute; inset: auto 0 0; margin: 0; padding: .6rem .8rem; text-align: center; font-weight: 600; color: var(--text); background: var(--surface); opacity: .9; }

.legal { max-width: 70ch; }

@keyframes breathe { 50% { opacity: .5; } }
@keyframes fire { to { stroke-dashoffset: -12; } }
@media (prefers-reduced-motion: reduce) { .synapse .halo, .synapse .edge.lit { animation: none; } }
@media (max-width: 640px) { .columns { grid-template-columns: 1fr; } .sociogram .node:not(.hub) .label { display: none; } .sociogram .hub .label { font-size: 34px; } main { margin-top: 1.5rem; } }
