/*
 * Threadbound design system, 2026 edition (docs/THEMES.md, design handoff 31 October 2026).
 * Four colour layers that never merge: brightness (dark, light, high contrast), theme (this file or an installed
 * theme), the player's accent (set inline on <html> by core/store.js, never in high contrast) and campaign identity
 * (House colours, board artwork). A modern sans for the interface; a restrained serif only for roleplay titles.
 * Themes (public/assets/themes/) restyle by setting these tokens under :root[data-style="<id>"].
 */

:root {
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Hoefler Text", Georgia, serif;
  --font-heading: var(--font-display);
  --font-ui: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: var(--font-ui);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* Dark (the default): deep blue-black slate, teal accent, old gold for prestige. */
  --bg: #0a1017;
  --bg-2: #0d141c;
  --surface: #111a24;
  --surface-2: #162230;
  --surface-3: #1b2a39;
  --border: #263747;
  --border-strong: #34495c;
  --text: #eaf1f7;
  --text-muted: #9aacbb;
  --text-faint: #7d909f;
  --accent: #36b8a1;
  --accent-strong: #5fd0bb;
  --on-accent: #04201b;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 55%, transparent);
  --focus: var(--accent-strong);
  --link: #7fd6c5;
  --gold: #d7ad5f;
  --bronze: #d7ad5f;
  --danger: #e05a5a;
  --danger-bg: #2c1519;
  --success: #3fb67a;
  --success-bg: #12271d;
  --info: #5aa2e6;
  --info-bg: #13233a;
  --warning: #e0a63a;
  --stone: #8a8780;
  --hero-fallback: radial-gradient(120% 140% at 85% 20%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 55%),
    radial-gradient(90% 120% at 10% 110%, rgba(215, 173, 95, .18), transparent 60%), linear-gradient(135deg, #142231, #0c141d 70%);
  --hero-overlay: linear-gradient(90deg, rgba(6, 10, 16, .92) 0%, rgba(6, 10, 16, .72) 38%, rgba(6, 10, 16, .18) 72%, rgba(6, 10, 16, .05) 100%);
  --row-overlay: linear-gradient(90deg, rgba(6, 10, 16, .94) 0%, rgba(6, 10, 16, .82) 42%, rgba(6, 10, 16, .45) 100%);

  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 15px;
  --radius-xl: 19px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .18);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .3);
  --gap: 16px;
  --nav-width: 248px;
  --topbar: 60px;
  --content-max: 1480px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 150ms;
  font-size: calc(16px * var(--text-scale, 1));
  color-scheme: dark;
}

/* Light: a design of its own, cool paper and ink, not inverted dark. */
:root[data-theme="light"] {
  --bg: #eef2f5;
  --bg-2: #e6ebef;
  --surface: #ffffff;
  --surface-2: #f5f8fa;
  --surface-3: #eaf0f4;
  --border: #d7e0e6;
  --border-strong: #c2cfd8;
  --text: #17232d;
  --text-muted: #566876;
  --text-faint: #627482;
  --accent: #187e70;
  --accent-strong: #106558;
  --on-accent: #ffffff;
  --link: #126e62;
  --gold: #8f6413;
  --bronze: #8f6413;
  --danger: #c23434;
  --danger-bg: #fbeaea;
  --success: #23794c;
  --success-bg: #e3f4ea;
  --info: #2867a8;
  --info-bg: #e5eff9;
  --warning: #9a6408;
  --hero-fallback: radial-gradient(120% 140% at 85% 20%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 55%),
    radial-gradient(90% 120% at 10% 110%, rgba(143, 100, 19, .25), transparent 60%), linear-gradient(135deg, #1d3344, #12202c 70%);
  --shadow: 0 1px 2px rgba(23, 35, 45, .06), 0 6px 20px rgba(23, 35, 45, .07);
  --shadow-lift: 0 2px 6px rgba(23, 35, 45, .08), 0 14px 34px rgba(23, 35, 45, .12);
  color-scheme: light;
}

/* High contrast: accessibility first. Decorative accents and artwork overlays are ignored. */
:root[data-theme="contrast"] {
  --bg: #000;
  --bg-2: #000;
  --surface: #000;
  --surface-2: #0d0d0d;
  --surface-3: #1a1a1a;
  --border: #fff;
  --border-strong: #fff;
  --text: #fff;
  --text-muted: #f0f0f0;
  --text-faint: #d8d8d8;
  --link: #ffe066;
  --focus: #ffe066;
  --accent: #ffe066 !important;
  --accent-strong: #fff !important;
  --on-accent: #000 !important;
  --accent-soft: #1a1a1a !important;
  --accent-line: #ffe066 !important;
  --gold: #ffe066;
  --danger: #ff6b6b;
  --success: #6bff9a;
  --info: #8cc8ff;
  --hero-fallback: #000;
  --hero-overlay: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .92) 60%, rgba(0, 0, 0, .8) 100%);
  --row-overlay: linear-gradient(90deg, #000, rgba(0, 0, 0, .9));
  --shadow: none;
  --shadow-lift: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation: none !important; transition: none !important; }

h1, h2, h3, h4 { font-family: var(--font-ui); font-weight: 650; letter-spacing: -.005em; line-height: 1.2; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: 1.9rem; letter-spacing: -.015em; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.05rem; }
h4 { text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; font-weight: 700; color: var(--text-faint); }
.display, .hero__title, .post__author, .forum-card__name { font-family: var(--font-display); }
p { margin: 0 0 .9em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
small, .muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--gap) 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface-3); color: var(--text); padding: 8px 12px; z-index: 1000; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }

.boot { display: grid; place-items: center; min-height: 100vh; font-family: var(--font-display); color: var(--text-muted); font-size: 1.2rem; }
.boot__mark { font-size: 2rem; color: var(--accent); margin-right: .4em; }
/* Shown by boot.js when start-up fails or stalls. */
.boot-fail { max-width: 560px; margin: 12vh auto 0; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.boot-fail h1 { margin: 0 0 8px; font-size: 1.35rem; }
.boot-fail p { color: var(--text-muted); }
.boot-fail__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.boot-fail pre { white-space: pre-wrap; overflow-wrap: anywhere; font: .8rem/1.5 var(--font-mono); background: var(--surface-2); padding: 10px; border-radius: var(--radius); max-height: 240px; overflow: auto; }
@media (max-width: 600px) { .boot-fail { margin: 16px; } }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--nav-width) minmax(0, 1fr); grid-template-rows: var(--topbar) 1fr; min-height: 100vh; }
.topbar { min-width: 0; grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 18px 0 14px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: saturate(1.3) blur(10px); }
:root[data-theme="contrast"] .topbar { background: var(--surface); backdrop-filter: none; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; min-width: 0; font-weight: 700; letter-spacing: .01em; }
.brand:hover { color: var(--text); }
.brand__mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none; color: var(--on-accent); background: var(--accent);
  font-size: 1.05rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.brand__sub { font-size: .74rem; font-weight: 500; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.topbar__label { white-space: nowrap; }
.topbar__date { color: var(--text-muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__spacer { flex: 1; }
.topbar__menu { display: none; }
.topbar__search { flex: 0 1 420px; min-width: 0; position: relative; }
.topbar__search input[type="search"] { padding-left: 34px; background: var(--surface-2); border-color: var(--border); height: 38px; }
.topbar__search::before { content: ""; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border: 2px solid var(--text-faint); border-radius: 50%; pointer-events: none; }
.topbar__search::after { content: ""; position: absolute; left: 23px; top: 50%; width: 6px; height: 2px; margin-top: 4px; background: var(--text-faint); transform: rotate(45deg); pointer-events: none; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; justify-content: center; background: var(--danger); color: #fff; border-color: transparent; font-size: .68rem; line-height: 18px; }
.account-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font: 600 .88rem var(--font-ui); max-width: 220px; }
.account-btn:hover { background: var(--surface-3); }
.account-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidenav { background: var(--bg-2); border-right: 1px solid var(--border); padding: 14px 12px 28px; overflow-y: auto; position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar));
  scrollbar-width: thin; }
.sidenav h4 { margin: 18px 10px 6px; }
.sidenav h4:first-child { margin-top: 4px; }
.sidenav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius); color: var(--text-muted); text-decoration: none; font-size: .93rem; font-weight: 550;
  transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.sidenav a:hover { background: var(--surface-2); color: var(--text); }
.sidenav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.sidenav img.icon { width: 20px; height: 20px; image-rendering: pixelated; opacity: .92; }
.sidenav__foot { margin: 22px 4px 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); font-size: .82rem; color: var(--text-muted); }
.sidenav__foot strong { color: var(--text); display: block; font-size: .88rem; }
.main { padding: 26px clamp(14px, 3vw, 40px) 72px; min-width: 0; width: 100%; max-width: calc(var(--content-max) + 80px); margin: 0 auto; }
.main:focus, .main:focus-visible { outline: none; }
.main--wide { padding: 0; max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head > div:first-child { min-width: 0; }
.page-head .sub { color: var(--text-muted); margin-top: 4px; }
.crumbs { font-size: .84rem; color: var(--text-muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

/* Bottom navigation (phones): the most used places, driven by the same permissions as the sidebar. */
.bottomnav { display: none; }

@media (max-width: 1199px) {
  :root { --nav-width: 220px; }
  .topbar__search { flex-basis: 280px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar__label, .topbar__date, .brand__sub, .topbar__search, .topbar .icon-btn:not(.topbar__menu) { display: none; }
  .topbar select { max-width: 120px; min-height: 36px; padding: 4px 8px; }
  .account-btn span:last-child { display: none; }
  .account-btn { padding: 3px; }
  .composer { position: static; }
  .sidenav { position: fixed; left: 0; top: var(--topbar); width: min(86vw, 310px); transform: translateX(-105%); transition: transform .2s var(--ease); z-index: 40; box-shadow: var(--shadow-lift); background: var(--surface); }
  .shell.nav-open .sidenav { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: var(--topbar) 0 0; background: rgba(3, 6, 10, .5); z-index: 35; }
  .topbar__menu { display: inline-grid; }
  .main { padding: 18px 14px 96px; }
  .bottomnav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--border); backdrop-filter: blur(10px); }
  .bottomnav a, .bottomnav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; border-radius: var(--radius);
    color: var(--text-muted); text-decoration: none; font: 600 .7rem var(--font-ui); cursor: pointer; }
  .bottomnav img.icon { width: 22px; height: 22px; }
  .bottomnav [aria-current="page"] { color: var(--text); background: var(--accent-soft); }
  .bottomnav .badge { position: absolute; top: 0; left: 55%; background: var(--danger); color: #fff; border: 0; min-width: 17px; height: 17px; padding: 0 4px; font-size: .65rem; line-height: 17px; justify-content: center; }
  .toasts { bottom: 78px; }
}

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: var(--gap); }
.grid > .card, .row > .card, .split > .card { margin-top: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__head h2, .card__head h3 { margin: 0; }
.card--flush { padding: 0; overflow: hidden; }
.parchment { background: linear-gradient(180deg, #f3ead6, #ebdfc3); color: #2a2318; border-color: #c7b48a; }
.parchment h1, .parchment h2, .parchment h3 { color: #2a2318; }
.parchment .muted { color: #6b5d45; }
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; min-width: 0; }
.stat__label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.stat__value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr)); gap: 10px; }
.stats .stat { padding: 12px 14px; }
.stats .stat__value { font-size: 1.45rem; margin: 0; }
.stats .stat__label { text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.gold { color: var(--gold); }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 15px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 .9rem/1 var(--font-ui); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); border-color: transparent; color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn--small { min-height: 30px; padding: 4px 11px; font-size: .82rem; border-radius: var(--radius-sm); }
.btn--glass { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(6px); }
.btn--glass:hover { background: rgba(255, 255, 255, .18); color: #fff; border-color: rgba(255, 255, 255, .35); }
:root[data-theme="contrast"] .btn--glass { background: #000; border-color: #fff; }
.btn img.icon { width: 18px; height: 18px; image-rendering: pixelated; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font: 650 .72rem/1.65 var(--font-ui); background: var(--surface-3); color: var(--text-muted);
  border: 1px solid var(--border); white-space: nowrap; }
.badge--danger { background: var(--danger-bg); color: #ffb4b0; border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.badge--success { background: var(--success-bg); color: #9fe3bd; border-color: color-mix(in srgb, var(--success) 50%, transparent); }
.badge--info { background: var(--info-bg); color: #a9cff5; border-color: color-mix(in srgb, var(--info) 50%, transparent); }
.badge--gold { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.badge--accent { background: var(--accent-soft); color: var(--text); border-color: var(--accent-line); }
:root[data-theme="light"] .badge--danger { color: #9b1c1c; }
:root[data-theme="light"] .badge--success { color: #1d5e3b; }
:root[data-theme="light"] .badge--info { color: #1f4f80; }
:root[data-theme="light"] .badge--gold { color: #6b4a07; }

label { font-weight: 600; font-size: .86rem; display: block; margin-bottom: 5px; }
.field { margin-bottom: 15px; }
.field__hint { font-size: .8rem; color: var(--text-muted); margin-top: 5px; }
.field__error { font-size: .82rem; color: #ff9c96; margin-top: 4px; }
:root[data-theme="light"] .field__error { color: #9b1c1c; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="url"], input[type="date"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 400 .95rem/1.4 var(--font-ui);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
:root[data-theme="contrast"] input:focus-visible, :root[data-theme="contrast"] select:focus-visible, :root[data-theme="contrast"] textarea:focus-visible { outline: 2px solid var(--focus); }
textarea { min-height: 110px; resize: vertical; font-size: 1rem; line-height: 1.6; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type="color"] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--danger); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 650; font-size: .88rem; }

/* A switch: a checkbox drawn as a toggle; still a checkbox for keyboards and screen readers. */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.switch > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.switch small { font-weight: 400; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer;
  flex: none; transition: background var(--t) var(--ease); margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); transition: transform var(--t) var(--ease), background var(--t) var(--ease); }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(18px); background: var(--on-accent); }

/* Segmented choice: radio buttons drawn as one control. */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--surface-2); }
.segmented label { margin: 0; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 6px 12px; border-radius: var(--radius); border: 1px solid transparent; font-weight: 650; color: var(--text-muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Accent swatches. */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { position: relative; margin: 0; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.swatch input + span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sw, var(--surface-3)); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong);
  color: #fff; font: 700 .7rem var(--font-ui); transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease); }
.swatch:hover input + span { transform: scale(1.06); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch input:checked + span::after { content: "✓"; font-size: 1rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.swatch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 4px; }
.swatch--auto input + span { background: conic-gradient(from 200deg, #36b8a1, #3b8beb, #8b6cf0, #e0577f, #e0703a, #6e9f4b, #36b8a1); }
.swatch { display: flex; flex-direction: column; align-items: center; }
.swatch__name { display: block; text-align: center; font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

/* ---------------------------------------------------------------- tables, lists, tabs */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-faint); background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t) var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 11px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--surface); margin-bottom: 18px; overflow-x: auto; width: fit-content; max-width: 100%; }
.tabs button { background: none; border: 0; border-radius: var(--radius); color: var(--text-muted); padding: 8px 14px; font: 600 .88rem var(--font-ui); cursor: pointer; white-space: nowrap; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.tabs button:hover { color: var(--text); }
.empty { padding: 32px 20px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.empty img { width: 44px; height: 44px; image-rendering: pixelated; opacity: .85; display: block; margin: 0 auto 10px; }
.empty .btn { margin-top: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.meter { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter--danger > span { background: var(--danger); }
.meter--success > span { background: var(--success); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot--ok { background: var(--success); }
.dot--warn { background: var(--warning); }
.dot--bad { background: var(--danger); }

/* ---------------------------------------------------------------- identity: avatars, heraldry */
.avatar { --size: 40px; display: inline-grid; place-items: center; width: var(--size); height: var(--size); flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-3);
  border: 1px solid var(--border-strong); color: var(--text); font: 700 calc(var(--size) * .4) / 1 var(--font-ui); text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sq { border-radius: 28%; }
.avatar--sm { --size: 32px; }
.avatar--lg { --size: 96px; }
.avatar--gm { color: var(--gold); font-family: var(--font-display); font-size: calc(var(--size) * .5); }
.house-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--text); }
.house-chip__shield { width: 15px; height: 18px; border-radius: 2px 2px 8px 8px; border: 1px solid rgba(255, 255, 255, .25); flex: none; }
.banner { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 20px; border-radius: var(--radius-xl); color: #fff; position: relative; overflow: hidden; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, .05)); pointer-events: none; }
.banner > * { position: relative; z-index: 1; }
.banner__shield { width: 64px; height: 76px; border-radius: 4px 4px 32px 32px; border: 2px solid rgba(255, 255, 255, .6); display: grid; place-items: center; font-family: var(--font-display); font-size: 1.8rem; }
.banner h1 { color: #fff; margin: 0; font-family: var(--font-display); }
.banner__motto { font-family: var(--font-display); font-style: italic; opacity: .9; }
.portrait { width: 72px; height: 72px; border-radius: 22%; background: var(--surface-3); border: 1px solid var(--border-strong); object-fit: cover; image-rendering: pixelated; flex: none; }
.portrait--small { width: 40px; height: 40px; }
div.portrait { display: grid; place-items: center; color: var(--text-muted); font-weight: 700; }
.charcard { display: flex; gap: 10px; align-items: center; min-width: 0; }
.charcard__name { font-weight: 650; }
.charcard__meta { font-size: .82rem; color: var(--text-muted); }

/* ---------------------------------------------------------------- heroes: campaign, board, thread */
.hero { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius-xl); border: 1px solid var(--border); color: #fff; min-height: 200px;
  display: flex; align-items: flex-end; padding: clamp(18px, 3vw, 34px); margin-bottom: 20px; background: var(--hero-fallback); box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--hero-image, none) center / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hero-overlay); }
.hero--plain::after { background: linear-gradient(90deg, rgba(6, 10, 16, .55), rgba(6, 10, 16, .05)); }
.hero__emblem { position: absolute; right: clamp(18px, 4vw, 56px); top: 50%; transform: translateY(-50%); z-index: -1; font-family: var(--font-display); font-size: clamp(90px, 12vw, 170px);
  line-height: 1; color: rgba(255, 255, 255, .07); pointer-events: none; }
.hero__body { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; width: 100%; }
.hero__text { min-width: 0; flex: 1 1 360px; max-width: 760px; }
.hero__eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .78); margin-bottom: 8px; }
.hero__eyebrow a { color: rgba(255, 255, 255, .86); text-decoration: none; }
.hero__eyebrow a:hover { color: #fff; text-decoration: underline; }
.hero__title { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 600; line-height: 1.1; margin: 0 0 6px; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.hero__sub { color: rgba(255, 255, 255, .84); margin: 0; max-width: 64ch; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: rgba(255, 255, 255, .8); font-size: .88rem; margin-top: 8px; }
.hero__meta strong { color: #fff; }
.hero .badge { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); backdrop-filter: blur(4px); }
.hero .badge--gold { color: #f1d08f; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero--tall { min-height: 250px; }
.hero--compact { min-height: 150px; }
.hero--campaign { min-height: 220px; }
:root[data-theme="contrast"] .hero { border-color: #fff; }
:root[data-theme="contrast"] .hero::before { opacity: .25; }
:root[data-theme="contrast"] .hero .badge { background: #000; border-color: #fff; }
@media (max-width: 860px) {
  .hero { min-height: 160px; border-radius: 16px; padding: 18px; }
  .hero::after { background: linear-gradient(0deg, rgba(6, 10, 16, .94) 0%, rgba(6, 10, 16, .7) 55%, rgba(6, 10, 16, .25) 100%); }
  .hero__actions { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .hero__actions .btn { width: 100%; }
}

/* ---------------------------------------------------------------- dashboard */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: var(--gap); align-items: start; }
.dash > * { min-width: 0; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.quick-actions .btn { min-height: 46px; justify-content: flex-start; padding: 10px 14px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-2); text-decoration: none; color: var(--text); transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
a.feed__item:hover { border-color: var(--accent-line); background: var(--surface-3); color: var(--text); }
.feed__title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.feed__chev { color: var(--text-faint); font-size: 1.2rem; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.side-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-list li > div { min-width: 0; }
.side-list strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .dash { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- roleplay: posts and the postbit */
.posts { display: grid; gap: 14px; }
.post { display: grid; grid-template-columns: 188px minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.post__bit { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 20px 14px; background: var(--surface-2); border-right: 1px solid var(--border); min-width: 0; }
.post__bit .avatar { margin-bottom: 4px; }
.post__author { font-size: 1.08rem; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; line-height: 1.25; }
a.post__author:hover { color: var(--accent-strong); }
.post__role { font-size: .8rem; color: var(--text-muted); overflow-wrap: anywhere; }
.post__badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.post__main { min-width: 0; padding: 14px 20px 14px; display: flex; flex-direction: column; }
.post__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.post__meta { font-size: .8rem; color: var(--text-muted); }
.post__num { font-size: .8rem; color: var(--text-faint); text-decoration: none; font-variant-numeric: tabular-nums; }
.post__body { font-family: var(--font-body); font-size: 1.03rem; line-height: 1.75; max-width: 76ch; overflow-wrap: anywhere; }
.post__body p { margin: 0 0 .85em; }
.post__body blockquote { margin: .6em 0; padding: 6px 14px; border-left: 3px solid var(--accent-line); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-muted); }
.post__body :is(h1, h2, h3, h4, h5, h6) { font-family: var(--font-display); font-size: 1.15em; line-height: 1.3; margin: .9em 0 .4em; }
.post__body :is(ul, ol) { margin: 0 0 .8em; padding-left: 1.6em; }
.post__body li > p { margin: 0 0 .3em; }
.post__body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post__body hr { border: 0; height: auto; margin: 1em 0; text-align: center; color: var(--text-faint); }
.post__body hr::after { content: "⁂"; font-size: 1.25em; line-height: 1; }
.post__body code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border-radius: 4px; padding: .05em .3em; }
.post__body pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; }
.post__body pre code { background: none; padding: 0; }
.post__body .mention { color: var(--accent-strong); font-weight: 600; white-space: nowrap; }
.post__actions { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; padding-top: 10px; }
.post--ai .post__author::after { content: " · AI"; font: 650 .7rem var(--font-ui); color: var(--info); vertical-align: middle; }
.post--ooc .post__body { font-size: .97rem; }
.post--ooc .post__bit { background: color-mix(in srgb, var(--info) 7%, var(--surface-2)); }
.post--gm .post__bit { background: color-mix(in srgb, var(--gold) 8%, var(--surface-2)); }
.post--deleted { opacity: .6; }
.thread-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: var(--gap); align-items: start; }
.thread-layout > * { min-width: 0; }
@media (max-width: 1100px) { .thread-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .post { grid-template-columns: minmax(0, 1fr); }
  .post__bit { flex-direction: row; align-items: center; text-align: left; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--border); gap: 10px; }
  .post__bit .avatar { --size: 40px; margin: 0; }
  .post__bit .post__who { min-width: 0; flex: 1; }
  .post__badges { justify-content: flex-start; }
  .post__main { padding: 12px 14px; }
  .post__head { padding-bottom: 6px; margin-bottom: 8px; }
}

/* The post editor: a toolbar over an editable post body, or the Markdown source. */
.rte { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); min-width: 0; }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rte__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); }
.rte__tool, .rte__mode { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent; color: var(--text); font: 600 .95rem/1 var(--font-ui); cursor: pointer; }
.rte__tool:hover:not(:disabled), .rte__mode:hover { background: var(--surface-3); }
.rte__tool[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.rte__tool:disabled { opacity: .35; cursor: default; }
.rte__h { font-family: var(--font-display); font-size: 1.05rem; }
.rte__sep { width: 1px; height: 20px; margin: 0 4px; background: var(--border); }
.rte__spacer { flex: 1 1 0; }
.rte__mode { font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.rte__mode[aria-pressed="true"] { color: var(--text); border-color: var(--accent-line); }
.rte__surface { position: relative; max-width: none; max-height: 65vh; overflow-y: auto; padding: 10px 12px; overflow-wrap: anywhere; outline: none; cursor: text; }
.rte__surface.is-empty::before { content: attr(data-placeholder); position: absolute; top: 10px; left: 12px; right: 12px; color: var(--text-faint); pointer-events: none; }
.rte__surface > :last-child { margin-bottom: 0; }
.rte__surface .mention { background: var(--accent-soft); border-radius: 4px; padding: 0 .2em; }
.rte__source { display: block; border: 0; border-radius: 0 0 var(--radius) var(--radius); background: transparent; }
.rte__source:focus-visible { outline: none; box-shadow: none; }
.rte__note { padding: 6px 12px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-muted); }
.composer { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-top: 14px; box-shadow: var(--shadow-lift); }
.posting-as { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------------------------------------------------------------- overlays */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface-3); border: 1px solid var(--border); border-left: 4px solid var(--info); padding: 11px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lift); font-size: .92rem; }
.toast--error { border-left-color: var(--danger); }
.toast--success { border-left-color: var(--success); }
dialog { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); color: var(--text); padding: 0; width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(4, 8, 12, .62); backdrop-filter: blur(2px); }
.dialog__head { padding: 18px 20px 0; }
.dialog__head h2 { margin: 0; }
.dialog__body { padding: 14px 20px; max-height: 70vh; overflow: auto; }
.dialog__foot { padding: 12px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }
dialog.dialog--wide { width: min(940px, calc(100vw - 24px)); }
@media (max-width: 600px) { dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); } .dialog__foot .btn { flex: 1; } }
.menu { position: relative; }
.menu__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift); padding: 6px; z-index: 50; }
.menu__panel a, .menu__panel button { display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: var(--radius); color: var(--text); background: none; border: 0; font: 500 .92rem var(--font-ui); cursor: pointer; text-decoration: none; }
.menu__panel a:hover, .menu__panel button:hover { background: var(--surface-2); }
.menu__panel hr { margin: 6px 4px; }
.menu__who { padding: 8px 11px 10px; font-size: .82rem; color: var(--text-muted); }
.menu__who strong { display: block; color: var(--text); font-size: .92rem; }
.notice { padding: 11px 14px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--info) 45%, transparent); margin-bottom: 14px; font-size: .92rem; }
.notice--danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.notice--success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 50%, transparent); }
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 32px; text-align: center; color: var(--text-muted); }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(70% 60% at 80% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
  radial-gradient(60% 50% at 0% 100%, rgba(215, 173, 95, .12), transparent 60%), var(--bg); }
.auth__card { width: min(430px, 100%); }
.auth__title { text-align: center; margin-bottom: 18px; }
.auth__title .brand__mark { width: 56px; height: 56px; font-size: 1.9rem; border-radius: 16px; margin: 0 auto 10px; }

/* ---------------------------------------------------------------- map */
.map-view { display: grid; grid-template-columns: 1fr 340px; height: calc(100vh - var(--topbar)); }
.map-canvas-wrap { position: relative; overflow: hidden; background: #1c2a33; }
.map-canvas-wrap canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.map-canvas-wrap canvas.dragging { cursor: grabbing; }
.map-toolbar { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; max-width: calc(100% - 24px); }
.map-toolbar select, .map-toolbar .btn { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.map-legend { position: absolute; left: 12px; bottom: 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; font-size: .8rem; max-width: 300px; }
.map-side { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 16px; }
@media (max-width: 960px) { .map-view { grid-template-columns: 1fr; grid-template-rows: 62vh auto; height: auto; } .map-side { border-left: 0; border-top: 1px solid var(--border); } }

/* ---------------------------------------------------------------- feudal tree, family tree */
.tree { list-style: none; margin: 0; padding-left: 0; }
.tree li > ul { list-style: none; margin: 0; padding-left: 26px; border-left: 1px dashed var(--border); }
.tree li { position: relative; margin: 10px 0; }
.tree li > ul > li::before { content: ""; position: absolute; left: -26px; top: 26px; width: 22px; border-top: 1px dashed var(--border); }

/* ---------------------------------------------------------------- misc */
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pill-nav a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text-muted); font-size: .86rem; font-weight: 550; }
.pill-nav a:hover { color: var(--text); background: var(--surface-2); }
.pill-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); border-color: var(--accent-line); }
.chronicle-entry { padding: 14px 0; border-bottom: 1px solid var(--border); }
.chronicle-entry h3 { margin-bottom: 4px; font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }
.chronicle-entry__date { color: var(--gold); font-size: .82rem; font-weight: 600; }
.odds { font-variant-numeric: tabular-nums; }
.code-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font: .82rem/1.5 var(--font-mono); white-space: pre-wrap; overflow: auto; max-height: 360px; }
.replay-host { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: #000; }
.noscript { padding: 24px; }
/* Icon sprite sheets hold animation frames side by side: show the first frame, crisp. */
img.icon { object-fit: cover; object-position: 0 50%; image-rendering: pixelated; flex: none; }

/* List beside detail (messages, queues): one column on phones, the open item replaces the list. */
.split { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: var(--gap); align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split[data-open="detail"] > :first-child, .split[data-open="list"] > :last-child { display: none; } }

/* Conversation bubbles: the reader's own messages on the right. */
.chat { display: flex; flex-direction: column; gap: 8px; }
.chat__msg { max-width: min(78%, 620px); padding: 9px 13px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.chat__msg--mine { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-line); }
.chat__meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* Long forms in two columns where there is room. */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 16px; }
/* Main content beside a narrower sidebar; stacks on small screens. */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: var(--gap); align-items: start; }
@media (max-width: 960px) { .with-sidebar { grid-template-columns: minmax(0, 1fr); } }
/* Multi-selects follow the theme (browsers default them to a light list). */
select[multiple] { background: var(--surface-2); color: var(--text); }
select[multiple] option:checked { background: var(--accent); color: var(--on-accent, #fff); }
/* Theme picker (core/themes.js): a card per theme with its colours; the radio stays for keyboards and screen readers. */
.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.theme-card { position: relative; display: block; cursor: pointer; margin: 0; }
.theme-card input { position: absolute; top: 13px; right: 12px; margin: 0; }
.theme-card__body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-2); font-weight: 500;
  transition: border-color var(--t) var(--ease); }
.theme-card:hover .theme-card__body { border-color: var(--border-strong); }
.theme-card input:checked + .theme-card__body { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-card input:focus-visible + .theme-card__body { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-card__hint { font-size: .8rem; color: var(--text-muted); line-height: 1.35; }
.theme-swatch { display: flex; height: 38px; margin: 0 26px 6px 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.theme-swatch:empty { background: repeating-linear-gradient(135deg, var(--surface-3) 0 6px, var(--surface-2) 6px 12px); }
.theme-swatch > span { flex: 1; }

/* Appearance: controls beside a live preview. */
.appearance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: var(--gap); align-items: start; }
.appearance > * { min-width: 0; }
.appearance__section + .appearance__section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.appearance__section h3 { margin-bottom: 4px; }
.appearance__section > p { color: var(--text-muted); font-size: .88rem; margin-bottom: 12px; }
.preview { position: sticky; top: calc(var(--topbar) + 16px); }
.preview__frame { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg); }
.preview__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border); font-weight: 650; font-size: .85rem; }
.preview__body { padding: 12px; display: grid; gap: 10px; }
.preview .hero { min-height: 96px; padding: 14px; margin: 0; border-radius: 12px; }
.preview .hero__title { font-size: 1.2rem; }
@media (max-width: 960px) { .appearance { grid-template-columns: minmax(0, 1fr); } .preview { position: static; } }

/* ---------------------------------------------------------------- forums (views/forums.js) */
.forum-cat { margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.forum-cat:first-of-type { margin-top: 6px; }
.forum-cat h2 { margin: 0; font-size: 1.12rem; }
.forum-cat .muted { font-size: .88rem; }
.forum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* A board: art (or a crafted tile), name and badges, counts, then the latest post. */
.forum-card { position: relative; isolation: isolate; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto minmax(220px, 290px); gap: 16px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.forum-card:hover { border-color: var(--border-strong); }
.forum-card--unread { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.forum-card__tile { position: relative; width: 72px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: var(--hero-fallback) center / cover; color: rgba(255, 255, 255, .9);
  font-family: var(--font-display); font-size: 1.5rem; overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); }
.forum-card__tile img:not(.icon) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.forum-card__tile img.icon { width: 30px; height: 30px; }
.forum-card__tile .unread-dot { position: absolute; top: 5px; right: 5px; }
.forum-card__main { min-width: 0; }
.forum-card__name { font-size: 1.18rem; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.forum-card__name::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.forum-card__name:hover { color: var(--text); }
.forum-card--unread .forum-card__name { font-weight: 700; }
.forum-card__desc { font-size: .88rem; color: var(--text-muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.forum-card__tags { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; align-items: center; }
.forum-card__subs { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .84rem; }
.forum-card__subs a { color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.forum-card__subs a:hover { color: var(--text); text-decoration: underline; }
.forum-card__subs a.is-unread { color: var(--text); font-weight: 650; }
.forum-card__counts { display: flex; gap: 8px; }
.count { display: grid; justify-items: center; min-width: 66px; padding: 6px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: .74rem; color: var(--text-muted); }
.count strong { font-size: 1rem; color: var(--text); font-variant-numeric: tabular-nums; }
.latest { position: relative; z-index: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; min-width: 0; font-size: .84rem;
  padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; }
a.latest:hover { border-color: var(--accent-line); color: var(--text-muted); }
.latest .avatar { grid-row: span 3; }
.latest__label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.latest__title { color: var(--text); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest__who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest__who strong { color: var(--text); font-weight: 600; }
.latest--empty { display: flex; align-items: center; justify-content: center; min-height: 64px; color: var(--text-faint); font-style: italic; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: none; }
/* With artwork: the art fills the row under a directional overlay; text turns light whatever the brightness. */
.forum-card--art { border-color: transparent; color: #fff; background: #0b121a; min-height: 104px; }
.forum-card--art::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--row-art) center / cover no-repeat; transition: transform .4s var(--ease); }
.forum-card--art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--row-overlay); }
.forum-card--art:hover::before { transform: scale(1.02); }
.forum-card--art .forum-card__name, .forum-card--art .forum-card__name:hover { color: #fff; }
.forum-card--art .forum-card__desc, .forum-card--art .forum-card__subs a { color: rgba(255, 255, 255, .8); }
.forum-card--art .forum-card__subs a.is-unread, .forum-card--art .forum-card__subs a:hover { color: #fff; }
.forum-card--art .count, .forum-card--art .latest { background: rgba(6, 10, 16, .55); border-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .78); backdrop-filter: blur(6px); }
.forum-card--art .count strong, .forum-card--art .latest__title, .forum-card--art .latest__who strong { color: #fff; }
.forum-card--art .latest__label { color: rgba(255, 255, 255, .6); }
.forum-card--art .badge { background: rgba(6, 10, 16, .5); color: #fff; border-color: rgba(255, 255, 255, .22); }
.forum-card--art .forum-card__tile { border-color: rgba(255, 255, 255, .2); background: rgba(6, 10, 16, .45); backdrop-filter: blur(4px); }
:root[data-theme="contrast"] .forum-card--art { border-color: #fff; }
:root[data-theme="contrast"] .forum-card--art::before { opacity: .2; }
/* Sub-boards listed under their parent on a board page. */
.subboards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 1199px) {
  .forum-card { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .forum-card__tile { width: 64px; height: 52px; }
  .forum-card .latest { grid-column: 2 / -1; }
}
@media (max-width: 760px) {
  .forum-card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; }
  .forum-card__tile { display: none; }
  .forum-card--art .forum-card__tile { display: none; }
  .forum-card .latest { grid-column: auto; }
  .forum-card__counts { gap: 6px; }
  .count { grid-auto-flow: column; gap: 5px; min-width: 0; padding: 3px 9px; align-items: baseline; }
  .count strong { font-size: .88rem; }
  .forum-card--art::after { background: linear-gradient(0deg, rgba(6, 10, 16, .95), rgba(6, 10, 16, .72)); }
}

/* A board's threads. */
.thread-row { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) 96px 96px minmax(200px, 270px); gap: 14px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease); }
.thread-row:last-child { border-bottom: 0; }
.thread-row__pick { display: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.is-picking .thread-row__pick { display: block; position: relative; z-index: 2; cursor: pointer; }
.is-picking .unread-dot { display: none; }
.pick-bar { position: sticky; top: calc(var(--topbar-h, 56px) + 8px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--surface); box-shadow: var(--shadow-sm, none); }
.pick-bar[hidden] { display: none; }
.thread-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.thread-row--unread { box-shadow: inset 3px 0 0 var(--accent); }
.thread-row__title { font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.thread-row__title::after { content: ""; position: absolute; inset: 0; }
.thread-row--unread .thread-row__title { font-weight: 750; }
.thread-row__meta { font-size: .82rem; color: var(--text-muted); margin-top: 3px; }
.thread-row__badges { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; margin-right: 6px; }
.thread-row__num { text-align: center; font-size: .78rem; color: var(--text-muted); }
.thread-row__num strong { display: block; font-size: .98rem; color: var(--text); font-variant-numeric: tabular-nums; }
.thread-row .latest { background: transparent; border-color: transparent; padding: 4px 0; }
.thread-head { display: grid; grid-template-columns: 16px minmax(0, 1fr) 96px 96px minmax(200px, 270px); gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); background: var(--surface-2); }
.thread-head span:nth-child(3), .thread-head span:nth-child(4) { text-align: center; }
@media (max-width: 960px) {
  .thread-head { display: none; }
  .thread-row { grid-template-columns: 12px minmax(0, 1fr); gap: 4px 12px; }
  .thread-row__num { display: none; }
  .thread-row .latest { grid-column: 2; padding: 0; }
  .thread-row__stats { display: flex !important; }
}
.thread-row__stats { display: none; gap: 12px; font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* The board manager: artwork beside the editing form. */
.board-manage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: var(--gap); align-items: start; }
.board-manage > * { min-width: 0; }
.board-manage__panel { position: sticky; top: calc(var(--topbar) + 16px); }
.board-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px; border-radius: var(--radius-lg); border: 1px solid transparent; }
.board-line + .board-line { margin-top: 4px; }
.board-line:hover { background: var(--surface-2); }
.board-line.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.board-line--child { margin-left: 32px; grid-template-columns: 72px minmax(0, 1fr) auto; }
.board-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--hero-fallback); display: grid; place-items: center; color: rgba(255, 255, 255, .85);
  font-family: var(--font-display); font-size: 1.3rem; border: 1px solid var(--border); }
.board-thumb img.icon { width: 28px; height: 28px; }
.board-thumb img:not(.icon) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-field { border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 12px; background: var(--surface-2); }
.art-field .hero { margin: 0 0 10px; min-height: 120px; }
@media (max-width: 1100px) { .board-manage { grid-template-columns: minmax(0, 1fr); } .board-manage__panel { position: static; } }
@media (max-width: 600px) { .board-line, .board-line--child { grid-template-columns: 64px minmax(0, 1fr); margin-left: 0; } .board-line > :last-child { grid-column: 1 / -1; } }

.post-unread-divider { display: flex; align-items: center; gap: 10px; margin: 2px 0; color: var(--accent-strong); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.post-unread-divider::before, .post-unread-divider::after { content: ""; flex: 1; border-top: 1px solid var(--accent-line); }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 14px 0; }
.pager .btn[aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- administration */
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.admin-card__label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); }
.admin-card__value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.01em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.admin-card__value.is-ok { color: var(--success); }
.admin-card__value.is-warn { color: var(--warning); }
.admin-card__value.is-bad { color: var(--danger); }
.admin-card__note { font-size: .82rem; color: var(--text-muted); }
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.health-list li:last-child { border-bottom: 0; }
.health-state { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: .86rem; }
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stats .stat { padding: 10px; text-align: center; }
  .stats .stat__value { font-size: 1.2rem; }
  .stats .stat__label { font-size: .74rem; }
  .quick-actions .btn { white-space: normal; text-align: left; line-height: 1.2; }
}
/* The AdminCP's section switch reads as tabs. */
.admin-tabs { width: fit-content; max-width: 100%; padding: 4px; gap: 4px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--surface); margin-bottom: 18px; overflow-x: auto; flex-wrap: nowrap; }
.admin-tabs a { border: 0; border-radius: var(--radius); padding: 7px 14px; white-space: nowrap; }
.admin-tabs a[aria-current="page"] { box-shadow: inset 0 0 0 1px var(--accent-line); }
.list > li.board-line { border-bottom: 0; }
/* Dice results in posts (Roleplay/DiceService). */
.dice-roll { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap; padding: 1px 9px; margin: 0 1px; border-radius: 999px; border: 1px solid var(--accent-line);
  background: var(--accent-soft); font: 600 .88em/1.6 var(--font-ui); color: var(--text); white-space: nowrap; }
.dice-roll strong { font-size: 1.08em; }
.dice-roll small, .dice-roll em { color: var(--text-muted); font-weight: 500; }
.dice-roll--max { border-color: color-mix(in srgb, var(--success) 60%, transparent); }
.dice-roll--min { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.dice-roll--hidden, .dice-roll--missing { border-style: dashed; background: transparent; color: var(--text-muted); }
.ooc-note { font-family: var(--font-ui); font-size: .86em; color: var(--text-muted); background: var(--surface-2); border-radius: 6px; padding: 0 .4em; }
/* Scene scripts ("conversation mode"): narration, then each character's lines beside their portrait. */
.script { display: grid; gap: 10px; }
.script__narration { margin: 2px 0; font-style: italic; color: var(--text-muted); text-align: center; padding: 0 8%; }
.script__line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.script__bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 8px 12px; min-width: 0; }
.script__who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .85rem; margin-bottom: 2px; }
.script__who strong { font-family: var(--font-display); font-size: 1rem; }
.script__emotion { color: var(--text-muted); font-style: italic; }
.script__emotion::before { content: "("; } .script__emotion::after { content: ")"; }
.script-edit { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.script-edit__who { display: grid; gap: 6px; }
.script-edit textarea { min-height: 64px; }
.btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-line); }
@media (max-width: 700px) { .script-edit { grid-template-columns: minmax(0, 1fr); } }
/* Pictures, sound and video in posts (Roleplay/MediaEmbeds). */
.post-media { margin: .8em 0; max-width: 100%; }
.post-media img, .post-media video { display: block; max-width: 100%; max-height: 70vh; border-radius: var(--radius); border: 1px solid var(--border); background: #000; }
.post-media audio { width: min(100%, 520px); }
.post-media figcaption { font: .78rem var(--font-ui); color: var(--text-faint); margin-top: 4px; }
.post-media--missing { font: .85rem var(--font-ui); color: var(--text-faint); font-style: italic; }

/* Reactions on posts */
.reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.reaction { display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.reaction:hover { border-color: var(--accent); }
.reaction--mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.reactions__add { position: relative; }
.reactions__add > summary { list-style: none; display: inline-flex; align-items: center; min-height: 30px; padding: 2px 10px; border: 1px dashed var(--border);
  border-radius: 999px; color: var(--text-muted, inherit); font-size: .85rem; cursor: pointer; }
.reactions__add > summary::-webkit-details-marker { display: none; }
.reactions__menu { position: absolute; z-index: 6; bottom: calc(100% + 6px); left: 0; display: flex; gap: 4px; padding: 6px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lift); }
.reactions__menu button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 1.15rem; cursor: pointer; }
.reactions__menu button:hover, .reactions__menu button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
