:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #2b2a27;
  --sub: #6b6a66;
  --accent: #2f6f4f;
  --accent-light: #e7f1ec;
  --border: #e3e0d8;
  --answered: #2f6f4f;
  font-size: 17px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  padding-bottom: 80px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}
.topbar-inner { max-width: 760px; margin: 0 auto; }
.progress-wrap { display: flex; align-items: center; gap: 12px; }
.progress-track {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .3s ease;
}
.progress-label { font-size: 13px; color: var(--sub); white-space: nowrap; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }

.loading { text-align: center; color: var(--sub); padding: 60px 0; }

.title-block { text-align: center; margin: 18px 0 6px; }
.title-block h1 { font-size: 26px; margin: 0 0 8px; }
.title-block p.intro { color: var(--sub); font-size: 15px; }

.howto {
  background: var(--accent-light);
  border: 1px solid #cfe3d8;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0 26px;
  font-size: 15px;
}
.howto b { display: block; margin-bottom: 6px; }
.howto ul { margin: 6px 0 0; padding-left: 20px; }
.howto li { margin: 4px 0; }

.section {
  margin: 40px 0 18px;
  scroll-margin-top: 70px;
}
.section h2 {
  font-size: 20px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.section .sec-note { color: var(--sub); font-style: italic; font-size: 14px; margin-bottom: 12px; }

.subsection h3 {
  font-size: 17px;
  margin: 22px 0 6px;
  color: var(--accent);
}

.qcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.qcard.answered { border-color: var(--answered); }
.qlabel { font-size: 15.5px; margin-bottom: 8px; }
.qlabel .num { color: var(--accent); font-weight: 600; margin-right: 4px; }

textarea.answer {
  width: 100%;
  min-height: 44px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fdfdfc;
}
textarea.answer:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.qstatus {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
  min-height: 14px;
}
.qstatus.ok { color: var(--accent); }

.jumpnav {
  position: fixed;
  right: 10px;
  top: 60px;
  bottom: 10px;
  overflow-y: auto;
  width: 46px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 15;
}
.jumpnav a {
  display: block;
  text-align: center;
  font-size: 12px;
  padding: 5px 0;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--sub);
  text-decoration: none;
}
.jumpnav a:hover { background: var(--accent-light); color: var(--accent); }

.savetoast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 30;
}
.savetoast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-note {
  text-align: center;
  color: var(--sub);
  font-size: 14px;
  margin: 50px 0 10px;
}

@media (max-width: 640px) {
  :root { font-size: 16px; }
  .jumpnav { display: none; }
}
