/* =============================================================================
   ui.css - MUOnline.ai design system (tokens, base, page shell, components).
   Load order on every header.php page: /css/style.css -> /css/ui.css -> page CSS.
   Mobile first. Breakpoints: sm 640px, md 900px, lg 1100px (nav).
   Frame (header, footer, hero, banners, CTA bands) is dark "ink"; content is light.
   ========================================================================== */

/* == UI 1. TOKENS == */
:root {
  color-scheme: light;

  /* Colour: brand */
  --brand-1: #a20707;
  --brand-2: #c02c2c;
  --brand-3: #7a0606;
  --brand-soft: #fbeeee;
  --brand-line: rgba(162,7,7,.18);
  --gold: #f5c950;             /* accent on dark only, never text on a light surface */
  --gold-2: #e0ad2e;
  --gold-ink: #8a6100;         /* gold-family text on light */
  --gold-soft: #fdf6e0;
  --gold-line: rgba(245,201,80,.45);

  /* Colour: ink (dark frame) */
  --ink-900: #0b0c10;
  --ink-800: #121419;
  --ink-700: #1b1e25;
  --ink-600: #2a2e37;
  --ink-500: #3a3f4a;
  --on-ink: #f4f5f7;
  --on-ink-muted: #aeb4bf;
  --on-ink-subtle: #8b919c;

  /* Colour: light surfaces */
  --bg: #f3f4f6;
  --surface-0: #ffffff;
  --surface-1: #f8f9fb;
  --surface-2: #eef0f3;
  --surface-3: #e4e7ec;

  /* Colour: text */
  --text-strong: #14161b;
  --text: #2b2f36;
  --text-muted: #5b626d;
  --text-subtle: #676d77;      /* small meta only, never paragraphs */

  /* Colour: lines, focus, status */
  --border: #e3e5ea;
  --border-strong: #cfd3da;
  --border-input: #858b96;
  --focus: #c02c2c;
  --focus-on-ink: #f5c950;
  --focus-ring: 0 0 0 3px rgba(192,44,44,.28);
  --success: #1d7a3e;  --success-soft: #e7f5ec;
  --danger:  #b42318;  --danger-soft:  #fdecea;
  --warning: #9a5b00;  --warning-soft: #fef4e2;
  --info:    #1f5fae;  --info-soft:    #e8f1fb;

  /* Typography (system fonts: no CLS, no third-party requests) */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-lead: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  --fs-h4: 1.0625rem;
  --fs-h3: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem);
  --fs-h2: clamp(1.375rem, 1.18rem + .9vw, 1.75rem);
  --fs-h1: clamp(1.875rem, 1.35rem + 2.3vw, 2.75rem);
  --fs-display: clamp(2.125rem, 1.3rem + 3.6vw, 3.5rem);
  --lh-tight: 1.12;  --lh-snug: 1.3;  --lh-ui: 1.25;  --lh-body: 1.6;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-heavy: 800; --fw-black: 900;
  --ls-tight: -.015em;
  --ls-caps: .08em;

  /* Spacing (4px grid) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px; --sp-10: 64px; --sp-11: 80px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-gap: clamp(20px, 2.6vw, 32px);
  --card-pad: clamp(20px, 2.4vw, 32px);
  --page-pad-top: clamp(16px, 2.4vw, 28px);
  --page-pad-bottom: clamp(48px, 7vw, 88px);

  /* Radii: buttons/inputs sm, dropdowns/tables/stats md, cards/page header lg, hero card xl */
  --r-xs: 6px; --r-sm: 10px; --r-md: 12px; --r-lg: 14px; --r-xl: 18px; --r-pill: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16,19,26,.06);
  --shadow-sm: 0 1px 2px rgba(16,19,26,.06), 0 2px 8px rgba(16,19,26,.05);
  --shadow-md: 0 2px 4px rgba(16,19,26,.05), 0 8px 24px rgba(16,19,26,.08);
  --shadow-lg: 0 8px 16px rgba(16,19,26,.10), 0 24px 56px rgba(16,19,26,.18);
  --shadow-brand: 0 6px 16px rgba(162,7,7,.24);

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --measure: 70ch;
  --header-h: 60px;

  /* Motion */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 360ms; --dur-hero: 700ms;
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-in-out: cubic-bezier(.4,0,.2,1);

  /* Z-index */
  --z-header: 1000;
  --z-dropdown: 10;
  --z-drawer: 20;
  --z-backdrop: 999;
  --z-modal: 3000;

  /* Legacy aliases (other CSS files and the account area still use these names) */
  --page-bg: var(--bg); --surface-soft: var(--surface-1); --accent: #1d2026; --accent-2: #4a4f59;
  --border-2: var(--border-strong); --blue: #2483d6; --primary-bg: var(--surface-1); --secondary-bg: var(--surface-0);
  --text-main: var(--text); --border-light: var(--border); --box-shadow: var(--shadow-md); --box-radius: var(--r-lg);
  --gold-tone: #ffd862; --bg-dark: #18213a; --accent-color: #ffd700; --accent-contrast: var(--brand-1);
  --t-fast: var(--dur-fast) var(--ease-out); --t-med: var(--dur-base) var(--ease-out);
  --hero-height-desktop: 610px; --hero-height-mobile: 520px;
  --gradient-glow: linear-gradient(120deg,#ffffff 0%,#f4f5f7 60%,#ebedef 100%);
  --metal-gold: linear-gradient(90deg,#ffe680 0%,#ffd700 45%,#fff3b0 100%);
  --metal-silver: linear-gradient(90deg,#d4d7dd 0%,#c0c3cb 100%);
  --metal-bronze: linear-gradient(90deg,#bc8d4a 0%,#b37728 80%);
  --select-chevron: url("data:image/svg+xml;charset=UTF-8,<svg width='12' height='8' xmlns='http://www.w3.org/2000/svg'><path d='M1 1l5 5 5-5' stroke='%23232323' stroke-width='2' fill='none' fill-rule='evenodd'/></svg>");
  --ranking-primary: var(--brand-1);
  --ranking-primary-light: #e84141;
  --ranking-primary-dark: #750404;
  --ranking-gold: var(--metal-gold);
  --ranking-silver: var(--metal-silver);
  --ranking-bronze: var(--metal-bronze);
  --ranking-shadow: 0 12px 44px rgba(162, 7, 7, 0.10),0 1.5px 8px rgba(80, 25, 25, 0.06);
  --ranking-radius: var(--r-xl);
  --ranking-box-bg: var(--surface-soft);
  --ranking-box-border: #e6e8ea;
  --ranking-tab-bg: linear-gradient(105deg, #f7f7f9 80%, #ececec 100%);
  --ranking-tab-active-bg: var(--brand-1);
  --ranking-table-header-bg: #f7f7f9;
  --ranking-table-header-color: var(--brand-1);
  --ranking-badge-bg: #f3f4f6;
  --ranking-badge-radius: 13px;
}
@media (min-width: 1100px) {
  :root { --header-h: 64px; }
}

/* == UI 2. BASE == */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-weight: 400;
  color: var(--text);
  background: radial-gradient(1100px 420px at 50% -160px, rgba(162,7,7,.07) 0%, rgba(162,7,7,0) 70%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
/* plain element selectors on purpose: they beat style.css's equal-specificity h1/h2 rules by order */
h1, h2, h3, h4 {
  margin: 0 0 var(--sp-3);
  color: var(--text-strong);
  line-height: var(--lh-snug);
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: var(--ls-tight); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); letter-spacing: -.01em; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin: 0 0 var(--sp-4); }
a { color: inherit; text-underline-offset: 3px; }
img, svg, video, canvas { display: block; max-width: 100%; }
:where(img[width][height], video[width][height]) { height: auto; }   /* keeps the aspect ratio; any class wins */
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :focus-visible { outline-color: var(--focus-on-ink); }
::selection { background: rgba(245,201,80,.35); }

/* == UI 3. LAYOUT == */
.page { display: block; min-width: 0; }
.page-container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding: var(--page-pad-top) var(--gutter) var(--page-pad-bottom);
}
.page-container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
/* vertical rhythm: (0,2,0) on purpose, so component and legacy rules cannot move outer margins */
.page-container > :nth-child(n) { margin-block: 0; }
.page-container > :nth-child(n + 2) { margin-top: var(--section-gap); }
.page-container > .breadcrumb-nav + * { margin-top: var(--sp-3); }
.page-container > :is(script, style, template, link, meta, dialog, [hidden], .media-lightbox) { margin: 0; }
.page--home .page-container { padding-top: var(--section-gap); }

.grid { display: grid; gap: var(--sp-5); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (min-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.grid > *, .split > * { min-width: 0; }
.split { display: grid; gap: var(--sp-6); }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
}
.with-sidebar { display: grid; gap: var(--section-gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
.with-sidebar > * { min-width: 0; }
@media (min-width: 900px) {
  .with-sidebar { grid-template-columns: 240px minmax(0, 1fr); }
}

/* == UI 4. COMPONENTS == */

/* --- Buttons: .btn + exactly one variant --- */
.btn, .main-register-btn, .news-btn, .button /* legacy */ {
  --btn-h: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--btn-h);
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-0);
  color: var(--text-strong);
  font: inherit;
  font-size: .9375rem;
  font-weight: 700;
  line-height: var(--lh-ui);
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: none;
  transform: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--surface-0); border-color: var(--brand-1); color: var(--brand-1); }   /* bare .btn = secondary look (legacy markup only) */
.btn--primary, .btn-primary, .main-register-btn, .button /* legacy */ {
  background: linear-gradient(180deg, #c9302f 0%, var(--brand-1) 100%);
  border-color: #8e0606;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), var(--shadow-brand);
}
:is(.btn--primary, .btn-primary, .main-register-btn, .button):hover { background: linear-gradient(180deg, #d63b39 0%, #b30b0b 100%); border-color: #8e0606; color: #fff; }
:is(.btn--primary, .btn-primary, .main-register-btn, .button):active { background: var(--brand-3); }
.btn--secondary, .btn--blue /* legacy */ { background: var(--surface-0); border-color: var(--border-strong); color: var(--text-strong); }
:is(.btn--secondary, .btn--blue):hover { background: var(--surface-0); border-color: var(--brand-1); color: var(--brand-1); }
.btn--ghost, .btn-ghost /* legacy */ { background: transparent; border-color: transparent; box-shadow: none; color: var(--brand-1); }
:is(.btn--ghost, .btn-ghost):hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-1); }
.btn--link, .read-more, .news-archive-btn /* legacy */ {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  box-shadow: none;
  color: var(--brand-1);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(162,7,7,.35);
  text-underline-offset: 3px;
}
:is(.btn--link, .read-more, .news-archive-btn):hover { background: none; color: var(--brand-1); text-decoration-color: currentColor; }
.btn--sm, .news-btn { --btn-h: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn--lg, .main-register-btn { --btn-h: 52px; padding: 0 28px; font-size: 1.0625rem; border-radius: var(--r-md); }
.btn--block { display: flex; width: 100%; }
.btn--pill { /* legacy no-op: same radius as every button */ }
:is(.btn, .button):is(:disabled, [aria-disabled="true"]) { opacity: .55; pointer-events: none; box-shadow: none; }
/* focus: both rules (0,2,0); the dark one comes later and wins on dark surfaces */
:is(.btn, .main-register-btn, .news-btn, .button):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :is(.btn, .main-register-btn, .news-btn, .button):focus-visible { outline-color: var(--focus-on-ink); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  :is(.btn--primary, .btn-primary, .main-register-btn, .button):hover { transform: translateY(-1px); }
}
/* buttons on dark surfaces */
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :is(.btn--secondary, .btn--blue) { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.28); color: #fff; }
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :is(.btn--secondary, .btn--blue):hover { background: rgba(255,255,255,.08); border-color: var(--gold); color: var(--gold); }
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :is(.btn--ghost, .btn-ghost) { color: #fff; }
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :is(.btn--ghost, .btn-ghost):hover { background: rgba(255,255,255,.08); color: #fff; }
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :is(.btn--link, .read-more, .news-archive-btn) { color: var(--gold); text-decoration-color: rgba(245,201,80,.45); }
:where(.site-header, .site-footer, .home-hero, .page-header--banner, .cta-band--band, .on-ink, .launch-embed) :is(.btn--link, .read-more, .news-archive-btn):hover { color: var(--gold); text-decoration-color: currentColor; }

/* --- Cards and section heads --- */
.card, .white-box /* legacy */ {
  min-width: 0;   /* stops a wide table from blowing out a grid/flex track */
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--card-pad);
  color: var(--text);
}
.card__title { margin: 0 0 var(--sp-4); font-size: var(--fs-h2); line-height: var(--lh-snug); font-weight: 700; color: var(--text-strong); letter-spacing: -.01em; text-align: left; }
.card--flush { padding: 0; overflow: hidden; }
.card--muted { background: var(--surface-1); box-shadow: none; }
.card--interactive { transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); }
.card--interactive:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card--interactive:hover { transform: translateY(-2px); }
}
.page-section, .home-section { margin: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-2) var(--sp-5); margin: 0 0 var(--sp-5); }
.section-head__kicker { margin: 0 0 var(--sp-1); font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--brand-1); }
.section-head__title { margin: 0; font-size: var(--fs-h2); line-height: var(--lh-snug); color: var(--text-strong); text-align: left; }
.section-head__sub { margin: var(--sp-1) 0 0; max-width: var(--measure); color: var(--text-muted); }

/* --- Tables: .table-wrap > table.data-table --- */
.table-wrap, .ranking-table-wrap, .home-table-wrap, .responsive-table, .event-registration-table-wrapper, .muor-table-wrap /* legacy */ {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table /* legacy */ {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--text);
  background: var(--surface-0);
  margin: 0;
  box-shadow: none;
  border-radius: 0;
}
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) :is(th, td) { padding: 12px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); background: transparent; }
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) th { color: var(--text-strong); font-weight: 600; }
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) thead th { background: var(--surface-1); color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--border-strong); }
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) tbody tr:last-child :is(td, th) { border-bottom: 0; }
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) tbody tr:hover :is(td, th) { background: #fdf8ec; }
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) :is(th, td).num { text-align: right; font-variant-numeric: tabular-nums; }
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) a { color: var(--brand-1); font-weight: 600; text-decoration: none; }
:is(.data-table, .sys-table, .table-style, .ranking-table, .home-mini-table) a:hover { text-decoration: underline; }
.data-table--compact :is(th, td) { padding: 8px 10px; }
.data-table--zebra tbody tr:nth-child(even) :is(td, th) { background: var(--surface-1); }
.data-table--fixed { table-layout: fixed; }
.data-table--wide { min-width: 640px; }   /* opt-in: scrolls inside its .table-wrap on phones */

/* --- Pills, badges, chips, meta chips --- */
.pill, .badge /* legacy */ {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-strong);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.pill--brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-1); }
.pill--gold { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-ink); }
.pill--success { background: var(--success-soft); border-color: #b7e1c4; color: var(--success); }
.pill--danger { background: var(--danger-soft); border-color: #f5c2bd; color: var(--danger); }
.pill--dark { background: var(--ink-800); border-color: var(--ink-600); color: var(--on-ink); }
.meta-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface-1); border: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text); }
.meta-chip__label { color: var(--text-muted); }
.meta-chip__value { font-weight: 600; color: var(--text-strong); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 639.98px) {
  .chip-row--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
}
.chip, .realm-chip, .event-filter-btn /* legacy */ {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-0);
  color: var(--text-strong);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
:is(.chip, .realm-chip, .event-filter-btn):hover { border-color: var(--brand-1); color: var(--brand-1); }
:is(.chip, .realm-chip, .event-filter-btn):is(.is-active, .active, [aria-current="page"], [aria-selected="true"], [aria-pressed="true"]) { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }

/* --- Stat tiles --- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: var(--sp-3); margin: 0; }
.stat { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 14px 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); }
.stat__label { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--text-muted); }
.stat__value { margin: 0; font-size: clamp(1.25rem, 1.1rem + .6vw, 1.625rem); font-weight: 800; line-height: 1.2; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stat__note { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.stat--brand { border-top: 3px solid var(--brand-1); }
.stat--gold { border-top: 3px solid var(--gold); }

/* --- Prose, copy sections (includes/page_copy.php output), FAQ --- */
:is(.prose, .copy-section) { color: var(--text); line-height: var(--lh-body); }
.copy-section:not(.white-box):not(.card) { padding: 0; border: 0; background: none; box-shadow: none; }
:is(.prose, .copy-section) > h2 { margin: 0 0 var(--sp-4); font-size: var(--fs-h2); line-height: var(--lh-snug); color: var(--text-strong); text-align: left; }
:is(.prose, .copy-section) h3 { margin: var(--sp-6) 0 var(--sp-2); font-size: var(--fs-h3); text-align: left; }
:is(.prose, .copy-section) h4 { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-h4); }
:is(.prose, .copy-section) p { margin: 0 0 var(--sp-4); max-width: var(--measure); color: var(--text); }
:is(.prose, .copy-section) :is(ul, ol) { margin: 0 0 var(--sp-4); padding-left: 1.25em; max-width: var(--measure); }
:is(.prose, .copy-section) li { margin: .35em 0; }
:is(.prose, .copy-section) li::marker { color: var(--brand-2); }
:is(.prose, .copy-section) table:not(.data-table) { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: var(--sp-2) 0 var(--sp-5); font-size: var(--fs-sm); }
:is(.prose, .copy-section) table:not(.data-table) :is(th, td) { padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; text-align: left; }
:is(.prose, .copy-section) table:not(.data-table) thead th { background: var(--surface-1); color: var(--text-strong); font-weight: 600; }
:is(.prose, .copy-section) img { height: auto; border-radius: var(--r-md); }
:is(.prose, .copy-section) blockquote { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border-left: 3px solid var(--gold-2); background: var(--gold-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
:is(.prose, .copy-section) code { font-family: var(--font-mono); font-size: .9em; padding: .1em .35em; border-radius: 4px; background: var(--surface-2); }
:is(.prose, .copy-section) hr { margin: var(--sp-6) 0; border: 0; border-top: 1px solid var(--border); }
:is(.prose, .copy-section) > :last-child { margin-bottom: 0; }
:is(.prose, .copy-section, .page-lead, .copy-sources, .faq-a) a:not(.btn) { color: var(--brand-1); text-decoration: underline; text-decoration-color: rgba(162,7,7,.35); text-underline-offset: 3px; overflow-wrap: anywhere; }
:is(.prose, .copy-section, .page-lead, .copy-sources, .faq-a) a:not(.btn):hover { text-decoration-color: currentColor; }
.page-lead { margin: 0; max-width: var(--measure); font-size: var(--fs-lead); line-height: 1.65; color: var(--text); text-align: left; }
.copy-sources { margin: 0; max-width: var(--measure); font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.copy-sources a:not(.btn) { color: var(--text-muted); }
.copy-updated { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.faq-list { display: grid; margin: 0; }
.faq-item { margin: 0; padding: var(--sp-4) 0; border-top: 1px solid var(--border); }
.faq-item:first-child { border-top: 0; padding-top: 0; }
.faq-q, dl.faq-list dt { margin: 0 0 var(--sp-2); font-size: var(--fs-h4); font-weight: 700; line-height: 1.4; color: var(--text-strong); text-align: left; }
.faq-a, dl.faq-list dd { margin: 0; color: var(--text); }
.faq-a > :last-child { margin-bottom: 0; }
dl.faq-list dd + dt { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); }

/* --- News cards (home, 404, news archive, related news) --- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--sp-5); margin: 0; }
.news-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.news-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.news-title { margin: 0; font-size: var(--fs-h4); line-height: 1.35; font-weight: 700; color: var(--text-strong); text-align: left; }
.news-excerpt, .news-card > p:not([class]) /* legacy */ { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.news-archived-note { margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.news-card .news-btn { margin-top: auto; align-self: flex-start; }
.news-card--archived .news-title { color: var(--text-muted); }

/* --- Class tiles (home classes, classes archive, related classes) --- */
.class-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
@media (max-width: 639.98px) {
  .class-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
}
.class-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.class-tile__img, .class-tile__media img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--ink-800); }
.class-tile__body { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4); }
.class-tile__name { margin: 0; font-size: var(--fs-h4); font-weight: 700; line-height: 1.3; color: var(--text-strong); text-align: left; }
.class-tile__vs { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.class-tile__vs strong { color: var(--text-strong); font-weight: 600; }
.class-tile__desc { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.class-tile:hover { border-color: var(--brand-line); box-shadow: var(--shadow-md); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .class-tile:hover { transform: translateY(-2px); }
}
.class-tiles--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); gap: var(--sp-3); }
@media (max-width: 639.98px) {
  .class-tiles--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.class-tiles--compact .class-tile__body { padding: 8px 10px; }
.class-tiles--compact .class-tile__name { font-size: var(--fs-sm); text-align: center; }

/* --- Forms (register, login, contact, filters) --- */
.form, .form-layout /* legacy */ { display: grid; gap: var(--sp-4); }
.field { display: grid; gap: 6px; min-width: 0; }
:is(.form, .form-layout, .field, .filter-bar) label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.input,
.filter-input,
.filter-select,
:is(.form, .form-layout, .filter-bar) :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input:not([type]), select, textarea) {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-input);
  border-radius: var(--r-sm);
  background-color: var(--surface-0);
  color: var(--text-strong);
  font: inherit;
  font-size: 1rem;   /* 16px: no iOS zoom */
  line-height: 1.4;
  box-shadow: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input:hover,
.filter-input:hover,
.filter-select:hover,
:is(.form, .form-layout, .filter-bar) :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input:not([type]), select, textarea):hover {
  border-color: var(--text-muted);
}
.input:focus,
.filter-input:focus,
.filter-select:focus,
:is(.form, .form-layout, .filter-bar) :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input:not([type]), select, textarea):focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--brand-2);
  box-shadow: var(--focus-ring);
}
.input::placeholder,
.filter-input::placeholder,
:is(.form, .form-layout, .filter-bar) :is(input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input:not([type]), textarea)::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}
:is(.form, .form-layout) textarea { min-height: 120px; resize: vertical; }
:is(.form, .form-layout, .filter-bar) select, .filter-select {
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
}
.field__hint { font-size: var(--fs-sm); color: var(--text-muted); }
.field__error { font-size: var(--fs-sm); color: var(--danger); }
.check, .form-check /* legacy */ { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); }
.check input[type=checkbox], .form-check input[type=checkbox] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-1); }
.form-links { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: var(--fs-sm); }
.form-links a { color: var(--brand-1); }
.auth-card { width: 100%; max-width: 480px; margin-inline: auto; }   /* with .card */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); margin: 0; }
.filter-bar > :not(.btn):not(button) { flex: 1 1 180px; min-width: 0; }
.filter-bar > :is(.btn, button) { flex: 0 0 auto; }

/* --- Alerts --- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--r-md); background: var(--surface-1); color: var(--text-strong); font-size: var(--fs-sm); line-height: 1.5; }
.alert--success, .alert-success /* legacy */ { background: var(--success-soft); border-color: #b7e1c4; border-left-color: var(--success); }
.alert--danger, .alert--error, .alert-error /* legacy */ { background: var(--danger-soft); border-color: #f5c2bd; border-left-color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: #f3d9a4; border-left-color: var(--warning); }
.alert--info { background: var(--info-soft); border-color: #c3d7f1; border-left-color: var(--info); }

/* --- Pagination (nav.pagination-bar > ul.pagination-list > li > a|span) --- */
.pagination, .pagination-bar { display: flex; justify-content: center; margin-top: var(--sp-5); }
.pagination__list, .pagination-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
:is(.pagination__list, .pagination-list) :is(a, span) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-0);
  color: var(--text-strong);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
  transform: none;
}
:is(.pagination__list, .pagination-list) a:hover { border-color: var(--brand-1); color: var(--brand-1); background: var(--surface-0); }
:is(.pagination__list, .pagination-list) :is([aria-current="page"], .is-active, .active) { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }

/* --- CTA row and CTA band --- */
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: 0; }
.cta-band { display: grid; gap: var(--sp-4); justify-items: center; text-align: center; }
.cta-band .cta-row { justify-content: center; }
.cta-band--start, .cta-band--inline { justify-items: start; text-align: left; }
:is(.cta-band--start, .cta-band--inline) .cta-row { justify-content: flex-start; }
.cta-band--inline.cta-band--center { justify-items: center; }
.cta-band--inline.cta-band--center .cta-row { justify-content: center; }
.cta-band--band {
  padding: clamp(28px, 4vw, 48px) var(--card-pad);
  border: 1px solid var(--ink-600);
  border-radius: var(--r-lg);
  color: var(--on-ink);
  box-shadow: var(--shadow-md);
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(192,44,44,.40) 0%, rgba(192,44,44,0) 60%),
    radial-gradient(60% 100% at 100% 100%, rgba(245,201,80,.16) 0%, rgba(245,201,80,0) 60%),
    linear-gradient(135deg, var(--ink-700) 0%, var(--ink-900) 100%);
}
.cta-band__title { margin: 0; font-size: var(--fs-h2); color: #fff; text-align: inherit; }
.cta-band__text { margin: 0; max-width: 60ch; color: var(--on-ink-muted); }
@media (max-width: 639.98px) {
  .cta-band--band .cta-row { flex-direction: column; align-items: stretch; width: 100%; }
  .cta-band--band .btn { width: 100%; }
}

/* --- Steps (numbered how-to) --- */
.steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.step { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-md); }
.step__title { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; color: var(--text-strong); }
.step__num { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-1); color: #fff; font-size: var(--fs-sm); font-weight: 700; }
.step__media { position: relative; display: block; padding: 0; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--ink-800); cursor: zoom-in; }
.step__media img { display: block; width: 100%; height: auto; }

/* --- Side nav (ranking categories; chip scroller below 900px) --- */
.side-nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 8px; list-style: none; background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--r-lg); }
.side-nav :is(ul, ol) { display: contents; margin: 0; padding: 0; list-style: none; }
.side-nav li { margin: 0; padding: 0; list-style: none; }
.side-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.side-nav a:hover { background: var(--surface-1); color: var(--text-strong); }
.side-nav a:is([aria-current="page"], .active) { background: var(--brand-soft); color: var(--brand-1); box-shadow: inset 3px 0 0 var(--brand-1); }
@media (max-width: 899.98px) {
  .side-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 0; gap: 8px; background: none; border: 0; }
  .side-nav a { flex: 0 0 auto; min-height: 36px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface-0); white-space: nowrap; }
  .side-nav a:is([aria-current="page"], .active) { background: var(--brand-1); border-color: var(--brand-1); color: #fff; box-shadow: none; }
}

/* --- Share row (guild, server detail): a.btn.btn--secondary.btn--sm.share-btn --- */
.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }

/* == UI 5. SHELL == */

/* --- Skip link --- */
.skip-link { position: absolute; left: var(--sp-3); top: -200px; z-index: calc(var(--z-header) + 10); padding: 10px 16px; border-radius: var(--r-sm); background: var(--gold); color: #111; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: var(--sp-3); }

/* --- Site header (sticky ink bar) ---
   The blur lives on ::before so .site-header never becomes a containing block for the
   fixed drawer: never put backdrop-filter, filter or transform on .site-header itself. */
.site-header { position: sticky; top: 0; z-index: var(--z-header); height: var(--header-h); color: var(--on-ink); isolation: isolate; }
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(14,16,21,.94);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 10px 30px rgba(0,0,0,.18);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(245,201,80,0) 0%, rgba(245,201,80,.55) 30%, rgba(192,44,44,.7) 50%, rgba(245,201,80,.55) 70%, rgba(245,201,80,0) 100%);
}
.site-header__inner { display: flex; align-items: center; gap: var(--sp-3); height: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); overflow-x: clip; }
.site-logo { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: .28em; color: #fff; font-family: var(--font-display); font-size: 1.3125rem; font-weight: 800; letter-spacing: .02em; line-height: 1; white-space: nowrap; text-decoration: none; }
.site-logo__mu { color: var(--gold); }
.site-header__cta { margin-left: auto; }
.site-header__burger { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-right: -6px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: #fff; cursor: pointer; }
.site-header__burger:hover { background: rgba(255,255,255,.08); }
.burger { position: relative; display: block; width: 20px; height: 14px; }
.burger > span { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast); }
.burger > span:nth-child(1) { top: 0; }
.burger > span:nth-child(2) { top: 6px; }
.burger > span:nth-child(3) { top: 12px; }
[aria-expanded="true"] .burger > span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
[aria-expanded="true"] .burger > span:nth-child(2) { opacity: 0; }
[aria-expanded="true"] .burger > span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 359.98px) {
  .site-header__cta { display: none; }
  .site-header__burger { margin-left: auto; }
}

/* --- Site nav: off-canvas drawer by default (mobile first) --- */
.site-nav {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  width: min(88vw, 380px);
  padding: var(--sp-4) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ink-800);
  border-left: 1px solid var(--ink-600);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base);
}
.site-nav.is-open { transform: none; visibility: visible; transition: transform var(--dur-base) var(--ease-out), visibility 0s; }
.site-nav__list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav__link { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: none; color: rgba(255,255,255,.88); font: inherit; font-size: 1rem; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.site-nav__link:hover { background: rgba(255,255,255,.06); color: #fff; }
.site-nav__link:is(.is-active, [aria-current]) { color: var(--gold); }
.site-nav__chev { flex: 0 0 auto; transition: transform var(--dur-fast) var(--ease-out); }
.site-nav__toggle[aria-expanded="true"] .site-nav__chev { transform: rotate(180deg); }
.site-nav__menu { margin: 0 0 6px; padding: 0 0 0 12px; list-style: none; }
.site-nav__menu-link { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: rgba(255,255,255,.78); font-size: .9375rem; font-weight: 500; text-decoration: none; }
.site-nav__menu-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.site-nav__menu-link:is(.is-active, [aria-current]) { color: var(--gold); }
.site-nav__actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--ink-600); }
.site-nav__actions .account-controls { display: flex; flex-direction: column; gap: var(--sp-2); }
.site-nav__actions .btn { width: 100%; }
.lang-switcher { position: relative; display: inline-flex; }
.lang-switcher select {
  width: 100%;
  min-height: 44px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--ink-500);
  border-radius: var(--r-sm);
  background-color: var(--ink-700);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23e5e7eb' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--on-ink);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.lang-switcher select option { color: #111; background: #fff; }
.site-nav-backdrop { position: fixed; inset: var(--header-h) 0 0 0; z-index: var(--z-backdrop); background: rgba(8,9,12,.55); }
.site-nav-backdrop[hidden] { display: none; }
body.nav-open { overflow: hidden; }

/* desktop: one row; html.nav-compact (set by the inline fit check when the row does not fit) keeps the drawer */
@media (min-width: 1100px) {
  html:not(.nav-compact) :is(.site-header__burger, .site-header__cta, .site-nav-backdrop) { display: none; }
  html:not(.nav-compact) .site-nav { position: static; flex: 1 1 auto; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--sp-3); width: auto; min-width: 0; padding: 0; overflow: visible; background: none; border: 0; box-shadow: none; transform: none; visibility: visible; transition: none; }
  html:not(.nav-compact) .site-nav__list { flex-direction: row; align-items: center; gap: 2px; margin-left: var(--sp-4); }
  html:not(.nav-compact) .site-nav__item { position: relative; }
  html:not(.nav-compact) .site-nav__item--home { display: none; }
  html:not(.nav-compact) .site-nav__link { width: auto; min-height: 40px; padding: 0 10px; font-size: .875rem; white-space: nowrap; justify-content: flex-start; color: rgba(255,255,255,.82); }
  html:not(.nav-compact) .site-nav__link:is(.is-active, [aria-current]) { color: #fff; box-shadow: inset 0 -2px 0 var(--gold); border-radius: var(--r-sm) var(--r-sm) 0 0; }
  html:not(.nav-compact) .site-nav__menu { position: absolute; top: calc(100% + 10px); left: 0; z-index: var(--z-dropdown); min-width: 220px; margin: 0; padding: 6px; background: var(--ink-700); border: 1px solid var(--ink-600); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
  html:not(.nav-compact) .site-nav__item--group:last-child .site-nav__menu { left: auto; right: 0; }
  html:not(.nav-compact) .site-nav__actions { flex-direction: row; align-items: center; gap: var(--sp-2); margin: 0 0 0 auto; padding: 0; border: 0; }
  html:not(.nav-compact) .site-nav__actions .account-controls { flex-direction: row; }
  html:not(.nav-compact) .site-nav__actions .btn { width: auto; }
  html:not(.nav-compact) .lang-switcher select { min-height: 36px; width: auto; }
}
@media (min-width: 1280px) {
  html:not(.nav-compact) .site-nav__link { padding: 0 12px; font-size: .9375rem; }
  html:not(.nav-compact) .site-nav__list { gap: 4px; }
}

/* no-JS fallback: groups open on hover/focus on desktop; below 1100px the nav is a static block under the bar */
html.no-js .site-nav__item--group:is(:hover, :focus-within) > .site-nav__menu { display: block; }
@media (max-width: 1099.98px) {
  html.no-js .site-header { position: relative; height: auto; }
  html.no-js .site-header__inner { flex-wrap: wrap; height: auto; min-height: var(--header-h); padding-block: 10px; }
  html.no-js .site-header__burger { display: none; }
  html.no-js .site-nav { position: static; flex: 1 1 100%; width: 100%; padding: var(--sp-3) 0 var(--sp-4); overflow: visible; background: none; border: 0; box-shadow: none; transform: none; visibility: visible; transition: none; }
  html.no-js .site-nav__menu[hidden] { display: block; }
  html.no-js .site-nav__chev { display: none; }
  html.no-js .site-nav-backdrop { display: none; }
}

/* --- Site footer (brand + Site / Community / Legal columns + bottom line) --- */
.site-footer { position: relative; margin-top: auto; background: var(--ink-800); color: var(--on-ink-muted); font-size: var(--fs-sm); text-align: left; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--gold) 0%, var(--brand-2) 50%, var(--brand-1) 100%); }
.site-footer__inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-7) var(--sp-5); max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding: clamp(36px, 5vw, 56px) var(--gutter) var(--sp-6); }
.site-footer__brand, .site-footer__col--site { grid-column: 1 / -1; }
.site-footer__brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); }
@media (min-width: 900px) {
  .site-footer__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__brand, .site-footer__col--site { grid-column: auto; }
  .site-footer__brand { flex-direction: column; align-items: flex-start; justify-content: flex-start; }
}
.site-footer__list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-footer__list--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--sp-5); }
.site-footer a:not(.btn) { color: var(--on-ink-muted); text-decoration: none; transition: color var(--dur-fast); }
.site-footer a:not(.btn):is(:hover, :focus-visible) { color: var(--gold); }
.site-footer p { margin: 0; color: inherit; }
/* after the generic footer p/a rules on purpose: (0,2,0)/(0,2,1) so the heading stays gold and the logo white */
.site-footer .site-footer__heading { margin: 0 0 var(--sp-3); color: var(--gold); font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--ls-caps); text-transform: uppercase; }
.site-footer a.site-logo { font-size: 1.5rem; color: #fff; }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-6); max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding: var(--sp-5) var(--gutter) calc(var(--sp-5) + env(safe-area-inset-bottom)); border-top: 1px solid var(--ink-600); color: var(--on-ink-subtle); font-size: var(--fs-xs); }

/* --- Breadcrumb --- */
.breadcrumb-nav { margin: 0; font-size: var(--fs-sm); line-height: 1.4; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; row-gap: 4px; margin: 0; padding: 0; list-style: none; }
.breadcrumb > li { display: inline-flex; align-items: center; min-width: 0; color: var(--text-muted); }
.breadcrumb > li + li::before { content: "\203A"; content: "\203A" / ""; margin: 0 8px; color: var(--text-subtle); }
.breadcrumb a { color: var(--text-muted); font-weight: 500; text-decoration: none; border-radius: 4px; }
.breadcrumb a:hover { color: var(--brand-1); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb [aria-current="page"] { color: var(--text-strong); font-weight: 600; }
.breadcrumb [aria-current="page"] > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(60vw, 520px); }

/* --- Page header (after the card block on purpose: beats .white-box on legacy div.white-box.page-header-box) --- */
.page-header, .page-header-box /* legacy hand-written headers */ {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: center;
  margin: 0;
  padding: clamp(24px, 3.4vw, 44px);
  overflow: hidden;
  color: var(--text);
  background: radial-gradient(90% 140% at 100% 0%, rgba(245,201,80,.14) 0%, rgba(245,201,80,0) 42%), var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.page-header::before, .page-header-box::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--gold) 0%, var(--brand-2) 55%, var(--brand-1) 100%); }
.page-header__media { width: 64px; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.page-header__media img { width: 100%; height: 100%; object-fit: cover; }
.page-header__body, .page-header-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
.page-header__aside { grid-column: 1 / -1; justify-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-width: 0; }   /* own full row below 900px */
@media (min-width: 640px) {
  .page-header.has-media { grid-template-columns: auto minmax(0, 1fr); }
  .page-header__media { width: clamp(72px, 8vw, 104px); }
}
@media (min-width: 900px) {
  .page-header.has-aside { grid-template-columns: minmax(0, 1fr) auto; }
  .page-header.has-media.has-aside { grid-template-columns: auto minmax(0, 1fr) auto; }
  .page-header__aside { grid-column: auto; justify-self: end; justify-content: flex-end; max-width: 420px; }
}
.page-kicker { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-1); font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--ls-caps); text-transform: uppercase; line-height: 1.3; }
.page-header .page-title, .page-header-box .page-title { margin: 0; font-family: var(--font-display); font-size: var(--fs-h1); line-height: var(--lh-tight); font-weight: 800; letter-spacing: var(--ls-tight); color: var(--text-strong); text-align: left; }
.page-header :is(.page-subtitle, .page-lead) { margin: 0; max-width: var(--measure); font-size: var(--fs-lead); line-height: 1.6; font-weight: 400; color: var(--text-muted); text-align: left; }
.page-header .page-lead p { margin: 0 0 .6em; }
.page-header .page-lead p:last-child { margin-bottom: 0; }
.page-header .copy-updated { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.page-header__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.page-header__stats { width: 100%; }
.page-header__actions { margin-top: var(--sp-1); }
.page-count-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-1); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
/* banner variant (download, 404) */
.page-header--banner {
  background: radial-gradient(80% 120% at 0% 0%, rgba(192,44,44,.30) 0%, rgba(192,44,44,0) 55%), linear-gradient(135deg, var(--ink-700) 0%, var(--ink-900) 100%);
  border-color: var(--ink-600);
  color: var(--on-ink);
  box-shadow: var(--shadow-md);
  padding: clamp(32px, 5vw, 64px);
}
.page-header--banner .page-title { color: #fff; }
.page-header--banner :is(.page-subtitle, .page-lead, .copy-updated) { color: #cfd4dc; }
.page-header--banner .page-kicker { color: var(--gold); background: rgba(245,201,80,.10); border-color: rgba(245,201,80,.32); }
.page-header--banner .meta-chip { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: var(--on-ink); }
.page-header--banner :is(.meta-chip__label) { color: var(--on-ink-muted); }
.page-header--banner .meta-chip__value { color: #fff; }
.page-header--banner :is(.page-lead, .page-subtitle) a:not(.btn) { color: var(--gold); text-decoration-color: rgba(245,201,80,.45); }

/* == UI 6. LEGACY == */
/* Old markup only; delete in Wave 4 once no template prints these. */
.copy-cta /* legacy container */ { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }
.news-archive-link /* legacy */ { display: flex; justify-content: center; }
.faq-block /* legacy servers */ { margin: 0; padding: 0; background: none; border: 0; }
/* servers-list header.page-header inside .server-intro-box until migrated */
:is(.white-box, .card) > .page-header { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
:is(.white-box, .card) > .page-header::before { display: none; }

/* == UI 7. UTILITIES == */
.sr-only,
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.text-end { text-align: end; }
.text-muted { color: var(--text-muted); }
.text-strong,
.text-accent { color: var(--text-strong); }
.tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.break-anywhere { overflow-wrap: anywhere; }
.mt-0 { margin-top: 0 !important; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.stack > * + * { margin-top: var(--stack-gap, var(--sp-4)); }
.on-ink { background: var(--ink-800); color: var(--on-ink); }
.col-20 { width: 20%; }
.col-25 { width: 25%; }
.col-30 { width: 30%; }
.col-32 { width: 32%; }
.col-40 { width: 40%; }
.col-50 { width: 50%; }
.col-60 { width: 60%; }
.col-68 { width: 68%; }
.col-70 { width: 70%; }

/* == UI 8. MOTION + PRINT == */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .site-header, .site-footer, .skip-link, .site-nav-backdrop, .cta-band { display: none !important; }
}
