:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #fcfdff;
  --ink: #0f172a;
  --ink-muted: #475569;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --brand-soft: #f0fdfa;
  --accent: #0ea5a3;
  --danger: #b91c1c;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg), #ffffff 35%, var(--bg));
}

.page-glow,
.page-noise {
  display: none;
}

.container {
  width: min(1120px, 94vw);
  margin: 1.5rem auto 2.5rem;
  display: grid;
  gap: 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}

h1 {
  margin-top: 0.28rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
}

h3 {
  font-size: 1.1rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--brand-strong);
}

.subtitle {
  margin: 0;
  max-width: 48ch;
  color: var(--ink-muted);
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  background: var(--surface-soft);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.85rem;
  background: var(--surface);
}

.side-panel p {
  margin: 0;
  color: var(--ink-muted);
}

.side-stats {
  display: grid;
  gap: 0.5rem;
}

.stat {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.72rem;
}

.stat-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.66rem;
  color: var(--ink-muted);
  font-weight: 700;
}

.stat-value {
  margin: 0.16rem 0 0;
  font-size: 1.12rem;
  font-weight: 700;
}

.dynamic-hint {
  padding: 0.65rem 0.72rem;
  border-radius: var(--radius-sm);
  border: 1px solid #ccfbf1;
  background: var(--brand-soft);
  color: #0f5f58;
  font-weight: 600;
}

.main-panel {
  min-height: 420px;
}

.hidden {
  display: none;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.68rem 1.08rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
}

.btn.ghost {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
}

#progress-label {
  margin: 0;
  color: var(--ink-muted);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  margin: 0.9rem 0 0.85rem;
  overflow: hidden;
  background: #e2e8f0;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.3s ease;
}

.question-meta {
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.58rem;
  border-radius: 999px;
  border: 1px solid #c7f9f1;
  background: #f0fdfa;
  color: #0f5f58;
  font-size: 0.82rem;
  font-weight: 700;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.question-card h3 {
  margin-bottom: 0.35rem;
}

.question-card p {
  margin: 0;
  color: var(--ink-muted);
}

.option-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
}

.option-grid label {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.52rem 0.45rem;
  display: grid;
  justify-items: center;
  gap: 0.22rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.option-grid label:hover {
  border-color: #99f6e4;
  background: #f8fffd;
}

.option-grid input {
  margin: 0;
  accent-color: var(--brand);
}

.option-grid .score {
  font-size: 1.05rem;
  font-weight: 700;
}

.option-grid .label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.quiz-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
}

.field-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.32rem;
  font-weight: 600;
}

.field-full {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.86rem;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.68rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.2);
}

.error {
  margin: 0.8rem 0 0;
  color: var(--danger);
  font-weight: 700;
}

.success {
  margin: 0.8rem 0 0;
  color: var(--brand-strong);
  font-weight: 700;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

.leader-context {
  color: var(--ink-muted);
  margin: 0.5rem 0 0;
}

.report-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.level-card {
  border-color: #b9f2e9;
  background: linear-gradient(180deg, #f3fffc, #ffffff);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  margin: 0 0 0.35rem;
  color: var(--brand-strong);
  font-weight: 700;
}

.confidence {
  margin-bottom: 0;
  color: #0f5f58;
  font-weight: 700;
}

.ladder-list {
  margin: 0.75rem 0 0;
  padding-left: 1.06rem;
  display: grid;
  gap: 0.4rem;
}

.ladder-item {
  color: var(--ink-muted);
}

.ladder-item.current {
  color: var(--ink);
  font-weight: 700;
}

ul,
ol {
  margin: 0.72rem 0 0;
  padding-left: 1.05rem;
}

li {
  margin-bottom: 0.4rem;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 740px) {
  .container {
    width: min(97vw, 1120px);
    margin: 1rem auto 2rem;
  }

  .panel {
    border-radius: 14px;
    padding: 0.92rem;
  }

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

  .field-grid {
    grid-template-columns: 1fr;
  }

  .quiz-top,
  .report-head,
  .quiz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}
