:root {
  --paper: #f6f7fb;
  --paper-deep: #eaecf6;
  --paper-card: #ffffff;
  --ink: #14141f;
  --ink-soft: #4b4c62;
  --ink-faint: #7a7b93;
  --line: rgba(20, 20, 31, 0.09);
  --line-strong: rgba(20, 20, 31, 0.16);
  --accent: #5542f6;
  --accent-wash: rgba(85, 66, 246, 0.1);
  --gold: #d97706;
  --gold-soft: #f59e0b;
  --good: #15803d;
  --danger: #e11d48;
  --btn-gradient: linear-gradient(135deg, #5542f6 0%, #e11d48 100%);
  --radius-m: 14px;
  --radius-l: 22px;
  --shadow-card: 0 2px 6px rgba(20,20,31,0.04), 0 20px 40px -20px rgba(85,66,246,0.2);
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Noto Kufi Arabic', 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper: #0b0c14;
  --paper-deep: #131523;
  --paper-card: #161827;
  --ink: #f1f1f7;
  --ink-soft: #b3b4c9;
  --ink-faint: #7d7e97;
  --line: rgba(241, 241, 247, 0.1);
  --line-strong: rgba(241, 241, 247, 0.18);
  --accent: #9387ff;
  --accent-wash: rgba(147, 135, 255, 0.18);
  --gold: #fbbf24;
  --gold-soft: #fcd34d;
  --good: #4ade80;
  --danger: #fb7185;
  --btn-gradient: linear-gradient(135deg, #9387ff 0%, #ff7ab8 100%);
  --shadow-card: 0 2px 6px rgba(0,0,0,0.4), 0 28px 56px -24px rgba(147,135,255,0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.paper-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.paper-texture::before,
.paper-texture::after {
  content: "";
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.6;
}
.paper-texture::before {
  top: -20vmax;
  inset-inline-end: -18vmax;
  background: radial-gradient(circle, var(--accent-wash), transparent 70%);
}
.paper-texture::after {
  bottom: -22vmax;
  inset-inline-start: -16vmax;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.12), transparent 70%);
}

.watermark-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  flex-wrap: wrap;
  align-content: space-around;
  justify-content: space-around;
  color: var(--ink);
  transform: rotate(-15deg) scale(1.2);
}

body.zen-mode .site-header,
body.zen-mode .paper-texture,
body.zen-mode .site-footer {
  display: none !important;
}
body.zen-mode #app {
  padding-top: 20px;
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 5vw, 60px) 10px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-meta {
  font-size: 12.5px; color: var(--ink-soft); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper-card);
  cursor: pointer; display: grid; place-items: center; position: relative;
  font-size: 14px; color: var(--ink); transition: transform 0.15s, border-color 0.15s;
}
.theme-toggle:hover { border-color: var(--accent); transform: scale(1.05); }
.theme-icon { position: absolute; font-size: 16px; transition: opacity 0.2s; }
.theme-icon-sun { opacity: 1; color: var(--gold); }
.theme-icon-moon { opacity: 0; color: var(--gold-soft); }
html[data-theme="dark"] .theme-icon-sun { opacity: 0; }
html[data-theme="dark"] .theme-icon-moon { opacity: 1; }

#app {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 10px clamp(16px, 5vw, 40px) 60px;
}
.view { display: none; }
.view.view-active { display: block; animation: fade-up 0.35s ease both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.challenge-banner {
  background: var(--accent-wash);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-m);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}
.challenge-icon { font-size: 18px; }

.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
  padding: 24px 0 16px;
}
.eyebrow { font-size: 13px; font-weight: 700; color: var(--accent); margin: 0 0 12px; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 16px;
}
.hero-title-accent {
  background: var(--btn-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lede { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 22px; }
.feature-list { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.feature-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.disclaimer-small { font-size: 12px; color: var(--ink-faint); line-height: 1.6; margin-top: 14px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--btn-gradient); color: #fff; border: none;
  padding: 13px 24px; font-size: 15px; font-weight: 700;
  border-radius: var(--radius-m); cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 12px 24px -10px rgba(85,66,246,0.5);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-arrow { transform: scaleX(-1); display: inline-block; }

.btn-ghost {
  background: var(--paper-card); border: 1.5px solid var(--line-strong);
  color: var(--ink-soft); padding: 12px 20px; font-size: 14px;
  font-weight: 600; border-radius: var(--radius-m); cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.intro-visual { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.dial-preview { position: relative; width: min(230px, 58vw); }
.dial-svg { width: 100%; height: auto; transform: rotate(-90deg); }
.dial-track { fill: none; stroke: var(--paper-deep); stroke-width: 10; }
.dial-fill {
  fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 540.35; stroke-dashoffset: 540.35;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.dial-preview-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.dial-preview-number { font-family: var(--font-display); font-size: 40px; font-weight: 900; line-height: 1; }
.dial-preview-caption { font-size: 11.5px; color: var(--ink-soft); }
.visual-shapes { display: flex; gap: 14px; align-items: center; }
.mini-shape { background: var(--accent); }
.mini-circle { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); }
.mini-diamond { width: 18px; height: 18px; transform: rotate(45deg); background: var(--accent); }
.mini-hex { width: 22px; height: 22px; background: var(--gold); clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }

.category-strip { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; border-top: 1px solid var(--line); margin-top: 10px; }
.category-chip {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); background: var(--paper-card); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}
.chip-num { color: var(--accent); font-weight: 800; font-size: 11px; }

/* History Card */
.history-card {
  margin-top: 28px; background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-m); padding: 16px;
}
.history-title { font-size: 14px; font-weight: 800; margin: 0 0 10px; }
.history-chart-wrap { width: 100%; height: 120px; margin-bottom: 12px; }
.history-chart-wrap canvas { width: 100%; height: 100%; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px;
}

/* Setup View */
.setup-card {
  max-width: 620px; margin: 24px auto; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-card); padding: clamp(20px, 5vw, 36px);
}
.setup-heading { font-family: var(--font-display); font-size: 21px; font-weight: 800; margin: 4px 0 18px; }
.setup-subheading { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin: 18px 0 8px; display: block; }
.setup-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.setup-options-3 { grid-template-columns: repeat(3, 1fr); }
.setup-options-row { grid-template-columns: repeat(2, 1fr); }
.setup-option {
  border: 1.5px solid var(--line); background: var(--paper);
  border-radius: var(--radius-m); padding: 11px 13px; cursor: pointer;
  text-align: right; transition: border-color 0.15s, background 0.15s;
}
.setup-option:hover { border-color: var(--accent); }
.setup-option.selected { border-color: var(--accent); background: var(--accent-wash); }
.setup-option-title { font-size: 13px; font-weight: 700; color: var(--ink); display: block; }
.setup-option-sub { font-size: 11px; color: var(--ink-soft); display: block; margin-top: 2px; }
.setup-option.selected .setup-option-title { color: var(--accent); }
.security-box { margin-top: 14px; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); font-size: 13px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-soft); }
.setup-start { width: 100%; justify-content: center; margin-top: 22px; }

/* Quiz Topbar Controls */
.quiz-topbar { padding: 16px 0 8px; }
.quiz-progress-labels { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; font-weight: 600; flex-wrap: wrap; gap: 8px; }
.quiz-progress-right { display: flex; align-items: center; gap: 8px; }
.btn-flag {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.btn-flag.is-flagged { background: var(--gold-soft); color: #fff; border-color: var(--gold); }
.btn-grid-toggle {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer;
}
.quiz-integrity { font-size: 12px; font-weight: 700; color: var(--good); background: rgba(21, 128, 61, 0.1); padding: 2px 8px; border-radius: 999px; }
.quiz-timer {
  font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 12px;
}
.quiz-timer.timer-urgent { color: var(--danger); border-color: var(--danger); }
.quiz-category-label { color: var(--accent); font-weight: 700; }
.progress-track { height: 6px; border-radius: 999px; background: var(--paper-deep); overflow: visible; position: relative; }
.progress-fill { height: 100%; width: 0%; background: var(--btn-gradient); border-radius: 999px; transition: width 0.3s; }
.ghost-marker {
  position: absolute; top: -7px; font-size: 14px; line-height: 1; transform: translateX(50%);
  transition: right 0.5s linear; pointer-events: none;
}
.security-warning {
  background: rgba(225, 29, 72, 0.12); color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--radius-m);
  padding: 9px 14px; font-size: 12.5px; font-weight: 700; margin-bottom: 12px; text-align: center;
}

/* Palette Drawer */
.quiz-palette-card {
  background: var(--paper-card); border: 1.5px solid var(--line); border-radius: var(--radius-m);
  padding: 16px; margin-top: 10px; box-shadow: var(--shadow-card); animation: q-fade-in 0.2s ease both;
}
.palette-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; }
.palette-legend { display: flex; gap: 10px; font-size: 11.5px; color: var(--ink-soft); }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ans { background: var(--accent); }
.dot-flag { background: var(--gold); }
.dot-empty { background: var(--paper-deep); }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; }
.palette-btn {
  height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper);
  font-size: 12px; font-weight: 700; color: var(--ink); cursor: pointer; position: relative;
}
.palette-btn.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); font-weight: 900; }
.palette-btn.is-answered { background: var(--accent-wash); color: var(--accent); border-color: var(--accent); }
.palette-btn.is-flagged::after {
  content: "★"; position: absolute; top: 1px; left: 2px; font-size: 8px; color: var(--gold);
}

/* Question Area & Pinch-To-Zoom Touch Action */
.quiz-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-card); padding: clamp(18px, 4vw, 32px); margin-top: 12px; min-height: 290px;
  position: relative;
}
.quiz-card.q-anim { animation: q-fade-in 0.2s ease both; }
@keyframes q-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.zoom-helper-tip { font-size: 10.5px; color: var(--ink-faint); margin-bottom: 6px; text-align: left; }
.zoomable-area { touch-action: pan-x pan-y; transition: transform 0.15s ease-out; }
.question-instruction { font-size: 13px; font-weight: 700; color: var(--ink-faint); margin: 0 0 14px; }
.question-body { font-size: clamp(17px, 2.5vw, 22px); font-weight: 700; line-height: 1.6; margin-bottom: 22px; }
.question-numbers {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  font-size: clamp(20px, 3.5vw, 28px); font-weight: 800; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 20px 14px;
}
.question-numbers .qmark { color: var(--accent); }
.question-numbers .sep { color: var(--ink-faint); font-size: 0.7em; }
.question-visual-row {
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 22px 14px;
}
.matrix-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 260px; margin: 0 auto; }
.matrix-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; }
.matrix-cell.matrix-blank { border-style: dashed; border-color: var(--accent); }
.matrix-blank .qmark { font-size: 20px; font-weight: 800; color: var(--accent); }
.spatial-reference { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-m); padding: 22px 14px; }
.spatial-reference-label { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; }
.memorize-label { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; }
.memorize-label .memorize-count { color: var(--accent); font-weight: 900; font-size: 16px; }

.options-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
@media (min-width: 600px) {
  .options-grid.options-text { grid-template-columns: repeat(2, 1fr); }
  .options-grid.options-visual { grid-template-columns: repeat(4, 1fr); }
}
.option-btn {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-m);
  padding: 13px; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer;
  text-align: center; display: flex; align-items: center; justify-content: center; min-height: 52px;
}
.option-btn:hover { border-color: var(--accent); background: var(--paper-card); }
.option-btn.selected { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.quiz-footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

.gate-card {
  max-width: 420px; margin: 30px auto; background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius-l); box-shadow: var(--shadow-card); padding: clamp(22px, 5vw, 36px); text-align: center;
}
.gate-heading { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin: 4px 0 12px; }
.gate-subtext { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.gate-preview {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent-wash);
  color: var(--accent); font-size: 28px; font-weight: 800; display: grid; place-items: center; margin: 0 auto 18px;
}
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.text-input {
  width: 100%; font-family: var(--font); font-size: 14px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius-m); background: var(--paper); color: var(--ink);
}
.text-input:focus { border-color: var(--accent); outline: none; }
.gate-submit { justify-content: center; }

/* Dossier & Reporting */
.results-header-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-card); padding: clamp(20px, 5vw, 36px); display: grid;
  grid-template-columns: 0.8fr 1.2fr; gap: 28px; align-items: center; margin-bottom: 20px;
}
.results-dial-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.score-ci { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin: 0; }
.score-band { font-size: 13.5px; font-weight: 800; color: var(--accent); background: var(--accent-wash); padding: 5px 16px; border-radius: 999px; margin: 0; }
.results-heading { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin: 4px 0 8px; }
.percentile-line { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-wash); border-radius: 999px; padding: 4px 12px; margin-bottom: 10px; }
.results-summary { font-size: 14px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 16px; }

.match-card { display: flex; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; }
.match-icon { font-size: 24px; }
.match-info { display: flex; flex-direction: column; gap: 2px; }
.match-label { font-size: 11px; color: var(--ink-faint); font-weight: 600; }
.match-name { font-size: 14px; color: var(--accent); font-weight: 800; }
.match-desc { font-size: 12px; color: var(--ink-soft); margin: 2px 0 0; line-height: 1.5; }

.section-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow-card); padding: clamp(18px, 4vw, 28px); margin-bottom: 20px;
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.section-header h3 { font-family: var(--font-display); font-size: 17px; font-weight: 800; margin: 0; }
.section-badge { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-wash); padding: 3px 9px; border-radius: 999px; }
.section-desc { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 16px; }

.table-wrap { overflow-x: auto; margin-top: 10px; }
.psych-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: right; }
.psych-table th, .psych-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.psych-table th { color: var(--ink-soft); font-weight: 700; font-size: 12px; }
.font-bold { font-weight: 800; color: var(--accent); }

.brain-map-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; }
.brain-svg-container { width: 100%; max-width: 280px; margin: 0 auto; }
.brain-svg-container svg { width: 100%; height: auto; }
.brain-legend { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.brain-item { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); }

.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.swot-box { padding: 14px; border-radius: var(--radius-m); border: 1px solid var(--line); }
.swot-strong { background: rgba(21, 128, 61, 0.08); border-color: var(--good); }
.swot-weak { background: rgba(225, 29, 72, 0.08); border-color: var(--danger); }
.swot-title { font-size: 13px; font-weight: 800; display: block; margin-bottom: 4px; }
.swot-strong .swot-title { color: var(--good); }
.swot-weak .swot-title { color: var(--danger); }
.swot-text { font-size: 12.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; }

.rival-card { border-color: var(--accent); }
.rival-body { display: flex; justify-content: space-around; align-items: center; padding: 10px; }
.rival-player { text-align: center; }
.rival-score { font-size: 26px; font-weight: 900; color: var(--accent); display: block; }
.rival-vs { font-weight: 800; font-size: 16px; color: var(--ink-faint); }

.region-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; }
.region-cohort-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 6px; }

.bell-curve-wrap { width: 100%; overflow-x: auto; padding: 6px 0; }
.bell-curve-svg { width: 100%; min-width: 520px; height: auto; display: block; }

.radar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.radar-canvas-wrap { display: flex; justify-content: center; align-items: center; }
.category-breakdown { display: flex; flex-direction: column; gap: 9px; }
.breakdown-row { display: grid; grid-template-columns: 120px 1fr 36px; align-items: center; gap: 10px; font-size: 12.5px; }
.breakdown-label { color: var(--ink-soft); font-weight: 600; }
.breakdown-track { height: 7px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; }
.breakdown-fill { height: 100%; width: 0%; background: var(--btn-gradient); border-radius: 999px; transition: width 0.8s; }
.breakdown-score { text-align: left; font-weight: 700; }

.careers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.career-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; }
.career-title { font-weight: 800; font-size: 13.5px; color: var(--ink); margin-bottom: 3px; display: block; }
.career-desc { font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }

.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; }
.review-item.is-correct { border-inline-start: 4px solid var(--good); }
.review-item.is-incorrect { border-inline-start: 4px solid var(--danger); }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 12.5px; font-weight: 700; }
.review-badge-correct { color: var(--good); }
.review-badge-incorrect { color: var(--danger); }
.review-explanation { font-size: 12px; color: var(--ink-soft); line-height: 1.6; margin: 4px 0 0; }

.challenge-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cert-link-row { display: flex; gap: 8px; margin-top: 10px; }
.cert-link-row[hidden] { display: none; }

.shape { display: inline-block; flex-shrink: 0; }
.shape-circle { border-radius: 50%; }
.shape-square { border-radius: 4px; }
.shape-diamond { border-radius: 4px; transform: rotate(45deg); }
.shape-triangle {
  width: 0; height: 0; background: transparent !important;
  border-left: var(--tri-w, 20px) solid transparent; border-right: var(--tri-w, 20px) solid transparent;
  border-bottom: var(--tri-h, 34px) solid var(--tri-color, var(--ink));
}
.shape-pentagon { clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%); }
.shape-hexagon { clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.shape-flag { clip-path: polygon(0% 0%, 38% 0%, 38% 62%, 100% 62%, 100% 100%, 0% 100%); }
.shape-f { clip-path: polygon(0% 0%, 100% 0%, 100% 28%, 38% 28%, 38% 50%, 82% 50%, 82% 75%, 38% 75%, 38% 100%, 0% 100%); }
.shape-hook { clip-path: polygon(0% 0%, 100% 0%, 100% 40%, 60% 100%, 25% 100%, 65% 35%, 0% 35%); }
.shape-z { clip-path: polygon(0% 0%, 65% 0%, 65% 35%, 100% 35%, 100% 100%, 35% 100%, 35% 65%, 0% 65%); }
.shape-arrow { clip-path: polygon(0% 0%, 55% 0%, 100% 50%, 55% 100%, 0% 100%, 35% 50%); }
.shape-outline { background: transparent !important; border: 4px solid var(--outline-color, var(--ink)); }
.shape-outline.shape-triangle { border: none; }
.dot-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }

.site-footer {
  position: relative; z-index: 1; display: flex; justify-content: center;
  gap: 8px; padding: 24px 16px; color: var(--ink-faint); font-size: 12px;
}
.footer-dot { opacity: 0.6; }

@media print {
  body { background: #fff !important; color: #000 !important; }
  .no-print, .site-header, .site-footer, .paper-texture, .theme-toggle, .btn-primary, .btn-ghost, .watermark-overlay { display: none !important; }
  .section-card, .results-header-card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; page-break-inside: avoid; margin-bottom: 20px; }
  #app { max-width: 100% !important; padding: 0 !important; }
}

@media (max-width: 768px) {
  .intro-grid { grid-template-columns: 1fr; }
  .results-header-card { grid-template-columns: 1fr; text-align: center; }
  .radar-grid { grid-template-columns: 1fr; }
  .swot-grid { grid-template-columns: 1fr; }
  .brain-map-wrap { grid-template-columns: 1fr; }
  .setup-options-3 { grid-template-columns: 1fr; }
  .breakdown-row { grid-template-columns: 100px 1fr 34px; }
  .quiz-footer { flex-direction: column-reverse; }
  .quiz-footer .btn-primary, .quiz-footer .btn-ghost { width: 100%; justify-content: center; }
}
