:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --text: #142033;
  --muted: #607089;
  --line: #d8e0ec;
  --accent: #126b63;
  --accent-dark: #0d514b;
  --accent-soft: #dff3f0;
  --danger: #a13b2a;
  --warning: #a3650a;
  --shadow: 0 24px 70px rgba(20, 32, 51, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(18, 107, 99, 0.14), transparent 30rem),
    linear-gradient(135deg, #f7f9fc 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100% - 2rem, 980px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 2rem 0;
}

.panel {
  width: 100%;
  min-height: min(780px, calc(100vh - 4rem));
  background: var(--panel);
  border: 1px solid rgba(216, 224, 236, 0.8);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.app-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.label {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.08;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

p {
  margin: 0;
}

.status {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status.error {
  color: var(--danger);
  font-weight: 700;
}

.screen {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.intro {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.survey-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.survey-button,
.primary-button,
.ghost-button,
.option-button {
  border-radius: 8px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.survey-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  font-weight: 750;
}

.survey-button:hover,
.survey-button:focus-visible,
.option-button:hover,
.option-button:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.survey-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin-top: 1.5rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-dark);
}

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

.ghost-button {
  min-height: 2.45rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 750;
}

.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-weight: 750;
}

.progress-track {
  height: 0.5rem;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 180ms ease;
}

.question-topic {
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-weight: 800;
}

.question-prompt {
  max-width: 48rem;
  margin-bottom: 1.35rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.18;
  font-weight: 800;
}

.options {
  display: grid;
  gap: 0.75rem;
}

.option-button {
  width: 100%;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.option-button.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-button:disabled {
  cursor: default;
}

.option-key {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 850;
}

.selected .option-key {
  background: var(--accent);
  color: #ffffff;
}

.results-summary {
  display: grid;
  gap: 0.65rem;
  max-width: 62ch;
  color: var(--muted);
}

.topic-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.topic-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fbfcfe;
}

.topic-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.priority {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  background: #edf2f7;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.priority.high {
  background: #fde8df;
  color: var(--danger);
}

.priority.medium {
  background: #fff0d8;
  color: var(--warning);
}

.topic-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.stat-pill {
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: #eef3f8;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.recommendation {
  color: var(--text);
  font-weight: 650;
}

details {
  margin-top: 0.85rem;
  color: var(--muted);
}

summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 800;
}

.missed-list {
  display: grid;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.missed-list li {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.small {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 680px) {
  .app-shell {
    width: 100%;
    align-items: stretch;
    padding: 0;
  }

  .panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-header,
  .progress-row,
  .topic-head {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    max-width: 10ch;
  }

  .survey-button {
    align-items: flex-start;
    flex-direction: column;
  }

  .survey-meta {
    white-space: normal;
  }
}
