:root {
  --ink: #1d2a22;
  --ink-soft: #4a5a50;
  --paper: #f6f3ea;
  --card: #fffdf7;
  --line: #ddd6c4;
  --green: #234d36;
  --green-2: #2f6447;
  --meadow: #7a9a55;
  --meadow-soft: #e7eedb;
  --amber: #a5641a;
  --amber-soft: #fbefd9;
  --focus: #e0a21c;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 19px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 36px; padding-bottom: 64px; outline: none; }

/* header */
.site-header { background: var(--green); color: #f4f1e6; position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.wordmark { font-family: var(--serif); font-size: 1.25rem; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.leaf { width: 18px; height: 18px; background: var(--meadow); border-radius: 0 60% 0 60%; display: inline-block; transform: rotate(-10deg); }
.progress { flex: 1; height: 6px; background: rgba(255,255,255,.18); border-radius: 6px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: #c9dba8; transition: width .4s ease; }

.mobile-note { background: var(--amber-soft); color: #5a3a10; border-bottom: 1px solid #ecd4ab; font-size: .9rem; padding: 12px 0; }

/* type */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--green); }
h1 { font-size: 2.1rem; margin: 0 0 .6em; }
h2 { font-size: 1.6rem; margin: 0 0 .5em; }
h3 { font-size: 1.15rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.12rem; color: var(--ink); }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.eyebrow { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--meadow); font-weight: 700; margin-bottom: .4em; }
a { color: var(--green-2); }

/* panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 30px; margin-bottom: 22px; }
.callout { background: var(--meadow-soft); border-left: 5px solid var(--meadow); border-radius: 10px; padding: 16px 20px; margin: 18px 0; }
.callout.amber { background: var(--amber-soft); border-color: var(--amber); }
.steps-list { padding-left: 1.2em; }
.steps-list li { margin-bottom: .5em; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 28px; }
.actions .spacer { flex: 1; }
button, .btn {
  font: inherit; font-size: 1rem; border-radius: 10px; cursor: pointer;
  padding: 14px 26px; border: 2px solid var(--green); background: var(--green); color: #fff;
  font-weight: 600; transition: background .15s, transform .05s;
}
button:hover { background: var(--green-2); }
button:active { transform: translateY(1px); }
button.secondary { background: transparent; color: var(--green); }
button.secondary:hover { background: var(--meadow-soft); }
button.link { background: none; border: none; color: var(--green-2); padding: 6px 0; text-decoration: underline; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* topic cards */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 22px 0; }
.topic-card {
  text-align: left; background: var(--card); color: var(--ink); border: 2px solid var(--line);
  padding: 16px 18px; border-radius: 12px; font-weight: 400; position: relative; min-height: 96px;
}
.topic-card:hover { background: #fff; border-color: var(--meadow); }
.topic-card .t-icon { font-size: 1.5rem; display: block; margin-bottom: 6px; }
.topic-card .t-title { font-weight: 650; line-height: 1.3; display: block; }
.topic-card.selected { border-color: var(--green); background: var(--meadow-soft); }
.topic-card .t-badge {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 700; display: none; align-items: center; justify-content: center; font-size: .9rem;
}
.topic-card.selected .t-badge { display: flex; }

.order-list { list-style: none; padding: 0; margin: 12px 0 0; }
.order-list li { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.order-list .num { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-size: .9rem; }
.order-list .name { flex: 1; }
.order-list button { padding: 6px 12px; font-size: .9rem; }

/* questions */
.topic-tag { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green-2); background: var(--meadow-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; }
.question { margin-top: 4px; }
.question + .question { margin-top: 34px; }
.q-label { display: block; font-family: var(--serif); font-weight: 600; color: var(--green); font-size: 1.6rem; line-height: 1.25; margin-bottom: 14px; }
.mention { margin: 0 0 18px; }
.mention .m-label { font-weight: 650; margin-bottom: 4px; }
.mention ul { margin: 0; padding-left: 1.2em; }
.mention li { margin-bottom: 4px; }
.starter { border-left: 3px solid var(--line); padding: 4px 0 4px 16px; margin: 0 0 14px; }
.starter .s-label { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; line-height: 1.5; }
.starter .s-text { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--ink); margin: 6px 0 2px; }
.starter button { font-size: .85rem; }
textarea {
  width: 100%; font: inherit; font-size: 1.02rem; line-height: 1.5; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); resize: vertical; min-height: 130px;
}
textarea:focus { border-color: var(--green-2); outline: none; box-shadow: 0 0 0 3px rgba(122,154,85,.25); }
.hint { font-size: .9rem; color: var(--ink-soft); margin-top: 6px; }
.error { color: #9b2c1f; font-weight: 600; margin-top: 8px; }
.optional { font-weight: 400; color: var(--ink-soft); font-size: .9rem; }

/* radios */
.choice { display: flex; gap: 14px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 12px 0; background: var(--card); cursor: pointer; }
.choice:hover { border-color: var(--meadow); }
.choice input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--green); flex-shrink: 0; }
.choice.checked { border-color: var(--green); background: var(--meadow-soft); }

/* review */
.review-item { border-top: 1px solid var(--line); padding: 14px 0; }
.review-item:first-of-type { border-top: none; }
.review-item .ans { white-space: pre-wrap; color: var(--ink-soft); font-size: .95rem; margin: 4px 0; }

/* loading */
.loading { text-align: center; padding: 70px 20px; }
.spinner { width: 54px; height: 54px; border: 5px solid var(--meadow-soft); border-top-color: var(--green); border-radius: 50%; margin: 0 auto 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result */
.letter-box { font-family: var(--serif); font-size: 1.05rem; line-height: 1.65; min-height: 480px; padding: 22px 24px; }
.result-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.wordcount { font-size: .88rem; color: var(--ink-soft); margin-top: 6px; }
.form-answers dt { font-weight: 650; margin-top: 10px; }
.form-answers dd { margin: 2px 0 0; color: var(--ink-soft); }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 14px 24px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 20; }
.overlap-list li { font-family: var(--serif); font-style: italic; margin-bottom: 6px; }

.site-footer { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--ink-soft); font-size: .88rem; }
.site-footer summary { cursor: pointer; font-weight: 600; color: var(--green); }
.site-footer details p { margin-top: .7em; }

@media (max-width: 640px) {
  html { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .panel { padding: 20px 18px; }
  h1 { font-size: 1.7rem; }
  .wordmark { font-size: 1.05rem; }
  .actions button { flex: 1 1 100%; }
}

/* video */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1d2a22; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #e9efe0; font-weight: 600; }
.video-placeholder .play { width: 72px; height: 72px; border-radius: 50%; background: rgba(255,255,255,.14); position: relative; }
.video-placeholder .play::after { content: ""; position: absolute; left: 29px; top: 22px; border-left: 22px solid #e9efe0; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.video-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.video-link code { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: .9rem; word-break: break-all; flex: 1; min-width: 220px; }
.video-link button { padding: 10px 18px; }
.question label:not(.q-label) { font-weight: 650; display: block; margin-bottom: 6px; }
.mention .m-note { font-size: .88rem; color: var(--ink-soft); font-style: italic; margin-bottom: 6px; }
