:root {
  --bg-top: #efe7db;
  --bg-bottom: #f7f3ec;
  --card: #fffdf8;
  --ink: #1f2a2e;
  --muted: #5c686d;
  --line: #dccfbb;
  --accent: #136f63;
  --accent-soft: #d7efe8;
  --warm: #cf8b4b;
  --shadow: 0 14px 40px rgba(28, 40, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.42;
  filter: blur(2px);
}

.bg-shape-left {
  top: -10vmax;
  left: -14vmax;
  background: radial-gradient(circle at 40% 40%, #f7c896, rgba(247, 200, 150, 0) 68%);
}

.bg-shape-right {
  bottom: -14vmax;
  right: -14vmax;
  background: radial-gradient(circle at 50% 50%, #b8ddd0, rgba(184, 221, 208, 0) 70%);
}

.app-shell {
  width: min(1150px, 92vw);
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid rgba(220, 207, 187, 0.8);
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: rise 500ms ease-out both;
}

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

.hero h1 {
  font-family: "Fraunces", Georgia, serif;
  margin: 8px 0 12px;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  line-height: 1.12;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 14px;
}

.stat-card-progress {
  display: grid;
  gap: 8px;
}

.stat-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f4ebdf;
}

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

.toolbar {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.search-wrap {
  display: grid;
  gap: 6px;
  flex: 1 1 340px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.search-wrap input {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 0.98rem;
}

.search-wrap input:focus-visible {
  outline: 2px solid #80b8ae;
  outline-offset: 1px;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
}

.question-list {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 10px 24px rgba(28, 40, 46, 0.08);
  overflow: hidden;
  animation: rise 420ms ease-out both;
}

.question-card.is-completed {
  border-color: #9cc8bb;
  box-shadow: 0 10px 28px rgba(30, 97, 85, 0.18);
}

.card-head {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(220, 207, 187, 0.75);
  display: grid;
  gap: 8px;
}

.question-index {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

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

.question-meta {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

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

.btn:focus-visible {
  outline: 2px solid #80b8ae;
  outline-offset: 1px;
}

.btn-complete {
  color: #0d463f;
  background: #d7efe8;
  border-color: #b9ddd3;
}

.question-card.is-completed .btn-complete {
  background: #0f6f62;
  border-color: #0f6f62;
  color: #ffffff;
}

.btn-answer {
  color: #503619;
  background: #f8e6d4;
  border-color: #efcda7;
}

.btn-nav {
  color: #1f2a2e;
  background: #eef1f2;
  border-color: #d3dbdf;
}

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

.answer-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.answer-count {
  font-size: 0.84rem;
  color: var(--muted);
  min-width: 84px;
  text-align: center;
  font-weight: 700;
}

.answer-panel {
  border-top: 1px solid rgba(220, 207, 187, 0.75);
  padding: 0 16px 16px;
}

.answer-panel pre {
  white-space: pre-wrap;
  margin: 12px 0 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.55;
  color: #2a3539;
  font-size: 0.96rem;
}

.status-message {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}

.noscript {
  margin: 16px;
  padding: 10px 12px;
  border: 1px solid #c6ab8c;
  background: #fff4e8;
  color: #59340d;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (max-width: 680px) {
  .app-shell {
    width: min(100%, 94vw);
    padding-top: 16px;
  }

  .hero {
    padding: 20px;
  }

  .card-head,
  .card-actions,
  .answer-panel {
    padding-left: 12px;
    padding-right: 12px;
  }
}
