:root {
  --bg: #f5efe3;
  --bg-strong: #e6dcc8;
  --surface: rgba(255, 251, 245, 0.94);
  --surface-strong: #fffdf8;
  --text: #172434;
  --muted: #596574;
  --line: rgba(23, 36, 52, 0.12);
  --brand: #174a7e;
  --brand-dark: #0b2747;
  --brand-soft: rgba(23, 74, 126, 0.12);
  --brand-action: #174a7e;
  --brand-action-dark: #0b2747;
  --accent: #b72d36;
  --accent-dark: #8f2029;
  --accent-soft: rgba(183, 45, 54, 0.12);
  --accent-action: #b72d36;
  --accent-action-dark: #8f2029;
  --success: #18794e;
  --danger: #b53b3b;
  --shadow: 0 24px 60px rgba(54, 45, 31, 0.12);
  --card-blur: 14px;
  --focus: rgba(23, 74, 126, 0.22);
  --font-scale: 1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  font-size: calc(16px * var(--font-scale));
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 12%, transparent), transparent 30%),
    radial-gradient(circle at bottom right, color-mix(in srgb, var(--brand) 14%, transparent), transparent 28%),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 100%);
}

body[data-state-code] {
  --brand: var(--state-brand);
  --brand-dark: var(--state-brand-dark);
  --brand-soft: color-mix(in srgb, var(--state-brand) 14%, transparent);
  --brand-action: var(--state-brand);
  --brand-action-dark: var(--state-brand-dark);
  --accent: var(--state-accent);
  --accent-dark: var(--state-accent-dark);
  --accent-soft: color-mix(in srgb, var(--state-accent) 14%, transparent);
  --accent-action: var(--state-accent);
  --accent-action-dark: var(--state-accent-dark);
  --focus: color-mix(in srgb, var(--state-brand) 22%, transparent);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumbs a {
  color: var(--brand-dark);
  font-weight: 700;
  text-underline-offset: 0.18em;
}

.breadcrumbs [aria-current="page"] {
  font-weight: 650;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.85) 0, rgba(255, 255, 255, 0) 26%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 45%);
}

body[data-theme="dark"] {
  --bg: #081525;
  --bg-strong: #12263a;
  --surface: rgba(12, 28, 45, 0.92);
  --surface-strong: #14263a;
  --text: #edf3f9;
  --muted: #bac8d6;
  --line: rgba(237, 243, 249, 0.12);
  --brand: #78b7ee;
  --brand-dark: #4d93cf;
  --brand-soft: rgba(120, 183, 238, 0.16);
  --accent: #ef6b73;
  --accent-dark: #d84c56;
  --accent-soft: rgba(239, 107, 115, 0.16);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  --focus: rgba(120, 183, 238, 0.28);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 12%, transparent), transparent 24%),
    radial-gradient(circle at bottom right, color-mix(in srgb, var(--brand) 10%, transparent), transparent 28%),
    linear-gradient(180deg, #0b1a2b 0%, var(--bg) 100%);
}

body[data-theme="dark"][data-state-code] {
  --brand: color-mix(in srgb, var(--state-brand) 38%, #fff);
  --brand-dark: color-mix(in srgb, var(--state-brand) 52%, #fff);
  --brand-soft: color-mix(in srgb, var(--state-brand) 24%, transparent);
  --accent: color-mix(in srgb, var(--state-accent) 44%, #fff);
  --accent-dark: color-mix(in srgb, var(--state-accent) 58%, #fff);
  --accent-soft: color-mix(in srgb, var(--state-accent) 24%, transparent);
  --focus: color-mix(in srgb, var(--state-brand) 34%, transparent);
}

body[data-contrast="high"] {
  --line: rgba(31, 42, 40, 0.28);
  --muted: #37403a;
  --shadow: 0 0 0 rgba(0, 0, 0, 0);
}

body[data-theme="dark"][data-contrast="high"] {
  --line: rgba(237, 242, 238, 0.28);
  --muted: #dbe7df;
}

body[data-font-size="large"] {
  --font-scale: 1.08;
}

body[data-font-size="large"] .accessibility-panel {
  width: min(460px, calc(100vw - 24px));
}

body[data-font-size="large"] .segmented-control {
  grid-template-columns: 1fr;
}

body[data-font-size="large"] .segment-button {
  min-height: 3.5rem;
  padding: 13px 14px;
}

body[data-font-size="large"] .accessibility-trigger,
body[data-font-size="large"] .accessibility-reset {
  white-space: normal;
  text-align: center;
}

body[data-font-size="large"] .accessibility-reset {
  width: 100%;
  justify-content: center;
}

body[data-motion="reduced"] *,
body[data-motion="reduced"] *::before,
body[data-motion="reduced"] *::after {
  animation: none !important;
  transition: none !important;
}

body[data-focus-highlight="true"] *:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus);
}

body[data-focus-highlight="true"] .answer-button:focus-visible,
body[data-focus-highlight="true"] .segment-button:focus-visible,
body[data-focus-highlight="true"] .primary-button:focus-visible,
body[data-focus-highlight="true"] .secondary-button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.site-header,
.app-shell {
  width: min(1120px, calc(100% - 24px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 12px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-home-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.brand-home-button:hover .brand-title,
.brand-home-button:focus-visible .brand-title {
  color: var(--brand);
}

.brand-home-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
  border-radius: 20px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: block;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
}

.brand-title,
.hero-title,
h2,
h3 {
  margin: 0;
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.brand-title {
  font-size: 1.65rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.header-chip,
.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  color: var(--brand-dark);
  font-weight: 600;
}

.header-chip-free {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-action) 0%, var(--accent-action-dark) 100%);
  color: #fff9ed;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-action) 24%, transparent);
  text-decoration: underline;
  text-decoration-color: rgba(255, 249, 237, 0.78);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

.accessibility-wrap {
  position: relative;
}

.accessibility-trigger {
  white-space: normal;
  text-align: center;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.accessibility-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 24px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  backdrop-filter: blur(var(--card-blur));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.accessibility-panel-head {
  margin-bottom: 12px;
}

.accessibility-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.accessibility-group + .accessibility-group {
  margin-top: 14px;
}

.accessibility-reset {
  display: inline-flex;
  white-space: normal;
  margin-top: 16px;
}

.accessibility-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.segment-button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
  cursor: pointer;
}

.segment-button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-action) 0%, var(--brand-action-dark) 100%);
  color: #f8fbf9;
}

.meta-pill-soft {
  border-color: rgba(18, 37, 58, 0.08);
  color: var(--muted);
}

.app-shell {
  display: grid;
  gap: 22px;
  padding-bottom: 28px;
}

.hero-shell,
.test-card,
.results-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  backdrop-filter: blur(var(--card-blur));
  box-shadow: var(--shadow);
}

.hero-shell::after,
.test-card::after,
.results-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -110px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.state-signature {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  margin: 0 0 16px;
  padding: 5px 13px 5px 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--brand-dark);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 38%, transparent);
}

.state-silhouette {
  display: block;
  width: 64px;
  height: 44px;
}

.state-silhouette path {
  fill: var(--brand-soft);
  stroke: var(--brand);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.state-monogram {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hero-title {
  max-width: 11ch;
  font-size: clamp(2.4rem, 4.1vw, 4.35rem);
}

.hero-text,
.feature-card p,
.state-note,
.feedback-copy,
.results-copy,
#progress-copy {
  color: var(--muted);
  line-height: 1.65;
}

.hero-text {
  max-width: 52ch;
  margin: 14px 0 0;
  font-size: 1rem;
}

.hero-info-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
  max-width: 760px;
}

.hero-info-card {
  padding: 14px 15px 12px;
  border-radius: 18px;
  border: 1px solid rgba(18, 37, 58, 0.08);
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
}

.hero-info-value {
  display: block;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  white-space: pre-line;
}

.hero-info-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.setup-card {
  position: relative;
  z-index: 1;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 98%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
}

.setup-head h2 {
  font-size: 1.36rem;
  max-width: 14ch;
}

.state-lockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--brand-soft) 70%, transparent);
  border: 1px solid var(--line);
}

.state-lockup-label,
.state-lockup-value span {
  color: var(--muted);
}

.state-lockup-value {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.state-lockup-value strong {
  font-size: 1.05rem;
}

.language-field {
  margin-top: 14px;
}

.language-field-priority {
  margin-top: 18px;
}

.language-select-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.language-select {
  width: 100%;
  min-height: 58px;
  padding: 15px 48px 15px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background-color: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  appearance: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand-dark) 50%),
    linear-gradient(135deg, var(--brand-dark) 50%, transparent 50%);
  background-position:
    calc(100% - 24px) calc(50% - 3px),
    calc(100% - 18px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.language-select:hover,
.language-select:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus);
  outline: none;
}

.language-select option {
  font-weight: 600;
}

.stat-value {
  display: block;
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.state-note {
  min-height: 44px;
  margin: 14px 0 0;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-action) 0%, var(--brand-action-dark) 100%);
}

.secondary-button {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-strong) 80%, var(--bg-strong));
}

.secondary-button-compact {
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(16, 40, 68, 0.08);
}

#exit-button {
  color: var(--brand-dark);
  font-weight: 800;
}

.exit-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: 0 10px 24px rgba(16, 40, 68, 0.08);
}

.exit-button-icon {
  width: 1.55rem;
  height: 1.55rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-soft) 90%, transparent);
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.primary-button-wide {
  width: 100%;
}

.primary-button:hover,
.secondary-button:hover,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.test-topbar,
.test-meta,
.progress-row,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.test-topbar,
.progress-row,
.question-panel,
.feedback-panel,
.actions {
  position: relative;
  z-index: 1;
}

.test-topbar {
  align-items: flex-start;
  margin-bottom: 6px;
}

.test-topbar > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.progress-row {
  margin: 14px 0 12px;
}

.progress-bar {
  flex: 1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-strong) 70%, var(--surface-strong));
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
}

.question-panel {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.question-media {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 96%, transparent), color-mix(in srgb, var(--bg-strong) 75%, transparent));
}

.question-media img {
  display: block;
  width: min(100%, 320px);
  height: auto;
  margin: 0 auto;
  padding: 8px 0;
}

.question-text {
  margin: 0 0 14px;
  font-size: 1.08rem;
  line-height: 1.45;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer-button {
  width: 100%;
  min-height: 48px;
  text-align: start;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1), border-color 150ms ease, background 200ms ease, box-shadow 200ms ease;
}

.answer-button:hover,
.answer-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus);
  outline: none;
}

.answer-button.selected {
  background: var(--brand-soft);
  border-color: rgba(13, 94, 168, 0.48);
  animation: answer-pop 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.answer-button.correct {
  background: rgba(24, 121, 78, 0.08);
  border-color: rgba(24, 121, 78, 0.4);
  animation: answer-correct 400ms ease;
}

.answer-button.incorrect {
  background: rgba(181, 59, 59, 0.08);
  border-color: rgba(181, 59, 59, 0.36);
  animation: answer-shake 400ms ease;
}

@keyframes answer-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes answer-correct {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(24, 121, 78, 0); }
  50% { transform: scale(1.015); box-shadow: 0 0 0 6px rgba(24, 121, 78, 0.15); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(24, 121, 78, 0); }
}

@keyframes answer-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.feedback-panel {
  min-height: 84px;
  margin: 12px 0 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--bg-strong));
}

.feedback-status {
  margin: 0 0 8px;
  font-weight: 800;
}

.feedback-status.correct {
  color: var(--success);
}

.feedback-status.incorrect {
  color: var(--danger);
}

.feedback-status.skipped {
  color: var(--brand-dark);
}

.results-score {
  margin: 14px 0 10px;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
  display: none;
}

.score-ring-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 20px 0 14px;
}

.score-ring {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.score-ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 8;
}

.score-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1), stroke 400ms ease;
}

.score-ring-fill.pass { stroke: var(--success); }
.score-ring-fill.fail { stroke: var(--danger); }

.score-ring-label {
  font-size: 1.85rem;
  font-weight: 900;
  fill: var(--text);
  text-anchor: middle;
  dominant-baseline: central;
}

.score-ring-detail {
  display: grid;
  gap: 6px;
}

.score-ring-detail-value {
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
}

.score-ring-detail-label {
  color: var(--muted);
  line-height: 1.4;
}

.pass-animation {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

.pass-checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success);
  display: grid;
  place-items: center;
  animation: checkmark-pop 800ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.pass-checkmark svg {
  width: 40px;
  height: 40px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pass-checkmark svg path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: checkmark-draw 500ms 300ms ease forwards;
}

@keyframes checkmark-pop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes checkmark-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes checkmark-fade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.confetti-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(200px) rotate(720deg); opacity: 0; }
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.results-grid article {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand-soft) 70%, transparent);
}

.review-list {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.test-card {
  padding: 20px 22px 18px;
}

.test-meta {
  flex: 0 0 auto;
  margin-left: 16px;
  padding-top: 2px;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.review-item {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
}

.review-item-image {
  display: block;
  width: min(100%, 220px);
  height: auto;
  margin-bottom: 10px;
  border-radius: 12px;
}

.review-item p {
  margin: 0;
}

.review-item p + p {
  margin-top: 8px;
}

.site-disclaimer {
  padding: 18px 20px 6px;
}

.disclaimer-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.disclaimer-copy {
  margin: 8px 0 0;
  max-width: 78ch;
  color: var(--muted);
  line-height: 1.65;
}

.disclaimer-link {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

.disclaimer-link:hover,
.disclaimer-link:focus-visible {
  color: var(--brand);
}

.seo-guide {
  display: grid;
  gap: 24px;
  padding: 26px 20px 12px;
  border-top: 1px solid var(--line);
}

.seo-guide-intro {
  max-width: 78ch;
}

.seo-guide h2,
.seo-guide h3 {
  letter-spacing: -0.02em;
}

.seo-guide h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.seo-guide h3 {
  font-size: 1.08rem;
}

.seo-guide p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.68;
}

.state-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.state-facts div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface-strong));
}

.state-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.state-facts dd {
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.state-facts a {
  color: var(--brand-dark);
  text-underline-offset: 0.16em;
}

.seo-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.seo-feature-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.seo-feature-grid h3,
.seo-feature-grid p {
  margin: 0;
}

.seo-feature-grid p {
  margin-top: 8px;
}

.seo-faq {
  display: grid;
  gap: 10px;
  max-width: 860px;
}

.seo-faq h2 {
  margin-bottom: 4px;
}

.seo-faq details {
  border-top: 1px solid var(--line);
}

.seo-faq details:last-child {
  border-bottom: 1px solid var(--line);
}

.seo-faq summary {
  cursor: pointer;
  padding: 16px 0;
  color: var(--text);
  font-weight: 800;
}

.seo-faq summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 44%, transparent);
  outline-offset: 4px;
  border-radius: 8px;
}

.seo-faq details p {
  margin: -4px 0 16px;
}

.site-footer {
  text-align: center;
  padding: 32px 16px 24px;
  font-size: calc(13px * var(--font-scale));
  color: var(--muted);
}

.site-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

.footer-languages {
  max-width: 1120px;
  margin: 0 auto 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.footer-languages-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-languages-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
}

.footer-languages-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 10px;
  border-radius: 10px;
}

.footer-policy-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 0 auto 14px;
}

.footer-policy-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.test-wrap {
  display: grid;
  gap: 12px;
}

.site-disclaimer,
.seo-guide,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 360px;
}

.test-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.test-sticky-bar .progress-bar {
  flex: 1;
  height: 8px;
}

.test-sticky-bar .sticky-counter {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--muted);
  white-space: nowrap;
}

.test-sticky-bar .sticky-sections {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--brand-dark);
  white-space: nowrap;
}

.skeleton-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.skeleton-line {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, transparent) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line-short { width: 65%; }
.skeleton-line-medium { width: 85%; }

.skeleton-answer {
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, transparent) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.accessibility-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.accessibility-group-row .accessibility-label {
  margin-bottom: 0;
  flex-shrink: 1;
  min-width: 0;
}

.accessibility-group-row .segmented-control {
  flex-shrink: 0;
}

.accessibility-panel .segmented-control {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 200px;
}

.accessibility-divider {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: var(--line);
}

.accessibility-section-title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.accessibility-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
}

.accessibility-toggle-row .accessibility-label {
  margin-bottom: 0;
  flex: 1;
}

.a11y-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 150ms ease, border-color 150ms ease;
}

.a11y-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 150ms ease;
}

.a11y-toggle[aria-checked="true"] {
  background: var(--brand);
  border-color: var(--brand);
}

.a11y-toggle[aria-checked="true"]::after {
  transform: translateX(20px);
}

.hidden {
  display: none;
}

html[dir="rtl"] .language-select {
  padding: 15px 16px 15px 48px;
  background-position:
    24px calc(50% - 3px),
    18px calc(50% - 3px);
}

html[dir="rtl"] .brand-block,
html[dir="rtl"] .exit-button {
  flex-direction: row-reverse;
}

html[dir="rtl"] .header-actions {
  justify-content: flex-start;
}

@media (max-width: 920px) {
  .hero-shell {
    grid-template-columns: 1fr;
  }

  .hero-info-strip {
    grid-template-columns: 1fr;
  }

  .state-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body {
    background: linear-gradient(180deg, #fbf7ef 0%, var(--bg) 100%);
  }

  .site-header,
  .app-shell {
    width: min(100% - 18px, 1120px);
  }

  .page-backdrop {
    display: none;
  }

  .site-header,
  .test-topbar,
  .test-meta,
  .progress-row,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header {
    gap: 12px;
  }

  .header-chip-support {
    display: none;
  }

  .header-actions {
    flex-wrap: nowrap;
    align-items: center;
  }

  .accessibility-wrap {
    flex: 1;
    min-width: 0;
  }

  .accessibility-trigger {
    width: 100%;
  }

  .header-chip {
    padding: 8px 12px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .hero-shell,
  .test-card,
  .results-card {
    padding: 20px;
    border-radius: 24px;
    backdrop-filter: none;
    box-shadow: 0 10px 30px rgba(54, 45, 31, 0.08);
  }

  .hero-info-strip,
  .state-facts,
  .seo-feature-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    max-width: none;
  }

  .language-field-priority {
    margin-top: 16px;
    margin-bottom: 4px;
  }

  .state-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .state-lockup-value {
    justify-items: start;
  }

  .accessibility-panel {
    left: 0;
    right: auto;
    width: min(100vw - 18px, 420px);
    backdrop-filter: none;
  }

  .accessibility-panel .segmented-control {
    width: 100%;
  }

  .test-sticky-bar {
    padding: 10px 16px;
    backdrop-filter: none;
    box-shadow: 0 8px 20px rgba(54, 45, 31, 0.08);
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .test-sticky-bar .sticky-sections {
    width: 100%;
    order: 3;
    font-size: 0.76rem;
    text-align: center;
  }

  .test-sticky-bar.is-stuck {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-left: -9px;
    margin-right: -9px;
    width: calc(100% + 18px);
  }

  .accessibility-group-row {
    flex-direction: column;
    align-items: stretch;
  }

  html[dir="rtl"] .accessibility-panel {
    left: auto;
    right: 0;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .score-ring-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .score-ring {
    width: 100px;
    height: 100px;
  }
}
