/* SBAI Mastermind — one stylesheet for the public site and the members' app.
   Warm paper + ink, a vermilion signal colour, Fraunces for display, Inter for UI,
   JetBrains Mono for anything a member will copy. Light by default, dark via OS. */

:root {
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --surface-2: #faf6ec;
  --ink: #17181c;
  --ink-2: #3a3a40;
  --muted: #6b665c;
  --line: #e4ddcd;
  --line-strong: #cfc6b2;
  --accent: #e4572e;
  --accent-ink: #b23a17;
  --accent-soft: #fbe3d8;
  --teal: #1f5f5b;
  --teal-soft: #dcebe8;
  --gold: #f3c969;
  --gold-soft: #fbf0d0;
  --ok: #2f7d4f;
  --ok-soft: #dff0e4;
  --danger: #b42318;
  --danger-soft: #fde4e1;
  --code-bg: #1d1e22;
  --code-ink: #f1ede4;
  --shadow: 0 1px 2px rgba(23, 24, 28, .06), 0 8px 24px -12px rgba(23, 24, 28, .18);
  --shadow-lg: 0 2px 4px rgba(23, 24, 28, .05), 0 24px 48px -20px rgba(23, 24, 28, .28);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121214;
    --surface: #1a1a1e;
    --surface-2: #202025;
    --ink: #f1ede4;
    --ink-2: #d6d1c6;
    --muted: #a29d92;
    --line: #2c2b31;
    --line-strong: #3d3c43;
    --accent: #ff7a50;
    --accent-ink: #ff9a78;
    --accent-soft: #3a2119;
    --teal: #6cc3b9;
    --teal-soft: #17302d;
    --gold: #f3c969;
    --gold-soft: #3a3020;
    --ok: #6fcf97;
    --ok-soft: #173326;
    --danger: #ff8a7a;
    --danger-soft: #3d1c19;
    --code-bg: #0c0c0e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 48px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--gold); color: #17181c; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .5em; font-variation-settings: "opsz" 72; }
h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.tiny { font-size: .76rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.sm { width: 15px; height: 15px; vertical-align: -2px; }
.icon.lg { width: 22px; height: 22px; }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 .92rem/1 var(--font-ui); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { min-height: 32px; padding: .35rem .75rem; font-size: .82rem; }
.btn.lg { min-height: 50px; padding: .8rem 1.5rem; font-size: 1rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.inline-form { display: inline; }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.field { margin-bottom: 1.1rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: .3rem; }
.field .err, .err { color: var(--danger); font-size: .84rem; margin-top: .3rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: .65rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 400 .95rem/1.45 var(--font-ui); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 140px; resize: vertical; }
textarea.code, .code-input { font: 400 .86rem/1.55 var(--font-mono); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
input[type=file] { font-size: .88rem; color: var(--muted); max-width: 100%; }
.check { position: relative; display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .92rem; cursor: pointer; }
.check input { margin-top: .3rem; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.segmented { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { margin: 0; padding: .45rem .95rem; border-radius: 999px; cursor: pointer; font-size: .86rem; display: inline-flex; gap: .4rem; align-items: center; color: var(--muted); }
.segmented input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check label { margin: 0; display: inline-flex; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .84rem; font-weight: 500; cursor: pointer; background: var(--surface); }
.chip-check input:checked + label { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-check input:focus-visible + label { outline: 2px solid var(--accent); }

/* ---------- Tags, badges, avatars ---------- */
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .01em; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; text-decoration: none; }
.tag.res { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.tag.plat { background: var(--teal-soft); border-color: transparent; color: var(--teal); }
.tag.pin { background: var(--gold-soft); border-color: transparent; color: #8a6400; }
.tag.new { background: var(--accent); color: #fff; border-color: transparent; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--gold-soft); color: #8a6400; border-color: transparent; }
.tag.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
@media (prefers-color-scheme: dark) { .tag.pin, .tag.warn { color: var(--gold); } }
.badge { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; }
.avatar { --size: 36px; width: var(--size); height: var(--size); border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font: 700 calc(var(--size) * .38)/1 var(--font-ui); letter-spacing: .02em; flex: none; text-decoration: none; }
.avatar.sm { --size: 26px; }
.avatar.lg { --size: 64px; }
.avatar.xl { --size: 92px; }
.avatar.xxl { --size: 128px; }
.avatar { overflow: hidden; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-edit { position: relative; display: inline-block; border-radius: 50%; text-decoration: none; }
.photo-edit .photo-badge { position: absolute; right: 0; bottom: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); border: 3px solid var(--paper); }
.photo-edit:hover .photo-badge { background: var(--accent); }
.photo-row { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.photo-row .photo-actions { display: grid; gap: .6rem; }

/* ---------- Flash messages ---------- */
.flashes { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-weight: 500; border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); display: flex; gap: .6rem; align-items: center; }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert { padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.card.pad-lg { padding: 1.75rem; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .75rem; }
.card-title h2, .card-title h3 { margin: 0; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: .5rem; }
.empty h3 { color: var(--ink); }

/* =============================================================
   PUBLIC SITE
   ============================================================= */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.site-nav { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; }
.brand-name em { font-style: normal; color: var(--accent); }
.site-nav .links { display: flex; gap: 1.4rem; margin-left: auto; font-size: .92rem; font-weight: 500; }
.site-nav .links a { text-decoration: none; color: var(--ink-2); }
.site-nav .links a:hover { color: var(--accent); }
@media (max-width: 860px) { .site-nav .links { display: none; } .site-nav .actions { margin-left: auto; } }
.site-nav .actions { display: flex; gap: .5rem; }

.hero { padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow { display: inline-flex; align-items: center; gap: .55rem; font: 600 .78rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-ink); margin-bottom: 1.4rem; }
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.hero h1 { font-size: clamp(2.5rem, 6.2vw, 4.6rem); line-height: 1.02; letter-spacing: -.025em; font-weight: 500; margin-bottom: 1.4rem; font-variation-settings: "opsz" 144, "SOFT" 30; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.hero .lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.6; color: var(--ink-2); max-width: 37em; margin-bottom: 2rem; }
.hero .cta-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.hero .fine { margin-top: 1.1rem; font-size: .88rem; color: var(--muted); }
.hero .fine a { color: var(--ink); font-weight: 600; }

.next-session { display: inline-flex; gap: .9rem; align-items: center; margin-top: 2.2rem; padding: .8rem 1.1rem .8rem .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.cal { width: 50px; border-radius: 10px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: var(--surface); flex: none; }
.cal .m { background: var(--accent); color: #fff; font: 700 .64rem/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; padding: .3rem 0; }
.cal .d { font: 600 1.35rem/1 var(--font-display); padding: .35rem 0 .4rem; }

/* Hero visual: a fanned stack of resource cards */
.deck { position: relative; height: 545px; }
@media (max-width: 960px) { .deck { height: 530px; max-width: 520px; margin-inline: auto; width: 100%; } }
@media (max-width: 520px) { .deck { height: 520px; } }
.rcard { position: absolute; left: 50%; width: min(400px, 92%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 1.1rem 1.15rem 1rem; transform-origin: 50% 100%; }
.rcard .rc-head { display: flex; gap: .45rem; align-items: center; margin-bottom: .7rem; flex-wrap: wrap; }
.rcard .rc-title { font: 600 1.02rem/1.3 var(--font-display); margin-bottom: .55rem; }
.rcard .rc-code { background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: .8rem .9rem; font: 400 .74rem/1.6 var(--font-mono); white-space: pre-wrap; position: relative; }
.rcard .rc-code b { color: var(--gold); font-weight: 500; }
.rcard .rc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .75rem; font-size: .78rem; color: var(--muted); }
.rcard .rc-foot .who { display: flex; gap: .45rem; align-items: center; }
.rcard .copy-pill { position: absolute; top: .55rem; right: .55rem; background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; padding: .2rem .55rem; font: 600 .66rem/1.4 var(--font-ui); }
.rcard.c1 { top: 0; transform: translateX(-60%) rotate(-5deg); z-index: 1; }
.rcard.c2 { top: 118px; transform: translateX(-40%) rotate(3.5deg); z-index: 2; }
.rcard.c3 { top: 245px; transform: translateX(-52%) rotate(-1.5deg); z-index: 3; }
@media (max-width: 520px) {
  .rcard.c1 { transform: translateX(-54%) rotate(-5deg); }
  .rcard.c2 { transform: translateX(-46%) rotate(3deg); top: 120px; }
  .rcard.c3 { transform: translateX(-50%) rotate(-1deg); top: 245px; }
}
@media (prefers-reduced-motion: no-preference) {
  .deck .rcard { animation: deal .8s cubic-bezier(.2,.8,.2,1) both; }
  .deck .rcard.c2 { animation-delay: .12s; }
  .deck .rcard.c3 { animation-delay: .24s; }
  @keyframes deal { from { opacity: 0; translate: 0 30px; } to { opacity: 1; translate: 0 0; } }
}

.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: 2.75rem; }
.section-head .kicker { font: 600 .78rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-ink); margin-bottom: 1rem; display: block; }
.section-head h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); font-weight: 500; line-height: 1.08; letter-spacing: -.02em; }
.section-head p { font-size: 1.08rem; color: var(--ink-2); }

.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 860px) { .share-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .share-grid { grid-template-columns: 1fr; } }
.share-item { background: var(--surface); padding: 1.6rem 1.5rem 1.7rem; }
.section.alt .share-item { background: var(--paper); }
.share-item .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 1rem; color: #fff; }
.share-item h3 { font-size: 1.18rem; margin-bottom: .35rem; }
.share-item p { color: var(--muted); margin: 0 0 .8rem; font-size: .94rem; }
.share-item .ex { font: 400 .78rem/1.5 var(--font-mono); color: var(--ink-2); border-left: 2px solid var(--line-strong); padding-left: .7rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; counter-reset: step; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 1.6rem 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.step::before { counter-increment: step; content: "0" counter(step); font: 500 2.6rem/1 var(--font-display); color: var(--accent); display: block; margin-bottom: 1rem; font-variation-settings: "opsz" 144; }
.step h3 { font-size: 1.25rem; }
.step p { color: var(--muted); margin: 0; }

.principles { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 860px) { .principles { grid-template-columns: 1fr; } }
.principle { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.3rem 0; border-top: 1px solid var(--line); }
.principle:last-child { border-bottom: 1px solid var(--line); }
.principle .n { font: 500 1rem/1.6 var(--font-mono); color: var(--accent); }
.principle h3 { margin-bottom: .25rem; font-size: 1.15rem; }
.principle p { margin: 0; color: var(--muted); }
.quote-block { font: 400 clamp(1.4rem, 2.6vw, 2rem)/1.3 var(--font-display); letter-spacing: -.01em; font-variation-settings: "opsz" 144; position: sticky; top: 100px; }
.quote-block::before { content: "“"; display: block; font-size: 4rem; line-height: .6; color: var(--accent); margin-bottom: .6rem; }
.quote-block cite { display: block; margin-top: 1.25rem; font: 500 .9rem/1.4 var(--font-ui); color: var(--muted); font-style: normal; }

.request-wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 900px) { .request-wrap { grid-template-columns: 1fr; } }
.request-copy h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; line-height: 1.05; letter-spacing: -.02em; }
.request-copy ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .8rem; }
.request-copy li { display: flex; gap: .7rem; color: var(--ink-2); }
.request-copy li .icon { color: var(--accent); margin-top: .2rem; }
.request-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow-lg); }

.stat-strip { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 2.25rem; }
.stat-strip div { font-size: .85rem; color: var(--muted); }
.stat-strip strong { display: block; font: 500 2rem/1 var(--font-display); color: var(--ink); margin-bottom: .25rem; }

.site-footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.site-footer .row { justify-content: space-between; }
.site-footer a { color: var(--ink-2); }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.prose-page { max-width: 46rem; margin: 0 auto; padding: 3rem 0 4rem; }
.prose-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 500; }
.prose-page h2 { margin-top: 2rem; }

/* Auth pages */
.auth-shell { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 2rem 0 4rem; }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.5rem, 4vw, 2.25rem); box-shadow: var(--shadow-lg); }
.auth-card.wide { width: min(560px, 100%); }
.auth-card h1 { font-size: 1.8rem; font-weight: 500; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin: 1.4rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.inviter { display: flex; gap: .8rem; align-items: center; padding: .9rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 1.4rem; }
.inviter blockquote { margin: .5rem 0 0; font-style: italic; color: var(--ink-2); }

/* =============================================================
   MEMBERS' APP
   ============================================================= */
.app { min-height: 100vh; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 1rem; padding: 0 1rem 0 1.1rem; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .brand { min-width: calc(var(--sidebar-w) - 1.1rem); }
.topbar .search { flex: 1; max-width: 520px; position: relative; }
.topbar .search input { padding-left: 2.3rem; border-radius: 999px; background: var(--surface); height: 40px; }
.topbar .search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .tb-actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.icon-btn .badge { position: absolute; top: 2px; right: 0; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .menu-toggle { display: grid; }
  .topbar .brand { min-width: 0; }
  .topbar .brand-name { display: none; }
  .topbar .search { max-width: none; }
  .topbar .new-label { display: none; }
}
@media (max-width: 560px) { .topbar .search { display: none; } .topbar .search-link { display: grid; } }
.search-link { display: none; }

.user-menu { position: relative; }
.user-menu > button { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .4rem; z-index: 50; }
.dropdown a, .dropdown button { display: flex; gap: .6rem; align-items: center; width: 100%; padding: .55rem .7rem; border-radius: 8px; text-decoration: none; color: var(--ink); font: 500 .9rem/1.2 var(--font-ui); background: none; border: 0; cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.dropdown .who { padding: .6rem .7rem .7rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.dropdown .who strong { display: block; }

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 1.1rem .8rem 2rem; border-right: 1px solid var(--line); }
.sidebar nav { display: grid; gap: 2px; }
.sidebar .nav-label { font: 700 .68rem/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 1.4rem .7rem .55rem; display: flex; justify-content: space-between; align-items: center; }
.sidebar a { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.sidebar a:hover { background: var(--surface); color: var(--ink); }
.sidebar a.active { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.sidebar a .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; margin-inline: 4px; }
.sidebar a .count { margin-left: auto; }
.sidebar .invite-cta { margin: 1.5rem .3rem 0; padding: 1rem; border-radius: 12px; background: var(--ink); color: var(--paper); }
.sidebar .invite-cta p { font-size: .84rem; opacity: .8; margin: .25rem 0 .8rem; }
.sidebar .invite-cta strong { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; }
.sidebar .invite-cta .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.sidebar .invite-cta .btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; height: 100vh; width: min(300px, 86vw); background: var(--paper); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
}

.main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; }
.main-inner { max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-weight: 500; }
.page-head p { margin: .35rem 0 0; color: var(--muted); }
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: .6rem; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 1180px) { .two-col { grid-template-columns: minmax(0, 1fr) 280px; } }
@media (max-width: 1040px) { .two-col { grid-template-columns: 1fr; } }
.side-stack { display: grid; gap: 1.25rem; }

/* Welcome banner */
.hello { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; padding: 1.5rem 1.6rem; border-radius: var(--radius); background: var(--ink); color: var(--paper); margin-bottom: 1.5rem; flex-wrap: wrap; position: relative; overflow: hidden; }
.hello::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%); pointer-events: none; }
.hello h1 { font-size: 1.7rem; margin: 0 0 .2rem; font-weight: 500; }
.hello p { margin: 0; opacity: .75; }
.hello .btn { position: relative; z-index: 1; }
.hello .btn.light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.hello .btn.light:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.hello .btn.outline { background: transparent; color: var(--paper); border-color: color-mix(in srgb, var(--paper) 35%, transparent); }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.cat-tile { display: flex; gap: .85rem; padding: 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.cat-tile:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.cat-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.cat-tile strong { display: block; font-size: .95rem; }
.cat-tile span { font-size: .8rem; color: var(--muted); }

/* Thread list */
.tlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.titem { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; padding: 1rem 1.15rem; border-top: 1px solid var(--line); align-items: start; position: relative; }
.titem:first-child { border-top: 0; }
.titem:hover { background: var(--surface-2); }
.titem .t-title { font-weight: 600; font-size: 1rem; line-height: 1.35; text-decoration: none; color: var(--ink); }
.titem .t-title::after { content: ""; position: absolute; inset: 0; }
.titem.unread .t-title { color: var(--ink); }
.titem.read .t-title { color: var(--ink-2); font-weight: 500; }
.titem .t-meta { display: flex; gap: .45rem .7rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.titem .t-meta a, .titem .tags a { position: relative; z-index: 1; }
.titem .t-excerpt { font-size: .88rem; color: var(--muted); margin: .3rem 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.titem .tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .35rem; }
.titem .t-stats { display: flex; gap: 1rem; text-align: center; font-size: .75rem; color: var(--muted); }
.titem .t-stats strong { display: block; font-size: 1rem; color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .titem { grid-template-columns: auto minmax(0, 1fr); } .titem .t-stats { grid-column: 2; justify-content: flex-start; text-align: left; } .titem .t-stats strong { display: inline; margin-right: .2rem; } }
.cat-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filters select { width: auto; min-width: 150px; padding-block: .45rem; border-radius: 999px; font-size: .86rem; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.tabs a { padding: .4rem .85rem; border-radius: 999px; text-decoration: none; font-size: .84rem; font-weight: 500; color: var(--muted); }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.pager { display: flex; gap: .4rem; justify-content: center; margin-top: 1.5rem; align-items: center; }

/* Library grid */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.lib-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.lib-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.lib-card h3 { font-size: 1.05rem; margin: .55rem 0 .4rem; line-height: 1.3; }
.lib-card h3 a { text-decoration: none; }
.lib-card h3 a::after { content: ""; position: absolute; inset: 0; }
.lib-card .snippet { font: 400 .74rem/1.55 var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; color: var(--ink-2); max-height: 6.3em; overflow: hidden; white-space: pre-wrap; margin: .3rem 0 .8rem; mask-image: linear-gradient(#000 60%, transparent); }
.lib-card .desc { font-size: .87rem; color: var(--muted); margin: 0 0 .8rem; }
.lib-card .lc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); gap: .5rem; }
.lib-card .lc-foot .stats { display: flex; gap: .7rem; }
.lib-side .facet a { display: flex; justify-content: space-between; padding: .4rem .6rem; border-radius: 8px; text-decoration: none; font-size: .9rem; color: var(--ink-2); }
.lib-side .facet a:hover { background: var(--surface-2); }
.lib-side .facet a.on { background: var(--ink); color: var(--paper); }
.lib-side .facet a span { color: var(--muted); font-size: .8rem; }
.lib-side .facet a.on span { color: inherit; opacity: .7; }
.lib-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .lib-layout { grid-template-columns: 1fr; } .lib-side { display: none; } }
.lib-mobile-filters { display: none; }
@media (max-width: 900px) { .lib-mobile-filters { display: flex; } }

/* Thread page */
.thread-head h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 500; letter-spacing: -.015em; margin: .5rem 0 .9rem; }
.byline { display: flex; gap: .7rem; align-items: center; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.byline a.name { color: var(--ink); font-weight: 600; text-decoration: none; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; scroll-margin-top: 90px; }
.post + .post { margin-top: .85rem; }
.post.op { padding: 1.5rem 1.6rem; }
.post .post-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .9rem; }
.post .post-head .who { line-height: 1.3; }
.post .post-head .who a { font-weight: 600; text-decoration: none; }
.post .post-head .who .muted { font-size: .8rem; }
.post .post-actions { display: flex; gap: .35rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.post:target { box-shadow: 0 0 0 2px var(--accent); }
.new-divider { display: flex; align-items: center; gap: .75rem; color: var(--accent); font: 700 .72rem/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; margin: 1.25rem 0 .85rem; }
.new-divider::before, .new-divider::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--accent) 40%, transparent); }

.vote { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font: 600 .82rem/1 var(--font-ui); cursor: pointer; color: var(--ink-2); }
.vote:hover { border-color: var(--accent); color: var(--accent-ink); }
.vote.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote[disabled] { cursor: default; opacity: .7; }
.vote.on .icon { fill: currentColor; }

/* Resource box */
.resource-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1.1rem 0 .5rem; }
.resource-box .rb-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem .7rem .6rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.resource-box .rb-head .label { font: 700 .72rem/1 var(--font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.resource-box pre { margin: 0; padding: 1.1rem 1.2rem; background: var(--code-bg); color: var(--code-ink); font: 400 .85rem/1.65 var(--font-mono); white-space: pre-wrap; word-break: break-word; max-height: 560px; overflow: auto; }
.resource-box.collapsed pre { max-height: 300px; mask-image: linear-gradient(#000 70%, transparent); }
.resource-box .rb-more { display: block; width: 100%; padding: .6rem; background: var(--surface-2); border: 0; border-top: 1px solid var(--line); font: 600 .82rem/1 var(--font-ui); color: var(--ink-2); cursor: pointer; }
.copy-btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.link-out { display: flex; gap: .7rem; align-items: center; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; margin: 1rem 0 .5rem; background: var(--surface-2); }
.link-out:hover { border-color: var(--accent); }
.link-out strong { display: block; font-size: .92rem; }
.link-out span { font-size: .8rem; color: var(--muted); word-break: break-all; }

.attachments { display: grid; gap: .5rem; margin-top: 1rem; }
.attachment { display: flex; gap: .7rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-size: .88rem; background: var(--surface-2); }
.attachment:hover { border-color: var(--line-strong); }
.attachment .icon { color: var(--accent); }
.attachment .meta { color: var(--muted); font-size: .78rem; margin-left: auto; white-space: nowrap; }
.att-image { display: block; border-radius: 10px; border: 1px solid var(--line); max-height: 420px; width: auto; margin-top: .75rem; }

/* Rendered markdown */
.prose { font-size: .98rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-family: var(--font-ui); font-weight: 700; margin: 1.4em 0 .5em; letter-spacing: 0; }
.prose h2 { font-size: 1.2rem; } .prose h3 { font-size: 1.08rem; } .prose h4, .prose h5, .prose h6 { font-size: 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1em; }
.prose li + li { margin-top: .25rem; }
.prose blockquote { margin: 0 0 1em; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose code { font: 400 .86em/1.5 var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); padding: .1em .35em; border-radius: 5px; }
.prose pre { position: relative; background: var(--code-bg); color: var(--code-ink); padding: 1rem 1.1rem; border-radius: 10px; overflow-x: auto; margin: 0 0 1em; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: .84rem; white-space: pre-wrap; }
.prose pre .copy-mini { position: absolute; top: .45rem; right: .45rem; border: 0; border-radius: 6px; padding: .25rem .5rem; font: 600 .7rem/1 var(--font-ui); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.prose pre .copy-mini:hover { background: rgba(255,255,255,.22); }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: .9rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; }
.prose th { background: var(--surface-2); }
.prose img { border-radius: 8px; }
.prose a { color: var(--accent-ink); }

/* Editor */
.editor { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.editor .ed-bar { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem .45rem; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.editor .ed-tabs { display: flex; gap: 2px; }
.editor .ed-tabs button { border: 0; background: none; padding: .35rem .7rem; border-radius: 6px; font: 600 .8rem/1 var(--font-ui); color: var(--muted); cursor: pointer; }
.editor .ed-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.editor .ed-tools { display: flex; gap: 2px; }
.editor .ed-tools button { border: 0; background: none; width: 30px; height: 28px; border-radius: 6px; cursor: pointer; color: var(--muted); display: grid; place-items: center; font: 700 .85rem/1 var(--font-ui); }
.editor .ed-tools button:hover { background: var(--surface); color: var(--ink); }
.editor textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 180px; }
.editor .ed-preview { padding: .9rem 1rem; min-height: 180px; }
.editor .ed-foot { padding: .4rem .7rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 1rem; text-align: center; color: var(--muted); font-size: .88rem; background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { margin-top: .5rem; }
.file-list { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .3rem; text-align: left; font-size: .84rem; }
.resource-fields { padding: 1.25rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 1.1rem; }

.reply-box { margin-top: 1.25rem; }

/* Member cards */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.member-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem; position: relative; transition: border-color .15s, box-shadow .15s; }
.member-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.member-card .mc-top { display: flex; gap: .8rem; align-items: center; }
.member-card a.name { font-weight: 600; text-decoration: none; }
.member-card a.name::after { content: ""; position: absolute; inset: 0; }
.member-card p { margin: 0; font-size: .87rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.member-card .mc-foot { margin-top: auto; font-size: .78rem; color: var(--muted); display: flex; gap: .8rem; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.profile-head h1 { margin: 0 0 .2rem; font-weight: 500; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Events */
.event-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.1rem; align-items: center; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.event-row + .event-row { margin-top: .75rem; }
.event-row h3 { margin: 0 0 .2rem; }
.event-row h3 a { text-decoration: none; }
@media (max-width: 640px) { .event-row { grid-template-columns: auto minmax(0, 1fr); } .event-row .rsvp-mini { grid-column: 1 / -1; } }
.cal.lg { width: 64px; }
.cal.lg .d { font-size: 1.8rem; }
.rsvp-bar { display: flex; gap: .5rem; flex-wrap: wrap; }
.rsvp-bar .btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.attendees { display: flex; flex-wrap: wrap; gap: .4rem; }
.live-pill { display: inline-flex; gap: .4rem; align-items: center; color: var(--accent-ink); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.live-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* Tables */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font: 700 .7rem/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .75rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.stat-card strong { display: block; font: 500 1.9rem/1 var(--font-display); margin-bottom: .3rem; }
.stat-card span { font-size: .8rem; color: var(--muted); }
.admin-section { scroll-margin-top: 80px; margin-bottom: 2.5rem; }
.req-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.req-card + .req-card { margin-top: .75rem; }
.req-card blockquote { margin: .6rem 0; padding-left: .9rem; border-left: 3px solid var(--line-strong); color: var(--ink-2); white-space: pre-wrap; }

.notif { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1.1rem; border-top: 1px solid var(--line); text-decoration: none; }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.notif .when { font-size: .78rem; color: var(--muted); }

.copy-field { display: flex; gap: .5rem; }
.copy-field input { font-family: var(--font-mono); font-size: .82rem; }

.onboard { display: grid; gap: .6rem; }
.onboard a { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; background: var(--surface); }
.onboard a:hover { border-color: var(--accent); }
.onboard .done { opacity: .55; }
.onboard .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .85rem; flex: none; }

.error-page { text-align: center; padding: 5rem 1rem; }
.error-page .code { font: 500 6rem/1 var(--font-display); color: var(--accent); }

@media print { .topbar, .sidebar, .site-header, .post-actions, .reply-box { display: none !important; } .shell { display: block; } }

/* Small phones: keep the public header on one line */
@media (max-width: 520px) {
  .site-nav { gap: .6rem; }
  .site-nav .brand-name { font-size: 1rem; line-height: 1.1; }
  .site-nav .actions { gap: .25rem; }
  .site-nav .actions .btn { min-height: 36px; padding: .4rem .8rem; font-size: .84rem; }
  .site-nav .actions .btn.ghost { padding-inline: .5rem; }
  .hide-xs { display: none; }
  .hero .cta-row .btn { flex: 1 1 auto; }
}
