/*
Theme Name: Statistical Trader Labs
Theme URI: https://www.thestatisticaltraderlabs.com
Author: Statistical Trader Labs
Description: Original professional theme for a trading education, research, products, and community platform.
Version: 2.20.0
Requires at least: 6.0
Requires PHP: 8.3
Text Domain: statistical-trader-labs
*/

/* ==========================================================================
   Statistical Trader Labs — theme system
   --------------------------------------------------------------------------
   Three ownership layers plus one compatibility layer. Components only ever
   reference Layer 2/3 names; Layer 1 primitives stay private to the theme.

     Layer 1 · Brand primitives   raw hues — fixed, never referenced elsewhere
     Layer 2 · Semantic tokens    named for purpose (surfaces, text, accents,
                                  lines, shadows) — re-assigned per theme
     Layer 3 · Component tokens   named for a component's fills/chrome
     Layer 4 · Compatibility      deprecated aliases retained for forks and
                                  bookmarklets; do not use in new rules

   To add a theme: copy one :root[data-theme="…"] block below, rename the
   attribute, and re-assign Layer 2 + Layer 3. Nothing else in this file
   changes — every component is token-driven.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ---------- Layer 1 · Brand primitives ---------- */
  --stl-brand-blue: #6aa9ff;
  --stl-brand-blue-strong: #2662be;
  --stl-brand-blue-deep: #1a4f8f;
  --stl-brand-ink: #071222;
  --stl-brand-paper: #f4f7fb;
  --stl-brand-gold: #d9a441;
  --stl-brand-teal: #5aa9f0;
  --stl-brand-white: #f8fbff;
  --stl-brand-navy-700: #132846;
  --stl-brand-navy-600: #10213b;

  /* ---------- Layer 2 · Semantic tokens (dark) ---------- */
  --stl-bg: var(--stl-brand-ink);
  --stl-band: var(--stl-brand-paper);
  --stl-surface: rgba(16, 33, 59, .72);
  --stl-surface-raised: rgba(24, 49, 82, .86);
  --stl-surface-hover: rgba(31, 61, 97, .96);
  --stl-surface-inset: rgba(7, 18, 34, .52);
  --stl-text: var(--stl-brand-white);
  --stl-text-strong: #f6f7fb;
  --stl-text-muted: #9db0c8;
  --stl-text-faint: #7792ad;
  --stl-accent: var(--stl-brand-blue);
  --stl-accent-2: var(--stl-brand-gold);
  --stl-accent-3: var(--stl-brand-teal);
  --stl-accent-strong: #cfe3ff;
  --stl-on-accent: var(--stl-brand-ink);
  --stl-link: var(--stl-brand-blue);
  --stl-link-on-band: #2662be;
  --stl-ok: #3ddc97;
  --stl-danger: #ff8a8a;
  --stl-warn: #e8a33d;
  --stl-info: var(--stl-brand-blue);
  --stl-line: rgba(157, 176, 200, .2);
  --stl-hairline: rgba(255, 255, 255, .03);
  --stl-hairline-strong: rgba(255, 255, 255, .12);
  --stl-shadow-sm: 0 10px 30px rgba(2, 12, 29, .18);
  --stl-shadow-md: 0 18px 45px rgba(2, 12, 29, .25);
  --stl-shadow-active: 0 14px 34px rgba(2, 12, 29, .24), 0 0 0 1px rgba(106, 169, 255, .18);
  --stl-nav-text: #dbe8f5;
  --stl-on-band: var(--stl-brand-ink);
  /* On-band pair (fixed, both themes — the .section-muted band is always near-white) */
  --stl-band-surface: #ffffff;
  --stl-band-text: #071222;
  --stl-band-muted: #50657d;
  --stl-band-line: #dce5ef;
  --stl-band-link: #2662be;
  --stl-band-link-hover: #1a4f8f;

  /* ---------- Layer 3 · Component tokens (dark) ---------- */
  --stl-header-bg: rgba(7, 18, 34, .94);
  --stl-bottom-nav-bg: rgba(7, 18, 34, .92);
  --stl-dropdown-bg: rgba(7, 18, 34, .96);
  --stl-panel-sheen: linear-gradient(180deg, color-mix(in srgb, var(--stl-accent) 7%, transparent), color-mix(in srgb, var(--stl-accent) 2%, transparent));
  --stl-banner-bg: #0f3a6b;
  --stl-banner-text: var(--stl-brand-white);
  --stl-panel-inner: 0 1px 0 rgba(255, 255, 255, .04) inset;

  /* ---------- Layer 4 · Compatibility aliases (deprecated) ---------- */
  --stl-ink: var(--stl-bg);
  --stl-white: var(--stl-text);
  --stl-muted: var(--stl-text-muted);
  --stl-signal: var(--stl-accent);
  --stl-teal: var(--stl-accent-3);
  --stl-gold: var(--stl-accent-2);
  --stl-paper: var(--stl-text-strong);
  --stl-panel-base: var(--stl-surface);
  --stl-panel-raised: var(--stl-surface-raised);
  --stl-panel-active: var(--stl-surface-hover);
  --stl-panel-inset: var(--stl-surface-inset);
  --stl-shadow: var(--stl-shadow-md);
  --stl-shadow-card: var(--stl-shadow-sm);

  /* ---------- Layer 1b · Typography (theme-independent) ---------- */
  --stl-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --stl-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --stl-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* ---------- Layer 1c · Geometry ---------- */
  --stl-radius-sm: 8px;
  --stl-radius-lg: 16px;
  --stl-radius-pill: 999px;
}

:root[data-theme="light"] {
  color-scheme: light;

  /* ---------- Layer 2 · Semantic tokens (light) ---------- */
  --stl-bg: var(--stl-brand-paper);
  --stl-band: #edf3f9;
  --stl-surface: #ffffff;
  --stl-surface-raised: #ffffff;
  --stl-surface-hover: #eef3f9;
  --stl-surface-inset: #eef3f9;
  --stl-text: var(--stl-brand-ink);
  --stl-text-strong: var(--stl-brand-ink);
  --stl-text-muted: #50657d;
  --stl-text-faint: #6a7d94;
  --stl-accent: var(--stl-brand-blue-strong);
  --stl-accent-2: #8a5e00;
  --stl-accent-3: #1d5b96;
  --stl-accent-strong: #174a94;
  --stl-on-accent: #ffffff;
  --stl-link: var(--stl-brand-blue-deep);
  --stl-link-on-band: var(--stl-brand-blue-deep);
  --stl-ok: #1d7a4d;
  --stl-danger: #b42318;
  --stl-warn: #7a5000;
  --stl-info: #2549a6;
  --stl-line: rgba(7, 18, 34, .16);
  --stl-hairline: rgba(7, 18, 34, .04);
  --stl-hairline-strong: rgba(7, 18, 34, .1);
  --stl-shadow-sm: 0 10px 30px rgba(20, 48, 84, .12);
  --stl-shadow-md: 0 18px 45px rgba(20, 48, 84, .12);
  --stl-shadow-active: 0 14px 34px rgba(20, 48, 84, .16), 0 0 0 1px rgba(38, 98, 190, .18);
  --stl-nav-text: #20344d;
  --stl-on-band: var(--stl-brand-ink);

  /* ---------- Layer 3 · Component tokens (light) ---------- */
  --stl-header-bg: rgba(244, 247, 251, .94);
  --stl-bottom-nav-bg: rgba(244, 247, 251, .94);
  --stl-dropdown-bg: rgba(255, 255, 255, .98);
  --stl-panel-sheen: linear-gradient(180deg, #ffffff, #f3f7fd);
  --stl-banner-bg: #1d4ed8;
  --stl-banner-text: #ffffff;
  --stl-panel-inner: 0 1px 0 rgba(255, 255, 255, .4) inset;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 100%; }
body { margin: 0; color: var(--stl-text); background: var(--stl-bg); font-family: var(--stl-body); line-height: 1.65; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--stl-accent); }
img { max-width: 100%; height: auto; }
.container { width: min(1400px, calc(100% - 32px)); margin: 0 auto; }
.site-shell { min-height: 100vh; background-color: var(--stl-bg); background-image: linear-gradient(color-mix(in srgb, var(--stl-text-muted) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--stl-text-muted) 5%, transparent) 1px, transparent 1px); background-size: 48px 48px; }
.site-header .container { width: min(1400px, calc(100% - 32px)); } .site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--stl-bg) 94%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid var(--stl-line); transition: transform .25s ease; }
@media (min-width: 641px) { .site-header.is-hidden { transform: translateY(-100%); } }
.nav-wrap { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--stl-display); font-weight: 700; letter-spacing: -.03em; }
.brand-icon { display: block; width: 36px; height: 36px; object-fit: contain; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--stl-accent) 70%, transparent); border-radius: var(--stl-radius-sm); color: var(--stl-bg); background: var(--stl-accent); box-shadow: 0 8px 20px color-mix(in srgb, var(--stl-accent) 18%, transparent); font-size: 0.75rem; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy small { margin-top: 4px; color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.5625rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 12px; color: var(--stl-nav-text); font-size: 0.75rem; font-weight: 650; }
.main-nav a { padding: 8px 0; }
.nav-cta, .button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--stl-radius-sm); padding: 12px 18px; color: var(--stl-bg); background: var(--stl-accent); font-family: var(--stl-display); font-weight: 700; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.nav-cta { padding: 8px 14px; font-size: 0.8125rem; min-height: 34px; }
.nav-tools .theme-toggle, .nav-tools .lang-switch { min-height: 34px; }
.nav-cta:hover, .button-primary:hover { color: var(--stl-on-accent); background: var(--stl-accent-strong); box-shadow: 0 10px 24px color-mix(in srgb, var(--stl-accent) 26%, transparent); transform: translateY(-1px); }
.button-secondary { display: inline-flex; align-items: center; justify-content: center; border: 1px solid color-mix(in srgb, var(--stl-accent) 42%, transparent); border-radius: var(--stl-radius-sm); padding: 11px 18px; color: var(--stl-text); background: color-mix(in srgb, var(--stl-accent) 4%, transparent); font-family: var(--stl-display); font-weight: 700; }
.button-secondary:hover { color: var(--stl-accent); border-color: var(--stl-accent); background: color-mix(in srgb, var(--stl-accent) 8%, transparent); }
.hero { padding: 40px 0 32px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 64px; align-items: center; }
.eyebrow { margin: 0 0 10px; color: var(--stl-accent); font-family: var(--stl-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, h4 { margin: 0; color: var(--stl-text); font-family: var(--stl-display); line-height: 1.08; letter-spacing: -.045em; }
h1 { max-width: 780px; font-size: clamp(2rem, 4.8vw, 3.25rem); }
h2 { font-size: clamp(1.2rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.05rem; }
.hero-lede { max-width: 650px; margin: 12px 0 20px; color: var(--stl-text-muted); font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .button-primary, .hero-actions .button-secondary { border-radius: 999px; }
.mono { font-family: var(--stl-mono); }
.signal-board { position: relative; min-height: 390px; padding: 23px; border: 1px solid color-mix(in srgb, var(--stl-accent) 35%, transparent); border-radius: var(--stl-radius-lg); overflow: hidden; background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-md); }
.signal-board:before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 0 49%, color-mix(in srgb, var(--stl-accent) 7%, transparent) 50%, transparent 51%); background-size: 96px 100%; }
.signal-board:after { content: "LIVE RESEARCH FEED / PAPER MODE"; position: absolute; right: 22px; bottom: 14px; color: color-mix(in srgb, var(--stl-accent) 48%, transparent); font-family: var(--stl-mono); font-size: 0.5625rem; letter-spacing: .14em; }
.board-label, .board-subline { position: relative; display: flex; justify-content: space-between; gap: 16px; color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.625rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.board-subline { margin-top: 7px; color: var(--stl-text-faint); letter-spacing: .04em; text-transform: none; }
.signal-chart { position: relative; height: 214px; margin: 25px 0 19px; border: 1px solid color-mix(in srgb, var(--stl-text-muted) 16%, transparent); border-radius: var(--stl-radius-sm); background: repeating-linear-gradient(to bottom, transparent 0 35px, color-mix(in srgb, var(--stl-text-muted) 9%, transparent) 36px), repeating-linear-gradient(to right, transparent 0 59px, color-mix(in srgb, var(--stl-text-muted) 6%, transparent) 60px); }
.signal-chart .axis { position: absolute; right: 9px; top: 10px; bottom: 10px; display: flex; flex-direction: column; justify-content: space-between; color: var(--stl-text-faint); font-family: var(--stl-mono); font-size: 0.5625rem; }
.signal-chart svg { position: absolute; inset: 16px 32px 18px 10px; width: calc(100% - 42px); height: calc(100% - 34px); overflow: visible; }
.signal-chart .baseline { fill: none; stroke: color-mix(in srgb, var(--stl-text-muted) 45%, transparent); stroke-width: 1.2; stroke-dasharray: 4 5; }
.signal-chart .curve { fill: none; stroke: var(--stl-accent); stroke-width: 2.8; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--stl-accent) 45%, transparent)); }
.signal-chart .confidence { fill: color-mix(in srgb, var(--stl-accent) 10%, transparent); stroke: none; }
.signal-chart .signal-point { fill: var(--stl-accent); stroke: var(--stl-bg); stroke-width: 2; }
.board-readouts { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.readout { padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--stl-text-muted) 16%, transparent); border-radius: var(--stl-radius-sm); background: var(--stl-surface-inset); box-shadow: inset 0 1px 0 var(--stl-hairline); }
.readout strong { display: block; color: var(--stl-text); font-family: var(--stl-mono); font-size: 0.875rem; font-weight: 500; }
.readout span { color: var(--stl-text-faint); font-family: var(--stl-mono); font-size: 0.5625rem; letter-spacing: .05em; text-transform: uppercase; }
.stat-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin-top: 16px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); overflow: hidden; background: var(--stl-line); }
.stat { padding: 12px 14px; border-radius: var(--stl-radius-sm); background: var(--stl-surface); }
.stat strong { display:block; color: var(--stl-accent); font-family: var(--stl-mono); font-size: 1.125rem; font-weight: 500; }
.stat span { color: var(--stl-text-muted); font-size: 0.75rem; }
.section { padding: 56px 0; }
.section-muted { background: var(--stl-band); color: var(--stl-band-text); }
.section-muted h2, .section-muted h3 { color: var(--stl-band-text); }
.section-kicker { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 12px; }
.section-kicker p { max-width: 550px; margin: 0; color: var(--stl-text-muted); }
.section-muted .section-kicker p { color: var(--stl-band-muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { padding: 16px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-sm); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-head .card-icon { margin: 0; width: 34px; height: 34px; flex: none; }
.card-head h3 { margin: 0; }
.card p { margin: 8px 0 0; color: var(--stl-text-muted); font-size: 0.9375rem; }
.section-muted .card { border-color: var(--stl-band-line); background: var(--stl-band-surface); box-shadow: 0 14px 30px color-mix(in srgb, var(--stl-band-text) 8%, transparent); }
.card-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid color-mix(in srgb, var(--stl-bg) 20%, transparent); border-radius: var(--stl-radius-sm); color: var(--stl-bg); background: var(--stl-accent); font-family: var(--stl-mono); font-size: 0.75rem; font-weight: 500; }
.card p { margin: 12px 0 0; color: var(--stl-text-muted); }
.section-muted .card p { color: var(--stl-band-muted); }
.card-link { display: inline-flex; margin-top: 14px; color: var(--stl-accent); font-family: var(--stl-display); font-weight: 700; }
.content-shell { padding: 56px 0; }
.content-shell .entry-content, .content-shell .entry-header { max-width: 820px; margin-left: auto; margin-right: auto; }
.entry-header { margin-bottom: 16px; }
.entry-content { color: var(--stl-text-muted); }
.entry-content h2, .entry-content h3 { margin: 24px 0 10px; }
.entry-content p, .entry-content ul, .entry-content ol { margin: 0 0 16px; }
.entry-content a { color: var(--stl-accent-3); text-decoration: underline; text-underline-offset: 3px; }
.notice { padding: 18px 20px; border-left: 3px solid var(--stl-accent); border-radius: var(--stl-radius-sm); color: var(--stl-text-strong); background: color-mix(in srgb, var(--stl-accent) 8%, transparent); }
.site-footer { padding: 28px 0 20px; border-top: 1px solid var(--stl-line); color: var(--stl-text-muted); }
.footer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.footer-strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 0; margin: 12px 0; }
.footer-strip-group { display: contents; }
.footer-strip a { display: inline; margin: 0; color: var(--stl-text-muted); font-size: 0.875rem; white-space: nowrap; }
.footer-strip a + a::before, .footer-strip-group + .footer-strip-group::before { content: "·"; margin: 0 10px; color: var(--stl-text-faint); }
.footer-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 0; font-family: var(--stl-mono); font-size: 0.6875rem; }
.footer-legal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; min-width: 0; }
.footer-legal a { display: inline; color: var(--stl-text-muted); font-size: 0.6875rem; white-space: nowrap; }
.footer-legal a + a::before, .footer-meta > span + .footer-legal::before, .footer-legal + span::before { content: "·"; margin: 0 10px; color: var(--stl-text-faint); }
.footer-note { display: flex; justify-content: space-between; gap: 16px; margin-top: 38px; padding-top: 18px; border-top: 1px solid var(--stl-line); font-family: var(--stl-mono); font-size: 0.6875rem; }
.wp-block-button__link, .submit { border-radius: var(--stl-radius-sm); color: var(--stl-bg); background: var(--stl-accent); }
.bbpress-wrapper { max-width: 1080px; margin: 0 auto; }
#bbpress-forums { color: var(--stl-text-muted); }
#bbpress-forums li.bbp-body, #bbpress-forums li.bbp-header, #bbpress-forums li.bbp-footer { border-color: var(--stl-line); background: var(--stl-surface); }
#bbpress-forums li.bbp-header { color: var(--stl-accent); font-family: var(--stl-mono); font-size: 0.625rem; letter-spacing: .08em; text-transform: uppercase; }
#bbpress-forums a { color: var(--stl-accent); }
.bbpress-wrapper .wp-editor-wrap { margin: 10px 0 18px; }
.bbpress-wrapper .quicktags-toolbar, .bbpress-wrapper .mce-toolbar-grp, .bbpress-wrapper .mce-statusbar, .bbpress-wrapper .mce-menubar { border-color: var(--stl-line); background: var(--stl-surface-inset); }
.bbpress-wrapper .mce-container, .bbpress-wrapper .mce-panel { border-color: var(--stl-line); background: var(--stl-surface-inset); }
.bbpress-wrapper .mce-btn, .bbpress-wrapper .ed_button { border-color: transparent; color: var(--stl-text-muted); background: transparent; box-shadow: none; }
.bbpress-wrapper .mce-btn:hover, .bbpress-wrapper .mce-btn.mce-active, .bbpress-wrapper .ed_button:hover { color: var(--stl-bg); background: var(--stl-accent); }
.bbpress-wrapper .mce-edit-area, .bbpress-wrapper .mce-edit-area iframe { background: var(--stl-text-strong); }
.bbpress-wrapper .stl-forum-attachment-field { display: grid; gap: 7px; margin: 16px 0; padding: 14px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface-inset); }
.bbpress-wrapper .stl-forum-attachment-field input[type="file"] { max-width: 100%; color: var(--stl-text-muted); }
.bbpress-wrapper .stl-forum-attachment-field .description { color: var(--stl-text-muted); font-size: 0.75rem; }
.bbpress-wrapper .stl-forum-attachment { display: grid; gap: 8px; margin-top: 16px; padding: 12px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface-inset); font-size: 0.75rem; }
.bbpress-wrapper .stl-forum-attachment-image { display: block; max-width: min(100%, 420px); height: auto; border-radius: var(--stl-radius-sm); }
.bbpress-wrapper .stl-forum-attachment-link { font-family: var(--stl-mono); font-size: 0.6875rem; }
#bbpress-forums code, .bbpress-wrapper .stl-inline-code { padding: 2px 5px; border: 1px solid var(--stl-line); border-radius: 4px; color: var(--stl-accent); background: var(--stl-surface-inset); font-family: var(--stl-mono); font-size: .9em; }
#bbpress-forums pre, .bbpress-wrapper .stl-code-block { overflow-x: auto; margin: 16px 0; padding: 14px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); color: var(--stl-text); background: var(--stl-surface-inset); font-family: var(--stl-mono); font-size: 0.75rem; line-height: 1.6; }
#bbpress-forums .bbp-author-avatar img, #bbpress-forums .bbp-author-avatar { width: 52px; height: 52px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); object-fit: cover; background: var(--stl-surface-inset); box-shadow: var(--stl-shadow-sm); }
#bbpress-forums .bbp-author-role.stl-role-label { display: inline-flex; align-items: center; min-height: 22px; margin: 5px 0 0; padding: 3px 7px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); color: var(--stl-text-muted); background: var(--stl-surface-inset); font-family: var(--stl-mono); font-size: 0.5625rem; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; }
#bbpress-forums .bbp-author-role.stl-role-keymaster, #bbpress-forums .bbp-author-role.stl-role-moderator { color: var(--stl-bg); background: var(--stl-accent); border-color: var(--stl-accent); font-weight: 700; }
#bbpress-forums .bbp-author-role.stl-role-participant { color: var(--stl-text-muted); background: var(--stl-surface); }
#bbpress-forums .bbp-author-role.stl-role-spectator { color: var(--stl-text-muted); opacity: .85; }
#bbpress-forums .bbp-author-role.stl-role-blocked { color: var(--stl-danger); border-color: color-mix(in srgb, var(--stl-danger) 45%, transparent); background: color-mix(in srgb, var(--stl-danger) 16%, transparent); }
#bbpress-forums .bbp-author-role.stl-role-guest, #bbpress-forums .bbp-author-role.stl-role-inactive, #bbpress-forums .bbp-author-role.stl-role-member { color: var(--stl-text-muted); }
.stl-member-profile { max-width: 900px; margin: 0 auto; padding: 28px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-sm); }
.stl-profile-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--stl-line); }
.stl-profile-avatar-image { display: block; width: 128px; height: 128px; border: 2px solid color-mix(in srgb, var(--stl-accent) 55%, transparent); border-radius: var(--stl-radius-lg); object-fit: cover; background: var(--stl-surface-inset); }
.stl-profile-heading .eyebrow { margin-bottom: 8px; }
.stl-profile-name { font-size: clamp(2rem, 5vw, 3.375rem); }
.stl-profile-handle { margin: 6px 0 12px; color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.75rem; }
.stl-profile-role { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); color: var(--stl-text-muted); background: var(--stl-surface-inset); font-family: var(--stl-mono); font-size: 0.625rem; letter-spacing: .06em; text-transform: uppercase; }
.stl-profile-role.stl-role-keymaster, .stl-profile-role.stl-role-moderator { color: var(--stl-bg); background: var(--stl-accent); border-color: var(--stl-accent); font-weight: 700; }
.stl-profile-role.stl-role-blocked { color: var(--stl-danger); border-color: color-mix(in srgb, var(--stl-danger) 45%, transparent); background: color-mix(in srgb, var(--stl-danger) 16%, transparent); }
.stl-profile-edit { align-self: start; }
.stl-profile-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 24px 0; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); overflow: hidden; background: var(--stl-line); }
.stl-profile-stat { padding: 18px; background: var(--stl-surface); }
.stl-profile-stat strong { display: block; color: var(--stl-accent); font-family: var(--stl-mono); font-size: 1.5rem; font-weight: 500; }
.stl-profile-stat span { color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.625rem; letter-spacing: .06em; text-transform: uppercase; }
.stl-profile-section { padding: 24px 0; border-bottom: 1px dashed var(--stl-line); }
.stl-profile-section:last-child { border-bottom: 0; padding-bottom: 0; }
.stl-profile-section h3 { margin-bottom: 16px; font-size: 1.375rem; }
.stl-profile-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 24px; margin: 0; }
.stl-profile-facts div { display: grid; grid-template-columns: minmax(100px, .45fr) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--stl-text-muted) 10%, transparent); }
.stl-profile-facts dt, .stl-profile-contact span { color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.625rem; letter-spacing: .05em; text-transform: uppercase; }
.stl-profile-facts dd { margin: 0; color: var(--stl-text); font-weight: 600; }
.stl-profile-bio { margin-top: 18px; color: var(--stl-text-muted); }
.stl-profile-contact p { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin: 0; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--stl-text-muted) 10%, transparent); }
.stl-profile-contact a { color: var(--stl-accent); overflow-wrap: anywhere; }
.stl-profile-contact strong { color: var(--stl-text-muted); font-weight: 500; }
.stl-profile-note { margin: 18px 0 0; color: var(--stl-text-muted); font-size: 0.8125rem; }
.stl-profile-note a { color: var(--stl-accent); }
.stl-profile-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stl-profile-actions .button-secondary { min-height: 44px; }
.stl-profile-edit-fields { margin: 22px 0; padding: 20px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface-inset); }
.stl-profile-edit-fields h2 { margin-bottom: 14px; font-size: 1.5rem; }
.stl-profile-edit-fields > div { margin: 0 0 16px; }
.stl-profile-edit-fields label { display: block; color: var(--stl-text); font-weight: 600; }
.stl-profile-edit-fields label span, .stl-profile-edit-fields .description { color: var(--stl-text-muted); font-size: 0.75rem; font-weight: 400; }
.stl-profile-edit-fields input[type="text"] { display: block; width: 100%; max-width: 480px; margin-top: 8px; padding: 11px 13px; color: var(--stl-text-strong); background: var(--stl-surface); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); }
.stl-profile-edit-fields input[type="checkbox"] { margin-right: 8px; accent-color: var(--stl-accent); }
.stl-register-form { max-width: 720px; }
.stl-register-form .description { display: block; margin-top: 7px; color: var(--stl-text-muted); font-size: 0.75rem; }
.stl-register-form .consent-line label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.stl-register-form .consent-line input { flex: 0 0 auto; margin-top: 4px; accent-color: var(--stl-accent); }
.password-strength { display: block; min-height: 20px; margin-top: 7px; color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.6875rem; }
.register-login, .contact-account-prompt { color: var(--stl-text-muted); }
.register-login a, .contact-account-prompt a { color: var(--stl-accent); }
@media (max-width: 900px) { .main-nav { gap: 12px; font-size: 0.75rem; } .hero-grid { grid-template-columns: 1fr; } .card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .container { width: min(100% - 32px, 1400px); } .site-header .container { width: min(1400px, calc(100% - 32px)); } .site-header { position: static; } .nav-wrap { flex-wrap: wrap; padding: 15px 0; } .main-nav { order: 3; width: 100%; flex-wrap: wrap; gap: 10px 16px; } .nav-cta { margin-left: auto; } .hero { padding: 36px 0 28px; } .board-readouts { grid-template-columns: 1fr 1fr 1fr; } .card-grid, .stat-strip { grid-template-columns: 1fr; } .section { padding: 48px 0; } .footer-note { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *:before, *:after { transition-duration: .01ms !important; } }


/* Production hardening: visible focus, resilient forms, and reduced motion. */
:focus-visible { outline: 3px solid var(--stl-accent); outline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, .button-primary, .button-secondary, .card-link, .nav-cta { min-height: 44px; }
.stl-request-form { max-width: 720px; margin: 28px 0; padding: 26px; background: var(--stl-surface-raised); border: 1px solid var(--stl-hairline-strong); border-radius: var(--stl-radius-lg); box-shadow: var(--stl-shadow-sm); }
.stl-request-form p { margin: 0 0 18px; }
.stl-request-form label { display: block; font-weight: 600; color: var(--stl-text-strong); }
.stl-request-form input:not([type="checkbox"]), .stl-request-form textarea, .stl-request-form select { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; color: var(--stl-text-strong); background: var(--stl-surface-inset); border: 1px solid var(--stl-hairline-strong); border-radius: var(--stl-radius-sm); }
.stl-request-form textarea { resize: vertical; }
.stl-request-form input:focus, .stl-request-form textarea:focus, .stl-request-form select:focus { border-color: var(--stl-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stl-accent) 14%, transparent); outline: none; }
.stl-consent { display: flex !important; gap: 10px; align-items: flex-start; font-size: 0.875rem; font-weight: 400 !important; }
.stl-consent input { margin-top: 4px; accent-color: var(--stl-accent); }
.stl-honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.site-footer a, .main-nav a, .card a { text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
@media (max-width: 720px) { .stl-request-form { padding: 20px; } .stl-request-form .button-primary { width: 100%; } }

.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; color: var(--stl-bg); background: var(--stl-accent); border-radius: var(--stl-radius-sm); transform: translateY(-180%); transition: transform .16s ease; }
.skip-link:focus { transform: translateY(0); color: var(--stl-bg); }


.nav-tools { display: flex; align-items: center; gap: 8px; }
.theme-toggle, .language-link { min-height: 38px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-pill); padding: 8px 11px; color: var(--stl-text-muted); background: transparent; font-family: var(--stl-mono); font-size: 0.625rem; letter-spacing: .05em; cursor: pointer; }
.theme-toggle:hover, .language-link:hover, .language-link.is-active { color: var(--stl-bg); background: var(--stl-accent); border-color: var(--stl-accent); }
.language-switcher { display: inline-flex; gap: 4px; align-items: center; }
.language-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none !important; }
.language-link.is-active { font-weight: 700; }
.platform-banner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); color: var(--stl-text-muted); background: color-mix(in srgb, var(--stl-accent) 7%, transparent); font-size: 0.8125rem; box-shadow: var(--stl-shadow-sm); }
.platform-banner strong { color: var(--stl-accent); font-family: var(--stl-mono); font-size: 0.625rem; letter-spacing: .08em; text-transform: uppercase; }
.catalog-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 30px; padding: 14px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); background: var(--stl-surface); box-shadow: var(--stl-shadow-sm); }
.catalog-tools input, .catalog-tools select { min-height: 44px; flex: 1 1 190px; padding: 10px 13px; color: var(--stl-text); background: var(--stl-surface-inset); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.meta-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.5625rem; letter-spacing: .04em; text-transform: uppercase; }
.meta-pill.is-signal { color: var(--stl-on-accent); background: var(--stl-accent); border-color: var(--stl-accent); }
.meta-pill.is-gold { color: var(--stl-on-accent); background: var(--stl-accent-2); border-color: var(--stl-accent-2); }
.evidence-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.evidence-card { padding: 16px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-sm); }
.evidence-card strong { display: block; margin-bottom: 7px; color: var(--stl-accent); font-family: var(--stl-mono); font-size: 0.9375rem; }
.evidence-card span { color: var(--stl-text-muted); font-size: 0.75rem; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: stl-step; }
.process-step { position: relative; padding: 22px 18px 18px; border: 1px solid var(--stl-line); border-top: 2px solid var(--stl-accent); border-radius: var(--stl-radius-lg); background: var(--stl-surface); box-shadow: var(--stl-shadow-sm); }
.process-step:before { counter-increment: stl-step; content: "0" counter(stl-step); display: block; margin-bottom: 18px; color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.6875rem; }
.process-step h3 { font-size: 1.125rem; }
.process-step p { color: var(--stl-text-muted); font-size: 0.8125rem; }
.data-table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 0.8125rem; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--stl-line); text-align: left; vertical-align: top; }
.data-table th { color: var(--stl-accent); font-family: var(--stl-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: .06em; }
.search-results-note { color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.6875rem; }
@media (max-width: 900px) { .nav-tools { width: 100%; justify-content: flex-end; } .evidence-grid, .process-grid { grid-template-columns: 1fr 1fr; } .contact-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .nav-tools { justify-content: space-between; gap: 5px; } .theme-toggle { padding: 8px 9px; } .theme-toggle [data-theme-label] { display: none; } .evidence-grid, .process-grid { grid-template-columns: 1fr; } .catalog-tools { padding: 10px; } .catalog-tools input, .catalog-tools select { flex: 1 1 100%; width: 100%; } }
@media (max-width: 420px) { .board-readouts { grid-template-columns: 1fr; } .product-gallery { padding: 18px; } .product-gallery-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .stl-member-profile { padding: 20px; } .stl-profile-hero { grid-template-columns: 1fr; gap: 14px; } .stl-profile-avatar-image { width: 96px; height: 96px; } .stl-profile-edit { justify-self: start; } .stl-profile-stat-grid { grid-template-columns: 1fr; } .stl-profile-facts { grid-template-columns: 1fr; } .stl-profile-contact p { grid-template-columns: 1fr; gap: 4px; } .stl-profile-actions { display: grid; } .stl-profile-actions .button-secondary { width: 100%; } }

/* Light-theme contrast corrections and accessibility utilities. */
:root[data-theme="light"] .notice { color: var(--stl-text); background: color-mix(in srgb, var(--stl-accent) 14%, transparent); }
.screen-reader-text { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.catalog-card[hidden] { display: none; }
.catalog-version { color: var(--stl-accent); font-size: 0.625rem; }

.product-featured-media { max-width: 820px; margin: 0 auto 28px; padding: 12px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-sm); }
.product-featured-image { display: block; width: 100%; height: auto; border-radius: calc(var(--stl-radius-lg) - 4px); }
.product-gallery { max-width: 820px; margin: 0 auto 34px; padding: 24px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-sm); }
.product-gallery h2 { margin: 0 0 18px; font-size: 1.5rem; }
.product-gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.product-gallery-item { display: block; overflow: hidden; aspect-ratio: 16 / 10; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface-inset); }
.product-gallery-image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .16s ease; }
.product-gallery-item:hover .product-gallery-image { transform: scale(1.025); }
.product-card-media { display: block; overflow: hidden; margin: -28px -28px 22px; border-radius: var(--stl-radius-lg) var(--stl-radius-lg) 0 0; background: var(--stl-surface-inset); }
.product-card-image { display: block; width: 100%; height: 180px; object-fit: cover; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 28px; align-items: start; }
.contact-main > h2 { margin-top: 8px; }
.contact-main > p { color: var(--stl-text-muted); }
.contact-aside { padding: 26px; }
.contact-aside h2 { margin-top: 8px; font-size: clamp(1.5rem, 4vw, 2.125rem); }
.contact-aside > p { color: var(--stl-text-muted); }
.whatsapp-button, .telegram-button { display: inline-flex; margin-top: 10px; }
.contact-channel + .contact-channel { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--stl-line); }
.contact-channel h3 { margin: 0; font-size: 1.25rem; }
.contact-channel p { margin-bottom: 0; }
.contact-unavailable { padding: 14px; border-left: 3px solid var(--stl-line); background: var(--stl-surface-inset); }
.contact-aside-note { display: grid; gap: 6px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--stl-line); }
.contact-aside-note strong { color: var(--stl-accent); font-family: var(--stl-mono); font-size: 0.625rem; letter-spacing: .07em; text-transform: uppercase; }
.contact-aside-note span { color: var(--stl-text-muted); font-size: 0.8125rem; }
.product-facts { margin: 30px 0; padding: 20px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-sm); }
.product-facts h2 { font-size: 1.5rem; }
.product-facts p { margin: 10px 0 0; }

/* Consolidated elevation states: raised cards and a restrained active lift. */
.card, .evidence-card, .process-step, .catalog-card, .product-facts { transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
.card:hover, .evidence-card:hover, .process-step:hover, .catalog-card:hover, .product-facts:hover { background: var(--stl-surface-hover); box-shadow: var(--stl-shadow-active); transform: translateY(-2px); }

/* Forum additions */
.forum-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 18px 0 24px; }
.forum-search label { display: grid; gap: 4px; font-size: 0.8125rem; color: var(--stl-text-muted); }
.forum-search input, .forum-search select { min-width: 200px; padding: 10px 12px; border-radius: var(--stl-radius-sm); border: 1px solid var(--stl-line); background: var(--stl-surface); color: var(--stl-text); font: inherit; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 22px 0; }
.pager-disabled { color: var(--stl-text-muted); opacity: .5; }
.post-body { white-space: normal; overflow-wrap: anywhere; }
.post-body code { font-family: var(--stl-mono); background: var(--stl-surface-inset); padding: 1px 5px; border-radius: 4px; }
.post-body a { color: var(--stl-accent-3); text-decoration: underline; }
.post-body.is-removed { color: var(--stl-text-muted); font-style: italic; }
.post-meta { color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.75rem; margin: 0 0 8px; }
.post-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.report-form { margin-top: 12px; }
.report-form textarea { width: 100%; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin: 8px 0 24px; }
.admin-table th, .admin-table td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--stl-line); }
.admin-table select, .admin-table input { max-width: 100%; }

/* Avatars, messages, mentions and feed link */
.avatar { display: inline-block; flex: 0 0 auto; border-radius: 50%; object-fit: cover; border: 1px solid var(--stl-line); background: var(--stl-surface-inset); }
.avatar-lg { width: 96px; height: 96px; margin-bottom: 12px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-head .post-meta { margin: 0; }
.avatar-editor { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.avatar-editor input[type="file"] { max-width: 100%; }
.mention { font-weight: 600; text-decoration: none; border-bottom: 1px dotted currentColor; }
.mention-item { margin: 0 0 10px; }
.feed-link { font-size: .55em; font-weight: 600; margin-left: 10px; vertical-align: middle; }
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding: 4px 2px 12px; }
.dm { max-width: 85%; padding: 12px 16px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg); align-self: flex-start; }
.dm.is-mine { align-self: flex-end; background: var(--stl-surface-raised); }
.dm .post-meta { margin-bottom: 6px; }
@media (max-width: 600px) {
  .dm { max-width: 100%; }
  .avatar-lg { width: 72px; height: 72px; }
}

/* ---------- Forms (shared by every .stl-form on the site) ---------- */
.stl-form { display: grid; gap: 18px; max-width: 560px; margin: 0 0 28px; }
.stl-form > p { margin: 0; }
.stl-form label { display: block; font-weight: 600; color: var(--stl-text); }
.stl-form input:not([type="checkbox"]):not([type="file"]), .stl-form textarea, .stl-form select {`r`n  display: block; width: 100%; margin-top: 8px; padding: 12px 14px; color: var(--stl-text);
  background: var(--stl-surface); border: 1px solid var(--stl-line);
  border-radius: var(--stl-radius-sm, 8px); font-weight: 400; }
.stl-form textarea { min-height: 120px; resize: vertical; }
.stl-form input:focus, .stl-form textarea:focus, .stl-form select:focus { border-color: var(--stl-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stl-accent) 14%, transparent); outline: none; }
.stl-form label:has(> input[type="checkbox"]) { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.stl-form input[type="checkbox"] { margin-top: 4px; accent-color: var(--stl-accent); flex: 0 0 auto; }
.stl-form .button-primary, .stl-form .button-secondary { justify-self: start; }
.stl-form .form-message { margin: 0; min-height: 1.4em; }
.stl-honeypot { position: absolute; left: -9999px; }

/* ---------- Narrow account and messages pages ---------- */
.narrow-page .container { max-width: 820px; margin: 0 auto; }
.narrow-page .entry-header { max-width: none; margin: 0 0 36px; }
.narrow-page h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); margin: 0 0 16px; letter-spacing: -.01em; }
.panel { margin: 0 0 36px; padding: 26px 28px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg, 14px); background: var(--stl-surface-raised); }
.panel > h2:first-child { margin-top: 0; }
.panel .hero-lede { margin-top: -6px; }
.avatar-editor { gap: 22px; }
.avatar-editor > div { flex: 1 1 280px; }
.avatar-editor .form-message { display: inline-block; margin-left: 10px; }
.conv-list { display: grid; gap: 10px; }
.conv { margin: 0; padding: 16px 18px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm, 10px); background: var(--stl-surface); box-shadow: none; }
.conv h3 { margin: 0 0 4px; font-size: 1.05rem; }
.conv .post-meta { margin: 0; }
.mention-list { display: grid; gap: 8px; }
.mention-item { margin: 0; padding: 12px 14px; border-radius: var(--stl-radius-sm, 10px); background: var(--stl-surface); }
.thread { padding: 16px; border-radius: var(--stl-radius-sm, 10px); background: var(--stl-surface); border: 1px solid var(--stl-line); min-height: 120px; }
.dm { border-radius: 14px; }
.dm.is-mine { background: color-mix(in srgb, var(--stl-accent) 10%, transparent); border-color: color-mix(in srgb, var(--stl-accent) 35%, transparent); }
.dm .post-body p { margin: 0; }
.dm .post-meta { font-size: .8rem; }
.narrow-page .button-secondary { margin-right: 6px; }

/* ---------- Premium two-column layout ---------- */
.wide-page { padding-top: 2.5rem; padding-bottom: 4rem; }
.wide-page .container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.page-head { margin-bottom: 1.75rem; }
.page-head h1 { margin: .25rem 0 .5rem; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; letter-spacing: -.01em; }
.page-head .eyebrow { color: var(--stl-accent); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin: 0; }
.page-head .hero-lede { max-width: 62ch; color: var(--stl-text-muted); opacity: .85; margin: 0; }

.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.split-side, .split-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--stl-accent) 7%, transparent), color-mix(in srgb, var(--stl-accent) 2%, transparent));
  border: 1px solid color-mix(in srgb, var(--stl-accent) 22%, transparent);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--stl-panel-inner), var(--stl-shadow-md);
}
.panel-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; font-size: 1.05rem; font-weight: 650; letter-spacing: .01em;
}
.panel-title::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--stl-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--stl-accent) 18%, transparent); flex: none;
}
.panel-title span { color: var(--stl-accent-2); font-weight: 600; }

.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 0 14px; border: 2px solid color-mix(in srgb, var(--stl-accent-2) 55%, transparent); }
.file-input { width: 100%; margin: 6px 0 4px; font-size: .9rem; }
.field-hint { display: block; font-size: .82rem; opacity: .75; margin-bottom: 4px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.side-links { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.side-links a {
  padding: 9px 12px; border-radius: 10px; text-decoration: none;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.side-links a:hover, .side-links a:focus-visible { background: color-mix(in srgb, var(--stl-accent) 10%, transparent); border-color: color-mix(in srgb, var(--stl-accent) 30%, transparent); }
.mod-note { font-size: .9rem; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--stl-accent-2) 8%, transparent); border: 1px solid color-mix(in srgb, var(--stl-accent-2) 35%, transparent); margin: 0 0 14px; }
.muted { opacity: .75; }
.composer { margin-top: 18px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--stl-accent) 20%, transparent); }
.empty-state { text-align: center; padding: 28px 12px; }
.conv-list { display: flex; flex-direction: column; gap: 6px; }

[data-auth="in"] .card { border-radius: 12px; }


/* ---------- Layout review fixes: alignment and spacing on forum, topic, admin ---------- */
.content-shell .entry-header { margin-left: 0; margin-right: 0; }
.content-shell h2 { margin-top: 40px; margin-bottom: 16px; font-size: clamp(1.625rem, 3vw, 2.125rem); }
.content-shell > .container > p:first-child a { display: inline-block; margin-bottom: 8px; }
.content-shell .card h1 { font-size: clamp(1.875rem, 4vw, 3rem); margin: 8px 0 22px; }
.content-shell .card h2 { margin-top: 32px; margin-bottom: 12px; font-size: clamp(1.375rem, 2.4vw, 1.75rem); }
.content-shell .card .post-meta { margin-top: 0; }
.content-shell form.stl-form, .content-shell form[data-api] { max-width: 640px; }

/* ---------- Tab-by-tab cleanup ---------- */
.button-primary, .button-secondary { white-space: nowrap; }
.section-muted .button-secondary { color: var(--stl-band-link-hover); border-color: color-mix(in srgb, var(--stl-band-link) 45%, transparent); background: color-mix(in srgb, var(--stl-band-link) 5%, transparent); }
.section-muted .button-secondary:hover { color: var(--stl-band-link-hover); border-color: var(--stl-band-link-hover); background: color-mix(in srgb, var(--stl-band-link) 10%, transparent); }
header .nav a, .site-header nav a { white-space: nowrap; }
.main-nav a, .nav-cta { white-space: nowrap; }

/* ---------- Link cards (curated, text only, no embedding) ---------- */
.link-cards h2 { margin-top: 0; }
.link-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.link-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px;
  border: 1px solid color-mix(in srgb, var(--stl-accent) 22%, transparent); border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--stl-accent) 7%, transparent), color-mix(in srgb, var(--stl-accent) 2%, transparent));
}
.link-card-title { font-family: var(--stl-display); font-weight: 700; font-size: 1.05rem; color: var(--stl-text); text-decoration: none; }
.link-card-title:hover, .link-card-title:focus-visible { color: var(--stl-accent); text-decoration: underline; }
.link-card-desc { margin: 0; opacity: .85; }
.link-card-host { margin-top: auto; font-family: var(--stl-mono); font-size: 0.75rem; color: var(--stl-text-muted); opacity: .8; word-break: break-all; }

.admin-table td > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-table td .button-secondary, .admin-table td .button-primary { padding: 7px 12px; font-size: .9rem; }

/* ---------- Admin console: section nav, counts, filters, tables, status pills ---------- */
.admin-page { --admin-bad: var(--stl-danger); --admin-ok: var(--stl-ok); --admin-warn: var(--stl-warn); --admin-info: var(--stl-info); }
.admin-page [hidden] { display: none !important; }
.admin-page section.admin-section[id] { scroll-margin-top: 24px; }

.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 12px; }
.admin-nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; white-space: nowrap;
  border: 1px solid var(--stl-line); border-radius: var(--stl-radius-pill);
  background: var(--stl-surface); color: var(--stl-text); text-decoration: none; font-size: 0.875rem;
}
.admin-nav a:hover, .admin-nav a:focus-visible { border-color: var(--stl-accent); color: var(--stl-accent); }
.admin-badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--stl-radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--stl-accent-2); color: var(--stl-bg); font: 700 12px/1 var(--stl-mono);
}
.admin-count { color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: .6em; font-weight: 400; margin-left: 4px; }
.admin-hint { color: var(--stl-text-muted); max-width: 72ch; margin: -4px 0 14px; }
.admin-msg { min-height: 1.4em; margin: 0 0 8px; font-size: 0.875rem; }
.admin-msg.is-ok { color: var(--stl-accent-3); }
.admin-msg.is-error { color: var(--admin-bad); }
.admin-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.admin-filter { max-width: 380px; width: 100%; }
.admin-filter-count { color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.8125rem; }
.admin-summary { margin: 0 0 12px; color: var(--stl-text-muted); font-size: 0.875rem; }
.admin-meter { height: 8px; margin-top: 8px; max-width: 360px; border-radius: 999px; background: var(--stl-surface-inset); overflow: hidden; border: 1px solid var(--stl-line); }
.admin-meter span { display: block; height: 100%; background: var(--stl-accent); }

.admin-table-wrap { overflow-x: auto; margin: 8px 0 28px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.admin-table-wrap .admin-table { margin: 0; }
.admin-table th { font-family: var(--stl-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--stl-text-muted); background: var(--stl-surface-inset); white-space: nowrap; }
.admin-table td { overflow-wrap: anywhere; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--stl-accent) 5%, transparent); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table select, .admin-table input { min-width: 0; }
.admin-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 48ch; }
.admin-mono { font-family: var(--stl-mono); font-size: 0.75rem; overflow-wrap: anywhere; }
.admin-empty { color: var(--stl-text-muted); margin: 8px 0 24px; }

.admin-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--stl-line); color: var(--stl-text-muted); font-family: var(--stl-mono); font-size: 0.75rem; white-space: nowrap; }
.admin-pill.is-ok { color: var(--admin-ok, var(--stl-accent-3)); border-color: color-mix(in srgb, var(--stl-accent-3) 50%, transparent); }
.admin-pill.is-warn { color: var(--admin-warn, var(--stl-accent-2)); border-color: color-mix(in srgb, var(--stl-accent-2) 55%, transparent); }
.admin-pill.is-bad { color: var(--admin-bad); border-color: color-mix(in srgb, var(--stl-danger) 50%, transparent); }
.admin-pill.is-info { color: var(--admin-info, var(--stl-accent)); border-color: color-mix(in srgb, var(--stl-accent) 50%, transparent); }

@media (max-width: 720px) {
  .admin-nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .admin-filter { max-width: none; }
}

/* Admin controls outside .stl-form: same field look as the site forms */
.admin-page .admin-filter,
.admin-page .admin-table input,
.admin-page .admin-table select {
  display: block; padding: 9px 12px; font: inherit; font-size: 0.875rem; color: var(--stl-text-strong);
  background: var(--stl-surface); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm, 8px);
}
.admin-page .admin-table input[type="text"] { min-width: 180px; }
.admin-page .admin-filter:focus, .admin-page .admin-table input:focus, .admin-page .admin-table select:focus {
  border-color: var(--stl-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stl-accent) 14%, transparent); outline: none;
}
.admin-page [data-admin-dm-view]:empty { display: none; }
.form-hint { display: block; margin-top: 6px; color: var(--stl-text-muted); font-size: 0.8125rem; font-weight: 400; }
.admin-page h3 { margin-top: 32px; }

/* Rich text editor (admin) and rich text on public pages */
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.35rem; }
.rich-btn { font: inherit; padding: 0.25rem 0.6rem; border: 1px solid currentColor; border-radius: 4px; background: transparent; cursor: pointer; }
.rich-btn:focus-visible, .rich-media:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.rich-media { font: inherit; max-width: 16rem; padding: 0.25rem; }
.rich-preview { border: 1px dashed currentColor; border-radius: 4px; padding: 0.75rem 1rem; margin: 0.5rem 0 1rem; opacity: 0.95; }
.rich-text img, .post-cover, .item-image { display: block; max-width: 100%; height: auto; border-radius: 6px; margin: 0.75rem 0; }
.media-thumb { object-fit: cover; border-radius: 4px; }
.table-wrap { overflow-x: auto; margin: 0.75rem 0; }
.table-wrap table { border-collapse: collapse; width: 100%; }
.table-wrap th, .table-wrap td { border: 1px solid currentColor; padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.rich-text pre { overflow-x: auto; padding: 0.75rem; border-radius: 6px; background: color-mix(in srgb, var(--stl-text-muted) 12%, transparent); }
.video-wrap { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.audio-wrap { margin: 1rem 0; }
.audio-wrap audio, .post-body audio { width: 100%; max-width: 100%; }
.post-body video { width: 100%; max-width: 100%; border-radius: 6px; }
.attach-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.attach-audio { max-width: 260px; }
.attach-video { max-width: 260px; border-radius: 6px; }
.code-copy { margin: 6px; font-size: 0.8rem; }
pre { position: relative; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tag-cloud a { padding: 6px 12px; border: 1px solid var(--stl-line); border-radius: 999px; text-decoration: none; font-size: 0.875rem; }
.tag-cloud a.is-active { font-weight: 700; border-width: 2px; }
.post-toc { margin: 16px 0; padding: 12px 16px; border: 1px solid var(--stl-line); border-radius: 8px; }
.post-toc ul { margin: 8px 0 0; padding-left: 18px; }
.post-toc .toc-l3 { margin-left: 12px; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0; }
.reading-progress { position: sticky; top: 0; height: 4px; background: transparent; z-index: 5; }
.reading-progress span, .reading-progress [data-progress-fill] { display: block; height: 100%; width: 0; background: var(--stl-accent); }
.post-nav { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0; }
/* Merged operating-path strip: the four steps live inside the ecosystem
   section as one inline row instead of a separate stacked block. */
.path-strip { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--stl-line); }
.path-strip .eyebrow { margin-bottom: 8px; }
.section-muted .path-strip { border-top-color: var(--stl-band-line); }
.section-muted .path-strip .eyebrow { color: var(--stl-band-link); }
.section-muted .path-strip strong { color: var(--stl-band-text); }
.section-muted .path-strip span { color: var(--stl-band-muted); }
.path-strip ol { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.path-strip li { display: flex; align-items: baseline; gap: 8px; font-size: 0.875rem; }
.path-strip strong { color: var(--stl-text); }
.path-strip span { color: var(--stl-text-muted); }
@media (max-width: 700px) { .path-strip ol { display: grid; grid-template-columns: 1fr 1fr; } }
.post-related ul { margin: 8px 0; padding-left: 18px; }
.card-tags { font-size: 0.85rem; opacity: 0.9; }

/* Theme studio: preset gallery, colour fields and live preview. */
.theme-presets { border: 1px solid var(--stl-line); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme-presets legend { padding: 0 6px; font-size: 0.8rem; color: var(--stl-text-muted); }
.theme-preset { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--stl-line); border-radius: 8px; cursor: pointer; font-size: 0.85rem; }
.theme-preset:has(input:checked) { border-width: 2px; border-color: var(--stl-accent); }
.preset-swatch { display: inline-flex; gap: 0; }
.preset-swatch i { width: 18px; height: 18px; display: inline-block; border: 1px solid rgba(0,0,0,.3); }
.preset-swatch i:first-child { border-radius: 4px 0 0 4px; }
.preset-swatch i:last-child { border-radius: 0 4px 4px 0; }
.preset-swatch .preset-default { background: linear-gradient(135deg, #071222 50%, #6aa9ff 50%); border-radius: 4px; }
.color-row .color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--stl-line); border-radius: 6px; background: var(--stl-surface); cursor: pointer; }
.color-field input[type="text"] { max-width: 110px; font-family: var(--stl-mono); }
.theme-preview { border: 1px solid var(--stl-line); border-radius: 10px; padding: 16px 18px; margin: 14px 0; }
.theme-preview-bar { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 10px; }
.theme-preview-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.theme-preview-btn { display: inline-block; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; }
.theme-preview-heading { font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }
.theme-preview-muted { font-size: 0.9rem; margin: 0 0 10px; }
.theme-preview-link { font-weight: 700; font-size: 0.9rem; }

/* Embedded web apps: the app fills its container, no outer frame. */
.app-shell-main { padding-top: 12px; padding-bottom: 12px; }
.app-shell-main .container { max-width: min(100% - 32px, 1400px); }
.webapp-frame-wrap { margin: 0; border: 0; border-radius: 0; overflow: hidden; background: transparent; }
.webapp-frame { display: block; width: 100%; height: calc(100vh - 140px); min-height: 640px; border: 0; background: transparent; }
@media (max-width: 720px) { .webapp-frame { height: calc(100vh - 130px); min-height: 520px; } }

/* Site-wide controls: announcement banner, footer containers, admin menu editor. */
.site-banner { background: var(--stl-banner-bg); color: var(--stl-banner-text); text-align: center; padding: 10px 16px; font-size: 0.95rem; }
.site-banner[hidden] { display: none; }
.footer-links { display: contents; }
.footer-contact { display: grid; gap: 4px; margin-top: 12px; font-size: 0.92rem; }
.footer-contact span { opacity: 0.85; }
.footer-social { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.footer-social[hidden] { display: none; }
.menu-editor { border: 1px solid var(--stl-line); border-radius: 10px; padding: 14px; margin: 14px 0; }
.menu-editor h4 { margin: 0 0 10px; }
.menu-rows { display: grid; gap: 8px; }
.menu-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto auto auto; gap: 6px; align-items: center; }
.menu-row input { min-width: 0; }
@media (max-width: 720px) { .menu-row { grid-template-columns: 1fr; } }

/* Admin navigation groups */
.admin-nav-heading { align-self: center; font-size: 0.6875rem; letter-spacing: .08em; text-transform: uppercase; opacity: .7; padding: 0 6px; white-space: nowrap; }
.admin-nav-heading[hidden] { display: none; }

/* Rich text: quotations, scripture callouts, and the sender warning in admin forms */
.entry-content blockquote { margin: 24px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--stl-accent-2); color: var(--stl-text-muted); }
.entry-content blockquote p { margin: 0; }
.scripture-callout { margin: 24px 0; padding: 20px 24px; border: 1px solid var(--stl-line); border-left: 3px solid var(--stl-accent-2); border-radius: var(--stl-radius-sm); background: var(--stl-surface); }
.scripture-callout p { margin: 0 0 12px; }
.scripture-callout cite { display: block; color: var(--stl-accent-2); font-family: var(--stl-mono); font-size: 0.8125rem; font-style: normal; letter-spacing: .04em; }
.form-warning { display: block; margin-top: 6px; color: var(--stl-accent-2); }

/* Eyebrow text on light ("paper") sections: a darker blue, so it meets WCAG AA (4.5:1) on var(--stl-band). */
.section-muted .eyebrow { color: var(--stl-band-link); }

/* Interactive HTML embedded in a post (its own sandboxed frame) */
.post-app { display: block; width: 100%; min-height: 640px; margin: 24px 0; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface); }

/* Product page: screenshots, specifications, downloads and reviews */
.product-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.product-gallery img { width: 100%; height: auto; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface); }
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.spec-list dt { font-weight: 600; }
.spec-list dd { margin: 0; }
.file-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.licence-entry { display: grid; gap: 4px; max-width: 360px; margin: 12px 0; }
.review { border-top: 1px solid var(--stl-line); padding: 12px 0; }
.review p { margin: 4px 0; }

/* Small screens: each admin table row becomes a stacked card, so every cell and action stays visible without sideways scrolling. */
@media (max-width: 700px) {
  .admin-table-wrap { overflow-x: visible; border: 0; background: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .admin-table tbody tr { border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); margin: 0 0 12px; padding: 4px 0; background: var(--stl-surface-inset); }
  .admin-table tbody tr:hover { background: var(--stl-surface-inset); }
  .admin-table td { display: grid; grid-template-columns: minmax(96px, 36%) 1fr; gap: 8px; align-items: start; padding: 6px 10px; border-bottom: 1px dashed var(--stl-line); }
  .admin-table tbody tr td:last-child { border-bottom: 0; }
  .admin-table td[data-label]::before { content: attr(data-label); font-family: var(--stl-mono); font-size: 0.6875rem; letter-spacing: .04em; text-transform: uppercase; color: var(--stl-text-muted); padding-top: 4px; }
  .admin-table td:not([data-label]) { display: flex; flex-wrap: wrap; gap: 8px; }
  .admin-table td > div { flex-wrap: wrap; }
  .admin-table td .button-secondary, .admin-table td .button-primary { min-height: 40px; }
}

/* ---------- Forum: search, discussion list, empty state ---------- */
/* Light theme: the blue accent is darkened so topic chips and links stay readable on pale backgrounds. */
:root { --forum-accent: var(--stl-accent); }

.forum-search { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(160px, 260px) auto; gap: 12px; align-items: end; margin: 24px 0 32px; }
.forum-field { min-width: 0; }
.forum-list { width: 100%; }
.forum-search label { display: block; margin: 0 0 6px; font-family: var(--stl-mono); font-size: 0.75rem; font-weight: 400; letter-spacing: .04em; text-transform: uppercase; color: var(--stl-text-muted); }
.forum-search input, .forum-search select { width: 100%; min-width: 0; padding: 12px 14px; font: inherit; font-size: 0.9375rem; color: var(--stl-text-strong); background: var(--stl-surface); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm, 8px); }
.forum-search input:focus, .forum-search select:focus { border-color: var(--forum-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stl-accent) 16%, transparent); outline: none; }
.forum-search .forum-apply { padding: 12px 22px; white-space: nowrap; }

.topic-list { list-style: none; margin: 0 0 32px; padding: 0; overflow: hidden; background: var(--stl-surface); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-lg, 16px); }
.topic-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 22px; border-top: 1px solid var(--stl-line); transition: background .15s ease; }
.topic-row:first-child { border-top: 0; }
.topic-row:hover { background: color-mix(in srgb, var(--stl-accent) 6%, transparent); }
.topic-main { min-width: 0; }
.topic-title { display: block; font-family: var(--stl-display); font-size: 1.08rem; font-weight: 600; line-height: 1.3; color: var(--stl-text-strong); text-decoration: none; overflow-wrap: anywhere; }
.topic-title:hover { color: var(--forum-accent); text-decoration: underline; text-underline-offset: 3px; }
.topic-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 0.8125rem; color: var(--stl-text-muted); }
.topic-chip { font-family: var(--stl-mono); font-size: 0.6875rem; letter-spacing: .04em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--forum-accent); color: var(--forum-accent); }
.topic-stats { flex: 0 0 auto; display: grid; justify-items: end; gap: 4px; font-size: 0.8125rem; color: var(--stl-text-muted); text-align: right; white-space: nowrap; }
.topic-count { font-family: var(--stl-display); font-size: 1rem; font-weight: 600; color: var(--stl-text-strong); }

.empty-state { margin: 8px 0 32px; padding: 48px 24px; text-align: center; border: 1px dashed var(--stl-line); border-radius: var(--stl-radius-lg, 16px); }
.empty-state h3 { margin: 0 0 8px; font-family: var(--stl-display); }
.empty-state p { margin: 0 0 20px; color: var(--stl-text-muted); }
.empty-note { margin: 8px 0 24px; color: var(--stl-text-muted); }

@media (max-width: 640px) {
  .forum-search { grid-template-columns: 1fr; }
  .topic-row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .topic-stats { justify-items: start; text-align: left; grid-auto-flow: column; gap: 14px; }
}

/* ---------- Forum: pinned topics, thread layout, post actions, attachments ---------- */
.topic-row.is-pinned { background: color-mix(in srgb, var(--stl-accent) 5%, transparent); box-shadow: inset 3px 0 0 var(--forum-accent); }
.topic-pin { font-family: var(--stl-mono); font-size: 0.6875rem; letter-spacing: .04em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; background: var(--forum-accent); color: var(--stl-bg); }

/* One frame per post: the thread has no outer card, and replies are spaced apart. */
[data-topic-view] > .card + .card { margin-top: 14px; }
.thread-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 8px; }

/* Post actions are quiet text links, so the conversation stays the focus. */
.post-actions { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; }
.post-actions .button-secondary { padding: 4px 0; background: none; border: 0; box-shadow: none; font-size: 0.875rem; font-weight: 600; color: var(--stl-text-muted); text-decoration: none; }
.post-actions .button-secondary:hover { color: var(--forum-accent); text-decoration: underline; text-underline-offset: 3px; }

/* Attachments: file rows, not a bullet list. */
.attach-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
.attach-list li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 0.875rem; color: var(--stl-text-muted); background: var(--stl-surface-inset); border: 1px solid var(--stl-line); border-radius: 999px; }
.attach-list a { font-weight: 600; color: var(--stl-text-strong); text-decoration: none; }
.attach-list a:hover { color: var(--forum-accent); text-decoration: underline; }

/* File picker: styled button instead of the browser default. */
.stl-form input[type="file"]::file-selector-button { margin-right: 12px; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--stl-text-strong); background: var(--stl-surface-raised); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm, 8px); cursor: pointer; }
.stl-form input[type="file"]::file-selector-button:hover { border-color: var(--forum-accent); }

/* Forum: toolbar, sort, unread and closed badges, reactions, presence, and small screens */
.forum-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.forum-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.forum-controls select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--stl-line); background: transparent; color: inherit; font: inherit; }
.topic-row.is-unread .topic-title { font-weight: 700; }
.topic-row > .avatar { flex: 0 0 auto; border-radius: 50%; }
.topic-new, .topic-closed { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }
.topic-new { background: color-mix(in srgb, var(--stl-accent) 18%, transparent); color: var(--stl-accent); }
.topic-closed { background: var(--stl-hairline-strong); }
.closed-note { border-left: 3px solid var(--stl-accent); padding: 8px 12px; margin: 16px 0; }
.react-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.react-btn { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--stl-line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.react-btn[aria-pressed="true"] { border-color: var(--stl-accent); background: color-mix(in srgb, var(--stl-accent) 16%, transparent); }
.react-count { font-size: .9rem; opacity: .8; }
.presence { color: var(--stl-ok); font-weight: 600; }
.thread-actions, .post-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .topic-row { flex-direction: column; align-items: flex-start; }
  .topic-stats { flex-wrap: wrap; }
  .thread-actions button, .post-actions button, .post-actions a { min-height: 44px; }
}

/* Composer: character counts and draft notice */
.char-count { font-size: .8rem; opacity: .7; text-align: right; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.char-count.is-near { color: var(--stl-warn); opacity: 1; font-weight: 600; }

/* The hidden attribute must win over component display rules (e.g. .button-secondary). */
[hidden] { display: none !important; }

/* ---- forum: quotes, previews, autocomplete, featured topics, edit history, start notes ---- */
.post-body blockquote { margin: 0.5rem 0; padding: 0.25rem 0 0.25rem 0.9rem; border-left: 3px solid var(--stl-line); color: var(--stl-text-muted); }
.composer-aids { display: flex; gap: 0.5rem; margin: 0.25rem 0 0.5rem; }

/* Composer toolbar (forum posts, messages, bios, support and contact fields): emoji picker, uploads, inline images. */
.composer-toolbar { position: relative; margin-bottom: 0.35rem; }
/* The formatted editor that replaces the forum text boxes. It looks like a text box and keeps the post's own styles. */
.rte { min-height: 9rem; padding: 0.6rem 0.75rem; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm, 6px); background: var(--stl-surface-inset); color: inherit; font: inherit; line-height: 1.55; overflow-wrap: anywhere; white-space: normal; outline: none; }
.rte:focus { border-color: var(--forum-accent, currentColor); box-shadow: 0 0 0 2px color-mix(in srgb, var(--stl-accent) 25%, transparent); }
.rte > :first-child { margin-top: 0; }
.rte p { margin: 0 0 0.6rem; white-space: normal; }
.rte p:last-child, .rte ul:last-child, .rte blockquote:last-child, .rte pre:last-child { margin-bottom: 0; }
.rte blockquote { margin: 0 0 0.6rem; padding-left: 0.9rem; border-left: 3px solid var(--stl-line); color: var(--stl-text-muted); }
.rte ul { margin: 0 0 0.6rem; padding-left: 1.4rem; }

.composer-toolbar .rich-btn { min-width: 2.25rem; min-height: 2.25rem; border-radius: var(--stl-radius-sm, 4px); }
.composer-toolbar .rich-btn:hover { background: var(--stl-surface-inset); }
.composer-status { margin: 0 0 0.35rem; font-size: 0.8125rem; color: var(--stl-text-muted); }
.composer-status:empty { display: none; }
.composer-status.is-error { color: var(--stl-danger); }
.emoji-pop { position: absolute; top: 100%; left: 0; z-index: 30; display: grid; grid-template-columns: repeat(8, 2.25rem); gap: 0.15rem; margin-top: 0.35rem; padding: 0.4rem; max-width: min(19.5rem, calc(100vw - 2rem)); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm, 6px); background: var(--stl-surface-raised); box-shadow: var(--stl-shadow-sm); }
.emoji-btn { width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: var(--stl-surface-inset); outline: 2px solid var(--forum-accent, currentColor); outline-offset: -2px; }
.post-body h3, .post-body h4, .dm h3, .dm h4, .post-preview h3, .post-preview h4 { margin: 0.75rem 0 0.35rem; line-height: 1.3; }
.post-body h3, .dm h3, .post-preview h3 { font-size: 1.15rem; }
.post-body h4, .dm h4, .post-preview h4 { font-size: 1.02rem; }
.post-body pre, .dm pre, .post-preview pre { overflow-x: auto; margin: 0.5rem 0; padding: 0.6rem 0.75rem; border-radius: var(--stl-radius-sm, 6px); background: var(--stl-surface-inset); }
.post-body pre code, .dm pre code, .post-preview pre code { font-size: 0.9em; white-space: pre; }
.post-body img.post-image, .dm img.post-image { display: block; max-width: 100%; max-height: 28rem; width: auto; height: auto; border-radius: var(--stl-radius-sm, 6px); margin: 0.5rem 0; }
.post-preview { border: 1px dashed var(--stl-line); border-radius: var(--stl-radius-sm); padding: 0.6rem 0.8rem; margin: 0 0 0.75rem; }
.post-preview p { margin: 0 0 0.5rem; }
.mention-suggest { list-style: none; margin: -0.25rem 0 0.75rem; padding: 0.25rem; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface-raised); max-width: 22rem; }
.mention-option { padding: 0.35rem 0.6rem; border-radius: var(--stl-radius-sm); cursor: pointer; }
.mention-option[aria-selected="true"], .mention-option:hover { background: var(--stl-surface-inset); outline: 2px solid var(--forum-accent); outline-offset: -2px; }
.featured-panel { margin: 1.25rem 0; }
.featured-panel .topic-row { border-left: 3px solid var(--forum-accent); }
.topic-search { margin: 2rem 0 1rem; }
.start-note { margin: 0.75rem 0; }
.revisions { margin: 0.25rem 0 0.5rem; }
.revision-list { margin-top: 0.5rem; padding-left: 0.75rem; border-left: 2px solid var(--stl-line); }
.revision { margin-bottom: 0.75rem; }
.revision-title { font-weight: 600; margin: 0.25rem 0; }

/* ---- home page: animated background behind the hero (public/assets/home-background.js) ---- */
/* The animation fills the hero box. The hero text sits above it, and keeps a dark palette in both themes because
   the animation is dark. Room is kept at the bottom for the scene captions when they are shown. */
.hero-stage { position: relative; overflow: hidden; isolation: isolate; color: var(--stl-text); }
.hero-stage > .container { position: relative; z-index: 1; }
.hero-stage:has(.home-bg[data-captions="1"]) { padding-bottom: 204px; }
.home-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--stl-text); }
.home-bg[hidden] { display: none; }
:root .hero-stage .hero-lede, .hero-stage .hero-lede { color: var(--stl-text-muted); }
.hero-stage .button-secondary { color: var(--stl-text); border-color: color-mix(in srgb, var(--stl-text-muted) 45%, transparent); }
@media (max-width: 720px) { .hero-stage:has(.home-bg[data-captions="1"]) { padding-bottom: 248px; } }

/* Admin: the scene editor. Each scene is a fieldset with its own English and French copy. */
.scene-fieldset { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); }
.scene-fieldset legend { padding: 0 6px; font-weight: 600; }
.scene-lang { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--stl-line); }
.scene-lang-name { margin: 0 0 4px; font-size: 0.75rem; color: var(--stl-text-muted); text-transform: uppercase; letter-spacing: .06em; }
/* A scrim over the left of the animation keeps the headline and lede readable. It paints above the animation layers. */
.home-bg::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--stl-bg) 86%, transparent) 0%, color-mix(in srgb, var(--stl-bg) 62%, transparent) 44%, color-mix(in srgb, var(--stl-bg) 8%, transparent) 78%); }

/* ---- header: logo and controls sized to the text, from desktop to phone ----
   The logo keeps its proportions at a fixed height and never shrinks. Language link, theme toggle and the join button
   share one 44px height, the touch target size, so the row reads evenly. Below 1360px the navigation takes its own
   row; on phones the header stacks as logo, navigation, then controls. */
.nav-wrap { gap: 14px 24px; }
.brand { flex: 0 0 auto; }
.main-nav { flex: 1 1 auto; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 0.75rem; }
.main-nav a { padding: 8px 0; line-height: 1.3; }
.nav-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 0.875rem; color: var(--stl-text-muted); white-space: nowrap; }
.nav-tools .theme-toggle { display: inline-flex; align-items: center; gap: 6px; height: 44px; min-height: 44px; padding: 0 14px; font-size: 0.75rem; border-radius: var(--stl-radius-pill); white-space: nowrap; }
.nav-cta { min-height: 44px; padding: 0 18px; font-size: 0.875rem; white-space: nowrap; }

@media (max-width: 1200px) {
  .nav-wrap { flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .main-nav { order: 3; width: 100%; justify-content: flex-start; gap: 6px 18px; }
  .nav-tools { margin-left: auto; }
}
@media (max-width: 640px) {
  .nav-wrap { flex-wrap: wrap; padding: 12px 0; gap: 12px; }
  .brand { width: 100%; }
  .main-nav { order: 2; width: 100%; gap: 6px 16px; font-size: 0.875rem; }
  .nav-tools { order: 3; width: 100%; justify-content: space-between; margin-left: 0; gap: 8px; }
  .nav-tools .theme-toggle { padding: 0 12px; }
  .nav-cta { margin-left: auto; }
}
@media (max-width: 640px) { .nav-wrap { padding: 10px 0; gap: 10px; } .main-nav { gap: 4px 14px; } }
@media (max-width: 640px) { .main-nav, .main-nav a { font-size: 0.8125rem; } .main-nav { gap: 4px 12px; } }

/* Phone menu: the navigation opens from a button in the brand row. Only when the script has marked the header
   (has-nav-toggle), so without JavaScript the navigation stays visible as before. */
.nav-toggle { display: none; }
@media (max-width: 640px) {
  .has-nav-toggle .brand { width: auto; }
  .has-nav-toggle .nav-toggle { display: inline-flex; align-items: center; justify-content: center; order: 2; margin-left: auto; min-height: 44px; min-width: 44px; padding: 0 16px; border: 1px solid color-mix(in srgb, var(--stl-accent) 42%, transparent); border-radius: var(--stl-radius-pill); background: transparent; color: inherit; font-family: var(--stl-display); font-size: 0.875rem; font-weight: 600; cursor: pointer; }
  .has-nav-toggle .nav-toggle:focus-visible { outline: 2px solid var(--stl-accent); outline-offset: 2px; }
  .has-nav-toggle .main-nav { display: none; order: 3; }
  .has-nav-toggle.nav-open .main-nav { display: flex; }
  .has-nav-toggle .nav-tools { order: 4; }
}

/* Admin on phones: wide tables scroll inside their own box, and form fields stay inside their column. */
@media (max-width: 720px) {
  .admin-page [data-admin-table] { overflow-x: auto; max-width: 100%; }
  .admin-page .stl-form, .admin-page .stl-form > * { max-width: 100%; min-width: 0; box-sizing: border-box; }
  .admin-page .stl-form select, .admin-page .stl-form input, .admin-page .stl-form textarea { max-width: 100%; }
}
@media (max-width: 720px) { .admin-page fieldset { min-width: 0; max-width: 100%; } }
@media (max-width: 700px) { .admin-table thead { display: none; } }
/* Long addresses in help text (for example a webhook URL) break onto the next line instead of pushing the page sideways. */
.form-hint, .admin-hint, .stl-form p { overflow-wrap: anywhere; }

/* ---------- App-like polish ---------- */
/* Smooth cross-document transitions for browsers that support View Transitions */
@view-transition { navigation: auto; }
html { -webkit-tap-highlight-color: transparent; }
/* Press feedback so buttons and links feel physical on touch screens */
.button-primary, .button-secondary, .nav-cta, .card-link, .footer-links a, .footer-grid a { transition: transform .12s ease, background-color .2s ease, border-color .2s ease; }
.button-primary:active, .button-secondary:active, .nav-cta:active, .card-link:active, .footer-links a:active { transform: scale(.97); }

/* Bottom navigation is hidden: the hamburger menu covers mobile navigation. */
.bottom-nav { display: none !important; }
@media (max-width: 768px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 30;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--stl-bg) 92%, transparent);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--stl-line);
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 48px; border-radius: 12px; text-decoration: none;
    color: var(--stl-text-muted); font-size: 0.6875rem; font-weight: 550;
  }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a:hover, .bottom-nav a:focus-visible { color: var(--stl-accent); background: color-mix(in srgb, var(--stl-accent) 8%, transparent); outline: none; }
  .bottom-nav a[aria-current="page"] { color: var(--stl-accent); }
    .site-shell { padding-bottom: 76px; }
}

/* ---------- Header brand: real text, not an image ---------- */
.header-mark { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; display: block; flex: none; }
.header-word { display: flex; flex-direction: column; line-height: 1.05; margin-left: 12px; font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; color: var(--stl-text); }
.header-tag { margin-top: 4px; color: var(--stl-text-muted); font-family: var(--stl-mono); font-weight: 500; font-size: 0.5625rem; letter-spacing: .13em; text-transform: uppercase; }
@media (max-width: 640px) { .header-mark { width: 32px; height: 32px; } .header-tag { display: none; } }

/* ---------- Light theme contrast fixes (WCAG AA) ---------- */
/* Left scrim was too heavy; allow the animated canvas to show through */
.home-bg::after { background: linear-gradient(90deg, color-mix(in srgb, var(--stl-bg) 70%, transparent) 0%, color-mix(in srgb, var(--stl-bg) 46%, transparent) 44%, color-mix(in srgb, var(--stl-bg) 0%, transparent) 78%); }

/* ---------- Dropdown navigation ---------- */
.main-nav { list-style: none; margin: 0; padding: 0; }
.main-nav .nav-item { position: relative; }
.main-nav .nav-trigger { display: inline-flex; align-items: center; gap: 6px; color: inherit; font: inherit; font-weight: 650; letter-spacing: inherit; text-decoration: none; background: transparent; border: 0; padding: 8px 0; cursor: pointer; white-space: nowrap; }
.main-nav .nav-trigger svg { transition: transform .18s ease; }
.main-nav .nav-item.open .nav-trigger svg, .main-nav .nav-item:hover .nav-trigger svg { transform: rotate(180deg); }
.main-nav .nav-drop { display: none; position: absolute; top: calc(100% + 10px); left: 0; z-index: 40; min-width: 230px; padding: 10px; border: 1px solid var(--stl-line); border-radius: 12px; background: var(--stl-dropdown-bg); backdrop-filter: blur(14px); box-shadow: var(--stl-shadow-md); list-style: none; margin: 0; }
@media (min-width: 641px) {
  .main-nav .nav-drop.nav-drop-cols { columns: 2; column-gap: 6px; min-width: 420px; }
  .main-nav .nav-drop.nav-drop-cols li { break-inside: avoid; }
}
.main-nav .nav-drop li { display: block; margin: 0; }
.main-nav .nav-drop a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--stl-text); text-decoration: none; white-space: nowrap; }
.main-nav .nav-drop a small { color: var(--stl-text-muted); font-size: 0.6875rem; font-weight: 400; }
.main-nav .nav-drop a:hover, .main-nav .nav-drop a:focus-visible { outline: none; background: color-mix(in srgb, var(--stl-accent) 8%, transparent); color: var(--stl-accent); }
.main-nav .nav-item:hover .nav-drop, .main-nav .nav-item:focus-within .nav-drop, .main-nav .nav-item.open .nav-drop { display: block; }
@media (max-width: 1200px) {
  .main-nav .nav-drop { position: static; min-width: 0; padding: 6px 0 10px 12px; border: 0; border-top: 1px solid var(--stl-line); border-radius: 0; box-shadow: none; background: transparent; backdrop-filter: none; display: none; }
  .main-nav .nav-item.open .nav-drop, .main-nav .nav-item:hover .nav-drop, .main-nav .nav-item:focus-within .nav-drop { display: flex; flex-direction: column; gap: 2px; }
  .main-nav .nav-drop a { white-space: normal; padding: 8px 10px; min-height: 40px; justify-content: center; }
  .main-nav .nav-drop a small { display: none; }
}

/* ---------- Password field show/hide toggle ---------- */
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--stl-text-muted); border-radius: 8px; cursor: pointer; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--stl-accent); background: color-mix(in srgb, var(--stl-accent) 10%, transparent); outline: none; }
.password-toggle:focus-visible { box-shadow: 0 0 0 2px var(--stl-accent); }
.password-toggle:active { transform: translateY(-50%) scale(.94); }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle .eye-hide { display: none; }
.password-toggle[aria-pressed="true"] .eye-show { display: none; }
.password-toggle[aria-pressed="true"] .eye-hide { display: block; }

/* ---------- Typography & readability pass ---------- */
/* Self-hosted fonts ship with the site. OFL licenses in /assets/fonts/. font-display: swap keeps text visible. */
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk-400-700.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/dm-sans-100-1000.woff2") format("woff2"); font-weight: 100 1000; font-style: normal; font-display: swap; font-optical-sizing: auto; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* Nothing on the page is below 0.6875rem (11px) — small mono labels lifted, dense copy kept readable. */
.main-nav { font-size: 0.8125rem; }
.brand-copy small, .header-tag { font-size: 0.6875rem; }
.readout span, .signal-chart .axis { font-size: 0.6875rem; }
.board-label, .board-subline { font-size: 0.6875rem; }
.board-subline { color: var(--stl-text-faint); }
.meta-pill { font-size: 0.6875rem; }
.platform-banner strong, .catalog-version, .contact-aside-note strong { font-size: 0.6875rem; }
.search-results-note, .post-meta, .footer-note { font-size: 0.75rem; }

/* Form controls render in the brand body font everywhere. */
.stl-form input, .stl-form textarea, .stl-form select,
.catalog-tools input, .catalog-tools select,
.forum-search input, .forum-search select,
.admin-table input, .admin-table select { font-family: var(--stl-body); }

/* Pointer cursor on interactive controls; not-allowed while disabled. */
button, [role="button"], input[type="submit"] { cursor: pointer; }
button:disabled, [role="button"][aria-disabled="true"] { cursor: not-allowed; }

/* Selection and placeholders tuned per theme. */
::selection { background: color-mix(in srgb, var(--stl-accent) 32%, transparent); color: var(--stl-text); }
.stl-form input::placeholder, .stl-form textarea::placeholder,
.catalog-tools input::placeholder, .forum-search input::placeholder { color: var(--stl-text-faint); }

/* Anchor links land below the sticky header instead of beneath it. */
section[id], .content-shell [id], .admin-page section[id] { scroll-margin-top: 96px; }

/* Buttons never lose their focus ring even on dense admin pages. */
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--stl-accent); outline-offset: 2px; }

/* Print: clean, legible, chrome-free output. */
@media print {
  .site-header, .site-footer, .bottom-nav, .site-banner, .home-bg, .signal-board,
  .hero-actions, .nav-tools, .theme-toggle, .lang-switch, .password-toggle, .nav-toggle { display: none !important; }
  .site-shell, body { background: var(--stl-surface); color: var(--stl-text); background-image: none; }
  .section-muted, .card, .evidence-card, .catalog-tools, .notice { background: var(--stl-surface); color: var(--stl-text); border-color: var(--stl-line); box-shadow: none; }
  h1, h2, h3, h4, .card-link, .topic-count, .topic-title { color: var(--stl-text) !important; }
  .entry-content a, a { color: var(--stl-link-on-band); text-decoration: underline; }
  .content-shell, .section, .content-shell .entry-content { padding: 18px 0; }
  .hero { padding: 12px 0 0; }
}

/* Reduced motion: also kill view transitions. */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- Final micro-polish ---------- */
/* Headings wrap balance (no ragged last lines); break long words safely (long French compounds). */
h1, h2, h3, h4, .entry-header h1, .section-kicker h2 { text-wrap: balance; overflow-wrap: break-word; }
.hero-lede, .card p, .entry-content p, .section-kicker p { text-wrap: pretty; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.025em; }

/* Tap targets: every primary control is at least 44px tall. */
.button-primary, .button-secondary, .nav-cta, .theme-toggle, .lang-switch { min-height: 44px; }

/* Long strings never break the layout. */
.hero-lede, .card-link, .entry-content, .topic-title, .topic-count, .admin-mono { overflow-wrap: break-word; }
a { overflow-wrap: anywhere; }

/* Headings in French keep a little more breathing room. */
:lang(fr) h1, :lang(fr) h2 { letter-spacing: -.02em; }

/* ---------- Muted-band (white section) contrast fixes ---------- */
/* The evidence band is white in both themes; cards are white there too, like .section-muted .card. */
.section-muted .evidence-card { background: var(--stl-band-surface); border-color: var(--stl-band-line); box-shadow: 0 14px 30px color-mix(in srgb, var(--stl-band-text) 8%, transparent); }
.section-muted .evidence-card strong { color: var(--stl-band-link); }
.section-muted .evidence-card span { color: var(--stl-band-muted); }
/* Links inside the white cards sit on white: use the light-link blue everywhere. */
.section-muted .card-link { color: var(--stl-band-link); }
.section-muted .card-link:hover { color: var(--stl-band-link-hover); }

/* The muted band is fixed near-white in both themes; its notices and buttons are fixed too. */
.section-muted .notice { color: var(--stl-band-text); background: color-mix(in srgb, var(--stl-band-link) 10%, transparent); border-left-color: var(--stl-band-link); }

/* ---------- Admin: page visibility editor (disable pages and their tabs) ---------- */
.page-tab-fieldset { margin: 0 0 16px; padding: 16px 18px; border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); background: var(--stl-surface); }
.page-tab-fieldset legend { padding: 0 8px; font-family: var(--stl-display); font-weight: 700; font-size: 0.9375rem; color: var(--stl-text); }
.page-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-weight: 400; cursor: pointer; }
.page-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--stl-accent); flex: 0 0 auto; }
.page-row input[type="checkbox"]:focus-visible { outline: 3px solid var(--stl-accent); outline-offset: 2px; }

/* ---------- Admin: specifications row editor (no-syntax label/value rows) ---------- */
.specs-list { display: grid; gap: 8px; margin: 8px 0 4px; }
.specs-row { display: grid; grid-template-columns: minmax(140px, .9fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; }
.specs-row input { min-width: 0; padding: 9px 12px; color: var(--stl-text); background: var(--stl-surface-inset); border: 1px solid var(--stl-line); border-radius: var(--stl-radius-sm); font-family: var(--stl-body); font-size: 0.875rem; }
.specs-row input:focus { border-color: var(--stl-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stl-accent) 14%, transparent); outline: none; }
.specs-remove { padding: 7px 12px; font-size: 0.8125rem; white-space: nowrap; }
.specs-add { margin-top: 4px; }
.specs-empty { color: var(--stl-text-muted); font-size: 0.875rem; margin: 4px 0; }
@media (max-width: 640px) { .specs-row { grid-template-columns: 1fr; } .specs-remove { justify-self: start; } }

/* ---------- Admin: e-mail template variable buttons ---------- */
.email-var { margin: 0 6px 6px 0; padding: 6px 12px; font-family: var(--stl-mono); font-size: 0.8125rem; }
[data-email-vars][hidden] { display: none; }

/* ---------- Admin: custom CSS textarea ---------- */
#look-css { font-family: var(--stl-mono); font-size: 0.8125rem; line-height: 1.6; tab-size: 2; }
