/* =========================================================
   Решето — Institutional Design System
   ========================================================= */

/* ── FONTS ── */
@font-face {
  font-family: 'Areal RNIDS';
  src: url('/static/fonts/ArealRNIDS-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Areal RNIDS';
  src: url('/static/fonts/ArealRNIDS-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Areal RNIDS';
  src: url('/static/fonts/ArealRNIDS-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Areal RNIDS';
  src: url('/static/fonts/ArealRNIDS-ExtraBold.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Areal RNIDS';
  src: url('/static/fonts/ArealRNIDS-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ── CSS VARIABLES ── */
:root {
  --navy:       #1e3a5f;
  --navy-light: #2c5282;
  --navy-dark:  #152d4a;
  --white:      #faf8f5;
  --off-white:  #f5f3ee;
  --gold:       #e8b84d;
  --gold-light: #f0cc6a;
  --text:       #1a1a1a;
  --text-muted: #555555;
  --border:     #ddd8d0;
  --radius:     8px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-button: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
  --green:      #16a34a;
  --red:        #dc2626;
  --orange:     #d97706;
}

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

/* ── ACCESSIBLE FOCUS STATES ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

html { height: 100%; }
body { scroll-behavior: smooth; overflow-x: hidden; min-height: 100%; }

/* Page transition — content fades in, nav stays instant */
.topnav, nav.public-nav, nav.auth-nav { opacity: 1 !important; animation: none !important; }
.app-container, .auth-container, .auth-split, .page, .hero, .stats-bar, .how-it-works, .example-section, .features-section, .pricing, .faq, .cta-banner, footer {
  animation: page-fade-in 0.25s ease-out;
}
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Respect user's motion preferences (WCAG, Apple HIG) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: 'Areal RNIDS', Arial, 'Helvetica Neue', sans-serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.6;
}

/* Arrow icon helper — Areal RNIDS renders → too small */
.arrow { font-size: 1.8em; vertical-align: 0em; line-height: 0; display: inline-block; }

a {
  color: inherit;
  text-decoration: none;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-dark);
  border: none;
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;  /* never wrap CTA text mid-button */
  border-radius: var(--radius);
  box-shadow: var(--shadow-button);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.3);
  padding: 14px 36px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;  /* never wrap CTA text mid-button */
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.6); transform: translateY(-1px); }

.btn-nav {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}
.btn-nav:hover { background: var(--navy-light); }

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn-outline:hover { background: var(--navy); color: var(--white); transform: translateY(-1px); }

.btn-check {
  display: block;
  width: 100%;
  background: var(--gold);
  color: var(--navy-dark);
  border: none;
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-transform: uppercase;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
}
.btn-check:hover { background: var(--gold-light); }

/* ── LOADING DOTS ── */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

/* ── PUBLIC NAV ── */
nav.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px 16px 24px;
  background: #ffffff;
  border-bottom: 2px solid var(--navy);
}
.nav-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
}
.nav-logo span { color: var(--gold); }
.nav-logo-img { height: 60px; width: auto; display: block; margin-top: -3px; margin-bottom: 4px; }
/* logo_nav.svg is already designed white-on-transparent, so no filter.
   Applying brightness(0) invert(1) here would collapse the sieve dots. */
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.btn-nav { color: var(--white); }
.nav-links a.btn-nav:hover { color: var(--white); }

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 101;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── LOGGED-IN TOPNAV ── */
nav.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 48px 10px 24px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
nav.topnav .nav-logo { color: #ffffff; }
nav.topnav .nav-links { gap: 20px; }
nav.topnav .nav-links a { color: rgba(255,255,255,0.7); font-size: 14px; }
nav.topnav .nav-links a:hover { color: #ffffff; }

/* ── HERO ── */
.hero {
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  color: var(--white);
  padding: 80px 48px 64px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 39px,
    rgba(255,255,255,0.03) 39px,
    rgba(255,255,255,0.03) 40px
  );
  pointer-events: none;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
}
.hero-text {
  text-align: left;
}
.hero-badge {
  display: inline-block;
  border: 1px solid rgba(232, 184, 77, 0.4);
  background: rgba(232, 184, 77, 0.1);
  color: var(--gold);
  padding: 8px 20px;
  font-size: 11px;
  margin-top: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 28px;
  border-radius: 100px;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 22px;
  letter-spacing: -0.8px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 800;
}
.hero h1 .punct {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

/* Editorial eyebrow — small caps with em-rule flanks. Replaces the
   old gold pill (.hero-badge). */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: rgba(255, 255, 255, 0.32);
}

/* Founder/RTV link bumped UP as the primary credibility signal —
   strongest social proof goes above the H1, not buried at the bottom. */
.hero-founder-link-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 14px 8px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 184, 77, 0.35);
  border-radius: 100px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.hero-founder-link-top:hover {
  background: rgba(232, 184, 77, 0.10);
  border-color: rgba(232, 184, 77, 0.6);
}
.hero-founder-link-top .rtv-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hero-founder-link-top .arrow {
  opacity: 0.6;
  margin-left: 2px;
  flex-shrink: 0;
}

/* Pull-quote callout — vertical stack: number + unit on one line, caption below */
.hero-pullquote {
  margin: 8px 0 26px;
  padding: 16px 20px;
  background: rgba(232, 184, 77, 0.08);
  border-left: 3px solid var(--gold);
  max-width: 540px;
}
.hero-pullquote-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: nowrap;
}
.hero-pullquote-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.hero-pullquote-unit {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1;
}
.hero-pullquote-cap {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

/* Trust strip below CTAs — inline horizontal facts separated by · */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.trust-strip .sep { opacity: 0.4; }
.trust-strip .stat-num {
  color: var(--gold);
  font-weight: 800;
}
.hero p {
  font-size: 19px;
  font-weight: 400;
  color: rgba(255,255,255,0.92);
  max-width: 520px;
  margin: 0 0 32px;
  line-height: 1.7;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Hero visual — test paper mockup */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-paper {
  background: #ffffff;
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  width: 100%;
  max-width: 400px;
  transform: perspective(800px) rotateY(-4deg) rotateX(2deg);
  overflow: hidden;
  transition: transform 0.15s ease-out;
}
.hero-paper-header {
  background: var(--navy-dark);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-radius: 10px 10px 0 0;
}
.hero-paper-header strong {
  font-weight: 800;
  font-size: 12px;
}
.hero-paper-header span {
  opacity: 0.6;
  font-size: 11px;
}
.hero-paper-body {
  padding: 20px;
  position: relative;
}
.hero-paper-q {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.hero-paper-qnum {
  font-weight: 800;
  color: var(--navy);
  flex-shrink: 0;
}
.hero-paper-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding-left: 20px;
}
.hero-paper-options span {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
}
.hero-paper-selected {
  background: rgba(30, 58, 95, 0.08);
  color: var(--navy) !important;
  font-weight: 700;
  border: 1px solid var(--navy);
}
.hero-paper-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(transparent, #ffffff);
  pointer-events: none;
}

/* Score chip floating over the paper */
.hero-score-chip {
  position: absolute;
  bottom: -12px;
  right: -12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
  white-space: nowrap;
}

.hero-free-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 12px 28px;
  background: rgba(232, 184, 77, 0.12);
  border: 1px solid rgba(232, 184, 77, 0.3);
  color: var(--gold);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-radius: 100px;
}
@media (max-width: 640px) {
  .hero-free-banner { font-size: 14px; padding: 10px 20px; }
}

/* Founder callout link (RTV badge + story line) — high contrast on the
   dark-navy hero background (gray text-muted #555 was 1.7:1, way below
   WCAG 4.5:1). Cream/white at 88% gives ~10:1 — comfortably readable. */
.hero-founder-link {
  padding: 8px 4px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.88) !important;
  transition: background 0.15s ease;
}
.hero-founder-link:hover {
  background: rgba(232, 184, 77, 0.12);
  color: #ffffff !important;
}
@media (max-width: 640px) {
  .hero-founder-link {
    padding: 12px 4px;
    font-size: 14px !important;
    /* Allow the badge to wrap to its own line below the text on narrow
       viewports — keeps both readable instead of crushing the line. */
    flex-wrap: wrap;
  }
}

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  justify-content: center;
  background: var(--navy-dark);
  padding: 0;
  border-bottom: 3px solid var(--gold);
}
.stat {
  padding: 20px 48px;
  text-align: center;
  color: var(--white);
  border-right: 1px solid rgba(255,255,255,0.1);
}
.stat:last-child { border-right: none; }
.stat-highlight .stat-number { font-size: 36px; color: var(--white); }
.stat-highlight .stat-label { color: var(--gold); font-weight: 700; }
.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
  display: block;
  margin-bottom: 2px;
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.6);
  font-weight: 700;
}

/* ── SECTION COMMON ── */
.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.section-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 56px;
  font-weight: 300;
}

/* ── HOW IT WORKS ── */
.how-it-works {
  padding: 80px 48px;
  background: var(--navy);
  color: var(--white);
  text-align: center;
}
.how-it-works .section-title { color: var(--white); }
.how-it-works .section-subtitle { color: rgba(255,255,255,0.6); }
.steps {
  display: flex;
  gap: 40px;
  max-width: 960px;
  margin: 0 auto;
  justify-content: center;
}
.step {
  flex: 1;
  max-width: 220px;
  text-align: center;
  position: relative;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--gold);
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}
.step h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.step p {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}
.step-arrow {
  position: absolute;
  right: -32px;
  top: 4px;
  color: var(--gold);
  font-size: 36px;
  font-weight: 800;
}

/* ── EXAMPLE QUESTION ── */
.example-section {
  padding: 80px 48px;
  background: var(--white);
}
.example-section .section-title { margin-bottom: 8px; }
.example-section .section-subtitle { margin-bottom: 40px; }
.example-card {
  max-width: 680px;
  margin: 0 auto;
  background: #ffffff;
  border: 2px solid var(--navy);
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.example-header {
  background: var(--navy);
  color: var(--white);
  padding: 12px 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.example-header span:last-child { color: var(--gold); }
.example-body { padding: 28px 32px; }
.example-q-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}
.example-q-text {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
  color: var(--text);
}
.example-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 4px;
  font-size: 14px;
}
.example-option:hover { background: var(--off-white); }
.example-circle {
  width: 18px;
  height: 18px;
  border: 2px solid var(--navy);
  border-radius: 50% !important;
  flex-shrink: 0;
}
.example-note {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── SHOWCASE GRID ── */
.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  align-items: stretch;
}
.showcase-panel {
  position: relative;
  display: flex;
  flex-direction: column;
}
.showcase-panel > .example-card,
.showcase-panel > .demo-explanation,
.showcase-panel > .demo-topics {
  flex: 1;
}
.showcase-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--navy);
  margin-bottom: 12px;
  background: rgba(30,58,95,0.06);
  padding: 6px 14px;
}
.showcase-panel:first-child {
  grid-column: 1 / -1;
  align-items: center;
}

/* Panel 1: question card — reuse existing example-card */
.showcase-panel .example-card { margin: 0; }
.example-option-selected { font-weight: 700; }
.example-circle-filled {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
}

/* Panel 2: AI explanation demo */
.demo-explanation {
  background: #ffffff;
  border: 1px solid var(--border);
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.demo-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fef2f2;
}
.demo-exp-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
}
.demo-exp-wrong {
  background: #ef4444;
  color: white;
}
.demo-exp-qnum {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.demo-exp-answers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.demo-exp-answer { text-align: center; }
.demo-exp-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.demo-exp-value {
  font-size: 24px;
  font-weight: 800;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.demo-exp-yours {
  background: #fef2f2;
  color: #ef4444;
  border: 2px solid #ef4444;
}
.demo-exp-correct {
  background: #f0fdf4;
  color: var(--green);
  border: 2px solid var(--green);
}
.demo-exp-arrow {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 800;
}
.demo-exp-text {
  padding: 20px;
  background: #f8fafc;
}
.demo-exp-text-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy);
  margin-bottom: 10px;
}
.demo-exp-text p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

/* Panel 3: topic breakdown demo */
.demo-topics {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.demo-topic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.demo-topic-header span:first-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.demo-topic-score {
  font-size: 13px;
  font-weight: 800;
}
.demo-topic-great { color: var(--green); }
.demo-topic-ok { color: var(--gold); }
.demo-topic-bad { color: #ef4444; }
.demo-bar {
  height: 8px;
  background: #f1f5f9;
  margin-bottom: 14px;
  overflow: hidden;
}
.demo-bar-fill {
  height: 100%;
  transition: width 0.6s ease;
}
.demo-topics-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

@media (max-width: 768px) {
  .showcase-grid { grid-template-columns: 1fr; max-width: 520px; }
}

/* ── FEATURES ── */
.features-section {
  padding: 80px 48px;
  background: var(--white);
  color: var(--navy);
}
.features-section .section-title { color: var(--navy); }
.features-section .section-subtitle { color: var(--text-muted); margin-bottom: 48px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.feature-card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 32px 28px;
  text-align: left;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gold);
}
.feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  color: var(--gold);
}
.feature-icon svg {
  width: 100%;
  height: 100%;
}
.feature-card h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--navy);
  letter-spacing: 0.2px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .features-section { padding: 48px 16px; }
  .features-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── SOCIAL PROOF ── */
.social-proof {
  padding: 80px 48px;
  background: var(--white);
}
.proof-cards {
  display: flex;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  justify-content: center;
}
.proof-card {
  flex: 1;
  max-width: 280px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.proof-subject {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.proof-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.proof-before {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(0,0,0,0.2);
}
.proof-arrow {
  font-size: 20px;
  color: var(--gold);
  font-weight: 800;
}
.proof-after {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
}
.proof-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
@media (max-width: 640px) {
  .social-proof { padding: 48px 16px; }
  .proof-cards { flex-direction: column; align-items: center; }
}

/* ── PRICING ── */
.pricing {
  padding: 80px 48px;
  background: var(--white);
  text-align: center;
}
.pricing .section-subtitle { margin-bottom: 16px; }
.pricing-countdown {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  background: rgba(212, 168, 67, 0.15);
  display: inline-block;
  padding: 8px 24px;
  margin-bottom: 40px;
  letter-spacing: 0.3px;
}
.pricing-cards {
  display: flex;
  gap: 24px;
  max-width: 840px;
  margin: 0 auto;
  justify-content: center;
  align-items: stretch;
}
.pricing-card {
  flex: 1;
  max-width: 260px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
}
.pricing-card.featured {
  border-color: var(--navy);
  border-width: 3px;
  transform: scale(1.05);
  background: #ffffff;
  box-shadow: 0 4px 24px rgba(30,58,95,0.12);
}
.pricing-card.featured::after {
  content: 'РЕШЕТО';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--navy-dark);
  padding: 4px 16px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
}
.pricing-card.dimmed { opacity: 0.55; }
.pricing-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.pricing-price {
  font-size: 36px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.pricing-price small {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}
.pricing-per {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
}
.pricing-features li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--off-white);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pricing-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
}
.pricing-card.dimmed .pricing-features li::before {
  content: '·';
  color: var(--text-muted);
}
.btn-pricing {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-decoration: none;
}
.btn-pricing.gold {
  background: var(--gold);
  color: var(--navy-dark);
}
.btn-pricing.gold:hover { background: var(--gold-light); }
.btn-pricing.outline {
  background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted);
  cursor: default;
}

/* ── PACK GRID (landing page pricing) ── */
.pack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto 32px;
}
a.pack-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: block;
}
.pack-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 24px 16px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  min-width: 0;
  box-sizing: border-box;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.pack-card:hover { border-color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.pack-card-btn {
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  color: inherit;
}
.pack-form-landing { display: contents; }
.pack-card.popular {
  background: var(--navy);
  border-color: var(--navy);
  border-width: 3px;
  box-shadow: 0 12px 40px rgba(30,58,95,0.22);
}
.pack-card.popular .pack-count,
.pack-card.popular .pack-price { color: #fff; }
.pack-card.popular .pack-price { color: var(--gold); }
.pack-card.popular .pack-per { color: rgba(255,255,255,0.55); }
.pack-card.popular .pack-discount {
  background: rgba(212,168,67,0.2);
  color: var(--gold);
}
.pack-card.popular .pack-badge {
  background: var(--gold);
  color: var(--navy-dark);
}
.pack-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 12px;
  white-space: nowrap;
}
.pack-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.pack-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1;
  margin-bottom: 4px;
}
.pack-price small { font-size: 14px; font-weight: 600; }
.pack-per {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.pack-discount {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  margin-top: 6px;
}
.pricing-compare {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--text-muted);
}

/* ── WEBSOCKET TOAST ── */
.ws-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.ws-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── PAYMENT RESULT PAGES (success / cancel / error) ── */
.result-card {
  max-width: 560px;
  margin: 40px auto;
  padding: 48px 40px;
  background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center;
}
.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 44px;
  font-weight: 800;
  margin-bottom: 20px;
  background: #f0fdf4;
  color: var(--green, #16a34a);
  border: 3px solid var(--green, #16a34a);
}
.result-icon-cancel {
  background: #fef9e7;
  color: #ca8a04;
  border-color: #ca8a04;
}
.result-icon-error {
  background: #fef2f2;
  color: var(--red, #dc2626);
  border-color: var(--red, #dc2626);
}
.result-title {
  font-family: "Areal RNIDS", sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
}
.result-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 32px;
}
.result-details {
  text-align: left;
  background: var(--off-white);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin: 0 0 32px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.result-row:last-child { border-bottom: none; }
.result-row span { color: var(--text-muted); }
.result-row strong { color: var(--navy); font-weight: 800; }
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.result-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 20px 0 0;
}
.result-note a { color: var(--navy); }

/* ── PURCHASE PAGE PAYMENT INFO BLOCK ── */
.purchase-payment-info {
  max-width: 720px;
  margin: 20px auto 0;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center;
}
.purchase-payment-note {
  margin: 18px 0 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.purchase-payment-note strong { color: var(--navy); }
.purchase-legal-links {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.purchase-legal-links a {
  color: var(--navy);
  text-decoration: none;
  margin: 0 2px;
}
.purchase-legal-links a:hover { color: var(--gold); }

/* ── PAYMENT LOGOS ── */
.payment-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.payment-logos-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Areal RNIDS", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.payment-logos-lock { font-size: 13px; }
.payment-logos-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.payment-logos-row img {
  width: auto;
  object-fit: contain;
  display: block;
}
/* Individual logo sizing — real logos have very different aspect ratios */
.payment-logos-row .logo-visa    { height: 18px; }
.payment-logos-row .logo-mc      { height: 26px; }
.payment-logos-row .logo-maestro { height: 22px; }
.payment-logos-row .logo-dina    { height: 22px; }
.payment-logos-row .logo-ips     { height: 22px; }
.payment-logos-row .logo-apay    { height: 26px; }
.payment-logos-row .logo-gpay    { height: 26px; }

.payment-logos-compact .payment-logos-row { gap: 10px; }
.payment-logos-compact .payment-logos-row .logo-visa    { height: 14px; }
.payment-logos-compact .payment-logos-row .logo-mc      { height: 20px; }
.payment-logos-compact .payment-logos-row .logo-maestro { height: 16px; }
.payment-logos-compact .payment-logos-row .logo-dina    { height: 16px; }
.payment-logos-compact .payment-logos-row .logo-ips     { height: 16px; }
.payment-logos-compact .payment-logos-row .logo-apay    { height: 20px; }
.payment-logos-compact .payment-logos-row .logo-gpay    { height: 20px; }

.payment-logos-footer .payment-logos-row {
  gap: 12px;
  opacity: 0.55;
  filter: grayscale(1);
}
.payment-logos-footer .payment-logos-row .logo-visa    { height: 11px; }
.payment-logos-footer .payment-logos-row .logo-mc      { height: 16px; }
.payment-logos-footer .payment-logos-row .logo-maestro { height: 12px; }
.payment-logos-footer .payment-logos-row .logo-dina    { height: 12px; }
.payment-logos-footer .payment-logos-row .logo-ips     { height: 12px; }
.payment-logos-footer .payment-logos-row .logo-apay    { height: 16px; }
.payment-logos-footer .payment-logos-row .logo-gpay    { height: 16px; }

@media (max-width: 640px) {
  .payment-logos-row { gap: 10px; }
}

/* ── LEGAL PAGES ── */
body.legal-page { background: var(--off-white); }
.legal-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-family: "Areal RNIDS", -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1a1a1a;
  line-height: 1.7;
}
.legal-breadcrumb {
  font-family: "Areal RNIDS", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.legal-breadcrumb a { color: var(--navy); text-decoration: none; }
.legal-breadcrumb a:hover { text-decoration: underline; }
.legal-breadcrumb .sep { margin: 0 10px; color: var(--border); }

.legal-content h1 {
  font-family: "Areal RNIDS", sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px;
  line-height: 1.2;
}
.legal-content h2 {
  font-family: "Areal RNIDS", sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin: 40px 0 16px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
}
.legal-content h3 {
  font-family: "Areal RNIDS", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 24px 0 12px;
}
.legal-content p {
  font-size: 15px;
  margin: 0 0 14px;
}
.legal-content strong { color: var(--navy); }
.legal-content a {
  color: var(--navy);
  text-decoration: underline;
}
.legal-content a:hover { color: var(--gold); }
.legal-content ul, .legal-content ol {
  margin: 0 0 16px 24px;
  font-size: 15px;
}
.legal-content li { margin-bottom: 6px; }
.legal-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 32px 0;
}
.legal-content blockquote {
  border-left: 4px solid var(--gold);
  padding: 8px 0 8px 20px;
  margin: 20px 0;
  background: var(--off-white);
  font-style: italic;
  color: var(--text-muted);
}
.legal-content code {
  background: var(--off-white);
  padding: 2px 6px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  border: 1px solid var(--border);
}
.legal-content pre {
  background: var(--off-white);
  border: 1px solid var(--border);
  padding: 16px;
  overflow-x: auto;
  font-family: "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.legal-content table th,
.legal-content table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.legal-content table th {
  background: var(--navy);
  color: #fff;
  font-family: "Areal RNIDS", sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.legal-content table tr:nth-child(even) { background: var(--off-white); }
.legal-back {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}
.btn-back {
  display: inline-block;
  font-family: "Areal RNIDS", sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy);
  text-decoration: none;
  padding: 12px 24px;
  border: 2px solid var(--navy);
  transition: all 0.15s;
}
.btn-back:hover { background: var(--navy); color: #fff; }
.legal-footer {
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 32px 24px;
  font-size: 13px;
  font-family: "Areal RNIDS", sans-serif;
}
.legal-footer a { color: var(--gold); text-decoration: none; }
.legal-footer a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .legal-content { padding: 24px 20px 60px; border-left: none; border-right: none; }
  .legal-content h1 { font-size: 24px; }
  .legal-content h2 { font-size: 17px; }
  .legal-content table { font-size: 12px; }
}

/* ── FAQ ── */
.faq {
  padding: 80px 48px;
  background: var(--white);
}
.faq-list {
  max-width: 680px;
  margin: 40px auto 0;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.faq-q {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after {
  content: '+';
  font-size: 20px;
  color: var(--gold);
  font-weight: 800;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.faq-item.open .faq-q::after {
  content: '−';
}
.faq-a {
  display: none;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 12px;
  padding-right: 40px;
}
.faq-item.open .faq-a {
  display: block;
}

/* ── CTA BANNER ── */
.cta-banner {
  background: var(--navy);
  padding: 56px 48px;
  text-align: center;
  color: var(--white);
}
.cta-banner h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}
.cta-banner p {
  font-size: 15px;
  font-weight: 300;
  color: rgba(255,255,255,0.65);
  margin-bottom: 28px;
}

/* ── FOOTER ── */
footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.4);
  padding: 32px 48px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.5px;
  border-top: 2px solid var(--gold);
}
footer a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}
footer a:hover { color: var(--gold); }

/* ── AUTH PAGES ── */
body.auth-page {
  background: var(--off-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Split layout: navy panel left, form right */
.auth-split {
  flex: 1;
  display: flex;
  /* No min-height: parent body.auth-page is flex column with min-height:100vh
     and flex:1 on this element makes it fill remaining space after the nav
     regardless of nav height. Hardcoded 100vh - 60px was wrong once the nav
     grew past 60px. */
}
.auth-panel {
  flex: 1;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.auth-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 39px,
    rgba(255,255,255,0.03) 39px, rgba(255,255,255,0.03) 40px
  );
  pointer-events: none;
}
.auth-panel-content {
  position: relative;
  max-width: 440px;
}
.auth-panel-content h2 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}
.auth-panel-content p {
  font-size: 18px;
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  margin-bottom: 40px;
}
.auth-panel-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
}
.auth-panel-stat {
  display: flex;
  flex-direction: column;
}
.auth-panel-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
}
.auth-panel-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}
.auth-panel-note {
  font-size: 15px;
  color: var(--gold);
  font-weight: 700;
}

.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 48px;
  background: var(--off-white);
}

.auth-card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 48px;
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.auth-card h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
  text-align: center;
  margin-bottom: 32px;
}

/* Legacy container (verify page) */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

@media (max-width: 768px) {
  .auth-split { flex-direction: column; }
  .auth-panel { padding: 32px 24px; min-height: auto; }
  .auth-panel-content h2 { font-size: 24px; }
  .auth-panel-stats { gap: 16px; }
  .auth-form-side { padding: 32px 24px; }
}
/* ── SETTINGS ── */
.settings-pfp-preview {
  width: 72px; height: 72px;
  background: var(--off-white); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.settings-pfp-preview img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.form-input {
  display: block;
  width: 100%;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus {
  border-color: var(--navy);
}
.form-error {
  margin-top: 6px;
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
}
.form-submit {
  margin-top: 28px;
}
.auth-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-link a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
}
.auth-link a:hover { color: var(--navy-light); }
.auth-error-box {
  background: #fef2f2;
  border: 2px solid var(--red);
  color: var(--red);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}
.auth-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  background: #ffffff;
  border-bottom: 2px solid var(--navy);
}

/* ── DASHBOARD (stub styles) ── */
body.dash-page {
  background: var(--off-white);
  min-height: 100vh;
}
.dash-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}
.dash-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.dash-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 40px;
}
.dash-placeholder {
  background: #ffffff;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── APP PAGE (generate, dashboard, etc.) ── */
.app-page { background: var(--off-white); }

.app-container {
  max-width: 600px;
  margin: 48px auto;
  padding: 0 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 28px;
}

/* User avatar with initials in topnav */
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-dark);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
  transition: box-shadow 0.2s;
}
.user-avatar:hover { box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Generate form card */
.generate-card {
  background: #ffffff;
  border: 2px solid var(--navy);
  padding: 32px;
  box-shadow: 6px 6px 0 rgba(30, 58, 95, 0.08);
}

/* Select styling */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231e3a5f' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* Optional label hint */
.form-optional {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

/* ── DIFFICULTY SLIDER ── */
.difficulty-slider {
  padding: 18px 14px 4px;
  /* --fill-pct is set by JS based on thumb position (0%, 50%, or 100%) */
}
.diff-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin: 0;
  /* Track uses a gradient with a hard stop at --fill-pct — gold to the left
     of the thumb, neutral to the right. Gives live progress feedback as you
     drag without needing a wrapper div. */
  background: linear-gradient(
    to right,
    var(--gold) 0%,
    var(--gold) var(--fill-pct, 50%),
    var(--border) var(--fill-pct, 50%),
    var(--border) 100%
  );
  transition: background 0.2s ease;
}
.diff-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--gold) 0%,
    var(--gold) var(--fill-pct, 50%),
    var(--border) var(--fill-pct, 50%),
    var(--border) 100%
  );
}
.diff-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border), 0 3px 10px rgba(30, 58, 95, 0.28);
  cursor: grab;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.diff-range::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 1px var(--gold), 0 5px 14px rgba(30, 58, 95, 0.35);
}
.diff-range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}
.diff-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border), 0 3px 10px rgba(30, 58, 95, 0.28);
  cursor: grab;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.diff-range::-moz-range-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 1px var(--gold), 0 5px 14px rgba(30, 58, 95, 0.35);
}
.diff-range::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}
/* Labels aligned under the 3 snap positions via grid: left-center-right
   within 3 equal columns puts label 0 at 0%, label 1 at 50%, label 2 at 100%. */
.diff-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 18px;
  padding: 0 2px;
}
.diff-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: color 0.2s ease, font-weight 0.2s ease;
}
.diff-label:first-child { text-align: left; }
.diff-label:last-child  { text-align: right; }
.diff-label:hover { color: var(--navy); }
.diff-label.active {
  color: var(--navy);
  font-weight: 700;
}

/* Gold submit button */
.btn-gold {
  display: inline-block;
  padding: 16px 36px;
  background: var(--gold);
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
  font-family: 'Areal RNIDS', Arial, sans-serif;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.btn-gold:hover { background: #c9a730; }
.btn-gold:active { transform: scale(0.98); }
.btn-gold:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Free test note */
.free-note {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2e7d32;
  text-align: center;
}

/* Success card */
.success-card {
  background: #ffffff;
  border: 2px solid var(--green);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: 6px 6px 0 rgba(22, 163, 74, 0.08);
}
.success-header {
  margin-bottom: 16px;
}
.success-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #2e7d32;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.success-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.success-detail {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.success-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  min-width: 70px;
}
.success-value {
  font-size: 15px;
  color: var(--navy-dark);
  font-weight: 500;
}
.success-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.success-actions .btn-primary,
.success-actions .btn-outline {
  padding: 14px 28px;
  font-size: 14px;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
}

/* ── CHECK / RESULTS PAGE ── */

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

.test-info-bar {
  background: var(--navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  color: var(--white);
}

.answer-section {
  background: #ffffff;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 16px;
  max-width: 100%;
}
@media (max-width: 640px) {
  .answer-grid { grid-template-columns: repeat(2, 1fr); }
}

.answer-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.answer-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

.answer-buttons {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.answer-btn {
  flex: 1;
  padding: 8px 0;
  border: 2px solid var(--border);
  background: var(--white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
}
.answer-btn:hover {
  border-color: var(--navy);
  background: rgba(30,58,95,0.04);
}
.answer-btn.selected {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.answer-btn.selected:hover {
  background: var(--navy-dark);
}

/* ── TABLE ANSWER WIDGET — for matching/T-N table questions ── */
/* The widget needs more space than a single row, so its parent
   answer-cell flips to full-width and the rows stack vertically. */
.answer-cell.answer-cell-wide {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  grid-column: 1 / -1;     /* span ALL columns of the parent grid */
  width: 100%;
  background: var(--off-white);
  border: 2px solid var(--border);
  padding: 14px 16px;
  gap: 10px;
}
.answer-cell.answer-cell-wide .answer-num {
  text-align: left;
  font-size: 14px;
  margin-bottom: 4px;
}
.table-widget {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.table-widget-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--white);
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.table-widget-rowlabel {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}
.table-widget-buttons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.table-widget-cell {
  padding: 6px 14px;
  border: 2px solid var(--border);
  background: var(--white);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.table-widget-cell:hover {
  border-color: var(--navy);
  background: rgba(30,58,95,0.04);
}
.table-widget-cell.selected {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
@media (max-width: 480px) {
  .table-widget-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .table-widget-buttons { justify-content: stretch; flex-wrap: wrap; }
  .table-widget-cell { flex: 1 1 auto; min-width: 80px; }
}
.answer-input {
  width: 100%;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center;
  font-size: 13px;
  text-transform: none;
  text-transform: uppercase;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
}
.answer-input:focus { border-color: var(--navy); outline: none; }

/* btn-check is already defined above, these add specificity for inline usage */

/* ── SCORE HERO ── */
.score-hero {
  background: var(--navy);
  text-align: center;
  padding: 32px 24px;
  color: var(--white);
}

.score-big {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--white);
}

.score-total {
  font-size: 28px;
  font-weight: 800;
  color: rgba(255,255,255,0.5);
}

.score-bar-outer {
  max-width: 400px;
  height: 10px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: var(--gold);
  transition: width 0.6s ease;
}

.score-calculation {
  font-size: 14px;
  color: var(--gold);
  font-weight: 700;
}

/* ── QUICK STATS ── */
.quick-stats {
  display: flex;
  gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  border-top: none;
}

.qs-card {
  flex: 1;
  text-align: center;
  padding: 20px 12px;
  border-right: 1px solid var(--border);
  background: #ffffff;
}
.qs-card:last-child { border-right: none; }

.qs-value {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.qs-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
}

/* ── REVIEW GRID ── */
.review-section {
  margin-top: 24px;
}

.review-section h3 {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--navy);
  letter-spacing: 1px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 12px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .review-grid { grid-template-columns: repeat(4, 1fr); }
}

.review-cell {
  padding: 10px 6px;
  text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
}

/* Student-answer line: long grammar/literature terms (e.g. "атрибутска",
   "апозицијска", "приповетка") overflow a ~90-100px grid cell at 14px.
   Ellipsis-truncate so the user sees a clear "…" hint instead of a
   silently-clipped word. Full text always visible in the wrong-answer
   section below. */
.review-cell > div:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.review-cell.correct {
  background: #f0fdf4;
  border-color: var(--green);
  color: var(--green);
}

.review-cell.wrong {
  background: #fef2f2;
  border-color: var(--red);
  color: var(--red);
}

/* ── WRONG ANSWER DETAILS ── */
.wrong-answer {
  position: relative;
  background: #ffffff;
  border: 2px solid var(--red);
  border-left: 6px solid var(--red);
  padding: 16px 80px 16px 20px;  /* right padding reserves space for the .confidence-meter */
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .wrong-answer { padding-right: 64px; }
}

.wrong-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.wrong-q-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--red);
}

.wrong-answers-row {
  display: flex;
  gap: 24px;
  margin-bottom: 12px;
}

.wrong-value {
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 800;
  border: 2px solid;
  display: inline-block;
  min-width: 48px;
  text-align: center;
}

.wrong-value.yours {
  background: #fef2f2;
  border-color: var(--red);
  color: var(--red);
}

.wrong-value.correct {
  background: #f0fdf4;
  border-color: var(--green);
  color: var(--green);
}

.wrong-explanation {
  font-size: 13px;
  line-height: 1.7;
  background: var(--off-white);
  border-left: 3px solid var(--navy);
  padding: 12px 16px;
  color: var(--text);
}

/* ── FEEDBACK BOX ── */
.feedback-box {
  margin-top: 32px;
  padding: 24px;
  background: var(--off-white);
  border: 2px solid var(--border);
  text-align: center;
}
.feedback-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.feedback-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.feedback-textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
}
.feedback-textarea:focus {
  outline: none;
  border-color: var(--navy);
}
.feedback-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: var(--navy);
  color: #fff;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.feedback-btn:hover { opacity: 0.9; }
.feedback-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.feedback-thanks {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

/* ── BOTTOM ACTIONS ── */
.bottom-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

/* ── DASHBOARD ── */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 24px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -0.3px; }
.page-header-actions { display: flex; gap: 12px; align-items: center; }
.btn-generate {
  display: inline-block;
  background: var(--gold); color: var(--navy-dark);
  border: none; padding: 14px 32px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.5px;
  cursor: pointer; text-transform: uppercase;
  font-family: inherit; text-decoration: none;
}
.btn-generate:hover { background: var(--gold-light); }
.btn-groups {
  display: inline-block;
  background: var(--navy); color: #fff;
  border: none; padding: 14px 28px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.5px;
  cursor: pointer; text-transform: uppercase;
  font-family: inherit; text-decoration: none;
  transition: all 0.2s;
  border-left: 4px solid var(--gold);
}
.btn-groups:hover { background: var(--navy-dark); border-left-width: 8px; }

.subject-tabs { display: flex; gap: 0; justify-content: space-between; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.subject-tab {
  padding: 14px 28px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; border: 2px solid transparent; border-bottom: none;
  background: transparent; color: var(--text-muted);
  font-family: inherit; position: relative; bottom: -2px;
  text-decoration: none; display: inline-block;
}
.subject-tab.active {
  background: var(--navy); color: var(--white);
  border-color: var(--navy); border-bottom: 2px solid var(--navy);
}
.subject-tab:hover:not(.active) { color: var(--navy); background: rgba(255,255,255,0.5); }
.subject-tab.gold-tab { color: var(--gold); }
.subject-tab.gold-tab.active { color: var(--gold); background: var(--navy); }

.overview { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-card { background: #ffffff; border: 1px solid var(--border); padding: 20px 24px; flex: 1; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.stat-card-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 4px; }
.stat-card-value { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-card-value small { font-size: 14px; font-weight: 700; color: var(--text-muted); }
.stat-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-card-value.green { color: var(--green); }

.charts-row { display: flex; gap: 16px; margin-bottom: 24px; }
.chart-card { background: #ffffff; border: 1px solid var(--border); padding: 24px; flex: 1; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.chart-card h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--navy); margin-bottom: 16px; }

.line-chart { position: relative; height: 180px; }
.line-chart svg { width: 100%; height: 100%; }
.chart-grid-line { stroke: var(--off-white); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--navy); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: url(#areaGrad); opacity: 0.15; }
.chart-dot { fill: var(--navy); }
.chart-dot.best { fill: var(--gold); stroke: var(--navy-dark); stroke-width: 2; }
.chart-label { font-size: 10px; fill: var(--text-muted); font-family: 'Areal RNIDS', Arial, sans-serif; }
.chart-value-label { font-size: 11px; fill: var(--navy); font-weight: 700; font-family: 'Areal RNIDS', Arial, sans-serif; }
.chart-y-label { font-size: 9px; fill: var(--text-muted); font-family: 'Areal RNIDS', Arial, sans-serif; }

.donut-container { display: flex; align-items: center; gap: 24px; }
.donut-chart { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.donut-center-value { font-size: 24px; font-weight: 800; color: var(--navy); display: block; }
.donut-center-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.legend-item { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; flex-shrink: 0; margin-right: 8px; }
.legend-name { flex: 1; color: var(--text); }
.legend-pct { font-weight: 800; min-width: 36px; text-align: right; }

.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.topic-item { background: #ffffff; border: 1px solid var(--border); padding: 16px 20px; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.topic-item.weakest { border-color: var(--red); }
.topic-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.topic-name { font-size: 12px; font-weight: 700; color: var(--text); }
.topic-score { font-size: 13px; font-weight: 800; }
.topic-bar { height: 8px; background: var(--off-white); width: 100%; margin-bottom: 4px; }
.topic-bar-fill { height: 100%; transition: width 0.3s; }
.topic-detail { font-size: 10px; color: var(--text-muted); display: flex; justify-content: space-between; }

.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--navy); }
.section-header h2 { font-size: 14px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: 1px; }

.test-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 32px; }
.test-row {
  display: flex; align-items: center; background: #ffffff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; gap: 16px;
}
.test-row:hover { border-color: var(--navy); }
.test-row-date { font-size: 11px; color: var(--text-muted); min-width: 80px; font-weight: 700; }
.test-row-focus { font-size: 12px; color: var(--text); flex: 1; }
.test-row-score { font-size: 16px; font-weight: 800; min-width: 50px; text-align: right; }
.test-row-bar { width: 80px; height: 6px; background: var(--off-white); flex-shrink: 0; }
.test-row-bar-fill { height: 100%; }
.test-row-badge { padding: 3px 10px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; min-width: 72px; text-align: center; }
.badge-checked { background: #e6f4ea; color: var(--green); }
.badge-pending { background: #fff7e6; color: var(--orange); }
.test-row-actions { display: flex; gap: 6px; }
.btn-xs {
  padding: 4px 10px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  border: 1.5px solid var(--navy); background: transparent; color: var(--navy);
  cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block;
}
.btn-xs:hover { background: var(--navy); color: var(--white); }
.btn-xs.gold { border-color: var(--gold); background: var(--gold); color: var(--navy-dark); }
.btn-xs.gold:hover { background: var(--gold-light); border-color: var(--gold-light); }

.empty-state { background: #ffffff; border: 1px solid var(--border); padding: 64px 48px; text-align: center; border-radius: var(--radius); box-shadow: var(--shadow-card); }
.empty-state h2 { font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 12px; }
.empty-state p { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* Color helpers used in dashboard */
.c-red { color: var(--red); }
.c-orange { color: var(--orange); }
.c-green { color: var(--green); }
.bg-red { background: var(--red); }
.bg-orange { background: var(--orange); }
.bg-green { background: var(--green); }
.bg-navy { background: var(--navy); }
.bg-blue { background: #3b82f6; }
.bg-purple { background: #8b5cf6; }
.bg-teal { background: #0d9488; }
.bg-gold { background: var(--gold); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .overview { flex-wrap: wrap; }
  .stat-card { min-width: calc(50% - 8px); }
  .charts-row { flex-direction: column; }
  .topic-grid { grid-template-columns: 1fr; }
  /* Stack hero CTAs earlier — at 900px the side-by-side layout starts to
     squeeze button padding and force awkward ellipses. Stacking at
     this breakpoint keeps buttons full-text without shrinking touch
     target. (Was: stacking only at ≤768px.) */
  .hero-buttons { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero-buttons .btn-primary,
  .hero-buttons .btn-secondary { text-align: center; }
}

@media (max-width: 768px) {
  nav.public-nav { padding: 12px 16px; position: relative; }
  .nav-logo-img { height: 46px; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 2px solid var(--navy);
    border-bottom: 2px solid var(--navy);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    z-index: 100;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links a {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a.btn-nav {
    margin: 8px 16px;
    border-bottom: none;
    text-align: center;
  }
  .btn-nav { padding: 10px 20px; font-size: 13px; }
  .subject-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .subject-tab { padding: 12px 16px; font-size: 11px; white-space: nowrap; }
  .hero { padding: 56px 24px 48px; }
  .hero p { font-size: 17px; }
  .hero-buttons { flex-direction: column; gap: 12px; }
  .stats-bar { flex-wrap: wrap; }
  .stat { padding: 16px 24px; flex: 1; min-width: 140px; }
  .steps { flex-direction: column; align-items: center; }
  .step-arrow { display: none; }
  .how-it-works,
  .example-section,
  .pricing,
  .faq { padding: 56px 24px; }
  .pricing-cards { flex-direction: column; align-items: center; }
  .pricing-card.featured { transform: scale(1); }
  .pack-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .pack-grid .pack-price { font-size: 22px; }
  .pack-grid .pack-count { font-size: 13px; }
  .cta-banner { padding: 40px 24px; }
  footer { padding: 24px 20px; }
  .auth-card { padding: 28px 20px; }
  nav.topnav { padding: 12px 20px; }
  .app-container { margin: 32px auto; padding: 0 16px; }
  .generate-card { padding: 20px 16px; }
  .success-actions { flex-direction: column; }
  .packs { grid-template-columns: repeat(2, 1fr); }
}

/* ── PURCHASE PAGE ── */
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px;
}
.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Credit counter in nav */
.credit-counter {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
  text-decoration: none;
}
.gold-sep {
  color: var(--gold);
  opacity: 0.4;
  font-size: 18px;
  margin: 0 4px;
}
.credit-zero {
  color: var(--red, #dc2626) !important;
}

/* Pack grid */
.packs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 100%;
}
@media (max-width: 768px) {
  .packs { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .packs { grid-template-columns: 1fr; gap: 10px; }
}
.pack-form {
  display: contents;
}
.pack {
  background: #ffffff;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: visible;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-family: inherit;
  box-shadow: var(--shadow-card);
}
.pack:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.pack.popular {
  border-color: var(--gold);
  border-width: 2px;
  overflow: visible;
}
.pack-popular-badge {
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--navy-dark);
  padding: 6px 18px 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  z-index: 2;
  white-space: nowrap;
}
.ribbon-clip {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.pack-ribbon {
  position: absolute;
  top: 8px;
  right: -28px;
  background: var(--red);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  padding: 6px 42px 6px 56px;
  transform: rotate(40deg);
  letter-spacing: 1.5px;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.pack-original {
  font-size: 16px;
  color: var(--red);
  text-decoration: line-through;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.8;
}
.pack .pack-count {
  font-size: 40px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.pack .pack-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
  margin: 6px 0 16px;
}
.pack .pack-price {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
}
.pack .pack-price small {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.pack .pack-per {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── GROUPS PAGES ── */

/* Groups list */
.groups-list {
  margin-bottom: 32px;
}

.group-row-wrap {
  display: flex;
  align-items: center;
}
.group-row-wrap .group-row { flex: 1; }
.group-delete-form { display: flex; align-items: center; }
.group-delete-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px 12px;
  opacity: 0.4;
  filter: grayscale(1);
  transition: opacity 0.15s, filter 0.15s;
}
.group-delete-btn:hover {
  opacity: 1;
  filter: grayscale(0) hue-rotate(0deg) saturate(3);
}
.group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border); border-radius: var(--radius);
  border-bottom: none;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s, border-color 0.1s;
}
.group-row:last-child { border-bottom: 2px solid var(--border); }
.group-row:hover {
  background: var(--off-white);
  border-color: var(--navy);
}

.group-row-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.group-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-meta-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-code-badge {
  background: var(--navy);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  padding: 4px 10px;
  text-transform: uppercase;
}

.group-creator-tag {
  background: var(--gold);
  color: var(--navy-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
}

/* Two-column forms row */
.groups-forms-row {
  display: flex;
  gap: 16px;
}

.groups-form-card {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px;
}

.groups-form-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy);
  margin-bottom: 8px;
}

/* Group detail page */
.group-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.group-code-box {
  background: var(--navy);
  border: 2px solid var(--gold);
  padding: 16px 24px;
  text-align: center;
  flex-shrink: 0;
}

.group-code-big {
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 6px;
  text-transform: uppercase;
}

/* Members list */
.members-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--off-white);
}
.member-row:last-child { border-bottom: none; }

.member-avatar {
  width: 36px;
  height: 36px;
  background: var(--gold);
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}

.member-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.member-joined {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Credit counter in topnav */
.credit-counter {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  letter-spacing: 0.2px;
  background: rgba(255,255,255,0.08);
  padding: 5px 12px;
  border-radius: 100px;
  transition: background 0.2s;
}
.credit-counter:hover { background: rgba(255,255,255,0.14); }
.credit-counter.credit-zero { color: #fca5a5; background: rgba(239,68,68,0.15); }
.gold-sep { color: rgba(255,255,255,0.15); margin: 0 4px; }

/* Empty state for groups */
.empty-state {
  background: #ffffff;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
}
.empty-state h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Responsive groups */
@media (max-width: 640px) {
  .groups-forms-row { flex-direction: column; }
  .group-detail-header { flex-direction: column; }
  .group-code-box { align-self: stretch; }
  .group-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── MOBILE SLEDGEHAMMER ──
   Catch-all rules for elements that don't have per-component mobile styles.
   Placed at end of file so they cascade over earlier desktop rules.
   No !important — let specific rules beat these when they exist. */
@media (max-width: 768px) {
  /* Nothing wider than the viewport, ever */
  html, body { overflow-x: hidden; }
  *, *::before, *::after { box-sizing: border-box; max-width: 100%; }

  /* Cap horizontal padding on common section containers */
  .app-container, .dash-container, .page, .auth-card, .auth-panel,
  .auth-form-side, .hero, .stats-bar, .how-it-works, .example-section,
  .pricing, .faq, .cta-banner, footer, section {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Stack side-by-side flex layouts */
  .auth-split { flex-direction: column; min-height: auto; }
  .auth-panel {
    padding-top: 32px;
    padding-bottom: 32px;
    flex: none;
  }
  .auth-panel-content h2 { font-size: 28px; }
  .auth-panel-content p { font-size: 15px; }
  .auth-panel-stats { gap: 20px; flex-wrap: wrap; }
  .auth-panel-stat-num { font-size: 22px; }

  /* Hero: stack on mobile */
  .hero    { padding: 48px 16px 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-text { text-align: center; }
  .hero p  { font-size: 18px; margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-pullquote { margin-left: auto; margin-right: auto; }
  .trust-strip { justify-content: center; }
  .hero-paper { max-width: 340px; transform: none; }
  .hero-score-chip { bottom: -8px; right: 4px; font-size: 12px; padding: 8px 12px; }

  /* Tables and tall blocks shouldn't bleed horizontally */
  table { width: 100%; }
  img, svg, video { height: auto; }

  /* Buttons should be thumb-friendly width */
  .btn-primary, .btn-secondary, .btn-full { width: 100%; }

  /* Dashboard page header: stack the two action buttons vertically
     so neither gets cut off, and force equal width */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .page-header-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }
  .btn-generate, .btn-groups {
    width: 100%;
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
    box-sizing: border-box;
  }

  /* Tighten topnav horizontal padding so the credit counter + user name
     sit closer to the edge and have room to breathe */
  nav.topnav { padding: 10px 12px; }

  /* Dashboard test rows: wrap on narrow screens */
  .test-row { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .test-row-bar { display: none; }
  .test-row-date { min-width: auto; }
  .test-row-badge { min-width: auto; }

  /* Dashboard stat cards: single column on narrow phones */
  .stat-card { min-width: 100% !important; }

  /* Check page bottom actions: stack vertically */
  .bottom-actions { flex-direction: column; }
  .bottom-actions > * { width: 100%; text-align: center; box-sizing: border-box; }

  /* Donut chart: stack on narrow screens */
  .donut-container { flex-direction: column; align-items: center; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   WORKSHOP — /tests/{id}/generating  (test is being generated)
   Editorial Light treatment: Fraunces display + Geist Mono log + cream paper.
   User stares at this for ~2–3 min; the goal is to make it feel like craft,
   not waiting. Narration stream + progressive question list + rotating
   literary quote carry the perceived time.
   ═════════════════════════════════════════════════════════════════════════ */

.workshop-page { background: var(--white); }

.workshop {
  max-width: 640px;
  margin: 40px auto 60px;
  padding: 0 20px;
}

/* -- Header ---------------------------------------------------------- */
.workshop-header {
  text-align: center;
  margin-bottom: 32px;
}
.workshop-eyebrow {
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.workshop-title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 50, 'WONK' 1;
  font-style: italic;
  font-weight: 400;
  font-size: 54px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 14px;
}
.workshop-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}
.workshop-meta .ws-subject { font-weight: 600; color: var(--text); }
.workshop-meta .ws-sep { opacity: 0.4; }
.workshop-meta .ws-time {
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 12px;
}
.workshop-meta #time-remaining,
.workshop-meta #elapsed-clock {
  color: var(--navy);
  font-weight: 600;
  font-feature-settings: 'tnum';
}

/* -- Narration stream ----------------------------------------------- */
.narration {
  margin: 0 auto 28px;
  min-height: 152px;
  max-width: 580px;
}
.narration-stream {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.narration-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  white-space: pre-wrap;
  max-width: 100%;
}
.narration-line.visible { opacity: 1; transform: translateY(0); }
/* Latest line darkest; older lines progressively fade */
.narration-line.visible:last-child { color: var(--text); opacity: 1; }
.narration-line.visible:nth-last-child(2) { opacity: 0.65; }
.narration-line.visible:nth-last-child(3) { opacity: 0.40; }
.narration-line.visible:nth-last-child(n+4) { opacity: 0.22; }

/* -- Paper card (question list) -------------------------------------- */
.workshop-paper {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 10px 30px rgba(30,58,95,0.06);
  margin-bottom: 36px;
}
.paper-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.paper-header-count { color: var(--navy); font-weight: 600; font-feature-settings: 'tnum'; }

.question-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 12px;
  row-gap: 2px;
}
.qrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 3px;
  transition: background 0.25s ease;
  min-height: 26px;
}
.qrow-num {
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 22px;
  text-align: right;
  font-feature-settings: 'tnum';
}
.qrow-status {
  display: inline-flex;
  position: relative;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.qrow-status svg {
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.qrow[data-state="pending"] .ic-pending { opacity: 1; color: var(--text-muted); }
.qrow[data-state="writing"] .ic-writing { opacity: 1; color: var(--navy); animation: qrow-pulse 1.3s ease-in-out infinite; }
.qrow[data-state="done"]    .ic-done    { opacity: 1; color: var(--navy); }

@keyframes qrow-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.18); opacity: 0.6; }
}

.qrow-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}
.qrow-phase {
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.55;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  transition: color 0.25s ease, opacity 0.25s ease;
}
.qrow[data-state="writing"] {
  background: rgba(232, 184, 77, 0.10);
}
.qrow[data-state="writing"] .qrow-label,
.qrow[data-state="writing"] .qrow-phase {
  color: var(--navy);
  opacity: 1;
}
.qrow[data-state="done"] {
  background: rgba(30, 58, 95, 0.025);
}
.qrow[data-state="done"] .qrow-label { color: var(--text); }
.qrow[data-state="done"] .qrow-phase { opacity: 0.35; }

/* -- Footer: quote + clock ------------------------------------------ */
/* Reset global <footer> styling that bleeds in from site footer rules */
.workshop-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 4px 0 0;
  margin: 0;
  background: transparent !important;
  color: inherit !important;
  border: none !important;
  text-align: inherit !important;
}
.workshop-footer * { color: inherit; }
.workshop-footer .wisdom blockquote { color: var(--text); }
.workshop-footer .wisdom figcaption { color: var(--text-muted); }
.workshop-footer .wisdom-timer { color: var(--text-muted); }
.workshop-footer .wisdom-timer #elapsed-clock { color: var(--navy); }
.wisdom {
  margin: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  max-width: 440px;
}
.wisdom.visible { opacity: 1; }
.wisdom blockquote {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.wisdom figcaption {
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.wisdom-timer {
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.03em;
  font-feature-settings: 'tnum';
}

/* Floating literary quote — fades in at random positions in the side margins.
   Hidden on screens narrower than 1100px (JS sets display:none). */
.wisdom-float {
  position: fixed;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
  margin: 0;
  z-index: 1;
  color: var(--text-muted);
}
.wisdom-float.visible { opacity: 0.78; }
.wisdom-float blockquote {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.wisdom-float figcaption {
  font-family: 'Geist Mono', 'SF Mono', Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.wisdom-timer #elapsed-clock { color: var(--navy); font-weight: 500; }
.wisdom-timer-sep { opacity: 0.4; margin: 0 4px; }

/* -- Error overlay (polls status=error) ----------------------------- */
/* CRITICAL: must respect the HTML `hidden` attribute. Without an explicit
   override, `display: flex` below would defeat `hidden` and the overlay
   would show on every page load. Lesson: any element using `hidden` as the
   visibility toggle needs `[hidden] { display: none }` first. */
.workshop-error[hidden] { display: none !important; }
.workshop-error {
  position: fixed;
  inset: 0;
  background: rgba(250, 248, 245, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 100;
  animation: workshop-fade-in 0.3s ease-out;
}
.workshop-error-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 20px;
}
.workshop-error h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: var(--navy);
  margin: 0 0 8px;
}
.workshop-error p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

@keyframes workshop-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* -- Responsive ------------------------------------------------------ */
@media (max-width: 640px) {
  .workshop { margin-top: 24px; }
  .workshop-title { font-size: 40px; }
  .question-grid { grid-template-columns: repeat(2, 1fr); }
  .qrow-phase { display: none; }
  .workshop-footer { flex-direction: column; align-items: stretch; }
  .wisdom-timer { align-self: flex-end; }
}
@media (max-width: 400px) {
  .workshop-title { font-size: 34px; }
  .question-grid { grid-template-columns: 1fr; column-gap: 0; }
  .narration { min-height: 120px; }
  .narration-stream { font-size: 12px; }
}

/* -- Reduced motion -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .qrow[data-state="writing"] .ic-writing { animation: none; }
  .narration-line { transition: none; transform: none; }
  .wisdom, .wisdom.visible { transition: none; }
}

/* ============================================================ */
/* Phase 1D — Structured answer widgets (new tests only)       */
/* ============================================================ */

.check-v2 { margin-top: 20px; }

.qcard-v2 {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.qcard-v2 .qhead-v2 {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
}
.qcard-v2 .qhead-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.qcard-v2 .num {
  font-weight: 800;
  color: var(--navy);
  font-size: 18px;
}
.qcard-v2 .meta {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.qcard-v2 .qtext-v2 {
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
}
.qcard-v2 .support-v2 {
  background: var(--off-white);
  border-left: 3px solid var(--navy);
  padding: 12px 16px;
  margin: 14px 0 6px;
  font-size: 15px;
  line-height: 1.7;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}
.qcard-v2 .support-v2 .caps {
  font-style: normal; font-weight: 800; color: var(--navy);
  text-transform: uppercase;
}
.qcard-v2 .qbody-v2 { padding: 14px 18px; }

/* field labels for grammar_fields */
.field-row-v2 { margin-bottom: 14px; }
.field-row-v2:last-child { margin-bottom: 0; }
.field-name-v2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Pills */
.pills-v2 { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-v2 {
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.18s ease-out;
  touch-action: manipulation;
}
.pill-v2:hover:not(.selected) {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-button);
}
.pill-v2:active { transform: translateY(0); }
.pill-v2.selected {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  font-weight: 700;
  box-shadow: var(--shadow-button);
}

/* Chips */
.tag-hint-v2 {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.chips-v2 { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-v2 {
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease-out;
  touch-action: manipulation;
}
.chip-v2:hover:not(.selected) {
  border-color: var(--navy);
  transform: translateY(-1px);
}
.chip-v2.selected {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  font-weight: 700;
}
.chip-v2.selected::before {
  content: "✓ ";
  color: var(--gold-light);
  font-weight: 800;
}

/* Numeric + unit */
.numeric-row-v2 { display: flex; gap: 10px; align-items: stretch; }
.num-input-v2 {
  flex: 1;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius);
  min-width: 0;
}
.num-input-v2:focus { border-color: var(--navy); outline: none; }
.unit-select-v2 {
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  border-radius: var(--radius);
  cursor: pointer;
  min-width: 100px;
}

/* Text input (keyword / choice_from_canon) */
.text-input-v2 {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  border-radius: var(--radius);
}
.text-input-v2:focus { border-color: var(--navy); outline: none; }

/* Autocomplete suggestions (choice_from_canon) */
.autocomplete-v2 { position: relative; }
.autocomplete-v2 .suggestions {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff;
  border: 1.5px solid var(--navy);
  border-top: none;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-card);
  z-index: 5;
}
.autocomplete-v2 .sug {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--off-white);
  display: flex; align-items: center;
}
.autocomplete-v2 .sug:last-child { border-bottom: none; }
.autocomplete-v2 .sug:hover,
.autocomplete-v2 .sug.active { background: var(--off-white); }
.autocomplete-v2 .sug mark {
  background: var(--gold-light);
  padding: 0 2px;
  border-radius: 2px;
}

/* Submit bar (sticky) */
.submit-bar-v2 {
  position: sticky; bottom: 0;
  padding: 16px 0 12px;
  margin-top: 24px;
  background: linear-gradient(to top, #fff 50%, rgba(255,255,255,0));
}
.submit-btn-v2 {
  width: 100%;
  min-height: 52px;
  padding: 14px;
  background: var(--navy);
  color: var(--white);
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.submit-btn-v2:hover { background: var(--navy-light); }
.submit-btn-v2:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}
.submit-btn-v2 .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result display v2 */
.result-v2 {
  padding: 14px 18px;
  background: var(--off-white);
  border-top: 1px dashed var(--border);
}
.result-top-v2 {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.badge-v2 {
  display: inline-flex;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}
.badge-v2.correct { background: var(--green); color: #fff; }
.badge-v2.wrong   { background: var(--red); color: #fff; }
.badge-v2.partial { background: var(--orange); color: #fff; }
.badge-v2.score {
  background: #fff;
  border: 1.5px solid var(--navy);
  color: var(--navy);
}

/* ── AI confidence indicator (opt-in toggle on results page) ──────────────
   Shows 🟢/🟡/🔴 next to each grade so students see whether the verdict is
   deterministic, normalized, or AI-judged. Hidden until the user clicks the
   "Прикажи AI поузданост" button — body gets .show-confidence and the
   badges become visible. */
/* AI confidence meter — vertical fill bar pinned to right edge of each
   wrong-answer card. Animated in sync with the SSE explanation stream:
   fill grows from 0% → target as the AI types. Track is gray, fill is a
   bottom-up gradient (red → yellow → green) so the visible color of the
   filled portion communicates confidence at a glance. */
.confidence-meter {
  position: absolute;
  top: 18px;
  bottom: 18px;
  right: 18px;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}
.confidence-meter-pct {
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  line-height: 1;
  min-height: 13px;
  transition: color 0.3s ease;
}
.confidence-meter-track {
  flex: 1;
  width: 10px;
  min-height: 80px;
  /* Track ALWAYS shows the full spectrum gradient (red bottom = 0% conf,
     blue top = 100% conf). The mask above hides the upper portion until
     the fill animates down. */
  background: linear-gradient(
    0deg,
    #c0392b  0%,    /* red */
    #e07d2a 25%,    /* orange */
    #d4a843 50%,    /* gold */
    #5fa86d 75%,    /* green */
    #3a7ec0 100%    /* blue */
  );
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.confidence-meter-mask {
  /* Opaque cover anchored to the TOP of the track. Starts at 100%
     (covers entire gradient → looks empty/gray). Animates DOWN to
     (100 - target)% so the bottom `target%` of the gradient is revealed.
     At 95% target the mask covers top 5%, so all 5 colors are visible.
     At 40% target the mask covers top 60%, so only red→orange→half-gold show. */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: #e8eaed;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  transition: height 2.4s cubic-bezier(0.25, 0.85, 0.4, 1.0);
}
.confidence-meter-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-top: 8px;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .confidence-meter { width: 36px; right: 12px; }
  .confidence-meter-pct { font-size: 12px; }
}
.result-detail-v2 {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.field-line-v2 {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.field-line-v2:last-child { border-bottom: none; }
.mark-ok-v2 { color: var(--green); font-weight: 800; }
.mark-bad-v2 { color: var(--red); font-weight: 800; }

/* Narrow phone tweaks */
@media (max-width: 400px) {
  .pills-v2, .chips-v2 { gap: 6px; }
  .pill-v2 { padding: 9px 13px; font-size: 13px; }
  .numeric-row-v2 { flex-direction: column; }
  .unit-select-v2 { min-width: 0; }
}

/* ============================================================ */
/* Phase 1D Pass 2 — camera / photo upload widget               */
/* ============================================================ */

.camera-block-v2 {
  margin-top: 16px;
  padding: 16px;
  background: var(--off-white);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
}
.camera-btn-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border: 1.5px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s ease-out;
}
.camera-btn-v2:hover {
  background: var(--navy);
  color: var(--white);
}
.camera-btn-v2:hover .camera-icon { color: var(--white); }
.camera-icon {
  width: 22px; height: 22px;
  color: var(--navy);
  transition: color 0.18s;
  flex-shrink: 0;
}
.camera-hint-v2 {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

.camera-uploading-v2 {
  margin-top: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.spinner-sm {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.camera-error-v2 {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(220,38,38,0.08);
  border: 1px solid var(--red);
  border-radius: 6px;
  font-size: 13px;
  color: var(--red);
}

.photo-preview-v2 {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 10px;
}
.photo-thumb-v2 {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}
.photo-meta-v2 { flex: 1; font-size: 13px; line-height: 1.4; min-width: 0; }
.photo-filename { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-size { color: var(--text-muted); font-size: 12px; }
.photo-retake-v2 {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.photo-retake-v2:hover { background: var(--navy); color: var(--white); }

/* ============================================================ */
/* Phase 1D Pass 3 — marking + table widgets                   */
/* ============================================================ */

.marking-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-style: italic;
}

.marking-sentence-v2 {
  background: var(--off-white);
  padding: 16px 18px;
  border-left: 3px solid var(--navy);
  font-size: 17px;
  line-height: 2.2;
  border-radius: 0 6px 6px 0;
}
.word-tap {
  display: inline-block;
  padding: 4px 8px;
  margin: 0 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  color: var(--text);
  touch-action: manipulation;
}
.word-tap:hover:not(.selected) {
  background: rgba(30,58,95,0.12);
}
.word-tap.selected {
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  box-shadow: 0 0 0 2px var(--gold);
}
.word-tap.punct-only { cursor: default; color: var(--text-muted); }
.word-tap.punct-only:hover { background: transparent; }

/* Table T/F or matching */
.tftable-v2 {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 4px;
}
.tftable-v2 th, .tftable-v2 td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
.tftable-v2 th {
  background: var(--off-white);
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tftable-v2 th:first-child { text-align: left; }
.tftable-v2 .tftable-label {
  background: #fff;
  font-size: 14px;
}
.tftable-v2 .tftable-mark {
  text-align: center;
  min-width: 56px;
  min-height: 44px;
  cursor: pointer;
  font-size: 20px;
  color: var(--border);
  user-select: none;
  transition: all 0.15s;
  touch-action: manipulation;
}
.tftable-v2 .tftable-mark:hover {
  background: var(--off-white);
}
.tftable-v2 .tftable-mark.selected {
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
}

/* Richer result detail (per-field breakdown) */
.field-result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.field-result-line:last-child { border-bottom: none; }
.field-result-line b { font-weight: 800; }
.field-mark-ok { color: var(--green); font-weight: 800; font-size: 16px; }
.field-mark-bad { color: var(--red); font-weight: 800; font-size: 16px; }

.method-result-v2 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.method-result-v2 .photo-thumb-res {
  width: 60px; height: 80px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}
.method-result-v2 .method-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
}

/* ============================================================ */
/* Phase 1D Pass 3c — live answered counter                     */
/* ============================================================ */
.progress-indicator-v2 {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.progress-indicator-v2 #progress-count {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}
.progress-indicator-v2.complete {
  color: var(--green);
}
.progress-indicator-v2.complete #progress-count {
  color: var(--green);
}

/* ============================================================ */
/* Apr 26 — SHAREABLE CHALLENGE CARD                            */
/* Story-aspect card the student can screenshot and post to IG/ */
/* Viber. Layout chosen so a phone-screenshot crops cleanly.    */
/* Mirrored in main.js renderResults(); keep CSS class names    */
/* in lock-step when editing.                                   */
/* ============================================================ */
.challenge-card-wrap {
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.challenge-card {
  width: 100%;
  max-width: 380px;
  /* Tall, story-ish aspect; min-height keeps the empty-percentile case
     looking the same height as the populated one (no awkward shrink). */
  min-height: 600px;
  padding: 32px 28px 24px;
  background: linear-gradient(170deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-light) 100%);
  color: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}

/* Subtle gold corner glow — visible in screenshots, doesn't print */
.challenge-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(232,184,77,0.25) 0%, rgba(232,184,77,0) 70%);
  pointer-events: none;
}

.challenge-card__top {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.challenge-card__logo {
  width: 96px;
  height: auto;
  /* Logo is navy on cream by default; force visibility on dark gradient. */
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.challenge-card__subject {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
}

.challenge-card__date {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  margin-bottom: 18px;
}

.challenge-card__score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 8px 0 4px;
  line-height: 1;
}

.challenge-card__score-num {
  font-size: 88px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -2px;
}

.challenge-card__score-sep {
  font-size: 48px;
  font-weight: 800;
  color: rgba(255,255,255,0.35);
}

.challenge-card__score-total {
  font-size: 48px;
  font-weight: 800;
  color: rgba(255,255,255,0.45);
}

.challenge-card__pct {
  font-size: 16px;
  color: var(--gold);
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: 0.4px;
}

.challenge-card__beat {
  margin: 18px 12px 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(232,184,77,0.4);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(255,255,255,0.92);
}
.challenge-card__beat strong {
  color: var(--gold);
  font-weight: 800;
}

.challenge-card__cta {
  margin-top: auto;
  padding-top: 20px;
}

.challenge-card__cta-line {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.challenge-card__cta-url {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1.5px;
}

.challenge-card__band {
  margin-top: 18px;
  padding-top: 14px;
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
}

/* Action row below the card — buttons explicitly NOT inside the card so
   they don't end up in the screenshot. */
.challenge-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.btn-share-card,
.btn-share-copy {
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.4px;
  padding: 12px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-share-card {
  background: var(--gold);
  color: var(--navy-dark);
  box-shadow: var(--shadow-button);
}
.btn-share-card:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-share-copy {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-share-copy:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}

.challenge-card__hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}

/* Brief flash to draw the eye to the card when "Сликај и подели" tapped —
   teen audience tends to miss instructions, the wiggle is the hint. */
@keyframes challenge-card-flash {
  0%   { box-shadow: 0 12px 32px rgba(0,0,0,0.18); }
  40%  { box-shadow: 0 0 0 6px rgba(232,184,77,0.55), 0 12px 32px rgba(0,0,0,0.18); }
  100% { box-shadow: 0 12px 32px rgba(0,0,0,0.18); }
}
.challenge-card.flash {
  animation: challenge-card-flash 1.2s ease-out;
}

/* ── Mobile — full-width and slightly tighter padding ── */
@media (max-width: 480px) {
  .challenge-card {
    max-width: 100%;
    padding: 26px 20px 20px;
    min-height: 560px;
    border-radius: 12px;
  }
  .challenge-card__score-num { font-size: 76px; }
  .challenge-card__score-sep,
  .challenge-card__score-total { font-size: 40px; }
}

/* ── Print: keep the card looking the same on paper ── */
@media print {
  .challenge-card { box-shadow: none; border: 1px solid var(--navy); }
  .challenge-card__actions,
  .challenge-card__hint { display: none; }
}
