/* =====================================================================
   IdeaSpark — design system
   Tokens → base → layout → components → pages → utilities
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f5f6fb;
  --bg-accent: #eceefe;
  --surface: #ffffff;
  --surface-2: #f3f4f9;
  --surface-3: #e8eaf3;
  --text: #151c2f;
  --text-muted: #566078;
  --text-subtle: #6b7489;
  --border: #e1e4ee;
  --border-strong: #c9cedd;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-text: #4338ca;
  --on-primary: #ffffff;

  --success: #15803d;
  --success-soft: #e7f8ee;
  --warning: #a0540a;
  --warning-soft: #fff4e0;
  --danger: #c62828;
  --danger-hover: #a91f1f;
  --danger-soft: #fdecec;
  --info-soft: #e8f1ff;

  --gold-1: #ffd54a;
  --gold-2: #e8a200;
  --silver-1: #eef1f6;
  --silver-2: #9aa4b5;
  --bronze-1: #f0b27a;
  --bronze-2: #b1652a;

  --chart-series: #2a78d6;
  --chart-series-soft: rgba(42, 120, 214, 0.14);
  --chart-grid: rgba(21, 28, 47, 0.07);
  --tooltip-bg: #151c2f;
  --tooltip-text: #ffffff;

  --focus: #6366f1;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(20, 25, 45, 0.06);
  --shadow-sm: 0 1px 3px rgba(20, 25, 45, 0.07), 0 1px 2px rgba(20, 25, 45, 0.04);
  --shadow: 0 6px 20px -6px rgba(20, 25, 45, 0.14), 0 2px 6px rgba(20, 25, 45, 0.05);
  --shadow-lg: 0 24px 48px -16px rgba(20, 25, 45, 0.25);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --speed: 180ms;

  --gutter: 16px;
  --container: 1200px;
  --topbar-h: 64px;

  /* status colours: background / foreground */
  --st-submitted-bg: #eef0f5;
  --st-submitted-fg: #465066;
  --st-under_review-bg: #e2edff;
  --st-under_review-fg: #1d4fc4;
  --st-needs_info-bg: #fff1d6;
  --st-needs_info-fg: #8a4a06;
  --st-appreciated-bg: #f4e8ff;
  --st-appreciated-fg: #7a24c4;
  --st-not_going-bg: #fde8e8;
  --st-not_going-fg: #b42121;
  --st-accepted-bg: #dff7e6;
  --st-accepted-fg: #13703a;
  --st-implemented-bg: #d9f3f7;
  --st-implemented-fg: #0b6475;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1120;
    --bg-accent: #141a33;
    --surface: #141a2b;
    --surface-2: #1b2236;
    --surface-3: #252d45;
    --text: #e9edf7;
    --text-muted: #a8b1c6;
    --text-subtle: #9099b0;
    --border: #283149;
    --border-strong: #3a4563;

    --primary: #8f8aff;
    --primary-hover: #a6a2ff;
    --primary-soft: #23264a;
    --primary-text: #b3b0ff;
    --on-primary: #0c1120;

    --success: #5fd68b;
    --success-soft: #12301f;
    --warning: #f5b454;
    --warning-soft: #33250f;
    --danger: #ff8a8a;
    --danger-hover: #ffa3a3;
    --danger-soft: #3a1717;
    --info-soft: #172542;

    --chart-series: #3987e5;
    --chart-series-soft: rgba(57, 135, 229, 0.2);
    --chart-grid: rgba(233, 237, 247, 0.08);
    --tooltip-bg: #e9edf7;
    --tooltip-text: #0c1120;

    --focus: #a6a2ff;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.7);

    --st-submitted-bg: rgba(148, 163, 184, 0.16);
    --st-submitted-fg: #cbd4e3;
    --st-under_review-bg: rgba(96, 165, 250, 0.16);
    --st-under_review-fg: #9cc6ff;
    --st-needs_info-bg: rgba(251, 191, 36, 0.15);
    --st-needs_info-fg: #fcd36b;
    --st-appreciated-bg: rgba(192, 132, 252, 0.16);
    --st-appreciated-fg: #dcbcff;
    --st-not_going-bg: rgba(248, 113, 113, 0.16);
    --st-not_going-fg: #ffabab;
    --st-accepted-bg: rgba(74, 222, 128, 0.14);
    --st-accepted-fg: #8ceaaf;
    --st-implemented-bg: rgba(34, 211, 238, 0.14);
    --st-implemented-fg: #7fe7f7;
  }
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (min-width: 1680px) { html { font-size: 106.25%; } }
@media (min-width: 2200px) { html { font-size: 118.75%; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--primary-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
code, kbd { font-family: var(--font-mono); font-size: 0.875em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--primary) 30%, transparent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Programmatic focus targets (skip link, pagination) need no ring. */
main[tabindex="-1"]:focus { outline: none; }

.icon { flex-shrink: 0; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--speed) var(--ease);
}
.skip-link:focus { top: 12px; color: var(--on-primary); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { --container: 1440px; }
.container--narrow { --container: 760px; }

main { flex: 1; outline: none; }
.page { padding-block: 28px 56px; }

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header h1 { margin: 0; }
.page-header__sub { margin: 6px 0 0; color: var(--text-muted); }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-weight: 550;
  text-decoration: none;
  font-size: 0.95rem;
}
.back-link:hover { color: var(--text); }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid--2 { grid-template-columns: minmax(0, 1fr); }
.grid--top { align-items: start; }
@media (min-width: 900px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.layout-split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) {
  .layout-split { grid-template-columns: minmax(0, 1fr) 360px; }
  .layout-split__side { position: sticky; top: calc(var(--topbar-h) + 60px); }
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--lg { gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }

.site-footer {
  padding: 24px 0 32px;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  margin-right: 12px;
}
.brand:hover { color: var(--text); }
.brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #f59e0b 130%);
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.7);
}

.topnav { display: none; order: 10; width: 100%; flex-direction: column; gap: 2px; padding-bottom: 12px; }
.topnav.is-open { display: flex; }
.topnav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.topnav__link:hover { background: var(--surface-2); color: var(--text); }
.topnav__link[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); }

.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar__me {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.925rem;
}
.topbar__me:hover { background: var(--surface-2); color: var(--text); }
.topbar__name { display: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__logout span { display: none; }

@media (min-width: 900px) {
  .btn.topbar__toggle { display: none; }
  .topnav { display: flex; order: 0; width: auto; flex-direction: row; padding: 0; gap: 4px; }
  .topnav__link { padding: 8px 12px; }
  .topbar__name { display: inline; }
  .topbar__logout span { display: inline; }
}

.subnav { border-top: 1px solid var(--border); }
.subnav__inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 6px;
}
.subnav__inner::-webkit-scrollbar { display: none; }
.subnav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.subnav__link:hover { color: var(--text); background: var(--surface-2); }
.subnav__link[aria-current="page"] { color: var(--on-primary); background: var(--primary); }
/* Phones: drop the icons and wrap instead of scrolling, so no section is ever hidden off-screen. */
@media (max-width: 559px) {
  .subnav__inner { flex-wrap: wrap; overflow-x: visible; gap: 2px; }
  .subnav__link { padding: 6px 8px; font-size: 0.85rem; }
  .subnav__link svg { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease),
    transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), color var(--speed) var(--ease);
  user-select: none;
}
.btn:hover { color: var(--btn-fg); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.btn--primary { --btn-bg: var(--primary); --btn-fg: var(--on-primary); --btn-border: transparent; box-shadow: 0 6px 14px -8px var(--primary); }
.btn--primary:hover:not(:disabled) { --btn-bg: var(--primary-hover); box-shadow: 0 10px 20px -10px var(--primary); }
.btn--secondary:hover:not(:disabled) { --btn-bg: var(--surface-2); }
.btn--ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--text-muted); }
.btn--ghost:hover:not(:disabled) { --btn-bg: var(--surface-2); --btn-fg: var(--text); }
.btn--danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: transparent; }
.btn--danger:hover:not(:disabled) { --btn-bg: var(--danger-hover); }
@media (prefers-color-scheme: dark) { .btn--danger { --btn-fg: #1a0707; } }
.btn--danger-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--danger); }
.btn--danger-ghost:hover:not(:disabled) { --btn-bg: var(--danger-soft); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 0.875rem; }
.btn--lg { min-height: 50px; padding: 12px 24px; font-size: 1.02rem; border-radius: var(--radius); }
.btn--block { width: 100%; }
.btn--icon { min-height: 40px; width: 40px; padding: 0; }
.btn--icon.btn--sm { min-height: 34px; width: 34px; }
.btn.is-done { --btn-fg: var(--success); }

.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.card--pad-lg { padding: 28px; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__title { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card__sub { margin: 2px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.card-section + .card-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

.stretched-link { color: inherit; text-decoration: none; }
.stretched-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.stretched-link:focus-visible { outline: none; }
.stretched-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field label, .label { font-weight: 650; font-size: 0.925rem; }
.field__optional { font-weight: 450; color: var(--text-muted); font-size: 0.85rem; }
.field__hint { margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.field__error {
  display: flex; align-items: center; gap: 6px;
  margin: 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 550;
  animation: fade-in 160ms var(--ease);
}
.field-row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.input--mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 48px; }
.input-group__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.input-icon { position: relative; flex: 1; min-width: 200px; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon .input { padding-left: 40px; }

.counter { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.counter--warn { color: var(--warning); font-weight: 650; }
.counter--short { color: var(--text-subtle); }

.form-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 550;
  font-size: 0.925rem;
  animation: shake 300ms var(--ease);
}
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; padding-top: 4px; }
.form-actions--start { justify-content: flex-start; }

/* switch */
.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative;
  flex-shrink: 0;
  width: 46px; height: 26px;
  margin-top: 2px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  transition: background var(--speed) var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed) var(--ease);
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: 0.5; }
.switch__text strong { display: block; font-weight: 650; }
.switch__text span { color: var(--text-muted); font-size: 0.9rem; }

/* range slider */
.range-field { display: flex; flex-direction: column; gap: 6px; }
.range-field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.range-field__value {
  min-width: 36px; text-align: center;
  font-weight: 800; font-size: 1.05rem;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}
.range-field__scale { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }
input[type="range"] {
  width: 100%;
  height: 28px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--primary); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px; margin-top: -8px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Chips, pills, badges ---------- */
.chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip--primary { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); }
.chip--danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.chip--success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.chip--mono { font-family: var(--font-mono); font-size: 0.78rem; }
.chip--team { gap: 5px; background: var(--info-soft); border-color: transparent; color: var(--text); }
.chip--team svg { flex-shrink: 0; color: var(--chart-series); }
.chip--team span { overflow: hidden; text-overflow: ellipsis; }

.pill {
  --pill-bg: var(--st-submitted-bg);
  --pill-fg: var(--st-submitted-fg);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--under_review { --pill-bg: var(--st-under_review-bg); --pill-fg: var(--st-under_review-fg); }
.pill--needs_info { --pill-bg: var(--st-needs_info-bg); --pill-fg: var(--st-needs_info-fg); }
.pill--appreciated { --pill-bg: var(--st-appreciated-bg); --pill-fg: var(--st-appreciated-fg); }
.pill--not_going { --pill-bg: var(--st-not_going-bg); --pill-fg: var(--st-not_going-fg); }
.pill--accepted { --pill-bg: var(--st-accepted-bg); --pill-fg: var(--st-accepted-fg); }
.pill--implemented { --pill-bg: var(--st-implemented-bg); --pill-fg: var(--st-implemented-fg); }
.pill--implemented .pill__dot { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 30%, transparent); }

.badge-row { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.badge-emoji {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1;
  cursor: default;
  transition: transform var(--speed) var(--ease);
}
.badge-emoji:hover { transform: scale(1.15) rotate(-6deg); }

/* ---------- Avatars ---------- */
.avatar {
  --size: 40px;
  width: var(--size); height: var(--size);
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
}
.avatar--xs { --size: 24px; font-size: 0.62rem; }
.avatar--sm { --size: 32px; font-size: 0.75rem; }
.avatar--md { --size: 44px; font-size: 0.95rem; }
.avatar--lg { --size: 72px; font-size: 1.5rem; }
.avatar--xl { --size: 112px; font-size: 2.3rem; }
.avatar--xxl { --size: 150px; font-size: 3rem; }
.avatar--initials {
  display: inline-grid; place-items: center;
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.02em;
  user-select: none;
}
.avatar--c0 { background: linear-gradient(135deg, #4f46e5, #6d28d9); }
.avatar--c1 { background: linear-gradient(135deg, #0f766e, #0e7490); }
.avatar--c2 { background: linear-gradient(135deg, #b45309, #c2410c); }
.avatar--c3 { background: linear-gradient(135deg, #be185d, #9d174d); }
.avatar--c4 { background: linear-gradient(135deg, #1d4ed8, #1e40af); }
.avatar--c5 { background: linear-gradient(135deg, #7e22ce, #6b21a8); }
.avatar--c6 { background: linear-gradient(135deg, #15803d, #166534); }
.avatar--c7 { background: linear-gradient(135deg, #c2410c, #9a3412); }
.avatar--c8 { background: linear-gradient(135deg, #0e7490, #155e75); }
.avatar--c9 { background: linear-gradient(135deg, #9f1239, #881337); }

/* ---------- Idea cards & votes ---------- */
.idea-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.idea-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.idea-card__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.idea-card__meta > .pill { margin-left: auto; }
.idea-card__title { margin: 2px 0 0; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.idea-card__summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.idea-card__footer { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.author-line { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-muted); font-size: 0.875rem; }
.author-line__name { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vote {
  position: relative;
  z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.vote:hover:not([aria-disabled="true"]) { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }
.vote.is-voted { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.vote.is-voted:hover { background: var(--primary-hover); color: var(--on-primary); }
.vote[aria-disabled="true"] { cursor: not-allowed; opacity: 0.6; border-style: dashed; }
.vote.is-bumping .icon { animation: bump 380ms var(--ease); }
@keyframes bump { 40% { transform: translateY(-5px) scale(1.2); } }
.vote--large { min-height: 56px; padding: 10px 22px 10px 16px; font-size: 1.15rem; width: 100%; justify-content: center; border-radius: var(--radius); }

/* ---------- Toolbar / filters ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.toolbar .select { width: auto; min-width: 150px; flex: 1 1 150px; }
.toolbar .input-icon { flex: 3 1 240px; }
.toolbar__check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.925rem; padding: 0 6px; cursor: pointer; }
.toolbar__check input { width: 18px; height: 18px; accent-color: var(--primary); }

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-weight: 650;
  font-size: 0.9rem;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.results-meta { margin: 0 0 12px; color: var(--text-muted); font-size: 0.9rem; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.pagination__info { color: var(--text-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--speed) var(--ease); }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover, .table tbody tr.is-clickable:focus-within { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table__title { font-weight: 650; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.table__title:hover { color: var(--primary-text); text-decoration: underline; }
.table__sub { display: block; color: var(--text-muted); font-size: 0.82rem; margin-top: 2px; }
.table__person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table__actions { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: wrap; }
.row-inactive td { opacity: 0.62; }
.overdue { color: var(--danger); font-weight: 650; }

@media (max-width: 760px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .table--stack td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
  }
  .table--stack td[data-label=""]::before { content: none; }
  .table--stack td.cell-main { display: block; text-align: left; padding-bottom: 8px; }
  .table--stack td.cell-main::before { content: none; }
  .table--stack .num { text-align: right; }
  .table--stack .table__actions { justify-content: flex-start; }
  .table--stack td > * { min-width: 0; }
  .table--stack td > details, .table--stack td > code { max-width: calc(100% - 5.5rem); }
  .json-preview, .json-full { max-width: 100%; }
}

/* ---------- KPI & stat tiles ---------- */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); margin-bottom: 24px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  color: inherit;
}
a.kpi { transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease); }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.85rem; font-weight: 650; }
.kpi__value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi__hint { color: var(--text-muted); font-size: 0.82rem; }
.kpi--alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: linear-gradient(180deg, var(--danger-soft), var(--surface) 80%); }
.kpi--alert .kpi__value, .kpi--alert .kpi__label { color: var(--danger); }
.kpi--good .kpi__value { color: var(--success); }

/* ---------- Charts ---------- */
.chart-box { position: relative; height: 280px; }
.chart-box--tall { height: 340px; }
.chart-box canvas { max-width: 100%; }
.chart-empty { display: grid; place-items: center; height: 100%; margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.chart-fallback { list-style: none; margin: 0; padding: 0; }
.chart-fallback li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding: 0 0 20px 40px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--border-strong);
}
.timeline__item--current .timeline__dot { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline__meta { color: var(--text-muted); font-size: 0.85rem; }
.timeline__comment {
  margin: 8px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
}

/* ---------- Notices ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  margin: 0;
  border-radius: var(--radius);
  background: var(--info-soft);
  color: var(--text);
  font-size: 0.925rem;
}
.notice .icon { margin-top: 2px; color: var(--primary-text); }
.notice--warning { background: var(--warning-soft); }
.notice--warning .icon { color: var(--warning); }
.notice--danger { background: var(--danger-soft); }
.notice--danger .icon { color: var(--danger); }
.notice--success { background: var(--success-soft); }
.notice--success .icon { color: var(--success); }
.notice strong { display: block; }
.notice p { margin: 4px 0 0; }

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed;
  z-index: 1000;
  right: 16px; left: 16px; bottom: 16px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none;
}
@media (min-width: 640px) { .toast-region { left: auto; width: 400px; bottom: 24px; right: 24px; } }
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius);
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  box-shadow: var(--shadow-lg);
  animation: toast-in 260ms var(--ease);
}
.toast__icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; background: rgba(127, 127, 127, 0.25); }
.toast--success .toast__icon { background: #16a34a; color: #fff; }
.toast--error .toast__icon { background: #dc2626; color: #fff; }
.toast--info .toast__icon { background: #4f46e5; color: #fff; }
.toast__message { margin: 2px 0 0; flex: 1; font-size: 0.925rem; font-weight: 550; }
.toast__close { border: 0; background: transparent; color: inherit; opacity: 0.7; padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.toast__close:hover { opacity: 1; }
.toast--leaving { animation: toast-out 200ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
.dialog--sm { width: min(460px, calc(100vw - 24px)); }
.dialog[open] { animation: dialog-in 220ms var(--ease); }
.dialog::backdrop { background: rgba(8, 12, 24, 0.55); backdrop-filter: blur(3px); animation: fade-in 200ms var(--ease); }
.dialog__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 20px 0 24px; }
.dialog__title { margin: 0; font-size: 1.2rem; }
.dialog__body { padding: 12px 24px 8px; display: flex; flex-direction: column; gap: 16px; }
.dialog__description { margin: 0; color: var(--text-muted); }
.dialog__footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 24px; flex-wrap: wrap; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes fade-in { from { opacity: 0; } }

.secret-box { display: flex; gap: 8px; }
.secret-box .input { font-size: 1.1rem; }

/* ---------- Skeletons, empty ---------- */
.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton--chip { width: 90px; height: 20px; border-radius: 99px; }
.skeleton--title { width: 70%; height: 20px; margin-top: 6px; }
.skeleton--line { width: 100%; height: 12px; margin-top: 10px; }
.skeleton--short { width: 55%; }
.skeleton--circle { border-radius: 50%; }
.skeleton-card { min-height: 180px; }
.skeleton-row td { padding-block: 16px; }
.skeleton-block { padding: 4px 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty { text-align: center; padding: 48px 20px; max-width: 460px; margin: 0 auto; }
.empty__art {
  width: 84px; height: 84px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 2.4rem;
  background: radial-gradient(circle at 30% 30%, var(--surface), var(--primary-soft));
  border: 1px solid var(--border);
  animation: float 4s ease-in-out infinite;
}
.empty__title { font-size: 1.15rem; margin-bottom: 6px; }
.empty__message { color: var(--text-muted); margin-bottom: 18px; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* =====================================================================
   Public leaderboard page
   ===================================================================== */
.public-page { background: var(--bg); }
.public-topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; }
.public-topbar .topbar__inner { flex-wrap: nowrap; }
.public-topbar__links { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 40px 0 36px;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto;
  height: 520px;
  z-index: -1;
  background:
    radial-gradient(40% 60% at 20% 30%, color-mix(in srgb, #6366f1 28%, transparent), transparent 70%),
    radial-gradient(35% 55% at 80% 20%, color-mix(in srgb, #f59e0b 22%, transparent), transparent 70%),
    radial-gradient(30% 50% at 55% 60%, color-mix(in srgb, #ec4899 14%, transparent), transparent 70%);
  filter: blur(10px);
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.hero__title {
  margin: 16px 0 10px;
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3.6rem);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(90deg, #6366f1, #a855f7 50%, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (prefers-color-scheme: dark) {
  .hero__title em { background: linear-gradient(90deg, #a5b4fc, #d8b4fe 50%, #fcd34d); -webkit-background-clip: text; background-clip: text; }
}
.hero__lead { max-width: 620px; color: var(--text-muted); font-size: 1.08rem; margin-bottom: 28px; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stat {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat:first-child { grid-column: span 2; }
@media (min-width: 640px) { .stat:first-child { grid-column: auto; } }
.stat__value { display: block; font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); font-weight: 850; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat__label { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; margin-top: 4px; }
.stat__emoji { font-size: 1rem; }

.section { padding: 28px 0; }
.section__header { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.section__title { margin: 0; font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem); font-weight: 800; }
.section__meta { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 0.85rem; }

.leaderboard { padding: 18px 16px; }
@media (min-width: 768px) { .leaderboard { padding: 32px; } }

/* Podium: always 2-1-3 on a stage, scaled down on small screens */
.podium {
  list-style: none;
  margin: 8px 0 12px;
  padding: 36px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}
.podium__place--2 { order: 1; }
.podium__place--1 { order: 2; }
.podium__place--3 { order: 3; }
.podium:has(> :only-child) { grid-template-columns: minmax(0, 340px); justify-content: center; }
.podium:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 300px)); justify-content: center; }
@media (min-width: 680px) {
  .podium { display: flex; justify-content: center; align-items: flex-end; gap: 20px; }
  .podium__place { flex: 0 1 340px; min-width: 0; }
}
.podium__place {
  --ring-1: var(--silver-1);
  --ring-2: var(--silver-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: rise 600ms var(--ease) both;
}
.podium__place--1 { --ring-1: var(--gold-1); --ring-2: var(--gold-2); animation-delay: 120ms; }
.podium__place--3 { --ring-1: var(--bronze-1); --ring-2: var(--bronze-2); animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.podium__photo {
  position: relative;
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--ring-1), var(--ring-2), var(--ring-1), var(--ring-2), var(--ring-1));
  box-shadow: 0 16px 36px -14px var(--ring-2);
}
.podium__photo .avatar { --size: 72px; border: 3px solid var(--surface); font-size: 1.5rem; }
.podium__place--1 .podium__photo .avatar { --size: 96px; font-size: 2rem; }
@media (min-width: 680px) {
  .podium__photo .avatar { --size: 104px; border-width: 4px; font-size: 2.2rem; }
  .podium__place--1 .podium__photo .avatar { --size: 148px; font-size: 3rem; }
}
@media (min-width: 1400px) {
  .podium__photo .avatar { --size: 128px; }
  .podium__place--1 .podium__photo .avatar { --size: 180px; }
}
.podium__crown {
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%) rotate(-8deg);
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
  animation: crown 3s ease-in-out infinite;
}
@keyframes crown { 50% { transform: translateX(-50%) rotate(6deg) translateY(-3px); } }
.podium__medal {
  position: absolute;
  bottom: -4px; right: 4px;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-weight: 850;
  color: #3b2a00;
  background: linear-gradient(135deg, var(--ring-1), var(--ring-2));
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}
.podium__place--2 .podium__medal { color: #2a3140; }
.podium__place--3 .podium__medal { color: #3a1d06; }
.podium__place--1 .podium__medal { width: 46px; height: 46px; font-size: 1.2rem; }
.podium__name { margin: 12px 0 0; font-size: 0.95rem; line-height: 1.25; font-weight: 800; overflow-wrap: break-word; max-width: 100%; }
.podium__place--1 .podium__name { font-size: 1.05rem; }
.podium__dept { color: var(--text-muted); font-size: 0.78rem; min-height: 1.4em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .badge-row { justify-content: center; flex-wrap: wrap; }
@media (max-width: 679px) {
  .podium__medal { width: 28px; height: 28px; font-size: 0.8rem; border-width: 2px; right: 0; }
  .podium__place--1 .podium__medal { width: 34px; height: 34px; font-size: 0.95rem; }
  .podium__crown { top: -24px; font-size: 1.6rem; }
  .podium__points { font-size: 0.95rem; padding: 2px 10px; margin: 6px 0; }
  .podium__place--1 .podium__points { font-size: 1.1rem; }
  .podium .badge-row { display: none; }
}
@media (min-width: 680px) {
  .podium__name { margin-top: 16px; font-size: 1.15rem; }
  .podium__place--1 .podium__name { font-size: 1.4rem; }
  .podium__dept { font-size: 0.9rem; }
}
.podium__points {
  display: inline-flex; align-items: baseline; gap: 4px;
  margin: 8px 0;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 850;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.podium__points small { font-size: 0.75rem; font-weight: 700; }
.podium__place--1 .podium__points { font-size: 1.45rem; }
.podium__block {
  width: 100%;
  margin-top: 12px;
  height: 44px;
  border-radius: var(--radius) var(--radius) 6px 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ring-1) 55%, var(--surface)), color-mix(in srgb, var(--ring-2) 25%, var(--surface-2)));
  border: 1px solid color-mix(in srgb, var(--ring-2) 35%, var(--border));
}
@media (min-width: 680px) {
  .podium__block { height: 70px; }
  .podium__place--1 .podium__block { height: 110px; }
  .podium__place--3 .podium__block { height: 48px; }
}
@media (max-width: 679px) {
  .podium__place--1 .podium__block { height: 68px; }
  .podium__place--3 .podium__block { height: 28px; }
}

/* Ranked list */
.ranking { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-row {
  display: grid;
  grid-template-columns: 30px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease), background var(--speed) var(--ease);
}
.rank-row:hover { border-color: var(--border-strong); background: var(--surface); transform: translateX(2px); }
.rank-row__rank { font-weight: 800; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: center; }
.rank-row__who { min-width: 0; }
.rank-row__name { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row__dept { display: block; color: var(--text-muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row__stats { display: none; color: var(--text-muted); font-size: 0.85rem; gap: 14px; }
.rank-row__stats span { white-space: nowrap; }
.rank-row__badges { display: none; }
.rank-row__points { font-weight: 850; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rank-row__points small { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; margin-left: 2px; }
@media (min-width: 760px) {
  .rank-row { grid-template-columns: 44px auto minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1fr) 110px; padding: 12px 18px; }
  .rank-row__stats { display: grid; grid-template-columns: 5.5rem 2.75rem 2.75rem; gap: 10px; }
  .rank-row__badges { display: flex; }
}

/* Team leaderboard */
.section--tight { padding-top: 0; }
.team-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.team-row {
  --medal: var(--surface-3);
  --medal-text: var(--text-muted);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.team-row--1 { --medal: linear-gradient(135deg, var(--gold-1), var(--gold-2)); --medal-text: #3d2a00; }
.team-row--2 { --medal: linear-gradient(135deg, var(--silver-1), var(--silver-2)); --medal-text: #1f2633; }
.team-row--3 { --medal: linear-gradient(135deg, var(--bronze-1), var(--bronze-2)); --medal-text: #2e1604; }
.team-row__rank {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--medal);
  color: var(--medal-text);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.team-row__main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.team-row__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.team-row__name { font-weight: 750; min-width: 0; overflow-wrap: anywhere; }
.team-row__members { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.team-row__bar { display: block; width: 100%; height: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.team-row__bar rect { fill: var(--chart-series); }
.team-row--1 .team-row__bar rect { fill: var(--gold-2); }
.team-row__stats { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-muted); font-size: 0.8rem; }
.team-row__stats span { white-space: nowrap; }
.team-row__points { font-weight: 850; font-size: 1.1rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.team-row__points small { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; margin-left: 2px; }
@media (min-width: 760px) {
  .team-row { grid-template-columns: 44px minmax(0, 1fr) 120px; padding: 14px 18px; gap: 16px; }
  .team-row__rank { width: 40px; height: 40px; }
  .team-row__main { display: grid; grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr); grid-template-areas: "head bar" "stats bar"; column-gap: 20px; row-gap: 2px; align-items: center; }
  .team-row__head { grid-area: head; }
  .team-row__stats { grid-area: stats; }
  .team-row__bar { grid-area: bar; height: 12px; }
  .team-row__points { font-size: 1.25rem; }
}

/* Charts grid: a card that spans both columns */
@media (min-width: 900px) { .grid--2 > .grid__wide { grid-column: 1 / -1; } }

.podium-skeleton { display: flex; justify-content: center; gap: 24px; align-items: flex-end; padding: 20px 0; }
.podium-skeleton .skeleton--circle:nth-child(1) { width: 96px; height: 96px; }
.podium-skeleton .skeleton--circle:nth-child(2) { width: 140px; height: 140px; }
.podium-skeleton .skeleton--circle:nth-child(3) { width: 96px; height: 96px; }

/* Wins */
.wins { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.win-card {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.win-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--st-accepted-fg), var(--chart-series)); }
.win-card--implemented::before { background: linear-gradient(90deg, var(--st-implemented-fg), var(--gold-2)); }
.win-card__title { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.win-card__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.win-card__footer { margin-top: auto; }

.public-cta {
  margin: 12px 0 8px;
  padding: 32px 24px;
  text-align: center;
  border-radius: var(--radius-xl);
  color: #fff;
  background: linear-gradient(135deg, #4338ca, #7c3aed 60%, #b45309 140%);
  box-shadow: var(--shadow-lg);
}
.public-cta h2 { color: #fff; font-size: 1.5rem; }
.public-cta p { color: rgba(255, 255, 255, 0.88); margin-bottom: 18px; }
.public-cta .btn { --btn-bg: #fff; --btn-fg: #3730a3; --btn-border: transparent; }
.public-cta .btn:hover { --btn-bg: #eef2ff; }

/* =====================================================================
   Auth pages (login / change password)
   ===================================================================== */
.auth {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
@media (min-width: 960px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth__aside {
  display: none;
  position: relative;
  overflow: hidden;
  padding: 48px;
  color: #fff;
  background: linear-gradient(145deg, #312e81 0%, #5b21b6 55%, #9a3412 120%);
}
@media (min-width: 960px) { .auth__aside { display: flex; flex-direction: column; justify-content: space-between; } }
.auth__aside::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  right: -180px; bottom: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.45), transparent 65%);
}
.auth__aside .brand { color: #fff; }
.auth__aside .brand__mark { background: rgba(255, 255, 255, 0.18); box-shadow: none; }
.auth__pitch { position: relative; z-index: 1; max-width: 460px; }
.auth__pitch h2 { font-size: 2.4rem; font-weight: 850; letter-spacing: -0.03em; line-height: 1.1; color: #fff; }
.auth__pitch p { color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; }
.auth__list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth__list li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.auth__list span[aria-hidden] { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.15); }
.auth__main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px var(--gutter); }
.auth__card { width: 100%; max-width: 420px; }
.auth__card .brand { margin-bottom: 28px; }
@media (min-width: 960px) { .auth__card > .brand { display: none; } }
.auth__title { font-size: 1.9rem; font-weight: 800; margin-bottom: 6px; }
.auth__lead { color: var(--text-muted); margin-bottom: 24px; }
.auth__foot { margin-top: 24px; color: var(--text-muted); font-size: 0.9rem; text-align: center; }

.checklist { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; font-size: 0.875rem; }
.checklist li { display: flex; align-items: center; gap: 8px; color: var(--text-muted); transition: color var(--speed) var(--ease); }
.checklist li::before {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease);
  flex-shrink: 0;
}
.checklist li.is-met { color: var(--success); font-weight: 600; }
.checklist li.is-met::before {
  border-color: var(--success);
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

/* =====================================================================
   App pages
   ===================================================================== */
.greeting { font-size: 0.95rem; color: var(--text-muted); margin: 0 0 4px; font-weight: 600; }

/* Idea detail */
.idea-detail__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.idea-detail__title { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); font-weight: 800; letter-spacing: -0.025em; overflow-wrap: anywhere; }
.idea-detail__author { display: flex; align-items: center; gap: 12px; margin: 18px 0 4px; }
.idea-detail__author strong { display: block; }
.idea-detail__author div > span { color: var(--text-muted); font-size: 0.875rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1.02rem; line-height: 1.7; margin: 0; }
.section-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 750; margin: 0 0 10px; }
.benefit {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--success-soft), var(--surface) 140%);
  border: 1px solid color-mix(in srgb, var(--success) 22%, var(--border));
}
.vote-panel { text-align: center; }
.vote-panel__hint { margin: 10px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }

/* Profile */
.profile-hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.profile-hero__photo { position: relative; }
.profile-hero__info { flex: 1; min-width: 220px; }
.profile-hero__info h1 { margin-bottom: 4px; }
.profile-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.points-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .points-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.points-tile { padding: 16px; border-radius: var(--radius); background: var(--surface-2); }
.points-tile--hero { background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff; }
@media (prefers-color-scheme: dark) { .points-tile--hero { background: linear-gradient(135deg, #4338ca, #6d28d9); } }
.points-tile__value { display: block; font-size: 1.9rem; font-weight: 850; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.points-tile__label { font-size: 0.85rem; font-weight: 650; opacity: 0.85; }

.badges-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.badge-tile {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 18px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--speed) var(--ease);
}
.badge-tile__icon { font-size: 2rem; line-height: 1; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); }
.badge-tile__name { font-weight: 750; font-size: 0.95rem; }
.badge-tile__rule { color: var(--text-muted); font-size: 0.8rem; }
.badge-tile--earned { border-color: color-mix(in srgb, var(--gold-2) 50%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--gold-1) 16%, var(--surface)), var(--surface)); }
.badge-tile--earned .badge-tile__icon { background: radial-gradient(circle, color-mix(in srgb, var(--gold-1) 45%, transparent), transparent 70%); }
.badge-tile--earned:hover { transform: translateY(-3px); }
.badge-tile--locked .badge-tile__icon { filter: grayscale(1); opacity: 0.45; }
.badge-tile--locked .badge-tile__name { color: var(--text-muted); }
.badge-tile__state { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.badge-tile--earned .badge-tile__state { color: var(--success); }

.status-group + .status-group { margin-top: 18px; }
.status-group__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.status-group__count { color: var(--text-muted); font-size: 0.85rem; font-weight: 650; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-item {
  position: relative;
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: background var(--speed) var(--ease);
}
.mini-item:hover { background: var(--surface-3); }
.mini-item__title { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item__meta { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }

.settings-list { display: flex; flex-direction: column; gap: 16px; }

/* Admin */
.score-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--primary-soft);
}
.score-summary__avg { font-size: 2.2rem; font-weight: 850; color: var(--primary-text); font-variant-numeric: tabular-nums; line-height: 1; }
.score-summary__text { font-size: 0.9rem; color: var(--text-muted); }
.score-summary__text strong { color: var(--text); display: block; }
.voter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.voter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: var(--radius-pill); background: var(--surface-2); font-size: 0.85rem; font-weight: 600; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 0.925rem; }
.dl dt { color: var(--text-muted); font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl--stacked { grid-template-columns: minmax(0, 1fr); gap: 2px; margin-top: 16px; }
.dl--stacked dt { font-size: 0.8rem; }
.dl--stacked dd + dt { margin-top: 10px; }

.pending-list { list-style: none; margin: 0; padding: 0; }
.pending-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pending-item:last-child { border-bottom: 0; }
.pending-item__body { flex: 1; min-width: 0; }
.pending-item__title { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-item__meta { color: var(--text-muted); font-size: 0.85rem; }
/* Phones: status and age move to their own row under the title, so the title gets the full width. */
@media (max-width: 559px) {
  .pending-item { flex-wrap: wrap; row-gap: 8px; }
  .pending-item__body { flex-basis: calc(100% - 44px); } /* 32px avatar + 12px gap */
  .pending-item > .pill { margin-left: 44px; }
}
.age-tag { flex-shrink: 0; font-size: 0.8rem; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-muted); }
.age-tag--overdue { background: var(--danger-soft); color: var(--danger); }

.category-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.category-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px 14px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.category-item > .field { grid-column: 1 / -1; margin: 0; }
@media (min-width: 640px) {
  .category-item { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .category-item > .field { grid-column: auto; }
}
.category-item .input { min-height: 40px; }
.category-item--inactive .input { color: var(--text-muted); }
.category-item__count { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; min-width: 4.5rem; text-align: right; }
.category-list--wide-count .category-item__count { white-space: normal; text-align: left; min-width: 0; }
@media (min-width: 640px) { .category-list--wide-count .category-item__count { white-space: nowrap; text-align: right; min-width: 9.5rem; } }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; }
.inline-form > .field { flex: 1 1 220px; margin: 0; min-width: 0; }
.inline-form > .form-alert { flex-basis: 100%; }
.inline-form > .btn { min-height: 44px; }

.points-form { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.points-form .input { font-variant-numeric: tabular-nums; font-weight: 700; }

.json-details summary { cursor: pointer; color: var(--primary-text); font-size: 0.85rem; font-weight: 600; }
.json-preview {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.json-full {
  margin: 8px 0 0;
  padding: 10px;
  max-width: 480px;
  max-height: 260px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
}

/* Privacy page */
.doc { padding-block: 32px 64px; }
.doc h1 { margin-bottom: 8px; }
.doc h2 { margin-top: 32px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 6px; }
.doc .card { margin-top: 20px; }

/* ---------- Page reveal ---------- */
.fade-in { animation: fade-up 360ms var(--ease) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Forced colours ---------- */
@media (forced-colors: active) {
  .pill, .chip, .vote, .btn { border: 1px solid CanvasText; }
  .switch__track { border: 1px solid CanvasText; }
}

/* stat tiles are <div><dt/><dd/></div>: show value above label */
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.stat__value { margin: 0; }
.stats { margin: 0; }
.badges-grid { list-style: none; margin: 0; padding: 0; }
.row--center { justify-content: center; }

.wins > .empty { grid-column: 1 / -1; }

/* Submit/edit page: breathing room around the optional notice and the tips */
#form-notice:not(:empty) { margin-bottom: 16px; }
#form-card + .notice { margin-top: 16px; }
