/* ══════════════════════════════════════════════════════════════════
   aura — give or take the glow
   A light, luminous interface. White cards floating over a living
   aurora, friendly rounded geometry, real motion. The aurora is the
   signature; aura values themselves stay monochrome with a ▲/▼ caret.
   ══════════════════════════════════════════════════════════════════ */

/* ─── Reset ─── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Tokens ─── */

:root {
  /* Signature aurora */
  --aurora: linear-gradient(110deg, #7CF3B0 0%, #58E1FF 34%, #A98BFF 67%, #FF97CE 100%);
  --aurora-2: linear-gradient(135deg, #8DF6BE, #5FD9FF 40%, #B79BFF 72%, #FFA9D6);

  /* Base */
  --bg: #eef0f6;
  --card: #ffffff;
  --card-2: #f7f8fb;
  --inset: #eef0f5;

  /* Ink & text */
  --ink: #191922;
  --muted: #63636f;
  --faint: #9a9aa6;

  /* Lines — used sparingly, never as primary structure */
  --line: rgba(20, 22, 40, 0.08);
  --line-strong: rgba(20, 22, 40, 0.16);

  /* Shadows — one cool-tinted elevation system */
  --shadow-sm: 0 1px 2px rgba(24, 26, 54, 0.05), 0 3px 10px rgba(24, 26, 54, 0.05);
  --shadow-md: 0 2px 4px rgba(24, 26, 54, 0.04), 0 12px 28px rgba(24, 26, 54, 0.09);
  --shadow-lg: 0 8px 16px rgba(24, 26, 54, 0.06), 0 32px 64px rgba(24, 26, 54, 0.16);
  --glow: 0 0 24px rgba(96, 200, 255, 0.45);

  /* Focus */
  --focus-ring: 0 0 0 3px rgba(96, 180, 255, 0.35);

  /* Solid ("ink") buttons — flip in dark so they stay high-contrast */
  --btn-solid-bg: var(--ink);
  --btn-solid-fg: #ffffff;

  /* Bars (header + bottom nav) are the INVERSE of the theme, so they pop.
     Light theme → dark bars; dark theme → light bars. */
  --header-bg: rgba(13, 14, 20, 0.88);
  --header-fg: #f3f3f8;
  --header-line: rgba(255, 255, 255, 0.10);
  --bar-chip: rgba(255, 255, 255, 0.12);
  --bar-chip-hover: rgba(255, 255, 255, 0.2);

  /* Radius — concentric: inner always clearly smaller than its container */
  --r-lg: 22px;   /* panels & cards */
  --r-md: 15px;   /* buttons, inputs, inner modules */
  --r-thumb: 12px;/* person thumbnails */
  --r-sm: 10px;   /* chips */
  --pill: 999px;

  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --maxw: 1140px;

  /* ── Legacy aliases so inline styles in app.js keep resolving ── */
  --paper: var(--bg);
  --surface: var(--card);
  --surface-2: var(--card-2);
  --surface-3: var(--inset);
  --surface-strong: var(--card-2);
  --surface-muted: var(--inset);
  --bg-lift: var(--card);
  --light-bg: var(--card);
  --border: var(--line);
  --border-hover: var(--line-strong);
  --text: var(--ink);
  --text-muted: var(--muted);
  --text-dim: var(--faint);
  --green: var(--ink);
  --red: var(--ink);
  --orange: var(--muted);
  --cyan: var(--ink);
  --shadow: var(--shadow-lg);
  --font-body: var(--font);
  --font-mono: var(--font);
  --font-serif: var(--font);
  --radius: var(--r-md);
  --radius-lg: var(--r-lg);
}

/* ─── Dark theme — the aurora shines brightest on a night sky ─── */
:root[data-theme="dark"] {
  --bg: #131420;
  --card: #1c1d2b;
  --card-2: #24263a;
  --inset: #2b2d44;

  --ink: #f1f2f8;
  --muted: #a3a4b8;
  --faint: #6c6e86;

  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 3px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.42), 0 14px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5), 0 40px 72px rgba(0, 0, 0, 0.55);
  --glow: 0 0 24px rgba(96, 200, 255, 0.5);

  --focus-ring: 0 0 0 3px rgba(120, 190, 255, 0.42);

  --btn-solid-bg: #f1f2f8;
  --btn-solid-fg: #16171f;

  --header-bg: rgba(241, 242, 248, 0.82);
  --header-fg: #191a22;
  --header-line: rgba(18, 19, 30, 0.10);
  --bar-chip: rgba(18, 19, 30, 0.07);
  --bar-chip-hover: rgba(18, 19, 30, 0.13);
}

/* Follow the OS preference until the visitor picks a theme explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131420;
    --card: #1c1d2b;
    --card-2: #24263a;
    --inset: #2b2d44;

    --ink: #f1f2f8;
    --muted: #a3a4b8;
    --faint: #6c6e86;

    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 3px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.42), 0 14px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5), 0 40px 72px rgba(0, 0, 0, 0.55);
    --glow: 0 0 24px rgba(96, 200, 255, 0.5);

    --focus-ring: 0 0 0 3px rgba(120, 190, 255, 0.42);

    --btn-solid-bg: #f1f2f8;
    --btn-solid-fg: #16171f;

    --header-bg: rgba(241, 242, 248, 0.82);
    --header-fg: #191a22;
    --header-line: rgba(18, 19, 30, 0.10);
    --bar-chip: rgba(18, 19, 30, 0.07);
    --bar-chip-hover: rgba(18, 19, 30, 0.13);
  }
}

/* ─── Base ─── */

html { -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss03" 1;
  letter-spacing: -0.011em;
  line-height: 1.45;
}

/* Living aurora — a single cohesive glow anchored to the top, drifting slowly */
body::before {
  content: "";
  position: fixed;
  top: -12vh;
  left: -10vw;
  right: -10vw;
  height: 96vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 46% at 18% 8%, rgba(124, 243, 176, 0.55), transparent 66%),
    radial-gradient(42% 48% at 48% -6%, rgba(88, 225, 255, 0.50), transparent 64%),
    radial-gradient(40% 50% at 76% 6%, rgba(169, 139, 255, 0.48), transparent 66%),
    radial-gradient(34% 42% at 96% 22%, rgba(255, 151, 206, 0.40), transparent 64%);
  filter: blur(40px) saturate(125%);
  opacity: 0.82;
  animation: auroraDrift 24s ease-in-out infinite alternate;
}

button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ─── Scrollbar ─── */

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(20, 22, 40, 0.18);
  border-radius: var(--pill);
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(20, 22, 40, 0.3); background-clip: padding-box; }

/* ─── Motion ─── */

@keyframes fadeUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes metricFade {
  0%   { opacity: 0; transform: translateY(6px); }
  14%, 86% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0.85; }
}
@keyframes loadingFade {
  0%, 100% { opacity: 0.3; transform: scale(0.82); }
  50% { opacity: 0.75; transform: scale(1); }
}
@keyframes auroraSpin { to { transform: rotate(360deg); } }
@keyframes auroraDrift {
  0%   { transform: translate3d(-2%, 0, 0) scale(1.04); filter: blur(40px) saturate(125%) hue-rotate(0deg); }
  100% { transform: translate3d(2%, 1.5%, 0) scale(1.12); filter: blur(46px) saturate(135%) hue-rotate(22deg); }
}
@keyframes marquee { to { transform: translateX(-25%); } }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.anim-fade-up { animation: fadeUp 0.28s ease-out both; }
.anim-slide-down { animation: slideDown 0.22s ease both; }

/* ─── Icons ─── */

.icon { width: 16px; height: 16px; display: block; color: inherit; flex: 0 0 auto; }
.oauth-icon { flex-shrink: 0; }

/* ─── Aura value (monochrome caret + magnitude) ─── */

.aura {
  display: inline-flex;
  align-items: center;
  gap: 0.32em;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.aura--zero { color: var(--faint); }
.aura--up::before,
.aura--down::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 0.3em solid transparent;
  border-right: 0.3em solid transparent;
}
.aura--up::before   { border-bottom: 0.38em solid currentColor; margin-bottom: 0.06em; }
.aura--down::before { border-top: 0.38em solid currentColor; margin-top: 0.06em; }

/* ─── App shell ─── */

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */

.header {
  position: sticky;
  top: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(var(--maxw), calc(100% - 32px));
  margin: 12px auto 0;
  padding: 9px 10px 9px 16px;
  border-radius: var(--pill);
  background: var(--header-bg);
  border: 1px solid var(--header-line);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 0;
  background: none;
  border: none;
  color: var(--header-fg);
  cursor: pointer;
}

/* Aurora halo — the signature mark. A boreal ring (SVG blob) whose thickness
   swells unevenly around a clean circular core, slowly turning. */
.logo-orbit { width: 24px; height: 24px; flex-shrink: 0; display: block; }
.aurora-mark {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 2.5px rgba(120, 190, 255, 0.5));
}
.header-logo > span:last-child {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--header-fg);
}

.header-statement {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.header-statement-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee 34s linear infinite;
}
/* Each copy carries its own trailing gap, so every copy is one equal unit and
   translating by exactly one copy (-25% of the 4 copies) loops seamlessly —
   the next phrase is always already there on the right. */
.header-statement-track span {
  flex-shrink: 0;
  padding-right: 56px;
  white-space: nowrap;
  color: var(--header-fg);
  opacity: 0.7;
  font-size: 13px;
  font-weight: 500;
}
.header-statement:hover .header-statement-track { animation-play-state: paused; }

.header-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* Theme toggle */
.header-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--pill);
  background: var(--bar-chip);
  color: var(--header-fg);
  cursor: pointer;
  transition: background 0.15s;
}
.header-toggle:hover { background: var(--bar-chip-hover); }
.header-toggle .icon { width: 16px; height: 16px; }

.header-points {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--header-fg);
  padding: 8px 14px;
  border-radius: var(--pill);
  background: var(--bar-chip);
  font-variant-numeric: tabular-nums;
}

/* ─── Content ─── */

.content {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 24px) 128px;
}

/* ─── Bottom nav ─── */

.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 4px;
  width: min(320px, calc(100% - 32px));
  padding: 6px;
  background: var(--header-bg);
  border: 1px solid var(--header-line);
  border-radius: var(--pill);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.bottom-nav:has(.nav-btn:only-child) { display: none; }

.nav-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: none;
  border: none;
  border-radius: var(--pill);
  color: var(--header-fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, opacity 0.18s, transform 0.12s;
}
.nav-btn .icon { width: 16px; height: 16px; }
/* Active pill = a chip the colour of the theme's base surface, so it pops on the inverse bar */
.nav-btn--active { background: var(--header-fg); color: var(--ink); }
.nav-btn--inactive { opacity: 0.58; }
.nav-btn--inactive:hover { opacity: 1; }
.nav-btn:active { transform: scale(0.97); }

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 600;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s;
}
.btn:active { transform: translateY(1px) scale(0.995); }

.btn--primary { background: var(--btn-solid-bg); color: var(--btn-solid-fg); }
.btn--primary:hover { box-shadow: var(--shadow-md); }

/* Vote actions: solid ink (direction lives in the caret + label) */
.btn--green,
.btn--red { background: var(--btn-solid-bg); color: var(--btn-solid-fg); }
.btn--green:hover,
.btn--red:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.btn--disabled {
  background: var(--inset);
  color: var(--faint);
  cursor: not-allowed;
  box-shadow: none;
}
.btn--disabled:active { transform: none; }

/* Aurora CTA — the signature action */
.btn.aurora-cta {
  background: var(--aurora);
  color: #16171f; /* fixed dark: the aurora is always a light pastel */
  font-weight: 700;
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.btn.aurora-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.btn--ghost {
  width: auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  padding: 0;
  cursor: pointer;
}
.btn--ghost:hover { color: var(--ink); }

.btn--back {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--pill);
  margin-bottom: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.15s, transform 0.15s;
}
.btn--back:hover { color: var(--ink); transform: translateX(-2px); }

.btn--logout {
  background: var(--card);
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.btn--logout:hover { color: var(--ink); box-shadow: var(--shadow-md); }

/* OAuth */
.btn--google {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  margin-bottom: 10px;
}
.btn--google:hover { box-shadow: var(--shadow-md); }
.btn--github { background: var(--btn-solid-bg); color: var(--btn-solid-fg); text-decoration: none; }
.btn--github:hover { box-shadow: var(--shadow-md); }

/* ─── Inputs ─── */

.input {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: transparent; box-shadow: var(--focus-ring); }

/* ─── Onboarding / registration ─── */

.reg-title { font-size: 22px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; }
.reg-subtitle { color: var(--ink); font-size: 13px; line-height: 1.5; }

/* ─── Country grid ─── */

.country-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 0 3px 0 0;
  margin-bottom: 18px;
  scrollbar-color: var(--line-strong) #fff;
  scrollbar-width: thin;
}
.country-grid::-webkit-scrollbar { width: 8px; }
.country-grid::-webkit-scrollbar-track { background: #fff; }
.country-grid::-webkit-scrollbar-thumb {
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--line-strong);
  background-clip: padding-box;
}
.country-btn {
  min-width: 0;
  padding: 10px 12px;
  background: var(--card-2);
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
}
.country-btn:hover { background: var(--inset); }
.country-btn--selected {
  background: var(--ink);
  color: var(--card);
}

/* ─── Cards ─── */

.card,
.filter-panel,
.pulse-rotator,
.suggested-block,
.leaderboard-panel,
.breakdown-card,
.vote-card,
.points-card,
.contribution-card,
.most-voted-card,
.profile-extreme,
.figure-nav-btn {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}

/* ─── Search ─── */

.search-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 12px;
}
.search-bar {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  gap: 11px;
  background: var(--card);
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
}
.search-bar--focused { box-shadow: var(--focus-ring), var(--shadow-md); transform: translateY(-1px); }
.search-icon { display: flex; flex: 0 0 auto; align-items: center; color: var(--faint); }
.search-icon .icon { width: 16px; height: 16px; }
.search-input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  padding: 12px 0;
  font-size: 16px; /* >=16px so iOS doesn't zoom the page on focus */
  background: transparent;
  border: none;
  color: var(--ink);
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-input::placeholder { color: var(--faint); }
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 4px;
}
.search-clear:hover { color: var(--ink); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.search-result {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.12s;
}
.search-result:hover,
.search-result--active { background: var(--card-2); }
.search-result-img {
  width: 42px;
  height: 42px;
  border-radius: var(--r-thumb);
  object-fit: cover;
  background: var(--inset);
  flex-shrink: 0;
}
.search-result-name { font-size: 14.5px; font-weight: 600; }
.search-hl { background: rgba(96, 180, 255, 0.22); color: inherit; border-radius: 4px; padding: 0 1px; }

/* Search states: loading skeleton, empty, keyboard hint */
.search-skeleton { display: flex; flex-direction: column; }
.search-skel { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.search-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.search-skel-img { width: 42px; height: 42px; border-radius: var(--r-thumb); flex-shrink: 0; }
.search-skel-l1 { height: 10px; width: 58%; border-radius: 5px; }
.search-skel-l2 { height: 9px; width: 36%; border-radius: 5px; }
.search-skel-img, .search-skel-l1, .search-skel-l2 { background: var(--inset); animation: skelPulse 1.3s ease-in-out infinite; }
@keyframes skelPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.search-empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.search-error { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.search-retry {
  border: none;
  border-radius: var(--pill);
  padding: 7px 16px;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.search-retry:hover { opacity: 0.9; }

.search-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px 5px;
  color: var(--faint);
  font-size: 11px;
}
.search-hint-sep { margin: 0 3px; }
.search-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 5px;
  background: var(--inset);
  color: var(--muted);
  font: 600 10.5px/1 var(--font);
}
@media (hover: none) { .search-hint { display: none; } }
.search-result-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-aura { font-size: 14px; }
.search-result-new {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  border-radius: var(--pill);
  padding: 5px 10px;
  background: #16171f;
}

/* ─── Home workspace ─── */

.home-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.discovery-rail {
  position: sticky;
  top: 88px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.leaderboard-column { min-width: 0; animation: fadeUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.06s both; }

.editorial-pulse { display: flex; flex-direction: column; gap: 14px; }

/* Filter panel */
.filter-panel { overflow: hidden; }
.filter-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.filter-panel-toggle strong { font-size: 21px; font-weight: 700; letter-spacing: -0.035em; }
.filter-chevron { display: flex; align-items: center; color: var(--ink); transition: transform 0.25s ease; }
.filter-chevron .icon { width: 16px; height: 16px; }
.filter-chevron.is-open { transform: rotate(180deg); }

.filter-panel-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 13px; }
.filter-group > span,
.filter-country > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.filter-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  background: var(--inset);
  border-radius: var(--r-md);
  padding: 4px;
}
.filter-options--split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-options button {
  padding: 9px 6px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.filter-options button:hover { color: var(--ink); }
.filter-options button.is-active { background: var(--card); color: var(--ink); }

.filter-country select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background-color: var(--card);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23191922' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: box-shadow 0.15s;
}
.filter-country select:focus { border-color: transparent; box-shadow: var(--focus-ring); }

/* Activity rotator */
.pulse-rotator { position: relative; min-height: 84px; padding: 15px 16px; }
.pulse-rotator-label { margin-bottom: 12px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.pulse-metric strong {
  display: block;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.pulse-metric--active { animation: metricFade 4.2s ease both; }
.pulse-dots { position: absolute; right: 18px; bottom: 18px; display: flex; gap: 5px; }
.pulse-dots span { width: 5px; height: 5px; border-radius: var(--pill); background: var(--inset); transition: all 0.25s; }
.pulse-dots span.is-active { width: 16px; background: var(--ink); }

/* Suggested list */
.suggested-block { padding: 15px 16px; }
.suggested-heading { margin-bottom: 14px; }
.suggested-heading h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.suggested-list { display: flex; flex-direction: column; gap: 4px; }
.suggested-person {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  margin: 0 -8px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s;
}
.suggested-person:hover { background: var(--card-2); transform: translateX(3px); }
.suggested-person img,
.suggested-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--r-thumb);
  object-fit: cover;
  background: var(--inset);
}
.suggested-placeholder { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.suggested-copy { min-width: 0; }
.suggested-copy strong,
.suggested-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggested-copy strong { font-size: 13.5px; font-weight: 600; }
.suggested-copy small { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.suggested-arrow { color: var(--faint); font-size: 15px; transition: transform 0.18s; }
.suggested-person:hover .suggested-arrow { transform: translate(2px, -2px); color: var(--ink); }

/* ─── Leaderboard ─── */

.leaderboard-search .search-wrap { margin-bottom: 12px; }
.leaderboard-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 2px 10px;
}
.leaderboard-heading h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); }

.leaderboard-panel {
  padding: 6px;
}
.lb-list { display: flex; flex-direction: column; }
.lb-item {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  background: transparent;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  scroll-margin-top: 96px;
  transition: background 0.18s, transform 0.12s;
}
.lb-item:hover { background: var(--card-2); }
.lb-rank {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  text-align: center;
}
.lb-rank--top { color: var(--ink); }
.lb-img {
  width: 44px;
  height: 44px;
  border-radius: var(--r-thumb);
  object-fit: cover;
  background: var(--inset);
}
.lb-img--placeholder { display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--muted); }
.person-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.person-placeholder-icon { display: block; width: 48%; height: 48%; }
.lb-name { font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-votes { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lb-value { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.lb-aura { font-size: 17px; }

/* Momentum pill — monochrome, direction shown by the arrow */
.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: var(--pill);
  background: var(--inset);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: default;
}
.trend-pill--up,
.trend-pill--down { color: var(--ink); }

.btn-load-more {
  display: block;
  width: calc(100% - 16px);
  margin: 8px 8px 4px;
  padding: 13px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-2);
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: color 0.15s, box-shadow 0.15s;
}
.btn-load-more:hover { color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-load-more:disabled { opacity: 0.5; cursor: default; }

.lb-empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px; }

/* ─── Figure page ─── */

.figure-page { width: 100%; max-width: 780px; margin: 0 auto; }
.figure-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.figure-toolbar .btn--back { margin-bottom: 0; }
.figure-period-toggle { width: 190px; }
.figure-period-toggle button { padding-block: 7px; }

.figure-header {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  column-gap: 20px;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
}
.figure-media, .figure-emoji { width: 88px; height: 88px; }
.figure-img {
  width: 88px;
  height: 88px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--inset);
  box-shadow: var(--shadow-sm);
}
.figure-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--inset);
  font-size: 34px;
}
.figure-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}
.figure-identity-line { min-width: 0; }
.figure-name { font-size: 24px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.12; }
.figure-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.figure-score { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.figure-aura-row { display: flex; align-items: center; gap: 10px; }
.figure-aura { font-size: 34px; }
.figure-meta { color: var(--muted); font-size: 12.5px; }

.figure-unrated { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.figure-unrated strong { font-size: 20px; font-weight: 700; color: var(--ink); }
.figure-unrated span { color: var(--muted); font-size: 12.5px; }
.figure-unrated .figure-history { display: flex; align-items: center; gap: 4px; }
.figure-unrated .figure-history .aura { color: var(--ink); font-size: inherit; }

/* Figure modules */
.figure-modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.figure-modules > :only-child { grid-column: 1 / -1; }

.breakdown-card, .vote-card { padding: 18px; }

.breakdown-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 18px; }
.breakdown-row { margin-bottom: 14px; }
.breakdown-row:last-child { margin-bottom: 0; }
.breakdown-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.breakdown-country { font-size: 13.5px; color: var(--ink); }
.breakdown-value { font-size: 13.5px; }
.breakdown-bar { height: 6px; background: var(--inset); border-radius: var(--pill); overflow: hidden; }
.breakdown-bar-fill { height: 100%; background: var(--aurora); border-radius: var(--pill); transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* ─── Vote slider ─── */

.vote-card { margin-top: 0; }
.vote-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.vote-label { color: var(--muted); font-size: 13.5px; }
.vote-value { font-size: 24px; }
.vote-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: color-mix(in srgb, var(--inset) 82%, var(--ink) 18%);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.vote-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 28%, transparent);
  animation: voteThumbPulse 3.6s cubic-bezier(0.2, 0.55, 0.35, 1) infinite;
  transition: transform 0.1s;
}
.vote-slider::-webkit-slider-thumb:active { transform: scale(1.12); }
.vote-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 28%, transparent);
  animation: voteThumbPulse 3.6s cubic-bezier(0.2, 0.55, 0.35, 1) infinite;
}
@keyframes voteThumbPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 24%, transparent); }
  72%, 100% { box-shadow: 0 0 0 10px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .vote-slider::-webkit-slider-thumb,
  .vote-slider::-moz-range-thumb { animation: none; }
}
.vote-range {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.vote-submit { margin-top: 20px; }

/* Shareable result shown after a successful vote. */
.take-result-card {
  min-width: 0;
  padding: 14px;
  border-radius: 11px;
  background: var(--card);
}
.take-preview {
  width: 100%;
  aspect-ratio: 1200 / 630;
  border-radius: 8px;
  background: #24211f;
  object-fit: cover;
}
.take-actions {
  display: flex;
  justify-content: flex-start;
  gap: 7px;
  margin-top: 12px;
}
.take-actions button {
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.take-share { background: var(--ink); color: var(--card); }
.take-copy { background: var(--card-2); color: var(--ink); }
.take-actions button:hover { opacity: .82; }

/* Guest vote CTA */
.vote-guest { display: flex; justify-content: flex-end; margin-top: 16px; }
.vote-guest-trigger {
  padding: 9px 16px;
  border: 0;
  border-radius: var(--pill);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
}
.vote-guest-trigger:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ─── Figure nav (prev/next) ─── */

.figure-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.figure-nav-btn {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}
.figure-nav-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.figure-nav-img, .figure-nav-placeholder {
  width: 42px;
  height: 42px;
  border-radius: var(--r-thumb);
  background: var(--inset);
  object-fit: cover;
}
.figure-nav-placeholder { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); }
.figure-nav-copy { min-width: 0; }
.figure-nav-copy small, .figure-nav-copy strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.figure-nav-copy small { margin-bottom: 2px; color: var(--faint); font-size: 11px; font-weight: 500; }
.figure-nav-copy strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.figure-nav-aura { font-size: 13.5px; }

/* ─── Profile ─── */

.profile-page { width: 100%; max-width: 740px; margin: 0 auto; }

.profile-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin: 4px 0 16px;
}
.profile-username { font-size: 24px; font-weight: 700; letter-spacing: -0.035em; }
.profile-providers { display: flex; gap: 7px; }
.provider-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--pill);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  text-transform: capitalize;
}

/* Compact points summary — one card instead of three + a note */
.points-card { padding: 16px 18px 14px; }
.points-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.points-stat { text-align: left; }
.points-stat strong { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.points-stat span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.points-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--faint);
}

/* colour utilities collapse to ink/muted */
.c-green, .c-red, .c-orange { color: var(--ink); }
.c-muted, .c-dim { color: var(--muted); }

.profile-section { margin: 30px 0 24px; }
.profile-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 16px;
}
.profile-section-title { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.profile-period { color: var(--muted); font-size: 12.5px; }

.profile-stats-loading, .profile-stats-error {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13.5px;
}
.profile-stats-loading .loading-icon { width: 7px; height: 7px; }
.profile-stats-error { color: var(--ink); }

.contribution-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) 1.3fr;
  gap: 24px;
  align-items: end;
  padding: 18px;
}
.contribution-copy { display: flex; flex-direction: column; align-items: flex-start; }
.contribution-kicker, .profile-extreme-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.contribution-value { margin: 8px 0 3px; color: var(--ink); font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.contribution-caption { color: var(--muted); font-size: 11.5px; }
.contribution-track { height: 8px; overflow: hidden; border-radius: var(--pill); background: var(--inset); }
.contribution-fill { height: 100%; border-radius: inherit; background: var(--aurora); box-shadow: var(--glow); }
.contribution-scale { display: flex; justify-content: space-between; margin-top: 9px; color: var(--faint); font-size: 10.5px; }

.profile-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.profile-metric {
  min-width: 0;
  padding: 18px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.profile-metric strong, .profile-metric span, .profile-metric small { display: block; }
.profile-metric strong { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.profile-metric span { margin-top: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.profile-metric small { margin-top: 3px; color: var(--muted); font-size: 11.5px; }

.most-voted-card {
  width: 100%;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.most-voted-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.most-voted-card img, .most-voted-placeholder {
  width: 50px;
  height: 50px;
  border-radius: var(--r-thumb);
  background: var(--inset);
  object-fit: cover;
}
.most-voted-placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.most-voted-copy { min-width: 0; }
.most-voted-copy small, .most-voted-copy strong, .most-voted-copy span { display: block; }
.most-voted-copy small { color: var(--muted); font-size: 11px; }
.most-voted-copy strong { margin: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; }
.most-voted-copy span { color: var(--muted); font-size: 11.5px; }
.most-voted-score { font-size: 18px; }

.profile-extremes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.profile-extreme { min-width: 0; padding: 16px; }
.profile-extreme strong { display: block; margin: 9px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; }
.profile-extreme .aura { font-size: 17px; }

/* ─── Header sign-in ─── */

.header-signin-wrap { position: relative; }
.header-signin {
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: var(--header-fg);
  border: none;
  border-radius: var(--pill);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
}
.header-signin:hover { opacity: 0.88; transform: translateY(-1px); }

.signin-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  min-width: 176px;
  padding: 6px;
  animation: slideDown 0.2s ease both;
}
.signin-dropdown-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s;
}
.signin-dropdown-item:hover { background: var(--card-2); }

/* ─── Vote modal ─── */

.vote-modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease both;
}
.vote-modal {
  width: min(430px, 100%);
  text-align: left;
}
.vote-modal-heading { margin-bottom: 10px; }
.vote-modal-copy {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

/* Compact OAuth */
.oauth-compact { display: flex; gap: 10px; justify-content: center; }
.btn-signin-compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.12s;
}
.btn-signin-compact:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--google-compact { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn--github-compact { background: var(--btn-solid-bg); color: var(--btn-solid-fg); }
.vote-modal .oauth-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.vote-modal .btn-signin-compact {
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}
.vote-modal .btn--google-compact { background: var(--card-2); }
.vote-modal .btn-signin-compact:hover { box-shadow: none; }

/* ─── Onboarding overlay ─── */

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease both;
}
.onboarding-card {
  position: relative;
  max-width: 430px;
  width: 100%;
  padding: 22px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(16, 16, 15, 0.14);
  text-align: left;
}
.onboarding-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--ink);
  cursor: pointer;
}
.onboarding-close .icon { width: 16px; height: 16px; }
.onboarding-close:disabled { cursor: wait; opacity: 0.55; }
.onboarding-heading {
  display: grid;
  gap: 7px;
  padding-right: 40px;
  margin-bottom: 22px;
}
.onboarding-card .form-error {
  margin-top: -6px;
}
.onboarding-submit {
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 13px;
  font-weight: 500;
}
.onboarding-submit:hover { transform: none; box-shadow: none; }
.onboarding-submit.btn--disabled {
  background: var(--card-2);
  color: var(--faint);
}

@media (max-width: 520px) {
  .onboarding-overlay { align-items: flex-end; padding: 12px; }
  .onboarding-card { max-height: calc(100dvh - 24px); padding: 20px; }
  .country-grid { max-height: min(44dvh, 320px); }
}

/* ─── Toast ─── */

.toast-container {
  position: fixed;
  bottom: 100px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  padding: 12px 22px;
  border-radius: var(--pill);
  font-size: 13.5px;
  font-weight: 600;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast--visible { opacity: 1; transform: translateY(0) scale(1); }
.toast--success, .toast--error, .toast--info { background: var(--btn-solid-bg); color: var(--btn-solid-fg); }

/* ─── Live feed ─── */

.live-feed-container {
  position: fixed;
  top: 84px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 55;
  pointer-events: none;
  padding: 0 16px;
}
.live-feed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  border-radius: var(--pill);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-feed .aura { color: inherit; font-weight: 700; }

/* ─── Loading ─── */

.loading-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-icon {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: loadingFade 1.2s ease-in-out infinite;
}
.page-loading { display: flex; justify-content: center; padding: 64px; }
.page-empty { text-align: center; padding: 64px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .loading-icon { animation: none; opacity: 0.55; }
}

/* ─── Utilities ─── */

.flex-fill { flex: 1; min-width: 0; }
.form-error { color: var(--ink); font-weight: 500; font-size: 13px; margin-bottom: 16px; padding: 11px 14px; border-radius: var(--r-md); background: var(--card-2); box-shadow: var(--shadow-sm); }

/* ══════════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 940px) {
  /* One simple full-width column. Flatten the rail so its cards can be
     ordered independently around the list. align-items:stretch overrides the
     desktop grid's align-items:start, so every box fills the full width. */
  .home-workspace { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .discovery-rail,
  .editorial-pulse { display: contents; }
  .filter-panel { order: 1; }      /* Shape the ranking — above the list */
  .leaderboard-column { order: 2; }
  .pulse-rotator { order: 3; }
  .suggested-block { order: 4; }
}

@media (max-width: 620px) {
  .content { padding: 22px 14px 128px; }
  .header { top: 10px; gap: 12px; width: calc(100% - 20px); margin-top: 10px; padding: 8px 8px 8px 14px; }
  .header-logo > span:last-child { display: none; }

  /* Keep form controls >=16px so iOS never zooms the page on focus */
  .filter-country select { font-size: 16px; }

  .figure-header { grid-template-columns: 68px minmax(0, 1fr); column-gap: 16px; padding: 18px; }
  .figure-toolbar { margin-bottom: 14px; }
  .figure-period-toggle { width: min(190px, 55vw); }
  .figure-media, .figure-emoji, .figure-img { width: 68px; height: 68px; }
  .figure-emoji { font-size: 28px; }
  .figure-copy { grid-template-columns: 1fr; gap: 12px; }
  .figure-score, .figure-unrated { align-items: flex-start; text-align: left; }
  .figure-name { font-size: 21px; }
  .figure-aura { font-size: 30px; }
  .figure-modules { grid-template-columns: 1fr; }
  .figure-nav { grid-template-columns: 1fr; }

  .stats-grid { gap: 8px; }
  .stat-card { padding: 15px 13px; }
  .stat-value { font-size: 22px; }

  .contribution-card { grid-template-columns: 1fr; gap: 20px; }
  .contribution-value { font-size: 40px; }
}

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

/* Mobile shell overrides must follow the legacy responsive layer. */
@media (max-width: 820px) {
  .bottom-nav { display: none; }
  .control-rail {
    position: relative;
    display: block;
    height: auto;
    padding: 78px 16px 18px;
    background: var(--card);
  }
  .control-rail::before {
    content: "";
    position: fixed;
    z-index: 55;
    inset: 0 0 auto;
    height: 64px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .rail-primary { display: block; }
  .rail-logo {
    position: fixed;
    z-index: 70;
    top: 12px;
    left: 16px;
  }
  .rail-logo .logo-orbit { width: 36px; height: 36px; }
  .rail-statement {
    width: 100%;
    max-width: 620px;
    margin: 0;
    font-size: 13px;
  }
  .rail-footer { display: contents; }
  .rail-service { display: none; }
  .rail-account {
    position: fixed;
    z-index: 70;
    top: 15px;
    right: 16px;
    margin: 0;
  }
  .rail-user {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }
  .rail-user-icon { display: inline-flex; }
  .rail-user-icon .icon { width: 16px; height: 16px; }
  .rail-user > span:not(.rail-user-icon),
  .rail-user > strong { display: none; }
  .rail-theme { width: 34px; height: 34px; }

  .context-panel {
    display: block;
    height: auto;
    padding: 0 16px 20px;
  }
  .context-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }
  .context-panel > .context-filters,
  .context-suggestions { display: none; }
  .mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 41px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: var(--card-2);
    color: var(--ink);
    font-size: 12px;
    cursor: pointer;
  }
  .mobile-filter-trigger .icon { width: 16px; height: 16px; }
  .modal-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 28px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .modal-filters .rail-filter-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .modal-filters .rail-label { margin: 0 0 9px; }
  .modal-filters .rail-filter-group button { line-height: 1.85; }
  .modal-filters .rail-country {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .modal-filters .rail-country select { width: 100%; padding: 9px 20px 9px 0; }
  .figure-modules { grid-template-columns: 1fr; }
  .figure-modules > * { grid-column: 1; }
  .leaderboard-panel { padding-bottom: 48px; }
  .profile-page { padding-bottom: 40px; }
}

/* Image-less figures need enough contrast to read as intentional avatars. */
.person-placeholder {
  background: #74746f;
  color: #f5f5f2;
}
:root[data-theme="dark"] .person-placeholder {
  background: color-mix(in srgb, var(--inset) 78%, var(--ink) 22%);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .person-placeholder {
    background: color-mix(in srgb, var(--inset) 78%, var(--ink) 22%);
    color: var(--ink);
  }
}

/* ─── Simplified identity and responsive workspace ─── */

.rail-user-icon,
.mobile-filter-trigger { display: none; }
.rail-user-initial { display: none; }

.points-card { position: relative; }
.points-info {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}
.points-info summary {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.points-info summary .icon { width: 16px; height: 16px; }
.points-info summary::-webkit-details-marker { display: none; }
.points-info > span {
  position: absolute;
  top: 38px;
  right: 0;
  width: max-content;
  max-width: min(250px, calc(100vw - 48px));
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--card);
  font-size: 11.5px;
  font-weight: 400;
  box-shadow: var(--shadow-md);
}
.contribution-fill {
  background: var(--ink);
  box-shadow: none;
}
.contribution-value {
  font-size: 24px;
  font-weight: 600;
}

.filters-modal-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 10, 9, 0.32);
}
.filters-modal {
  width: min(430px, 100%);
  padding: 18px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.filters-modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.filters-modal-heading strong { font-size: 16px; font-weight: 600; }
.filters-modal-heading button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--ink);
  cursor: pointer;
}
.filters-modal-heading button .icon { width: 16px; height: 16px; }
.filters-modal-done {
  width: 100%;
  margin-top: 22px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 13px;
  cursor: pointer;
}

@media (min-width: 821px) and (max-width: 1180px) {
  :root {
    --control-width: 36vw;
    --context-width: 0px;
  }
  .app-shell {
    grid-template-columns: minmax(290px, 36%) minmax(0, 1fr);
  }
  .workspace-chrome {
    grid-column: 1;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    min-width: 0;
    height: 100dvh;
    padding: 24px;
    background: var(--card);
  }
  .control-rail,
  .context-panel { display: contents; }
  .rail-primary { grid-row: 1; }
  .context-intro { grid-row: 2; margin-top: 28px; }
  .context-panel > .context-filters {
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
  }
  .context-panel > .context-filters .rail-country { grid-column: 1 / -1; }
  .context-suggestions { display: none; }
  .rail-footer { grid-row: 5; padding-top: 24px; }
  .content { grid-column: 2; }
  .figure-modules { grid-template-columns: 1fr; }
  .figure-modules > * { grid-column: 1; }
  .live-feed-container,
  .toast-container { left: 36vw; }
}

@media (max-width: 820px) {
  .bottom-nav { display: none; }
  .workspace-chrome { display: block; }
  .control-rail {
    position: relative;
    display: block;
    height: auto;
    padding: 78px 16px 18px;
    background: var(--card);
  }
  .control-rail::before {
    content: "";
    position: fixed;
    z-index: 55;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .rail-primary { display: block; }
  .rail-logo {
    position: fixed;
    z-index: 70;
    top: 12px;
    left: 16px;
  }
  .rail-logo .logo-orbit { width: 36px; height: 36px; }
  .rail-statement {
    width: 100%;
    max-width: 620px;
    margin: 0;
    font-size: 13px;
  }
  .rail-footer { display: contents; }
  .rail-service { display: none; }
  .rail-account {
    position: fixed;
    z-index: 70;
    top: 15px;
    right: 16px;
    margin: 0;
  }
  .rail-user {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }
  .rail-user-icon { display: inline-flex; }
  .rail-user-icon .icon { width: 16px; height: 16px; }
  .rail-user > span:not(.rail-user-icon),
  .rail-user > strong { display: none; }
  .rail-theme { width: 34px; height: 34px; }

  .context-panel {
    display: block;
    height: auto;
    padding: 0 16px 20px;
  }
  .context-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }
  .context-panel > .context-filters,
  .context-suggestions { display: none; }
  .mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 41px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: var(--card-2);
    color: var(--ink);
    font-size: 12px;
    cursor: pointer;
  }
  .mobile-filter-trigger .icon { width: 16px; height: 16px; }
  .modal-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .modal-filters .rail-filter-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .modal-filters .rail-label { margin: 0 0 7px; }
  .modal-filters .rail-country {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .modal-filters .rail-country select {
    width: 100%;
    padding: 7px 20px 7px 0;
  }
  .figure-modules { grid-template-columns: 1fr; }
  .figure-modules > * { grid-column: 1; }
  .leaderboard-panel { padding-bottom: 48px; }
  .profile-page { padding-bottom: 40px; }
}

/* ══════════════════════════════════════════════════════════════════
   Editorial workspace — fixed tools, scrollable ranking
   ══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #f1f1ef;
  --card: #ffffff;
  --card-2: #f5f5f2;
  --inset: #ededE9;
  --ink: #10100f;
  --muted: #74746f;
  --faint: #aaa9a3;
  --line: rgba(16, 16, 15, 0.11);
  --line-strong: rgba(16, 16, 15, 0.24);
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --r-lg: 4px;
  --r-md: 3px;
  --r-thumb: 3px;
  --r-sm: 2px;
  --pill: 3px;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --title-size: clamp(22px, 2vw, 29px);
  --control-width: 25vw;
  --context-width: 25vw;
}

:root[data-theme="dark"] {
  --bg: #20201e;
  --card: #121211;
  --card-2: #191918;
  --inset: #292926;
  --ink: #f2f2ed;
  --muted: #aaa9a3;
  --faint: #74736e;
  --line: rgba(255, 255, 250, 0.12);
  --line-strong: rgba(255, 255, 250, 0.26);
  --btn-solid-bg: #f2f2ed;
  --btn-solid-fg: #11110f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #20201e;
    --card: #121211;
    --card-2: #191918;
    --inset: #292926;
    --ink: #f2f2ed;
    --muted: #aaa9a3;
    --faint: #74736e;
    --line: rgba(255, 255, 250, 0.12);
    --line-strong: rgba(255, 255, 250, 0.26);
    --btn-solid-bg: #f2f2ed;
    --btn-solid-fg: #11110f;
  }
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  letter-spacing: -0.008em;
}

body::before { display: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--line-strong);
  background-clip: padding-box;
}

.app-shell {
  display: grid;
  grid-template-columns: 25% 25% 50%;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.workspace-chrome { display: contents; }

.control-rail,
.context-panel {
  min-width: 0;
  height: 100dvh;
  background: var(--card);
  border-right: 0;
}

.control-rail {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 25px 22px 20px;
}

.rail-primary { min-height: 0; }
.rail-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.rail-logo .logo-orbit {
  position: relative;
  width: 40px;
  height: 40px;
  overflow: visible;
}
.rail-logo .aurora-mark {
  position: relative;
  z-index: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
  transform: translateX(-9px);
  animation: none;
}

.context-panel .search-icon .icon {
  width: 16px;
  height: 16px;
}

.context-suggestions .suggested-heading h2 {
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.aurora-orbit-layer { mix-blend-mode: multiply; }
:root[data-theme="dark"] .aurora-orbit-layer { mix-blend-mode: screen; }
.rail-statement {
  width: 100%;
  max-width: none;
  margin-top: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.008em;
}
.privacy-trigger {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}
.rail-rules-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--chrome-control, var(--card-2));
  color: var(--ink);
  cursor: pointer;
}
.rail-rules-trigger .icon { width: 16px; height: 16px; }
.rail-rules-trigger:hover { opacity: .72; }
.rail-rules-trigger--mobile { display: none; margin-top: 0; }
.rail-logo > span:last-child {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.rail-navigation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-top: 46px;
}
.rail-navigation button,
.rail-filter-group button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s;
}
.rail-navigation button:hover,
.rail-filter-group button:hover,
.rail-navigation button.is-active,
.rail-filter-group button.is-active { color: var(--ink); }
.rail-navigation button.is-active,
.rail-filter-group button.is-active { font-weight: 400; }

.rail-filters {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 36px;
  padding-top: 0;
  border-top: 0;
}
.rail-filter-group { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.rail-label {
  display: block;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.rail-country select {
  width: 100%;
  padding: 7px 20px 7px 0;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  outline: none;
  cursor: pointer;
}

.rail-footer { flex: 0 0 auto; padding-top: 22px; }
.rail-service {
  display: block;
  padding-top: 0;
  border-top: 0;
}
.rail-activity-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rail-activity-heading .rail-label { margin: 0; }
.rail-activity-controls { display: flex; align-items: center; gap: 1px; }
.rail-activity-controls button {
  position: relative;
  width: 11px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.rail-activity-controls button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--faint);
  opacity: 0.3;
}
.rail-activity-controls button.is-active::after { opacity: 1; background: var(--ink); }
.rail-activity-summary { display: flex; align-items: baseline; gap: 6px; margin-top: 10px; }
.rail-activity-summary strong {
  color: var(--ink);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rail-activity-summary span {
  color: var(--ink);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}
.rail-activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
  margin-top: 12px;
  overflow: visible;
}
.rail-activity-chart > span {
  width: 3px;
  max-width: 3px;
  flex: 1 1 3px;
  border-radius: 999px 999px 0 0;
  background: var(--ink);
  transition: height 0.25s ease, opacity 0.25s ease;
}
.rail-activity-chart > span.is-empty { opacity: 0.12; }

.rail-account {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.rail-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card-2);
  color: var(--ink);
  cursor: pointer;
}
.rail-theme .icon { width: 16px; height: 16px; }
.rail-user {
  min-width: 0;
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 11.5px;
  cursor: pointer;
}
.rail-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user strong { font-variant-numeric: tabular-nums; }
.rail-account .header-signin {
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 12px;
}
.rail-copyright { display: block; margin-top: 15px; color: var(--faint); font-size: 10.5px; }

.context-panel {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  padding: 25px 30px 12px;
  overflow: visible;
}
.context-intro { flex: 0 0 auto; }
.context-kicker {
  display: block;
  margin-bottom: 19px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
}
.context-intro p {
  max-width: 275px;
  margin-top: 22px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.008em;
}
.context-panel .search-wrap { margin: 0; }
.context-panel .search-bar {
  padding: 0 12px;
  border: 0;
  border-bottom: 0;
  border-radius: 8px;
  background: var(--card-2);
  box-shadow: none;
}
.context-panel .search-bar--focused { transform: none; border-bottom-color: transparent; box-shadow: none; }
.context-panel .search-input { padding: 10px 0 11px; font-size: 13px; font-weight: 400; }
.context-panel .search-icon { color: var(--ink); }
.context-panel .search-clear { right: 0; }
.context-panel .search-dropdown {
  top: calc(100% + 8px);
  left: -12px;
  right: -12px;
  overflow: hidden auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
}
.context-panel .search-result { border-radius: 7px; }
.context-panel .search-result-img,
.context-panel .search-skel-img { border-radius: 50%; }
.context-filters { margin-top: 27px; }

.context-suggestions {
  margin-top: auto;
  padding-top: 42px;
}
.context-suggestions .suggested-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 0;
  border-bottom: 0;
}
.context-suggestions .suggested-heading h2 {
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.context-suggestions .suggested-list { gap: 0; }
.context-suggestions .suggested-person {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 0;
  border-bottom: 0;
  border-radius: 0;
}
.context-suggestions .suggested-person:hover { background: transparent; transform: translateX(2px); }
.context-suggestions .suggested-person img,
.context-suggestions .suggested-placeholder { width: 34px; height: 34px; border-radius: 50%; }
.context-suggestions .suggested-copy strong { font-size: 12px; }
.context-suggestions .suggested-copy small { font-size: 10.5px; }

.content {
  grid-column: 3;
  grid-row: 1;
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  overscroll-behavior: contain;
}

.leaderboard-column { width: 100%; min-height: 100%; animation: none; }
.leaderboard-heading {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  padding: 25px 42px 25px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.leaderboard-heading h2 {
  color: var(--ink);
  font-size: var(--title-size);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.leaderboard-heading p { color: var(--muted); font-size: 12px; white-space: nowrap; }
.leaderboard-panel { padding: 0 0 60px; border-radius: 0; background: transparent; box-shadow: none; }
.lb-item {
  grid-template-columns: 26px 48px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 76px;
  padding: 13px 42px;
  border-bottom: 0;
  border-radius: 0;
  scroll-margin-top: 100px;
  transition: padding 0.18s, background 0.18s;
}
.lb-item:hover { padding-right: 42px; padding-left: 42px; background: color-mix(in srgb, var(--card) 48%, transparent); }
.lb-rank { color: var(--faint); font-size: 11px; font-weight: 500; text-align: left; }
.lb-rank--top { color: var(--ink); }
.lb-img { width: 48px; height: 48px; border-radius: 50%; }
.lb-name { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.lb-votes { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.lb-aura { font-size: 17px; font-weight: 650; }
.trend-pill {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}
.btn-load-more {
  width: 100%;
  margin: 18px 0 0;
  padding: 14px;
  border-top: 0;
  border-radius: 0;
  background: transparent;
}
.btn-load-more:hover { box-shadow: none; color: var(--ink); }

.figure-page,
.profile-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 31px 42px 64px;
}
.figure-page {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}
.figure-toolbar { margin-bottom: 28px; padding-bottom: 18px; border-bottom: 0; }
.figure-toolbar .btn--back {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}
.figure-period-toggle {
  display: flex;
  width: auto;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--card);
}
.figure-period-toggle button {
  min-width: 74px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.16s, background 0.16s;
}
.figure-period-toggle button.is-active { background: var(--ink); color: var(--card); }
.figure-header {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 18px;
  margin-bottom: 24px;
  padding: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.figure-media,
.figure-emoji,
.figure-img { width: 88px; height: 88px; }
.figure-img,
.figure-emoji { border-radius: 50%; box-shadow: none; }
.figure-copy { display: block; width: 100%; }
.figure-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: start;
  gap: 18px;
  min-height: 34px;
}
.figure-primary-side {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  text-align: right;
}
.figure-name {
  min-width: 0;
  font-size: var(--title-size);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.figure-desc {
  max-width: none;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  white-space: normal;
}
.figure-aura-row { flex: 0 0 auto; }
.figure-aura { font-size: 26px; line-height: 1; }
.figure-status { flex: 0 0 auto; font-size: 14px; font-weight: 600; }
.figure-meta { margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.figure-history { display: flex; align-items: center; gap: 4px; }
.figure-history .aura { font-size: inherit; }
.figure-activity {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
  margin-top: 17px;
  overflow: visible;
}
.figure-activity-bar {
  width: 3px;
  max-width: 3px;
  flex: 1 1 3px;
  border-radius: 999px 999px 0 0;
  background: var(--ink);
}
.figure-activity-bar.is-empty { opacity: 0.12; }
.figure-activity-bar.is-negative {
  background: rgba(205, 70, 92, 0.68);
  opacity: 1;
}
.vote-submit,
.vote-guest-trigger {
  width: auto;
  min-width: 0;
  margin-left: auto;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
.vote-submit:hover,
.vote-guest-trigger:hover {
  opacity: 0.86;
  transform: none;
  box-shadow: none;
}
.vote-submit.btn--disabled {
  background: var(--card-2);
  color: var(--muted);
}
.breakdown-card,
.vote-card,
.figure-nav-btn {
  border-radius: 12px;
  box-shadow: none;
}
.breakdown-card,
.vote-card { padding: 20px; border-radius: 11px; background: var(--card); }
.breakdown-bar-fill { background: var(--ink); }
.figure-nav { margin-top: auto; padding-top: 54px; }
.figure-nav-btn {
  grid-template-columns: 34px minmax(0, auto);
  width: max-content;
  max-width: 100%;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.figure-nav-btn--next { justify-self: end; }
.figure-nav-btn:hover { box-shadow: none; transform: translateY(-1px); background: transparent; }
.figure-nav-img,
.figure-nav-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.figure-nav-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-page {
  max-width: 780px;
  margin: 0 auto;
}
.profile-header {
  align-items: baseline;
  margin: 0 0 22px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.profile-username {
  font-size: var(--title-size);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.provider-badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 500;
}

.points-card {
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card);
}
.points-stats { gap: 0; }
.points-stat { padding: 17px 18px 15px; }
.points-stat + .points-stat { border-left: 1px solid var(--line); }
.points-stat strong {
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
.points-stat span { margin-top: 7px; font-size: 12px; }
.points-note {
  margin: 0;
  padding: 11px 18px 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}

.profile-section { margin-top: 28px; }
.profile-section-heading { margin: 0 0 13px; }
.profile-section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.profile-period { font-size: 12px; }

.contribution-card {
  grid-template-columns: minmax(155px, 0.8fr) 1.2fr;
  gap: 30px;
  padding: 18px;
  border-radius: 12px;
  background: var(--card);
}
.contribution-kicker,
.profile-extreme-label { font-size: 12px; font-weight: 500; }
.contribution-value {
  margin: 7px 0 4px;
  font-size: 32px;
  font-weight: 600;
}
.contribution-track { height: 6px; }

.profile-metrics-grid {
  gap: 0;
  overflow: hidden;
  margin: 14px 0;
  border-radius: 12px;
  background: var(--card);
}
.profile-metric {
  padding: 17px 18px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.profile-metric:nth-child(odd) { border-right: 1px solid var(--line); }
.profile-metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
.profile-metric strong { font-size: 24px; font-weight: 600; }
.profile-metric span { margin-top: 7px; font-size: 12.5px; font-weight: 500; }

.most-voted-card {
  padding: 15px 18px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: none;
}
.most-voted-card:hover { transform: none; box-shadow: none; }
.most-voted-card img,
.most-voted-placeholder { border-radius: 50%; }

.profile-extremes {
  gap: 0;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 12px;
  background: var(--card);
}
.profile-extreme {
  padding: 16px 18px;
  border-radius: 0;
  background: transparent;
}
.profile-extreme + .profile-extreme { border-left: 1px solid var(--line); }
.profile-extreme strong { margin: 7px 0 4px; font-size: 14px; }
.profile-page .btn--logout {
  width: auto;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 12px;
}
.profile-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-admin-link { text-decoration: none; }
.profile-content { gap: 14px; }

.bottom-nav { display: none; }
.live-feed-container { top: 18px; left: calc(var(--control-width) + var(--context-width)); }
.live-feed {
  border-radius: 10px;
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
}
.live-feed .aura { font-weight: 400; }
.toast-container { left: calc(var(--control-width) + var(--context-width)); bottom: 24px; }
.toast {
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
}

@media (min-width: 821px) {
  .figure-page { padding-bottom: 20px; }
}

@media (max-width: 1040px) {
  .control-rail { padding-inline: 18px; }
  .context-panel { padding-inline: 24px; }
  .leaderboard-heading,
  .figure-page,
  .profile-page { padding-right: 28px; padding-left: 28px; }
  .lb-item { padding-right: 28px; padding-left: 28px; }
  .lb-item:hover { padding-right: 28px; padding-left: 28px; }
}

@media (max-width: 820px) {
  html,
  body,
  #app { height: auto; min-height: 100%; overflow: visible; }
  .app-shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .workspace-chrome { display: block; }
  .control-rail,
  .context-panel,
  .content { width: 100%; height: auto; }
  .control-rail {
    position: sticky;
    top: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 13px 16px;
    border-right: 0;
    border-bottom: 0;
  }
  .rail-primary { display: contents; }
  .rail-logo { grid-column: 1; grid-row: 1; }
  .rail-statement {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 540px;
    margin: 7px 0 2px;
  }
  .rail-navigation { grid-column: 2; grid-row: 1; flex-direction: row; justify-content: flex-end; gap: 14px; margin: 0; }
  .rail-service,
  .rail-copyright { display: none; }
  .rail-filters {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 10px 0 0;
    border-top: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .context-filters {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr 1fr;
    align-items: start;
    gap: 18px;
    overflow: visible;
  }
  .context-filters .rail-filter-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .context-filters .rail-filter-group .rail-label {
    width: auto;
    margin: 0 0 7px;
  }
  .context-filters .rail-country {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .context-filters .rail-country .rail-label { width: auto; margin: 0 0 7px; }
  .context-filters .rail-country select { width: 100%; min-width: 0; padding-top: 0; }
  .rail-filters::-webkit-scrollbar { display: none; }
  .rail-filter-group { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 10px; }
  .rail-filter-group .rail-label { margin: 0 2px 0 0; }
  .rail-filter-group button { white-space: nowrap; line-height: 1.4; }
  .rail-country { flex: 0 0 126px; display: flex; align-items: center; gap: 8px; }
  .rail-country .rail-label { margin: 0; }
  .rail-country select { padding-block: 3px; white-space: nowrap; }
  .rail-footer { display: contents; padding: 0; }
  .rail-account { grid-column: 3; grid-row: 1; margin: 0; }
  .rail-user span { display: none; }
  .rail-theme { border: 0; }
  .context-panel {
    padding: 28px 20px 24px;
    border-right: 0;
    border-bottom: 0;
  }
  .context-intro p { max-width: 540px; }
  .context-suggestions { margin-top: 30px; padding-top: 0; }
  .context-suggestions .suggested-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; }
  .content { overflow: visible; }
  .leaderboard-heading { position: static; padding-top: 28px; backdrop-filter: none; }
  .live-feed-container { top: 72px; left: 0; }
  .toast-container { left: 0; bottom: 84px; }
  .bottom-nav {
    display: flex;
    width: min(250px, calc(100% - 32px));
    gap: 2px;
    padding: 3px;
    border: 0;
    border-radius: 999px;
    background: var(--card);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .bottom-nav .nav-btn {
    gap: 0;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
  }
  .bottom-nav .nav-btn .icon { display: none; }
  .bottom-nav .nav-btn--active { background: var(--ink); color: var(--card); }
  .bottom-nav .nav-btn--inactive { opacity: 1; }
}

@media (max-width: 620px) {
  .control-rail { grid-template-columns: auto 1fr auto; gap: 10px; }
  .rail-navigation { display: none; }
  .rail-filters {
    overflow: visible;
  }
  .context-filters { grid-template-columns: 1.2fr 0.8fr 1fr; gap: 13px; }
  .context-panel { padding: 20px 16px 20px; }
  .context-kicker { margin-bottom: 13px; }
  .context-intro p { margin-top: 17px; font-size: 14px; }
  .context-suggestions { display: none; }
  .leaderboard-heading,
  .figure-page,
  .profile-page { padding-right: 16px; padding-left: 16px; }
  .leaderboard-heading { padding-top: 24px; padding-bottom: 19px; }
  .leaderboard-heading h2 { font-size: 22px; }
  .leaderboard-panel { padding-bottom: 100px; }
  .lb-item { grid-template-columns: 20px 42px minmax(0, 1fr) auto; gap: 10px; min-height: 68px; padding-right: 16px; padding-left: 16px; }
  .lb-item:hover { padding-right: 16px; padding-left: 16px; }
  .lb-img { width: 42px; height: 42px; }
  .lb-name { font-size: 14px; }
  .figure-header { gap: 15px; padding: 0; }
  .figure-media,
  .figure-emoji,
  .figure-img { width: 64px; height: 64px; }
  .figure-copy { gap: 11px; }
  .figure-name { font-size: 22px; }
  .figure-aura { font-size: 24px; }
  .figure-primary { gap: 10px; }
  .figure-primary { grid-template-columns: minmax(0, 1fr) 92px; }
  .figure-status--recent { display: none; }
  .figure-activity { gap: 2px; margin-top: 14px; }
  .figure-toolbar { margin-bottom: 23px; }
  .figure-period-toggle { width: auto; }
  .profile-username { font-size: 22px; }
  .points-stat { padding: 15px 13px 14px; }
  .points-stat strong { font-size: 21px; }
  .contribution-card { grid-template-columns: 1fr; gap: 20px; }
  .profile-metric { padding: 15px 13px; }
  .profile-extremes { grid-template-columns: 1fr; }
  .profile-extreme + .profile-extreme {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* Final responsive and profile refinements. */
.contribution-kicker,
.profile-extreme-label,
.most-voted-copy small {
  color: var(--muted);
  font-weight: 400;
}
.profile-extreme strong {
  color: var(--ink);
  font-weight: 400;
}
.contribution-value--swap { animation: profileValueSwap 0.34s ease-out both; }
@keyframes profileValueSwap {
  from { opacity: 0; }
  to { opacity: 1; }
}
.most-voted-card {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px 16px;
}
.most-voted-card img,
.most-voted-placeholder { width: 34px; height: 34px; }
.most-voted-copy {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.most-voted-copy small,
.most-voted-copy strong { display: block; margin: 0; }
.most-voted-copy small { font-size: 12px; line-height: 1.25; }
.most-voted-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
}
.profile-page { --profile-value-size: 22px; }
.profile-page .points-stat strong,
.profile-page .contribution-value,
.profile-page .profile-metric strong,
.profile-page .most-voted-score,
.profile-page .profile-extreme .aura {
  font-size: var(--profile-value-size);
  font-weight: 600;
  line-height: 1;
}
.profile-section { margin-bottom: 14px; }
.content .profile-page { padding-bottom: 20px; }
.profile-page .btn--logout {
  margin: 0;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 400;
  box-shadow: none;
}
.profile-page .btn--logout:hover { box-shadow: none; transform: none; }

@media (min-width: 821px) and (max-width: 1180px) {
  :root {
    --control-width: 38vw;
    --context-width: 0px;
  }
  .app-shell { grid-template-columns: minmax(310px, 38%) minmax(0, 1fr); }
  .workspace-chrome {
    grid-column: 1;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    min-width: 0;
    height: 100dvh;
    padding: 24px;
    background: var(--card);
  }
  .control-rail,
  .context-panel { display: contents; }
  .rail-primary { grid-row: 1; }
  .rail-statement { max-width: none; }
  .context-intro { grid-row: 2; margin-top: 28px; }
  .context-panel > .context-filters {
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
  }
  .context-panel > .context-filters .rail-country { grid-column: 1 / -1; }
  .context-suggestions { display: none; }
  .rail-footer { grid-row: 5; padding-top: 24px; }
  .content { grid-column: 2; }
  .figure-modules { grid-template-columns: 1fr; }
  .figure-modules > * { grid-column: 1; }
  .live-feed-container,
  .toast-container { left: 38vw; }
  .profile-page { padding-bottom: 20px; }
}

@media (max-width: 820px) {
  .profile-page { padding-bottom: 20px; }
  .most-voted-copy { align-items: flex-start; flex-direction: column; gap: 1px; }
}

/* Profile type system mirrors the navigation type system. */
.profile-page { --profile-value-size: 18px; }
.profile-section-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: inherit;
}
.profile-period,
.contribution-kicker,
.profile-extreme-label,
.most-voted-copy small,
.points-stat span,
.profile-metric span,
.profile-metric small,
.contribution-scale {
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
}
.profile-metric span { margin-top: 7px; }
.profile-metric small { margin-top: 3px; }
.profile-metric-copy {
  overflow: hidden;
  animation: profileValueSwap 0.34s ease-out both;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.most-voted-copy strong,
.profile-extreme strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}
.profile-page .points-stat strong,
.profile-page .contribution-value,
.profile-page .profile-metric strong,
.profile-page .most-voted-score,
.profile-page .profile-extreme .aura {
  color: var(--ink);
  font-size: var(--profile-value-size);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1;
}
.contribution-value { margin: 7px 0 0; }

.profile-swap {
  position: relative;
  display: block;
  min-height: 1.4em;
}
.profile-swap-primary,
.profile-swap-secondary {
  display: block;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.profile-swap-secondary {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.contribution-card:hover .profile-swap-primary,
.contribution-card:focus-visible .profile-swap-primary,
.profile-metric:hover .profile-swap-primary,
.profile-metric:focus-visible .profile-swap-primary { opacity: 0; }
.contribution-card:hover .profile-swap-secondary,
.contribution-card:focus-visible .profile-swap-secondary,
.profile-metric:hover .profile-swap-secondary,
.profile-metric:focus-visible .profile-swap-secondary { opacity: 1; }
.contribution-card:focus-visible,
.profile-metric:focus-visible { outline: none; }

.profile-page .profile-header,
.profile-page .points-card,
.profile-page .contribution-card,
.profile-page .profile-metrics-grid,
.profile-page .profile-metric,
.profile-page .most-voted-card,
.profile-page .profile-extremes,
.profile-page .profile-extreme {
  box-shadow: none !important;
}

:root[data-theme="dark"] {
  --bg: #2f2f2c;
  --chrome-control: #292926;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2f2f2c;
    --chrome-control: #292926;
  }
}

:root { --chrome-control: var(--card-2); }
.context-panel .search-bar,
.rail-theme,
.context-intro .mobile-filter-trigger { background: var(--chrome-control); }
.figure-page .figure-modules {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}
.figure-page .figure-modules > * { grid-column: auto; }

@media (min-width: 1601px) {
  :root { --title-size: clamp(24px, 2vw, 31px); }

  .rail-statement,
  .rail-navigation button,
  .rail-filter-group button,
  .rail-country select,
  .context-panel .search-input,
  .context-intro p { font-size: 14.5px; }

  .rail-label,
  .context-kicker,
  .context-suggestions .suggested-heading h2,
  .lb-rank,
  .profile-period,
  .contribution-kicker,
  .profile-extreme-label,
  .most-voted-copy small,
  .points-stat span,
  .profile-metric span,
  .profile-metric small,
  .contribution-scale { font-size: 12px; }

  .context-suggestions .suggested-copy strong,
  .leaderboard-heading p,
  .lb-votes,
  .figure-period-toggle button,
  .vote-submit,
  .vote-guest-trigger,
  .profile-page .btn--logout { font-size: 13px; }

  .lb-name { font-size: 16.5px; }
  .lb-aura { font-size: 19px; }
  .trend-pill { font-size: 11.5px; }
  .figure-desc,
  .figure-meta { font-size: 14px; }
  .figure-aura { font-size: 28px; }
  .figure-status { font-size: 15px; }
  .figure-nav-name,
  .breakdown-country,
  .breakdown-value,
  .vote-label { font-size: 15px; }
  .breakdown-title { font-size: 16.5px; }
  .vote-value { font-size: 26px; }
  .rail-activity-summary strong,
  .rail-activity-summary span { font-size: 23px; }

  .profile-page { --profile-value-size: 20px; }
  .profile-section-title,
  .most-voted-copy strong,
  .profile-extreme strong { font-size: 14.5px; }
}

:root[data-theme="dark"] .filters-modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}
:root[data-theme="dark"] .filters-modal {
  background: color-mix(in srgb, var(--bg) 90%, var(--ink) 10%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}
:root[data-theme="dark"] .filters-modal .rail-label { color: var(--muted); }
:root[data-theme="dark"] .filters-modal-heading button {
  background: color-mix(in srgb, var(--bg) 76%, var(--ink) 24%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .filters-modal-backdrop {
    background: rgba(0, 0, 0, 0.62);
  }
  :root:not([data-theme="light"]) .filters-modal {
    background: color-mix(in srgb, var(--bg) 90%, var(--ink) 10%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  }
  :root:not([data-theme="light"]) .filters-modal .rail-label { color: var(--muted); }
  :root:not([data-theme="light"]) .filters-modal-heading button {
    background: color-mix(in srgb, var(--bg) 76%, var(--ink) 24%);
  }
}

.mobile-activity { display: none; }
.rules-modal { width: min(390px, 100%); }
.rules-list { display: grid; gap: 5px; }
.rules-list > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card-2);
}
.privacy-modal { width: min(500px, 100%); }
.privacy-copy {
  display: grid;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}
.privacy-copy p { margin: 0; }
.privacy-copy a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
}
.privacy-copy a:hover { text-decoration-color: currentColor; }
.rules-list strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rules-list span { color: var(--ink); font-size: 13px; line-height: 1.45; }

@media (min-width: 821px) {
  .rules-modal { width: min(480px, 100%); }
}
@media (min-width: 1601px) {
  .rules-list strong,
  .rules-list span { font-size: 14.5px; }
}

@media (max-width: 820px) {
  .bottom-nav { display: none; }
  .points-info { display: none; }
  .figure-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .figure-nav > * { min-width: 0; }
  .figure-nav-btn {
    grid-template-columns: 34px minmax(0, 1fr);
    width: 100%;
    max-width: none;
  }
  .figure-nav-btn--next { justify-self: stretch; }
  .figure-nav-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .control-rail {
    position: relative;
    display: block;
    height: auto;
    padding: 78px 16px 18px;
    background: var(--card);
  }
  .control-rail::before {
    content: "";
    position: fixed;
    z-index: 55;
    inset: 0 0 auto;
    height: 64px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .rail-primary { display: block; }
  .rail-logo { position: fixed; z-index: 70; top: 12px; left: 16px; }
  .rail-logo .logo-orbit { width: 36px; height: 36px; }
  .rail-logo .aurora-mark { transform: translateX(-8px); }
  .rail-statement { width: 100%; max-width: 620px; margin: 0; font-size: 13px; }
  .rail-rules-trigger { margin-top: 16px; }
  .rail-rules-trigger--desktop { display: none; }
  .rail-rules-trigger--mobile {
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0;
  }
  .rail-footer { display: contents; }
  .rail-service { display: none; }
  .rail-account { position: fixed; z-index: 70; top: 15px; right: 16px; margin: 0; }
  .rail-user {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }
  .rail-user > .rail-user-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .rail-user > .rail-user-icon > .icon { display: none; }
  .rail-user-icon > .rail-user-initial {
    display: block;
    color: var(--card);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
  }
  .rail-user > span:not(.rail-user-icon),
  .rail-user > strong { display: none; }
  .rail-theme { width: 34px; height: 34px; }
  .context-panel { display: block; height: auto; padding: 0 16px 20px; }
  .context-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }
  .context-panel > .context-filters,
  .context-suggestions { display: none; }
  .mobile-activity {
    display: block;
    margin-top: 26px;
  }
  .mobile-activity .rail-service {
    display: block;
    width: 100%;
  }
  .mobile-activity .rail-activity-chart {
    width: 100%;
    max-width: none;
  }
  .mobile-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 41px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: var(--card-2);
    color: var(--ink);
    font-size: 12px;
    cursor: pointer;
  }
  .mobile-filter-trigger .icon { width: 16px; height: 16px; }
  .modal-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .modal-filters .rail-filter-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .modal-filters .rail-label { margin: 0 0 7px; }
  .modal-filters .rail-country {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .modal-filters .rail-country select { width: 100%; padding: 7px 20px 7px 0; }
  .figure-modules { grid-template-columns: 1fr; }
  .figure-modules > * { grid-column: 1; }
  .leaderboard-panel { padding-bottom: 48px; }
  .profile-page { padding-bottom: 40px; }
}

.profile-page .aura--down,
.profile-page .profile-extreme .aura--down,
.profile-page .most-voted-score.aura--down {
  color: rgba(187, 72, 139, 0.78);
}

@media (max-width: 820px) {
  .filters-modal { padding: 22px; }
  .filters-modal-heading { margin-bottom: 22px; }
  .modal-filters {
    column-gap: 24px;
    row-gap: 28px;
  }
  .modal-filters .rail-filter-group { gap: 4px; }
  .modal-filters .rail-label { margin-bottom: 9px; }
  .modal-filters .rail-filter-group button { line-height: 1.85; }
  .modal-filters .rail-country select { padding-block: 9px; }
  .filters-modal-done { margin-top: 28px; }
}

html.is-safari .rail-activity-chart {
  height: 52px;
  margin-top: 0;
  padding-top: 12px;
  overflow: hidden;
}
html.is-safari .figure-activity {
  height: 57px;
  margin-top: 0;
  padding-top: 17px;
  overflow: hidden;
}
@media (max-width: 820px) {
  html.is-safari .figure-activity {
    height: 54px;
    padding-top: 14px;
  }
}
