:root {
  --bg: #f3f8f4;
  --card: #ffffff;
  --primary: #4c9c7d;
  --primary-dark: #3f836a;
  --accent: #e0f1e7;
  --text: #1f2b26;
  --muted: #4f5a55;
  --line: #d6e5db;
  --shadow: rgba(38, 86, 62, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 25% 20%, #f2f7f3 0, #eef5f0 35%, #e6f0e8 70%, #f1f7f2 100%);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 28px 18px 48px;
  min-height: 100vh;
}
.page {
  width: 100%;
  max-width: 820px;
}
.view.hidden { display: none; }
.view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px);
}
#resultView { align-items: flex-start; }
#quizView { align-items: center; padding-top: 18vh; }

h1 {
  margin: 10px 0 8px;
  font-size: 28px;
  letter-spacing: 0.3px;
}
h2 {
  margin: 6px 0 10px;
  font-size: 24px;
  color: var(--text);
}
.lead {
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.6;
}
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 12px 30px var(--shadow);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 720px;
}
.hero { margin: 0 auto; }
.hero { text-align: center; }
.home-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 6vh;
}
.pill {
  display: inline-block;
  padding: 8px 14px;
  background: #e5f2e9;
  color: #587366;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.2px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.4px;
}
.feature-list { margin: 14px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.feature-grid { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; text-align: left; }
.feature-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px 14px;
  background: #f9fbf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 14px var(--shadow);
}
.feature-item { display: flex; gap: 10px; align-items: flex-start; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
}
.feature-title { font-weight: 600; color: var(--text); }
.feature-desc { color: var(--muted); font-size: 14px; line-height: 1.5; }
.note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.note div + div { margin-top: 4px; }
.muted { color: var(--muted); }
.info-card {
  text-align: left;
  background: #f8fbf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
  box-shadow: 0 6px 14px var(--shadow);
  line-height: 1.5;
}
.info-card div + div { margin-top: 6px; }
.tiny-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}
.home-action { margin-bottom: 6vh; }

.quiz-card { margin: 0 auto; }
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e6efe8;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-fill {
  height: 100%;
  width: 5%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition: width 0.25s ease;
}
.quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.question-title {
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.6;
  font-size: 21px;
}
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf8;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.2s ease;
}
.option input {
  display: none;
}
.option:hover { border-color: var(--primary); background: #edf6f0; box-shadow: 0 6px 18px var(--shadow); }
.option.selected { border-color: var(--primary); background: #e7f2eb; box-shadow: 0 8px 20px var(--shadow); }

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.actions.spaced { justify-content: space-between; }
.actions.center { justify-content: center; }
.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 20px rgba(76,156,125,0.35);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(76,156,125,0.4); }
.btn.secondary {
  background: #e7f1ea;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.alert {
  text-align: center;
  color: #b45309;
  margin: 6px 0 0;
  min-height: 18px;
  font-size: 14px;
}
.result-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: 0 16px 36px var(--shadow);
  margin: 0 auto;
  max-width: 780px;
  width: 100%;
}
.result-card h2 {
  margin: 10px 0 12px;
  font-size: 24px;
  color: #2f4a3f;
  text-align: center;
}
.result-sub {
  text-align: center;
  color: #4f6d60;
  font-size: 14px;
  font-weight: 700;
  margin-top: -2px;
  margin-bottom: 10px;
}
.result-pill {
  background: rgba(76,156,125,0.15);
  color: #4c9c7d;
}
.keyword-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 14px;
  justify-content: center;
}
.keyword-chip {
  padding: 6px 10px;
  background: #edf5ef;
  color: #355447;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid #dbe7de;
}
.sub-card {
  background: #f9fbf9;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  box-shadow: 0 8px 18px var(--shadow);
  margin-bottom: 12px;
}
.sub-title {
  font-weight: 700;
  color: #3f6c56;
  margin-bottom: 6px;
}
.sub-body { line-height: 1.65; color: var(--text); }
.actions.full { justify-content: center; }
.full-width { width: 100%; justify-content: center; display: inline-flex; }
.btn.big { padding: 14px 24px; font-size: 16px; }
.btn.text-link {
  background: transparent;
  color: #3f6c56;
  border: none;
  padding: 6px 10px;
  box-shadow: none;
}
.btn.text-link:hover { text-decoration: underline; transform: none; box-shadow: none; }
.actions.micro { margin-top: 4px; }

.toast {
  position: relative;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #d5efe1;
  color: var(--text);
  font-size: 14px;
  display: none;
  text-align: center;
}
.toast.show { display: block; animation: fade 3s ease forwards; }
@keyframes fade {
  0% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 640px) {
  body { padding: 16px 12px 30px; }
  h1 { font-size: 22px; line-height: 1.3; }
  h2 { font-size: 19px; }
  .lead { font-size: 14px; }
  .card { padding: 16px 14px; border-radius: 16px; }
  .hero { text-align: center; }
  .home-shell { padding-top: 4vh; gap: 14px; }
  .feature-grid { gap: 10px; }
  .feature-block { padding: 10px 12px; border-radius: 10px; }
  .feature-desc { font-size: 13px; }
  .info-card { padding: 10px 12px; border-radius: 10px; }
  .quiz-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .question-title { font-size: 16px; }
  .option { padding: 10px 12px; }
  .btn { width: 100%; justify-content: center; }
  .btn.big { width: 100%; }
  .actions.spaced { gap: 10px; flex-direction: column; }
  .view { min-height: auto; align-items: flex-start; }
  #quizView { padding-top: 10vh; }
  .result-card { padding: 18px 16px; border-radius: 18px; }
  .keyword-chip { font-size: 12px; }
}
