/* ideoMap — Mobile-first Modern Styles. Light-Whitish Aesthetic. */

/* ---------- Fonts (Self-hosted, see assets/fonts/LICENSE.txt) ---------- */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Devanagari headings. Only downloaded when Hindi text is set in serif. */
@font-face {
  font-family: "Tiro Devanagari Hindi";
  src: url("../fonts/tiro-devanagari-hindi.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF;
}

/* ---------- Design Tokens (Light-Whitish Theme) ---------- */

:root {
  --bg: #fcfcfd;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: rgba(226, 232, 240, 0.85);
  --border-strong: rgba(203, 213, 225, 0.9);
  --border-focus: #4f46e5;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-ring: rgba(79, 70, 229, 0.12);
  --whatsapp: #15803d;
  --whatsapp-hover: #166534;
  --danger: #dc2626;

  /* Compass Quadrants (Soft Pastel Light Tints) */
  --q-auth-left: rgba(244, 63, 94, 0.07);
  --q-auth-right: rgba(59, 130, 246, 0.07);
  --q-lib-left: rgba(16, 185, 129, 0.07);
  --q-lib-right: rgba(245, 158, 11, 0.07);
  --grid: #e2e8f0;

  /* Diverging Spectrum Colors (Clean, Harmonic) */
  --div-l2: #f43f5e;
  --div-lm: #fb7185;
  --div-l1: #fda4af;
  --div-mid: #cbd5e1;
  --div-r1: #93c5fd;
  --div-rm: #60a5fa;
  --div-r2: #3b82f6;

  /* Inspiring / Cautionary */
  --good: #16a34a;
  --good-soft: #f0fdf4;
  --good-border: #bbf7d0;
  --warn: #dc2626;
  --warn-soft: #fef2f2;
  --warn-border: #fecaca;

  /* Typography */
  --font-sans: "Instrument Sans", "Kohinoor Devanagari", "Noto Sans Devanagari", "Nirmala UI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", "Tiro Devanagari Hindi", "Noto Serif Devanagari", Georgia, "Times New Roman", serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;

  /* Elevation Shadows (Layered Luxury Soft Light) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -4px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 4px 6px -1px rgba(15, 23, 42, 0.03), 0 16px 36px -8px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 8px 20px -4px rgba(15, 23, 42, 0.06), 0 24px 48px -12px rgba(15, 23, 42, 0.1);

  /* Geometry */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 8px;
  --gutter: 18px;
  --column: 560px;       /* focused pages: start, quiz */
  --column-prose: 680px; /* reading pages: about, privacy, contact */
  --column-wide: 1040px; /* dashboards on desktop: home, result, stats */
  color-scheme: light;
}

/* Each page's content width. The header uses the same value so the logo lines up with the content. */
body { --page-width: var(--column); }
body[data-page="about"],
body[data-page="privacy"],
body[data-page="contact"] { --page-width: var(--column-prose); }
@media (min-width: 960px) {
  body[data-page="home"],
  body[data-page="result"],
  body[data-page="stats"] { --page-width: var(--column-wide); }
}

/* ---------- Base & Reset ---------- */

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

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

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(120% 70% at 50% -5%, rgba(79, 70, 229, 0.035) 0%, rgba(248, 250, 252, 0) 60%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
  font-feature-settings: "cv01", "cv02", "calt";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

[lang="hi"],
html[lang="hi"] body { line-height: 1.72; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease, opacity 0.15s ease;
}

h1, h2, h3 {
  margin: 0 0 10px;
  color: var(--ink);
  text-wrap: balance;
}
h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.45rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
p {
  margin: 0 0 12px;
  text-wrap: pretty;
}
strong { color: var(--ink); font-weight: 600; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Site Header (Frosted Glassmorphism) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px max(var(--gutter), calc((100% - var(--page-width)) / 2 + var(--gutter)));
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-decoration: none;
}
.brand img {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
}
.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  transition: color 0.15s ease;
}
@media (hover: hover) {
  .brand:hover span {
    color: var(--accent);
  }
}

.lang-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}
@media (hover: hover) {
  .lang-switch:hover {
    border-color: var(--ink);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }
}

/* ---------- Layout Containers ---------- */

.container {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 22px var(--gutter) 44px;
  flex: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  margin-bottom: 20px;
  overflow-wrap: break-word; /* wrap a word that is longer than the card instead of spilling out */
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Two cards side by side on desktop; a single stack on phones and tablets.
   minmax(0, 1fr) keeps the column at the container width: an unsized track grows to fit the
   longest unbreakable string (e.g. "Green/Alternative/Libertarian") and scrolls the page sideways. */
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.card-stack { min-width: 0; }
@media (min-width: 960px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }
}

.content {
  padding: 10px 4px 0;
  margin-bottom: 12px;
}
.content h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin-top: 14px;
  margin-bottom: 8px;
}
.content p, .content li {
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.62;
}
.muted { color: var(--muted); }

.site-footer {
  padding: 32px var(--gutter) 96px; /* Room for anchor ad */
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
}
.site-footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 12px;
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
@media (hover: hover) {
  .site-footer a:hover {
    color: var(--ink);
    text-decoration: underline;
  }
}
.site-footer p { margin: 0; font-size: 0.8rem; }

/* ---------- Buttons & Action Pills ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-align: center;
  text-wrap: balance;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:active { transform: scale(0.985); }
.btn svg { width: 19px; height: 19px; flex: none; }

.btn--primary {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15), 0 8px 20px -6px rgba(15, 23, 42, 0.35);
  border-color: rgba(255, 255, 255, 0.1);
}
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn--whatsapp {
  background: var(--whatsapp);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.2), 0 8px 20px -6px rgba(21, 128, 61, 0.45);
}

@media (hover: hover) {
  .btn--primary:hover {
    background: #1e293b;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2), 0 12px 28px -6px rgba(15, 23, 42, 0.45);
    transform: translateY(-1px);
  }
  .btn--ghost:hover {
    border-color: var(--ink);
    background: var(--surface-2);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }
  .btn--whatsapp:hover {
    background: var(--whatsapp-hover);
    box-shadow: 0 2px 4px rgba(21, 128, 61, 0.25), 0 12px 28px -6px rgba(21, 128, 61, 0.55);
    transform: translateY(-1px);
  }
}

.btn + .btn { margin-top: 12px; }

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.btn-row .btn {
  margin-top: 0;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 0.92rem;
}
.btn-row .btn svg { width: 17px; height: 17px; }
.btn-row .btn:only-child,
.btn-row > [hidden] + .btn { grid-column: 1 / -1; }

/* ---------- Badges & Tags ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge--accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #c7d2fe;
}
.badge--good {
  background: var(--good-soft);
  color: var(--good);
  border-color: var(--good-border);
}
.badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: var(--warn-border);
}
.badge--live {
  background: var(--good-soft);
  color: var(--good);
  border-color: var(--good-border);
}
.badge--sample {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border-strong);
}

/* ---------- Home Page Hero & Language Selection ---------- */

.hero {
  position: relative;
  isolation: isolate;
  text-align: center;
  padding: 26px 0 28px;
}

/* Luminous compass ambient grid background */
.hero::before {
  content: "";
  position: absolute;
  inset: -20px calc(-1 * var(--gutter)) 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 50% 30%, rgba(79, 70, 229, 0.06), transparent 70%),
    linear-gradient(rgba(226, 232, 240, 0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 232, 240, 0.7) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px, 28px 28px;
  background-position: center, center top, center top;
  -webkit-mask-image: radial-gradient(ellipse closest-side, #000 35%, transparent);
  mask-image: radial-gradient(ellipse closest-side, #000 35%, transparent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-xs);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: 2.95rem;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  text-wrap: balance;
}
.hero h1 em,
.hero-tiranga-text {
  font-style: italic;
  font-weight: 400;
  /* Tiranga: saffron and green, with Ashoka Chakra navy in place of white so every letter stays readable */
  background: linear-gradient(
    100deg,
    #e8590c 0%,
    #f07a1f 28%,
    #1e3a8a 50%,
    #15803d 72%,
    #138808 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #1e3a8a;
  display: inline-block;
  padding: 0 0.05em;
  position: relative;
}

.hero h1 em::after,
.hero-tiranga-text::after {
  content: "";
  display: block;
  height: 3.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff671f 0% 33.3%, #ffffff 33.3% 66.6%, #138808 66.6% 100%);
  box-shadow: 0 0 0 0.8px rgba(15, 23, 42, 0.2), 0 1px 3px rgba(15, 23, 42, 0.1);
  margin-top: 3px;
}



.hero__hi {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 14px;
  text-wrap: balance;
}

.hero__hi .hero-tiranga-text {
  font-style: normal;
  font-weight: 700;
}
.hero .lead {
  max-width: 32em;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.62;
  text-wrap: pretty;
}

.lang-pick {
  max-width: 640px;
  margin: 8px auto 16px;
}
.lang-pick h2 {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  margin-bottom: 14px;
}

.lang-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.lang-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 154px;
  padding: 20px 18px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.lang-tile:active { transform: scale(0.985); }
.lang-tile__glyph {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1;
  color: var(--ink);
  margin-bottom: auto;
}
.lang-tile__name {
  margin-top: 16px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.lang-tile__sub {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  font-weight: 500;
}
.lang-tile__go {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.lang-tile__go svg { width: 15px; height: 15px; }

@media (hover: hover) {
  .lang-tile:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
  }
  .lang-tile:hover .lang-tile__go {
    background: var(--accent);
    transform: translateX(3px);
  }
}

.meta-pill-bar {
  display: flex;
  justify-content: center;
  margin: 16px auto 0;
}
.meta-pill {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 12px;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meta-pill span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.meta-pill__sep { color: var(--border-strong); }

/* Bento List for "What you'll find out" */
.result-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 16px;
  display: grid;
  gap: 10px;
}
.result-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 0 14px;
  padding: 12px 16px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) {
  .result-list li:hover {
    border-color: var(--border-strong);
    transform: translateX(2px);
  }
}
.result-list__icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 1.18rem;
  line-height: 1;
}
.result-list__hi {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.86rem;
  line-height: 1.4;
}

/* Home "About" card: English and Hindi */
.about-cols__hi {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.about-cols p:last-child { margin-bottom: 0; }

/* ---------- Start Page (Name Form) ---------- */

.name-input {
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 18px 0 14px;
  padding: 14px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
  transition: all 0.2s ease;
}
.name-input::placeholder { color: var(--faint); }
.name-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.name-input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}
.error {
  color: var(--danger);
  font-size: 0.88rem;
  margin: -6px 0 14px;
  font-weight: 500;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 10px 0 14px;
  padding: 0;
  display: grid;
  gap: 16px;
}
.steps li {
  counter-increment: step;
  position: relative;
  min-height: 32px;
  padding: 3px 0 0 48px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.55;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #c7d2fe;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Quiz length picker (Quick 12 / In-depth 24) */
.mode-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 4px 0 18px;
  padding: 0;
  border: 0;
}
.mode-picker__legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.mode-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.mode-option:has(.mode-option__radio:checked) {
  border-color: var(--accent);
  background: #f8faff;
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-sm);
}
.mode-option__radio {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.mode-option__radio:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.mode-option__body {
  flex: 1;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.mode-option__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.mode-option__tag {
  padding: 2px 9px;
  font-size: 0.7rem;
}
.mode-option__meta {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.mode-option__desc {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}
@media (hover: hover) {
  .mode-option:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
  }
}

/* ---------- Quiz Page ---------- */

.progress {
  margin: 0 0 16px;
}
.progress__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.progress__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: -4px 0;
  padding: 4px 14px 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}
.progress__back svg { width: 14px; height: 14px; flex: none; }
@media (hover: hover) {
  .progress__back:hover {
    border-color: var(--ink);
    transform: translateX(-2px);
  }
}

.progress__bar {
  --steps: 12;
  --gap: 4px;
  width: calc(100% + var(--gap));
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / var(--steps) - var(--gap)), transparent 0 calc(100% / var(--steps)));
  mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / var(--steps) - var(--gap)), transparent 0 calc(100% / var(--steps)));
}
.progress__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transform: translateX(calc(var(--gap) / -2));
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.question {
  padding: 24px 20px 20px;
}
.question__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.question__text {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 22px;
  color: var(--ink);
}

.options {
  display: grid;
  gap: 10px;
}
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.005em;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.option:active { transform: scale(0.99); }
.option.is-chosen {
  border-color: var(--accent);
  background: #f8faff;
  box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-sm);
}
.option__dot {
  flex: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  transition: all 0.18s ease;
}
.option.is-chosen .option__dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 4px #ffffff;
}
@media (hover: hover) {
  .option:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }
  .option:hover .option__dot {
    border-color: var(--accent);
  }
}

/* Checkpoint after question 12 of the Quick quiz */
.checkpoint {
  padding: 28px 22px 24px;
  text-align: center;
}
.checkpoint__icon {
  margin: 0 0 6px;
  font-size: 2.2rem;
  line-height: 1;
}
.checkpoint__title {
  margin: 0 0 10px;
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
}
.checkpoint__sub {
  margin: 0 0 22px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}

/* "Why this matters" editorial note */
.note {
  padding: 16px 18px;
  margin: 12px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.note h2 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.note h2::before {
  content: "💡";
  font-size: 0.9rem;
}
.note p {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text);
  text-wrap: pretty;
  margin: 0;
}

/* ---------- Result Page (Bento Cards & Visualizations) ---------- */

.bento-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bento-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.bento-head__title,
.bento-card > h2 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}
.bento-card > h2 { margin-bottom: 14px; }
.bento-card > h2 + .muted { margin-top: -8px; }
.bento-card__sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.45;
}

/* Hero Result Card */
.result-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 20px 22px 20px;
  background: radial-gradient(100% 65% at 50% 0%, rgba(79, 70, 229, 0.04) 0%, rgba(255, 255, 255, 0) 70%), var(--surface);
}
.result-hero > * { position: relative; }

/* ── Brand block (logo + name + tagline) at top of result card ── */
.result-hero__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.result-hero__brand-logo {
  width: 36px;
  height: 36px;
  margin-bottom: 2px;
}

.result-hero__brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.result-hero__brand-tagline {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.01em;
}

.result-hero__emoji {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06), 0 12px 28px -6px rgba(15, 23, 42, 0.08);
  font-size: 2.5rem;
  line-height: 1;
}

.result-hero__lead {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.result-hero__title {
  font-family: var(--font-display);
  font-size: 3.05rem;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  color: var(--ink);
  text-wrap: balance;
}

.result-hero__badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.result-hero__badge {
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Speedometer Radial Gauge */
.gauge-container {
  width: 100%;
  max-width: 330px;
  margin: 4px auto 18px;
}
.gauge-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gauge-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.gauge-seg {
  transition: opacity 0.25s ease, filter 0.25s ease;
}
.gauge-seg.is-active {
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.16));
}
.gauge-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 4px;
  padding: 0 12px;
}
.gauge-end {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.gauge-center { text-align: center; }
.gauge-pct {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.result-hero__desc {
  text-align: left;
  margin: 18px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.98rem;
  line-height: 1.62;
  color: var(--text);
  text-wrap: pretty;
}

.friend-cta { margin-top: 20px; }
.precision-card .bento-head { flex-wrap: wrap; }
.precision-card .bento-card__sub { margin-bottom: 0; }
.precision-card .btn { margin-top: 16px; }

/* Quick Direct Share Block (Directly below Result Hero) */
.quick-share {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px 20px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.quick-share::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #15803d 0%, #e1306c 50%, var(--accent) 100%);
}
.quick-share__header {
  margin-bottom: 14px;
}
.quick-share__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.quick-share__sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.quick-share__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
@media (min-width: 520px) {
  .quick-share__actions {
    grid-template-columns: 1fr 1fr;
  }
}
.btn--share-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 14px;
  background: #15803d;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.22), 0 8px 18px -4px rgba(21, 128, 61, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
}
.btn--share-wa:hover {
  background: #166534;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.3), 0 12px 24px -4px rgba(21, 128, 61, 0.5);
}
.btn--share-insta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(220, 39, 67, 0.22), 0 8px 18px -4px rgba(220, 39, 67, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn--share-insta:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(220, 39, 67, 0.3), 0 12px 24px -4px rgba(220, 39, 67, 0.5);
}
.quick-share__secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.btn--ghost-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
}
.btn--ghost-pill:hover {
  background: #ffffff;
  border-color: var(--ink);
  transform: translateY(-1px);
}
.quick-share__toast {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  animation: toastFadeIn 0.25s ease;
}
.quick-share__toast--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.quick-share__toast--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.retake-btn { max-width: 420px; margin: 4px auto 0; }

/* ── Share Preview Modal ─────────────────────────────────────── */
.share-preview-modal .modal-card {
  max-width: 400px;
}

.share-preview-modal__header {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.share-preview-modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}

.share-preview-modal__subtitle {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 3px 0 0;
}

.share-preview-modal__img-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px 20px 8px;
  background: var(--surface-2);
}

/* canvas preview: scale 1080×1920 canvas to ~180px wide in the modal */
.share-preview-modal__img-wrap canvas,
.share-preview-modal__img-wrap img {
  width: 180px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(15,23,42,0.15);
  display: block;
}

.share-preview-modal__hint {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  padding: 6px 20px 0;
  background: var(--surface-2);
}

.share-preview-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 20px;
}

.btn--wa-confirm {
  background: #25d366;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  width: 100%;
}
.btn--wa-confirm:hover { background: #1ebe5c; transform: translateY(-1px); }

.btn--insta-confirm {
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  width: 100%;
}
.btn--insta-confirm:hover { opacity: 0.9; transform: translateY(-1px); }

.btn--dl-confirm {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
}
.btn--dl-confirm:hover { background: var(--surface-3); }

.share-preview-modal__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
}

.share-preview-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinnerRotate 0.75s linear infinite;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

/* Ideological Neighbours Chips */
.neighbour-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.neighbour-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  transition: all 0.18s ease;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}
@media (hover: hover) {
  .neighbour-chip:hover {
    background: #ffffff;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
  }
}
.neighbour-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.neighbour-chip:active {
  transform: translateY(0);
}
.neighbour-chip__emoji { font-size: 1.15rem; line-height: 1; }
.neighbour-chip__name { white-space: nowrap; }
.neighbour-chip__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  margin-left: 2px;
  transition: color 0.18s ease, transform 0.18s ease;
}
.neighbour-chip:hover .neighbour-chip__info {
  color: var(--accent);
  transform: scale(1.15);
}

.neighbour-sub-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}

/* Ideology Explainer Modal */
body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.is-active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.modal-close:hover {
  background: var(--surface-3);
  color: var(--ink);
  transform: scale(1.06);
}

.modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Modal Internal Sections */
.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 36px;
}

.modal-header__emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-size: 1.8rem;
  line-height: 1;
}

.modal-header__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-header__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.modal-header__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

/* Layman Box */
.modal-layman {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border-strong);
}

.modal-layman__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-layman__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--ink);
  text-wrap: pretty;
}

/* Pillars */
.modal-section {
  margin-bottom: 18px;
}

.modal-section__title {
  margin: 0 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-pillars {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-pillar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  line-height: 1.48;
  color: var(--text);
}

/* Examples inside modal */
.modal-examples-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.modal-example-card {
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.48;
}

.modal-example-card--good {
  background: var(--good-soft);
  border-color: var(--good-border);
}

.modal-example-card--bad {
  background: var(--warn-soft);
  border-color: var(--warn-border);
}

.modal-example-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.modal-example-card__tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.modal-example-card--good .modal-example-card__tag { color: var(--good); }
.modal-example-card--bad .modal-example-card__tag { color: var(--warn); }

.modal-example-card__name {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.modal-example-card__when {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-example-card__text {
  margin: 0;
  color: var(--text);
}

/* Why note */
.modal-why {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-size: 0.85rem;
  line-height: 1.48;
  color: var(--ink);
  margin-bottom: 18px;
}

/* Modal footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.modal-footer .btn {
  width: 100%;
}

@media (min-width: 480px) {
  .modal-footer .btn {
    width: auto;
    min-width: 130px;
  }
}

@media (max-width: 480px) {
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }
  .modal-card {
    max-height: 90vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
  .modal-body {
    padding: 20px 16px;
  }
}

/* Community Comparison */
.community-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 16px;
}
.community-stat-pill {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}
.community-stat-pill__val {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 4px;
}
.community-stat-pill__label {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--muted);
}
.community-btn {
  margin-top: 14px;
  font-size: 0.92rem;
}

/* Dual-Marker Comparison Bar */
.compare-bar {
  margin: 12px 0 6px;
}
.compare-bar__track {
  position: relative;
  height: 10px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.25) 0%, rgba(203, 213, 225, 0.4) 50%, rgba(244, 63, 94, 0.25) 100%);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 18px 0 16px;
}
.compare-bar__mid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgba(148, 163, 184, 0.6);
  transform: translateX(-50%);
  z-index: 1;
}
.compare-bar__avg-line {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2.5px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
  z-index: 2;
}
.compare-bar__marker-pill {
  position: absolute;
  top: -20px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.compare-bar__marker-pill--avg {
  background: var(--ink);
  color: #ffffff;
}
.compare-bar__user-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}
.compare-bar__user-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}
.compare-bar__marker-pill--user {
  top: 17px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}
.compare-bar__avg-line.is-start .compare-bar__avg-tag { left: 0; transform: none; }
.compare-bar__avg-line.is-end .compare-bar__avg-tag { left: auto; right: 0; transform: none; }
.compare-bar__user-pin.is-start .compare-bar__user-tag { left: 0; }
.compare-bar__user-pin.is-end .compare-bar__user-tag { right: 0; }
.compare-bar__ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.compare-bar__mid-tag {
  color: var(--faint);
}

/* Domain Bento Card & Diverging Meters */
.domain {
  margin-bottom: 20px;
}
.meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.meter-head__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.meter__track {
  position: relative;
  display: flex;
  gap: 3px;
  height: 12px;
  background: var(--surface-3);
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.meter__seg {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 4px;
  opacity: 0.45;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.meter__seg:first-child { border-radius: 999px 4px 4px 999px; }
.meter__seg:nth-last-child(2) { border-radius: 4px 999px 999px 4px; }
.meter__seg.is-active {
  opacity: 1;
  transform: scaleY(1.3);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
}
.meter__seg--l2 { background: var(--div-l2); }
.meter__seg--lm { background: var(--div-lm); }
.meter__seg--l1 { background: var(--div-l1); }
.meter__seg--mid { background: var(--div-mid); }
.meter__seg--r1 { background: var(--div-r1); }
.meter__seg--rm { background: var(--div-rm); }
.meter__seg--r2 { background: var(--div-r2); }

.meter__marker {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border: 3.5px solid #ffffff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transform: translateY(-50%);
  z-index: 2;
}
.meter__ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meter__ends strong { color: var(--ink); font-weight: 700; }

.domain__desc {
  margin: 14px 0 16px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  text-wrap: pretty;
}

/* Historical Case Studies (Inspiring & Cautionary) */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 12px;
}
.example {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--good);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.example--bad {
  border-left-color: var(--warn);
}
@media (hover: hover) {
  .example:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }
}
.example__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--good);
}
.example__tag svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.example--bad .example__tag {
  color: var(--warn);
}
.example__name {
  font-family: var(--font-sans);
  margin: 0 0 3px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.example__when {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.example__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.58;
  color: var(--text);
  text-wrap: pretty;
}

/* 2D Political Compass */
.compass {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 14px auto 8px;
}
@media (min-width: 960px) {
  .bento-card--compass .compass { max-width: 380px; margin-top: 22px; }
}
.compass-label {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.copy-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--good);
  font-weight: 600;
  transition: opacity 0.2s ease;
}
.disclaimer {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  margin: 18px auto 0;
  max-width: 32em;
  line-height: 1.5;
}

/* ---------- Overall Ideology Below Compass Card (result.html) ---------- */

.bento-card--community-overall {
  border-color: var(--border-strong);
}

.bento-card--community-overall .bento-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bento-card--community-overall .badge--live,
.bento-card--community-overall .badge--sample {
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulse-dot 2s infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 2-Column Bento KPI Row (Community Center + Top Worldview) */
.community-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 16px;
  align-items: stretch;
}

.community-kpi {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.community-kpi:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.community-kpi__label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

@media (max-width: 480px) {
  .community-kpis {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .community-kpi {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
  }
  .community-kpi__label { margin-bottom: 0; }
  .community-kpi__val { font-size: 1rem; text-align: right; }
}

@media (min-width: 960px) {
  /* The 16-row ranking reads top to bottom in two columns (1–8, then 9–16). */
  .community-section .stats-bars {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(8, auto);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 32px;
  }
}

.community-kpi__val {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  min-width: 0;
}

/* Top Worldview Split: Icon on left, Title + Pct stacked neatly on right */
.community-kpi-top-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.community-kpi-top-row__icon {
  font-size: 1.25rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.community-kpi-top-row__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.community-kpi-top-row__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  word-break: break-word;
}

.community-kpi-top-row__pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 2px;
}

@media (max-width: 360px) {
  .community-kpis {
    gap: 8px;
  }
  .community-kpi {
    padding: 10px 10px;
    gap: 4px;
  }
  .community-kpi__label {
    font-size: 0.62rem;
  }
  .community-kpi__val {
    font-size: 0.9rem;
  }
  .community-kpi-top-row__icon {
    font-size: 1.15rem;
  }
  .community-kpi-top-row__title {
    font-size: 0.88rem;
  }
  .community-kpi-top-row__pct {
    font-size: 0.76rem;
  }
}

/* Integrated Benchmark Hero Card */
.community-benchmark-hero {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.benchmark-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.benchmark-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.benchmark-legend__item--avg {
  color: var(--muted);
}

.benchmark-legend__indicator {
  width: 3px;
  height: 12px;
  background: var(--ink);
  border-radius: 2px;
}

.benchmark-legend__item--user {
  color: var(--accent);
}

.benchmark-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Insight Callout inside Benchmark Hero */
.community-callout {
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.community-callout__text {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
  margin: 0;
}

.community-callout__text strong {
  color: var(--ink);
}

.community-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.community-section__title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.community-section__sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.spectrum-band-row.is-user-row {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

/* ---------- Community Dashboard (stats.html) ---------- */

.stats-nav-bar {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
@media (hover: hover) {
  .btn-back:hover {
    background: var(--surface-2);
    border-color: var(--ink);
    transform: translateX(-2px);
  }
}
.stats-cta-row {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.stats-cta-row .btn { margin: 0; }
@media (min-width: 600px) {
  .stats-cta-row {
    display: flex;
    justify-content: center;
  }
  .stats-cta-row .btn { width: auto; min-width: 200px; }
}

.stats-hero__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.stats-hero__title-row .stats-hero__title {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4.2vw, 2.25rem);
  line-height: 1.15;
  flex: 1;
  min-width: 0;
}
.stats-hero__title-row .btn-refresh {
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .stats-hero__title-row {
    gap: 8px;
  }
  .btn-refresh {
    padding: 5px 10px;
    font-size: 0.75rem;
    gap: 5px;
  }
}
.btn-refresh {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}
@media (hover: hover) {
  .btn-refresh:hover {
    color: var(--ink);
    border-color: var(--ink);
    transform: translateY(-1px);
  }
}
.btn-refresh.is-spinning svg {
  animation: spin-refresh 0.6s linear infinite;
}
@keyframes spin-refresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.stats-hero__sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stats-kpi-card {
  min-width: 0;
  padding: 16px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}
.stats-kpi-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.stats-kpi-card__val {
  font-size: clamp(1.2rem, 0.6rem + 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* Ideology names are words, not numbers: let them wrap at a smaller size. */
.stats-kpi-card__val--text {
  font-size: 1.08rem;
  line-height: 1.3;
  white-space: normal;
}
.stats-kpi-card__sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.stats-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.stats-bar-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.18s ease;
  cursor: pointer;
  position: relative;
}

.stats-bar-item:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.stats-bar-item.is-user {
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.stats-bar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stats-bar-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.stats-bar-item.is-user .stats-bar-icon {
  background: #ffffff;
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.12);
}

.stats-bar-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-bar-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stats-bar-title {
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-bar-user-badge {
  background: var(--accent);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  flex-shrink: 0;
}

.stats-bar-sub {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-bar-metric {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex-shrink: 0;
  text-align: right;
}

.stats-bar-pct {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stats-bar-item.is-user .stats-bar-pct {
  color: var(--accent);
}

.stats-bar-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.stats-bar-emoji { font-size: 1.1rem; flex: none; }
.stats-bar-meta { flex: none; font-size: 0.85rem; color: var(--ink); font-weight: 600; white-space: nowrap; }
.stats-bar-track {
  height: 5px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.stats-bar-item.is-user .stats-bar-track {
  background: rgba(79, 70, 229, 0.15);
}

.stats-bar-fill {
  height: 100%;
  background: #818cf8;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.stats-bar-fill.is-user-fill,
.stats-bar-item.is-user .stats-bar-fill {
  background: var(--accent);
}

.stats-bars-toggle-btn {
  margin-top: 6px;
  width: 100%;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.stats-bars-toggle-btn:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.modal-header__example {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--ink);
}

.result-hero__example-badge {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 600;
}

.spectrum-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.spectrum-band-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.spectrum-band-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}
.spectrum-band-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.spectrum-band-name {
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.spectrum-band-pct {
  flex: none;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.spectrum-band-track {
  height: 7px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.spectrum-band-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.stats-domains-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}
.stats-domain-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.stats-domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.stats-domain-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.stats-domain-avg {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.recent-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.recent-feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
}
@media (hover: hover) {
  .recent-feed-item:hover {
    transform: translateX(2px);
    border-color: var(--border-strong);
  }
}
.recent-feed-icon { font-size: 1.35rem; flex-shrink: 0; }
.recent-feed-body { flex: 1; min-width: 0; }
.recent-feed-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-feed-meta { font-size: 0.78rem; color: var(--muted); }
.recent-feed-time { font-size: 0.78rem; color: var(--faint); flex-shrink: 0; }

@media (min-width: 600px) {
  .stats-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Ad Units (Clean Light Integration) ---------- */

.ad {
  margin: 28px calc(-1 * var(--gutter));
  text-align: center;
}
.ad__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}
.ad__label::before,
.ad__label::after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--border);
}
.ad__box {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad__box > ins { width: 100%; }
.ad[data-ad="top"] { margin-top: 0; margin-bottom: 16px; }
.ad[data-ad="top"] .ad__box { min-height: 100px; }
.ad[data-ad="top"] .ad__box > ins { width: 320px; height: 100px; }
.ad__box--placeholder {
  width: 300px;
  max-width: 100%;
  margin: 0 auto;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--faint);
  font-size: 0.8rem;
  font-weight: 500;
}
.ad[data-ad="top"] .ad__box--placeholder { width: 320px; height: 100px; }

@media (max-height: 700px) {
  .ad[data-ad="top"] .ad__box { min-height: 50px; }
  .ad[data-ad="top"] .ad__box > ins,
  .ad[data-ad="top"] .ad__box--placeholder { height: 50px; }
  .ad[data-ad="top"] { margin-bottom: 12px; }
  .question__label { display: none; }
  .site-header { padding-top: 9px; padding-bottom: 9px; }
  .container { padding-top: 14px; }
  .progress { margin-bottom: 12px; }
  .question { padding: 18px 16px 16px; }
  .question__text { font-size: 1.35rem; line-height: 1.2; margin-bottom: 16px; }
  .options { gap: 8px; }
  .option { min-height: 48px; padding-top: 10px; padding-bottom: 10px; }
}
.ad[data-ad="middle"] .ad__box--placeholder,
.ad[data-ad="bottom"] .ad__box--placeholder { height: 250px; }

/* ---------- Static Prose Pages ---------- */

.prose { padding-top: 28px; }
.prose h1 {
  font-family: var(--font-display);
  font-size: 2.7rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  text-wrap: balance;
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin-top: 32px;
  margin-bottom: 12px;
  text-wrap: balance;
}
.prose p, .prose li {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text);
  text-wrap: pretty;
}
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--faint); }
.prose a:not(.btn) {
  color: var(--accent);
  text-decoration-color: var(--border-strong);
}
.prose a:not(.btn):hover { text-decoration-color: var(--accent); }
.prose code {
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.prose .btn { margin-top: 28px; }

/* ---------- Motion & Animations ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.hero,
.lang-pick,
.card { animation: rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.lang-pick { animation-delay: 0.05s; }
.card + .card { animation-delay: 0.06s; }
.card + .card + .card { animation-delay: 0.12s; }

/* ---------- Modern Aesthetic Live Counter ---------- */

.live-counter-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 10px;
  width: 100%;
}

.live-counter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 20px auto 10px;
  padding: 22px 24px 18px;
  max-width: 460px;
  width: 100%;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 10px 28px -4px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.22s ease;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  animation: live-card-pop 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes live-card-pop {
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.live-counter-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 
    0 4px 12px rgba(15, 23, 42, 0.05),
    0 18px 38px -6px rgba(79, 70, 229, 0.12),
    inset 0 1px 0 #ffffff;
}

.live-counter-glow {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 90px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, rgba(79, 70, 229, 0.06) 55%, transparent 75%);
  pointer-events: none;
  filter: blur(24px);
}

.live-counter-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.live-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.24);
  margin-bottom: 2px;
}

.live-counter-badge-text {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #047857;
}

/* Line 1: The Number */
.live-counter-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  line-height: 1;
  padding: 4px 0 2px;
}

.live-counter-number {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(2.1rem, 6.8vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.05));
}

/* Line 2: The Text */
.live-counter-text-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.35;
  padding: 0 4px;
}

.live-counter-text {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  letter-spacing: -0.01em;
}

.live-counter-text-hi {
  font-size: 0.88rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1.3;
}

.live-counter-link-hint {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.live-counter-card:hover .live-counter-link-hint {
  opacity: 1;
  transform: translateX(2px);
}

.live-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.live-pulse::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  opacity: 0.6;
  animation: live-pulse-wave 2s infinite ease-out;
}
@keyframes live-pulse-wave {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Legacy pill fallback */
.live-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}

/* ---------- Wider Screens (Desktop / Tablet Polish) ---------- */

@media (min-width: 768px) {
  .container { padding-top: 36px; }
  h1 { font-size: 2.85rem; }
  h2 { font-size: 1.7rem; }
  .hero { padding: 40px 0 36px; }
  .hero h1 { font-size: 3.8rem; }
  .hero__hi { font-size: 1.55rem; }
  .question { padding: 30px 28px 24px; }
  .question__text { font-size: 1.85rem; line-height: 1.25; }
  .card { padding: 32px 28px; }
  .result-hero__title { font-size: 3.6rem; }
  .prose h1 { font-size: 3.2rem; }
}

@media (min-width: 960px) {
  /* Home: list in two columns, English and Hindi "About" side by side */
  .result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
  }
  .about-cols__hi {
    margin-top: 0;
    padding-top: 0;
    padding-left: 20px;
    margin-left: -20px;
    border-top: 0;
    border-left: 1px solid var(--border);
  }

  /* Result: keep the summary paragraph at a comfortable reading width */
  .result-hero { padding: 40px 48px 36px; }
  .result-hero__desc {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  .result-hero .friend-cta { max-width: 420px; margin-left: auto; margin-right: auto; }
  .section-intro { max-width: 720px; }
}

/* Small phones (320–360px): give text a little more room inside cards */
@media (max-width: 360px) {
  :root { --gutter: 14px; }
  .card,
  .bento-card { padding-left: 16px; padding-right: 16px; }
  .result-hero { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 2.55rem; }
  .lang-tiles { gap: 10px; }
  .lang-tile { padding: 16px 14px 14px; min-height: 140px; }
  .lang-tile__go { top: 12px; right: 12px; width: 28px; height: 28px; }
  .result-hero__title { font-size: 2.6rem; }
  .meta-pill { gap: 4px 10px; padding: 6px 12px; font-size: 0.76rem; }
  .meta-pill__sep { display: none; }
  .stats-kpi-card { padding: 14px 12px; }
  .stats-kpi-card__val--text { font-size: 0.95rem; }
}

/* ---------- Hindi Typography Integrity ---------- */

:lang(hi),
[lang="hi"] {
  letter-spacing: 0 !important;
}

html[lang="hi"] body {
  line-height: 1.72;
}

h1:lang(hi) {
  font-family: var(--font-sans);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.3;
}

h2:lang(hi) {
  font-family: var(--font-sans);
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.38;
}

.hero h1:lang(hi) {
  font-family: var(--font-sans);
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.28;
}

.hero__hi:lang(hi) {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.bento-head__title:lang(hi),
.bento-card > h2:lang(hi) {
  font-size: 1.22rem;
  line-height: 1.4;
}

.result-hero__title:lang(hi) {
  font-family: var(--font-sans);
  font-size: 2.45rem;
  font-weight: 700;
  line-height: 1.22;
}

.question__text:lang(hi) {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.42;
}

.note p:lang(hi) {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.68;
}

.compass-label:lang(hi),
.compass text:lang(hi) {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0;
}

@media (max-height: 700px) {
  .question__text:lang(hi) { font-size: 1.22rem; line-height: 1.38; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { transition: none !important; animation: none !important; }
}
