* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px;
}

.card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

h1 {
  margin-top: 0;
  font-size: 32px;
  line-height: 1.15;
}

h2,
h3 {
  margin-top: 0;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 16px;
  cursor: pointer;
  background: #111827;
  color: white;
}

button.secondary {
  background: #e5e7eb;
  color: #111827;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.options {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.option {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: start;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #d1d5db;
  background: white;
  cursor: pointer;
  line-height: 1.35;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  font-size: 14px;
}

.option-content {
  min-width: 0;
}

.option-feedback {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.12);
  font-weight: 400;
  line-height: 1.45;
}

.option.selected {
  border-color: #111827;
  background: #f9fafb;
  font-weight: 600;
}

.option.locked {
  cursor: default;
}

.option.correct {
  border-color: #16a34a;
  background: #f0fdf4;
}

.option.correct .option-letter {
  background: #16a34a;
  color: white;
}

.option.wrong {
  border-color: #dc2626;
  background: #fef2f2;
}

.option.wrong .option-letter {
  background: #dc2626;
  color: white;
}

.option.partial {
  border-color: #f59e0b;
  background: #fffbeb;
}

.option.partial .option-letter {
  background: #f59e0b;
  color: white;
}

.feedback {
  margin: 8px 0 20px;
  padding: 16px 18px;
  border-radius: 16px;
  line-height: 1.45;
}

.feedback p {
  margin: 8px 0 0;
}

.feedback-correct {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.feedback-wrong {
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.progress {
  margin-bottom: 16px;
  color: #6b7280;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.result-card {
  margin-top: 24px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff, #eef2ff);
  border: 1px solid #dbeafe;
}

.result-percent {
  margin: 18px 0 10px;
  font-size: 56px;
  line-height: 1;
  font-weight: 800;
}

.result-chart {
  margin-top: 30px;
  padding: 18px 0 4px;
}

.result-axis {
  position: relative;
  height: 28px;
  margin-right: 160px;
  color: #9ca3af;
  font-size: 13px;
}

.result-axis-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.result-axis-tick::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 1px;
  height: 54px;
  background: rgba(156, 163, 175, 0.45);
}

.gradient-scale-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}

.gradient-scale-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: visible;
}

.gradient-scale-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dd3f91 0%, #2f80ed 58%, #35b779 100%);
  box-shadow: 0 4px 12px rgba(47, 128, 237, 0.18);
}

.gradient-scale-value {
  position: absolute;
  bottom: 23px;
  transform: translateX(-50%);
  color: #4b5563;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.gradient-scale-label {
  color: #4b5563;
  font-size: 16px;
  line-height: 1.2;
}

@media (max-width: 560px) {
  .app {
    padding: 16px 12px;
  }

  .card {
    padding: 22px;
    border-radius: 20px;
  }

  h1 {
    font-size: 25px;
  }

  .option {
    grid-template-columns: 32px 1fr;
    padding: 14px;
  }
}

@media (max-width: 560px) {
  .result-axis {
    margin-right: 0;
  }

  .gradient-scale-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gradient-scale-label {
    font-size: 15px;
  }
}

.instruction-body p {
  margin: 0 0 12px;
  line-height: 1.55;
}

.info-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.info-field {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.info-field input,
.info-field select,
textarea.import-output {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: #111827;
}

.result-brand {
  margin-bottom: 10px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gradient-scale-label {
  display: grid;
  gap: 4px;
}

.gradient-scale-label span {
  color: #6b7280;
  font-size: 14px;
}

.scale-interpretation {
  grid-column: 1 / -1;
  margin: -4px 0 14px;
  color: #4b5563;
  line-height: 1.45;
}

.import-layout {
  max-width: 1180px;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.import-panel {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.import-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  padding: 24px;
  background: #f8fafc;
  text-align: center;
}

.import-dropzone input {
  max-width: 100%;
}

.import-meta {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.45;
}

.import-output {
  min-height: 520px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.import-log {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.import-log-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  line-height: 1.35;
}

.import-log-item.error {
  background: #fef2f2;
  color: #991b1b;
}

.import-log-item.warning {
  background: #fffbeb;
  color: #92400e;
}

.import-log-item.ok {
  background: #f0fdf4;
  color: #166534;
}

@media (max-width: 900px) {
  .import-grid {
    grid-template-columns: 1fr;
  }
}

/* Theme variables and dark mode */
:root {
  --page-bg: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --card-bg: #ffffff;
  --soft-bg: #f9fafb;
  --border: #d1d5db;
  --shadow: rgba(0, 0, 0, 0.08);
  --button-bg: #111827;
  --button-text: #ffffff;
  --secondary-bg: #e5e7eb;
  --secondary-text: #111827;
  --result-bg-1: #ffffff;
  --result-bg-2: #eef2ff;
  --result-border: #dbeafe;
  --track-bg: #e5e7eb;
  --tick: #8b95a1;
  --pill-bg: #111827;
  --pill-text: #ffffff;
}

html[data-theme="dark"] {
  --page-bg: #0f172a;
  --text: #e5e7eb;
  --muted: #a7b0c0;
  --card-bg: #172033;
  --soft-bg: #111827;
  --border: #374151;
  --shadow: rgba(0, 0, 0, 0.35);
  --button-bg: #e5e7eb;
  --button-text: #111827;
  --secondary-bg: #263244;
  --secondary-text: #e5e7eb;
  --result-bg-1: #172033;
  --result-bg-2: #111827;
  --result-border: #334155;
  --track-bg: #263244;
  --tick: #9ca3af;
  --pill-bg: #e5e7eb;
  --pill-text: #111827;
}

body {
  background: var(--page-bg);
  color: var(--text);
}

.card,
.import-panel {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 12px 40px var(--shadow);
}

button {
  background: var(--button-bg);
  color: var(--button-text);
}

button.secondary {
  background: var(--secondary-bg);
  color: var(--secondary-text);
}

.progress,
.result-brand,
.gradient-scale-label,
.gradient-scale-label span,
.import-meta,
.scale-detail-level {
  color: var(--muted);
}

.option {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text);
}

.option.selected {
  background: var(--soft-bg);
  border-color: var(--text);
}

.option-letter {
  background: var(--soft-bg);
  color: var(--text);
}

.info-field input,
.info-field select,
textarea.import-output {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

.theme-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 8px 22px var(--shadow);
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
}

.theme-icon.active {
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 800;
}

.result-card {
  background: linear-gradient(135deg, var(--result-bg-1), var(--result-bg-2));
  border-color: var(--result-border);
  color: var(--text);
}

.result-card > p {
  color: var(--text);
  line-height: 1.5;
}

.result-scales-summary {
  display: grid;
  gap: 24px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--result-border);
}

.scale-summary-row {
  display: grid;
  gap: 14px;
}

.scale-summary-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  font-size: 16px;
  line-height: 1.25;
}

.scale-summary-heading strong {
  min-width: 0;
}

.scale-summary-heading span {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 800;
}

.scale-meter {
  position: relative;
  padding-bottom: 28px;
}

.scale-meter-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: var(--track-bg);
  overflow: visible;
}

.scale-meter-fill {
  height: 100%;
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dd3f91 0%, #2f80ed 58%, #35b779 100%);
  box-shadow: 0 4px 12px rgba(47, 128, 237, 0.18);
}

.scale-meter-value {
  position: absolute;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 6px 16px var(--shadow);
}

.scale-meter-value::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 1px;
  height: 24px;
  background: var(--pill-bg);
  opacity: 0.8;
}

.scale-meter-ticks {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  height: 28px;
  color: var(--tick);
  font-size: 12px;
}

.scale-meter-tick {
  position: absolute;
  top: 10px;
  transform: translateX(-50%);
  font-weight: 500;
}

.scale-meter-tick::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -13px;
  width: 1px;
  height: 8px;
  background: currentColor;
  transform: translateX(-50%);
  opacity: 0.75;
}

.scale-meter-tick.active {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.scale-meter-tick.active::before {
  width: 3px;
  height: 12px;
  top: -15px;
  border-radius: 999px;
  opacity: 1;
}

.details-action {
  margin-top: 24px;
}

.details-toggle {
  padding: 10px 16px;
  font-size: 15px;
}

.scale-details {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.scale-detail {
  padding: 16px;
  border-radius: 16px;
  background: var(--soft-bg);
  border: 1px solid var(--result-border);
}

.scale-detail h4 {
  margin: 0 0 6px;
  font-size: 16px;
}

.scale-detail p {
  margin: 6px 0 0;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .theme-toggle {
    top: 8px;
    left: 8px;
  }

  .app {
    padding-top: 54px;
  }

  .scale-summary-heading {
    align-items: flex-start;
  }
}

/* --- UX refinement: dark theme feedback and compact result scales --- */
.app {
  max-width: 900px;
}

.option.correct .option-feedback {
  color: #166534;
}

.option.wrong .option-feedback {
  color: #991b1b;
}

.option.partial .option-feedback {
  color: #92400e;
}

html[data-theme="dark"] .option.correct {
  background: var(--card-bg);
  border-color: #22c55e;
  color: var(--text);
}

html[data-theme="dark"] .option.correct .option-letter {
  background: #16a34a;
  color: #ffffff;
}

html[data-theme="dark"] .option.wrong {
  background: rgba(127, 29, 29, 0.12);
  border-color: #ef4444;
}

html[data-theme="dark"] .option.partial {
  background: rgba(146, 64, 14, 0.12);
  border-color: #f59e0b;
}

html[data-theme="dark"] .option.correct .option-feedback {
  color: #86efac;
  border-top-color: rgba(134, 239, 172, 0.28);
}

html[data-theme="dark"] .option.wrong .option-feedback {
  color: #fca5a5;
  border-top-color: rgba(252, 165, 165, 0.28);
}

html[data-theme="dark"] .option.partial .option-feedback {
  color: #fcd34d;
  border-top-color: rgba(252, 211, 77, 0.28);
}

.result-card {
  padding: 24px;
}

.result-percent {
  margin: 14px 0 6px;
}

.result-scales-summary {
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
}

.scale-summary-row {
  gap: 6px;
}

.scale-summary-title {
  text-align: right;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
}

.scale-meter {
  position: relative;
  padding-bottom: 22px;
}

.scale-meter-track {
  height: 22px;
}

.scale-meter-fill {
  position: relative;
}

.scale-meter-inline-value {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  z-index: 2;
}

html[data-theme="dark"] .scale-meter-inline-value {
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
}

.scale-meter-ticks {
  top: 22px;
  height: 22px;
  font-size: 11px;
}

.scale-meter-tick {
  top: 6px;
}

.scale-meter-tick::before {
  top: -10px;
}

.scale-meter-tick.active {
  font-size: 13px;
  font-weight: 900;
}

.scale-meter-tick.active::before {
  top: -12px;
}

.scale-detail {
  padding: 14px 16px;
}

@media (max-width: 560px) {
  .result-card {
    padding: 20px;
  }

  .scale-summary-title {
    font-size: 14px;
  }

  .scale-meter-track {
    height: 20px;
  }

  .scale-meter-ticks {
    top: 20px;
  }
}

/* --- Visual compactness and static gradient adjustments --- */
.result-screen-card {
  padding-top: 18px;
}

.result-screen-card > .result-card {
  margin-top: 0;
}

.result-correct-line {
  margin: 4px 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.result-main-text {
  margin-top: 0;
}

.result-scales-summary {
  margin-top: 16px;
  gap: 12px;
}

.scale-summary-row {
  width: calc(100% - 50px);
  margin-left: auto;
  gap: 4px;
}

.scale-summary-title {
  margin-bottom: 1px;
}

.scale-meter {
  padding-bottom: 18px;
}

.scale-meter-track {
  position: relative;
  overflow: hidden;
  height: 18px;
  background: linear-gradient(90deg, #ec4899 0%, #3b82f6 50%, #22c55e 100%);
}

.scale-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: transparent;
  z-index: 1;
}

.scale-meter-rest {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  background: var(--track-bg);
  z-index: 1;
}

.scale-meter-inline-value {
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-size: 11px;
  padding: 2px 7px;
}

.scale-meter-ticks {
  top: 18px;
  height: 18px;
  font-size: 10px;
}

.scale-meter-tick {
  top: 5px;
}

.scale-meter-tick::before {
  top: -8px;
  height: 8px;
}

.scale-meter-tick.active {
  font-size: 12px;
}

.scale-meter-tick.active::before {
  top: -9px;
  height: 10px;
  width: 2px;
}

@media (max-width: 560px) {
  .scale-summary-row {
    width: 100%;
  }
}

/* --- Theme toggle single-button refinement and brand update spacing --- */
.app {
  padding-top: 72px;
}

.theme-toggle {
  top: 10px;
  left: 10px;
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-radius: 999px;
}

.theme-icon.single {
  width: 100%;
  height: 100%;
  font-size: 24px;
}

.theme-icon.single.active {
  background: transparent;
  color: var(--text);
  font-weight: 700;
}

.result-brand {
  letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .app {
    padding-top: 72px;
  }

  .theme-toggle {
    top: 10px;
    left: 10px;
    width: 46px;
    height: 46px;
  }

  .theme-icon.single {
    font-size: 22px;
  }
}

/* --- Keyboard navigation support --- */
.option:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.55);
  outline-offset: 3px;
}

.keyboard-hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

html[data-theme="dark"] .option:focus-visible {
  outline-color: rgba(147, 197, 253, 0.75);
}

@media (max-width: 720px) {
  .keyboard-hint {
    display: none;
  }
}

/* --- Respondent info screens --- */
.info-screen-body {
  margin: -6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.info-screen-body p {
  margin: 0 0 8px;
}

.info-field label {
  line-height: 1.35;
}

.info-other-input {
  margin-top: 2px;
}

/* --- Start screen v3: real structure, responsive, no pseudo-content duplication --- */
.start-card {
  max-width: 760px;
  margin: -34px auto 0;
  padding: clamp(22px, 3vh, 30px) clamp(24px, 4vw, 38px);
  border-radius: 34px;
  background: var(--card-bg);
}

.start-brand {
  margin-bottom: clamp(14px, 2.2vh, 22px);
  color: #5d35d5;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-align: center;
}

.start-title {
  margin: 0;
  color: #071451;
  font-size: clamp(42px, 5.3vw, 58px);
  line-height: .98;
  letter-spacing: -0.055em;
  font-weight: 800;
}

html[data-theme="dark"] .start-title {
  color: #f4f6ff;
}

.start-description {
  margin: clamp(14px, 2vh, 20px) 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.34;
  max-width: 660px;
}

.start-facts {
  display: grid;
  gap: 10px;
  margin-top: clamp(18px, 2.6vh, 26px);
}

.start-fact {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  min-height: 66px;
  padding: 7px 18px 7px 12px;
  border-radius: 22px;
  background: #f4f1fb;
}

html[data-theme="dark"] .start-fact {
  background: rgba(93, 53, 213, .13);
}

.start-icon {
  display: inline-block;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background-color: #ebe5fb;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 32px 32px;
}

html[data-theme="dark"] .start-icon {
  background-color: rgba(93, 53, 213, .22);
}

.start-icon-document {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Crect x='7' y='4.5' width='18' height='23' rx='2.5' stroke='%235D35D5' stroke-width='2.2'/%3E%3Ccircle cx='11' cy='11' r='1.1' fill='%235D35D5'/%3E%3Ccircle cx='11' cy='16' r='1.1' fill='%235D35D5'/%3E%3Ccircle cx='11' cy='21' r='1.1' fill='%235D35D5'/%3E%3Cpath d='M14.5 11H21M14.5 16H21M14.5 21H21' stroke='%235D35D5' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.start-icon-clock {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Ccircle cx='16' cy='16' r='11' stroke='%235D35D5' stroke-width='2.2'/%3E%3Cpath d='M16 9.5V16L20.7 19.2' stroke='%235D35D5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.start-icon-bubble {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Cpath d='M7.5 7.5h17a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3h-8.3L11 26v-4.5H7.5a3 3 0 0 1-3-3v-8a3 3 0 0 1 3-3Z' stroke='%235D35D5' stroke-width='2.2' stroke-linejoin='round'/%3E%3Cpath d='M10 13h12M10 17h8' stroke='%235D35D5' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.start-fact-text {
  padding-left: 10px;
  color: var(--text);
  font-size: clamp(20px, 2.3vw, 25px);
  line-height: 1.2;
  font-weight: 450;
}

.start-authors {
  margin-top: clamp(16px, 2.2vh, 22px);
  padding-top: clamp(14px, 2vh, 18px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.4;
  text-align: center;
}

.start-author-link {
  color: #5d35d5;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 650;
}

.start-author-link:hover {
  color: #4724b4;
}

.start-actions {
  margin-top: clamp(16px, 2.2vh, 22px);
}

.start-actions > button {
  width: 100%;
  min-height: 58px;
  border-radius: 22px;
  padding: 13px 22px;
  background: linear-gradient(135deg, #6439de 0%, #4d26c3 100%);
  color: #fff;
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.025em;
  box-shadow: 0 12px 24px rgba(93, 53, 213, .22);
}

.start-actions > button:hover {
  filter: brightness(1.04);
}

@media (max-width: 560px) {
  .start-card {
    margin-top: -24px;
    padding: 20px 18px 18px;
    border-radius: 26px;
  }

  .start-brand {
    margin-bottom: 14px;
    font-size: 15px;
  }

  .start-title {
    font-size: clamp(38px, 12vw, 46px);
    line-height: 1.0;
  }

  .start-description {
    margin-top: 14px;
    font-size: 17px;
    line-height: 1.36;
  }

  .start-facts {
    gap: 8px;
    margin-top: 16px;
  }

  .start-fact {
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 58px;
    padding: 6px 14px 6px 10px;
    border-radius: 19px;
  }

  .start-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background-size: 29px 29px;
  }

  .start-fact-text {
    padding-left: 8px;
    font-size: 19px;
  }

  .start-authors {
    margin-top: 14px;
    padding-top: 12px;
    font-size: 13px;
  }

  .start-actions {
    margin-top: 14px;
  }

  .start-actions > button {
    min-height: 54px;
    border-radius: 20px;
    font-size: 21px;
  }
}

/* Extra compact mode for short browser viewports. */
@media (max-height: 720px) and (min-width: 561px) {
  .start-card {
    margin-top: -40px;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .start-brand { margin-bottom: 10px; }
  .start-title { font-size: 46px; }
  .start-description { margin-top: 10px; font-size: 18px; }
  .start-facts { margin-top: 14px; gap: 7px; }
  .start-fact { min-height: 54px; }
  .start-icon { width: 40px; height: 40px; background-size: 28px 28px; }
  .start-fact-text { font-size: 19px; }
  .start-authors { margin-top: 12px; padding-top: 10px; font-size: 13px; }
  .start-actions { margin-top: 12px; }
  .start-actions > button { min-height: 50px; font-size: 21px; }
}

@media (max-height: 700px) and (max-width: 560px) {
  .app { padding-top: 60px; padding-bottom: 10px; }
  .start-card { margin-top: -20px; padding-top: 16px; padding-bottom: 14px; }
  .start-brand { margin-bottom: 10px; font-size: 13px; }
  .start-title { font-size: 34px; }
  .start-description { margin-top: 10px; font-size: 15px; }
  .start-facts { margin-top: 12px; gap: 6px; }
  .start-fact { min-height: 50px; }
  .start-icon { width: 38px; height: 38px; background-size: 26px 26px; }
  .start-fact-text { font-size: 17px; }
  .start-authors { margin-top: 10px; padding-top: 9px; font-size: 12px; }
  .start-actions { margin-top: 10px; }
  .start-actions > button { min-height: 48px; font-size: 19px; }
}

/* ========================================================================== */
/* Result screen v2 — compact hierarchy based on the approved visual concept. */
/* ========================================================================== */

.result-screen-v2 {
  width: 100%;
  padding: 34px 34px 30px;
  border-radius: 36px;
  background: var(--card-bg);
  box-shadow: 0 18px 55px rgba(26, 35, 74, 0.10);
  overflow: hidden;
}

.result-screen-v2 > .result-card-v2 {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
}

.result-brand-v2 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #111a42;
  font-size: 24px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.result-brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.result-brand-mark::before,
.result-brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.result-brand-mark::before {
  left: 0;
  top: 3px;
  width: 23px;
  height: 23px;
  background: #7045f3;
}

.result-brand-mark::after {
  right: 0;
  top: 0;
  width: 21px;
  height: 27px;
  background: rgba(111, 76, 240, 0.58);
}

.result-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-top: 44px;
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 15px;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.result-score-correct {
  color: #07143f;
  font-size: 88px;
  font-weight: 820;
}

.result-score-divider,
.result-score-total {
  color: #7e849e;
  font-size: 58px;
  font-weight: 430;
}

.result-score-divider {
  margin-left: 2px;
}

.result-researcher-level {
  margin-top: 25px;
  color: #6440e7;
  font-size: 35px;
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.result-benchmark {
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 0;
  align-items: center;
  justify-content: end;
  align-self: start;
  min-width: 236px;
  margin-top: 3px;
  color: #c5c7d2;
  line-height: 1;
  user-select: none;
}

.result-benchmark-label {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  padding: 0;
  text-align: right;
  font-size: 20px;
  line-height: 1.02;
  font-weight: 520;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.result-benchmark-number {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin: 0;
  color: #c5c7d2;
  font-size: 76px;
  line-height: 0.88;
  font-weight: 430;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.result-benchmark-number span {
  margin-left: 3px;
  font-size: 40px;
  letter-spacing: -0.04em;
}

.result-benchmark-label-bottom {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  margin: 3px 0 0;
}

.result-main-track,
.result-aux-track {
  overflow: hidden;
  background: #eeecfa;
  border-radius: 999px;
}

.result-main-track {
  height: 18px;
  margin-top: 37px;
}

.result-main-fill,
.result-aux-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6542ee 0%, #5840e5 100%);
}

.result-aux-scales {
  margin-top: 52px;
}

.result-aux-scale {
  padding: 0 0 30px;
}

.result-aux-scale + .result-aux-scale {
  padding-top: 29px;
  border-top: 1px solid rgba(119, 126, 158, 0.14);
}

.result-aux-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.result-aux-title {
  color: #101730;
  font-size: 25px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.result-aux-value {
  flex: 0 0 auto;
  color: #8e93a7;
  font-size: 24px;
  line-height: 1;
  font-weight: 420;
}

.result-aux-track {
  height: 11px;
  margin-top: 17px;
}

.result-aux-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  color: #228b2c;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 470;
}

.result-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  font-weight: 800;
}

.result-interpretation-v2 {
  margin: 15px 0 0 !important;
  color: #101730 !important;
  font-size: 31px;
  line-height: 1.28 !important;
  font-weight: 410;
  letter-spacing: -0.028em;
}

.result-course-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 34px;
  gap: 20px;
  align-items: center;
  margin-top: 39px;
  padding: 22px 24px 22px 20px;
  border-radius: 23px;
  background: linear-gradient(135deg, #f6f2ff 0%, #f1effc 100%);
  color: #101730;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.result-course-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(92, 63, 225, 0.10);
}

.result-course-icon {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Crect x='13' y='20' width='62' height='55' rx='10' fill='white' stroke='%23d7cef9' stroke-width='2'/%3E%3Cpath d='M13 31h62V20a10 10 0 0 0-10-10H23a10 10 0 0 0-10 10v11Z' fill='%236d49ef'/%3E%3Crect x='25' y='5' width='6' height='20' rx='3' fill='%23eeeaff'/%3E%3Crect x='57' y='5' width='6' height='20' rx='3' fill='%23eeeaff'/%3E%3Cpath d='m44 42 4.6 9.3 10.3 1.5-7.45 7.26 1.76 10.25L44 65.47l-9.21 4.84 1.76-10.25-7.45-7.26 10.3-1.5L44 42Z' fill='%23957bf3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 20px rgba(90, 61, 218, 0.13);
}

.result-course-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.result-course-main {
  font-size: 24px;
  line-height: 1.28;
  font-weight: 520;
  letter-spacing: -0.025em;
}

.result-course-title {
  color: #5f42e4;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 650;
}

.result-course-more {
  color: #6c4be8;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 470;
}

.result-course-arrow {
  color: #5c3fe3;
  font-size: 42px;
  line-height: 1;
  font-weight: 300;
}

.result-actions-v2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 25px;
}

.result-actions-v2 button {
  min-height: 58px;
  padding: 13px 16px;
  border-radius: 13px;
  background: linear-gradient(135deg, #6044df 0%, #4735d6 100%);
  color: #fff;
  font-size: 21px;
  line-height: 1.1;
  font-weight: 500;
  box-shadow: none;
}

.result-actions-v2 button:hover {
  filter: brightness(1.04);
}

html[data-theme="dark"] .result-brand-v2,
html[data-theme="dark"] .result-score-correct,
html[data-theme="dark"] .result-aux-title,
html[data-theme="dark"] .result-interpretation-v2,
html[data-theme="dark"] .result-course-card {
  color: #f3f5ff !important;
}

html[data-theme="dark"] .result-main-track,
html[data-theme="dark"] .result-aux-track {
  background: #2d2944;
}

html[data-theme="dark"] .result-course-card {
  background: linear-gradient(135deg, #24213b 0%, #211f35 100%);
}

@media (max-width: 560px) {
  .app {
    padding-left: 10px;
    padding-right: 10px;
  }

  .result-screen-v2 {
    padding: 23px 20px 20px;
    border-radius: 28px;
  }

  .result-brand-v2 {
    gap: 9px;
    font-size: 18px;
  }

  .result-brand-mark {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .result-brand-mark::before {
    width: 18px;
    height: 18px;
  }

  .result-brand-mark::after {
    width: 17px;
    height: 21px;
  }

  .result-hero-row {
    gap: 12px;
    margin-top: 31px;
  }

  .result-score {
    gap: 8px;
  }

  .result-score-correct {
    font-size: 57px;
  }

  .result-score-divider,
  .result-score-total {
    font-size: 39px;
  }

  .result-researcher-level {
    margin-top: 17px;
    font-size: 25px;
  }

  .result-benchmark {
    min-width: 154px;
    column-gap: 7px;
    margin-top: 2px;
  }

  .result-benchmark-label {
    font-size: 13px;
    line-height: 1.02;
  }

  .result-benchmark-number {
    font-size: 48px;
    line-height: 0.88;
  }

  .result-benchmark-number span {
    margin-left: 2px;
    font-size: 25px;
  }

  .result-benchmark-label-bottom {
    margin-top: 2px;
  }

  .result-main-track {
    height: 12px;
    margin-top: 24px;
  }

  .result-aux-scales {
    margin-top: 31px;
  }

  .result-aux-scale {
    padding-bottom: 21px;
  }

  .result-aux-scale + .result-aux-scale {
    padding-top: 20px;
  }

  .result-aux-title {
    font-size: 18px;
  }

  .result-aux-value {
    font-size: 18px;
  }

  .result-aux-track {
    height: 8px;
    margin-top: 11px;
  }

  .result-aux-level {
    gap: 7px;
    margin-top: 10px;
    font-size: 14px;
  }

  .result-status-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
    font-size: 12px;
  }

  .result-interpretation-v2 {
    margin-top: 10px !important;
    font-size: 20px;
    line-height: 1.29 !important;
  }

  .result-course-card {
    grid-template-columns: 62px minmax(0, 1fr) 24px;
    gap: 11px;
    margin-top: 25px;
    padding: 14px 14px 14px 12px;
    border-radius: 18px;
  }

  .result-course-icon {
    width: 60px;
    height: 60px;
    border-radius: 13px;
  }

  .result-course-copy {
    gap: 6px;
  }

  .result-course-main {
    font-size: 15px;
    line-height: 1.27;
  }

  .result-course-more {
    font-size: 11px;
  }

  .result-course-arrow {
    font-size: 27px;
  }

  .result-actions-v2 {
    gap: 7px;
    margin-top: 14px;
  }

  .result-actions-v2 button {
    min-height: 49px;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .result-screen-v2 {
    padding-left: 17px;
    padding-right: 17px;
  }

  .result-score-correct {
    font-size: 52px;
  }

  .result-score-divider,
  .result-score-total {
    font-size: 35px;
  }

  .result-researcher-level {
    font-size: 23px;
  }

  .result-benchmark {
    min-width: 139px;
    column-gap: 6px;
  }

  .result-benchmark-label {
    font-size: 12px;
  }

  .result-benchmark-number {
    font-size: 43px;
  }

  .result-benchmark-number span {
    font-size: 23px;
  }

  .result-course-main {
    font-size: 14px;
  }
}

/* ========================================================================== */
/* Test interaction refinement v1.4                                            */
/* 1) Primary test action uses the same purple language as start/result.        */
/* 2) Long answer feedback gets a CSS-only overflow cue and internal scrolling. */
/* ========================================================================== */

/* Primary actions inside regular cards: consistent purple CTA. */
.card > .actions > button:not(.secondary) {
  background: linear-gradient(135deg, #6439de 0%, #4d26c3 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(93, 53, 213, 0.20);
  transition: filter 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.card > .actions > button:not(.secondary):not(:disabled):hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(93, 53, 213, 0.25);
}

.card > .actions > button:not(.secondary):not(:disabled):active {
  transform: translateY(1px);
}

.card > .actions > button:not(.secondary):focus-visible {
  outline: 3px solid rgba(99, 57, 222, 0.24);
  outline-offset: 3px;
}

/*
  Long feedback is capped and scrollable. The two-layer background is a
  CSS-only "scroll shadow": the soft violet fade is visible at the bottom
  only while more text exists below. When the feedback fits completely (or
  the reader reaches the end), the local background cover hides the cue.
*/
.option-feedback {
  --feedback-max-height: 8.3em;
  --feedback-surface: #ffffff;
  position: relative;
  max-height: var(--feedback-max-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(93, 53, 213, 0.38) transparent;
  padding-right: 10px;
  padding-bottom: 8px;
  background:
    linear-gradient(
      to top,
      var(--feedback-surface) 28%,
      color-mix(in srgb, var(--feedback-surface) 78%, transparent) 62%,
      transparent 100%
    ) center bottom / 100% 46px no-repeat local,
    radial-gradient(
      farthest-side at 50% 100%,
      rgba(93, 53, 213, 0.28),
      rgba(93, 53, 213, 0)
    ) center bottom / 100% 18px no-repeat scroll;
}

.option-feedback::-webkit-scrollbar {
  width: 6px;
}

.option-feedback::-webkit-scrollbar-track {
  background: transparent;
}

.option-feedback::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(93, 53, 213, 0.30);
}

.option.correct .option-feedback {
  --feedback-surface: #f0fdf4;
}

.option.wrong .option-feedback {
  --feedback-surface: #fef2f2;
}

.option.partial .option-feedback {
  --feedback-surface: #fffbeb;
}

html[data-theme="dark"] .option-feedback,
html[data-theme="dark"] .option.correct .option-feedback,
html[data-theme="dark"] .option.wrong .option-feedback,
html[data-theme="dark"] .option.partial .option-feedback {
  --feedback-surface: #172033;
  scrollbar-color: rgba(167, 139, 250, 0.48) transparent;
  background:
    linear-gradient(
      to top,
      var(--feedback-surface) 28%,
      color-mix(in srgb, var(--feedback-surface) 78%, transparent) 62%,
      transparent 100%
    ) center bottom / 100% 46px no-repeat local,
    radial-gradient(
      farthest-side at 50% 100%,
      rgba(167, 139, 250, 0.34),
      rgba(167, 139, 250, 0)
    ) center bottom / 100% 18px no-repeat scroll;
}

@media (max-width: 560px) {
  .option-feedback {
    --feedback-max-height: 7.4em;
    padding-right: 7px;
  }
}

/* ==========================================================
   TESTQUAL RESULT INLINE INTERPRETATIONS v1.6
   Each interpretation sits directly under its own scale.
   ========================================================== */

.result-main-interpretation {
  margin: 24px 0 0 !important;
  max-width: 900px;
  color: #101730 !important;
  font-size: 24px;
  line-height: 1.38 !important;
  font-weight: 410;
  letter-spacing: -0.018em;
}

.result-aux-scales {
  margin-top: 42px;
}

.result-aux-interpretation {
  margin: 16px 0 0 !important;
  max-width: 900px;
  color: #555d73 !important;
  font-size: 18px;
  line-height: 1.45 !important;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.result-aux-scale {
  padding-bottom: 34px;
}

.result-aux-scale + .result-aux-scale {
  padding-top: 32px;
}

.result-course-card {
  margin-top: 18px;
}

html[data-theme="dark"] .result-main-interpretation {
  color: #f3f5ff !important;
}

html[data-theme="dark"] .result-aux-interpretation {
  color: #c7cbe0 !important;
}

@media (max-width: 560px) {
  .result-main-interpretation {
    margin-top: 18px !important;
    font-size: 18px;
    line-height: 1.4 !important;
  }

  .result-aux-scales {
    margin-top: 32px;
  }

  .result-aux-interpretation {
    margin-top: 12px !important;
    font-size: 15px;
    line-height: 1.42 !important;
  }

  .result-aux-scale {
    padding-bottom: 25px;
  }

  .result-aux-scale + .result-aux-scale {
    padding-top: 25px;
  }

  .result-course-card {
    margin-top: 12px;
  }
}

/* ==========================================================
   TESTQUAL CSS v1.7
   1) Answer feedback is always fully expanded.
   2) All result-scale interpretation texts use one font size.
   ========================================================== */

/* Show the full answer explanation; no inner scrolling or fade cue. */
.option-feedback,
.option.correct .option-feedback,
.option.wrong .option-feedback,
.option.partial .option-feedback,
html[data-theme="dark"] .option-feedback,
html[data-theme="dark"] .option.correct .option-feedback,
html[data-theme="dark"] .option.wrong .option-feedback,
html[data-theme="dark"] .option.partial .option-feedback {
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
  touch-action: auto !important;
  -webkit-overflow-scrolling: auto !important;
  scrollbar-width: none !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  background: transparent !important;
}

.option-feedback::-webkit-scrollbar {
  display: none !important;
}

/*
  One typography scale for all interpretation copy.
  The same clamp value is applied to the main and auxiliary scales.
*/
.result-main-interpretation,
.result-aux-interpretation {
  font-size: clamp(16px, 1.55vw, 20px) !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
  letter-spacing: -0.01em !important;
}

@media (max-width: 560px) {
  .result-main-interpretation,
  .result-aux-interpretation {
    font-size: 16px !important;
    line-height: 1.45 !important;
  }
}

/* ==========================================================
   TESTQUAL CSS v1.8
   Restore the original main-scale interpretation typography
   and apply it to all three scale explanations.
   ========================================================== */

.result-main-interpretation,
.result-aux-interpretation {
  font-size: 24px !important;
  line-height: 1.38 !important;
  font-weight: 410 !important;
  letter-spacing: -0.018em !important;
}

@media (max-width: 560px) {
  .result-main-interpretation,
  .result-aux-interpretation {
    font-size: 18px !important;
    line-height: 1.4 !important;
    font-weight: 410 !important;
    letter-spacing: -0.018em !important;
  }
}

/* ==========================================================
   TESTQUAL CSS v1.9
   Unified high-contrast interpretation copy on result screen.
   ========================================================== */

/* Same neutral comment color for all scale interpretations. */
.result-main-interpretation,
.result-aux-interpretation {
  color: #3f465a !important;
}

/* Night theme: noticeably lighter, readable neutral gray. */
html[data-theme="dark"] .result-main-interpretation,
html[data-theme="dark"] .result-aux-interpretation {
  color: #d9ddea !important;
}

