:root {
  color-scheme: light;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #3b3530;
  background: #faf7f2;
  --muted: #6b625a;
  --line: #e6ddd1;
  --accent: #7a5c3e;
  --card: #fffdf9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.65;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
button:hover,
.button:hover {
  border-color: #b59b80;
  background: #f4ecdf;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.primary,
.primary {
  background: var(--accent);
  color: #fffdf9;
  border-color: var(--accent);
}
button.primary:hover,
.primary:hover {
  background: #8b6745;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #c99a62;
  outline-offset: 3px;
}
.site-header {
  max-width: 780px;
  margin: auto;
  padding: 22px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-family: Georgia, serif;
  font-size: 32px;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: -1.5px;
}
.brand span {
  font-size: 13px;
  font-family: system-ui;
  font-weight: 400;
  letter-spacing: 3px;
  margin-left: 12px;
}
nav {
  display: flex;
  gap: 15px;
  font-size: 13px;
}
nav a[aria-current] {
  font-weight: bold;
  text-decoration: none;
}
main {
  max-width: 720px;
  margin: 20px auto 0;
  padding: 0 20px;
}
h1 {
  font-size: clamp(30px, 6vw, 45px);
  line-height: 1.28;
  letter-spacing: -0.035em;
  font-weight: 620;
  margin: 12px 0 20px;
}
h2 {
  font-size: 20px;
  line-height: 1.4;
}
h3 {
  font-size: 18px;
}
.intro {
  margin-bottom: 28px;
}
.intro p {
  margin: 8px 0;
  color: var(--muted);
}
.intro .eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #72583d;
}
.intro .next-line {
  font-size: 14px;
}
.hero {
  position: relative;
}
.lead {
  font-size: 18px;
  max-width: 450px;
  line-height: 1.9;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.story-mark {
  margin: 36px 0 28px;
  background: #efe5d5;
  border-radius: 24px;
  padding: 30px;
  min-height: 210px;
  position: relative;
  overflow: hidden;
  color: #75593c;
}
.story-mark span {
  position: absolute;
  right: 32px;
  top: 0;
  font-size: 150px;
  color: #9a7752;
  font-weight: 100;
}
.story-mark p {
  font:
    italic 32px/1.3 Georgia,
    serif;
  position: relative;
  margin: 0 0 20px;
}
.story-mark i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.2em;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 34px 0 48px;
}
.step-number {
  font:
    italic 25px Georgia,
    serif;
  color: #72583d;
}
.step-tile h2 {
  font-size: 16px;
}
.step-tile p {
  color: var(--muted);
  font-size: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  margin: 20px 0;
}
.wizard {
  min-height: 390px;
  padding-bottom: 28px;
}
.progress-caption {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}
progress {
  display: block;
  width: 100%;
  height: 5px;
  appearance: none;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  margin: 12px 0 28px;
}
progress::-webkit-progress-bar {
  background: #ece3d7;
}
progress::-webkit-progress-value {
  background: #b8936d;
}
progress::-moz-progress-bar {
  background: #b8936d;
}
label {
  display: block;
  margin: 10px 0;
}
textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid #d9cdbe;
  background: #fffefa;
  border-radius: 12px;
  padding: 13px;
  resize: vertical;
}
textarea {
  min-height: 120px;
  line-height: 1.8;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}
.choice {
  margin: 0;
  cursor: pointer;
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.choice span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 16px;
  min-height: 46px;
  background: #fffefa;
}
.choice input:checked + span {
  background: #f2e7d8;
  border-color: #a58461;
  color: #6d4c2c;
}
.choice input:focus-visible + span {
  outline: 3px solid #c99a62;
}
.muted,
#why {
  color: var(--muted);
  font-size: 13px;
}
.wizard-actions {
  display: flex;
  gap: 8px;
  margin-top: 25px;
}
.wizard-actions #next {
  margin-left: auto;
}
.wizard-actions button {
  font-size: 14px;
  padding: 10px 12px;
}
.notice:not(:empty) {
  background: #f2e8d8;
  border-radius: 12px;
  padding: 15px 18px;
  white-space: pre-wrap;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.card-heading h2,
.card-heading h3 {
  margin-top: 0;
}
.pill {
  font-size: 11px;
  color: #72583d;
  background: #f5edde;
  padding: 4px 9px;
  border-radius: 20px;
  display: inline-block;
}
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 20px;
}
.card-actions button {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 40px;
}
dl {
  margin: 0;
}
dt {
  font-size: 12px;
  color: #72583d;
  margin-top: 14px;
}
dd {
  margin: 0;
}
.card-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 6px 0;
}
ol {
  padding-left: 23px;
}
li {
  padding: 3px 0;
}
.paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.path-card {
  margin: 10px 0;
}
.path-card .button,
.path-card button {
  font-size: 14px;
  width: 100%;
}
.path-card p {
  font-size: 14px;
  color: var(--muted);
}
.prompt-card textarea {
  min-height: 320px;
  font-size: 13px;
  background: #faf7f2;
}
.guide-strip {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 15px;
  background: #efe5d5;
  border-radius: 12px;
  border: 1px solid #dccbb5;
  font-size: 14px;
}
details summary {
  cursor: pointer;
  color: var(--accent);
  padding: 8px 0;
}
dialog {
  width: min(680px, 95vw);
  max-height: 90svh;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #faf7f2;
  color: inherit;
  padding: 25px;
}
dialog::backdrop {
  background: #7a716a66;
}
dialog textarea {
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.draft-prose {
  white-space: pre-wrap;
  line-height: 2;
  overflow-wrap: anywhere;
}
footer {
  max-width: 720px;
  margin: 50px auto 0;
  padding: 25px 20px 35px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
}
.footer-brand {
  font-size: 14px;
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .site-header {
    padding: 17px 20px;
  }
  main {
    margin-top: 16px;
  }
  .card {
    padding: 20px;
  }
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .step-tile {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 0 14px;
  }
  .step-tile p {
    grid-column: 2;
    margin: 0;
  }
  .step-tile h2 {
    margin: 0 0 6px;
  }
  .step-number {
    grid-row: 1/3;
  }
  .paths {
    grid-template-columns: 1fr;
  }
  .wizard-actions {
    position: fixed;
    z-index: 10;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: #faf7f2f5;
    border-top: 1px solid var(--line);
    margin: 0;
  }
  .wizard-actions #next {
    min-width: 90px;
  }
  .wizard {
    margin-bottom: 100px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }
  body:has(.wizard) footer {
    padding-bottom: 95px;
  }
  .story-mark {
    min-height: 180px;
  }
  h1 {
    font-size: 32px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  .button {
    transition:
      background 0.15s,
      border-color 0.15s;
  }
}

html {
  scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
#question {
  scroll-margin-bottom: 120px;
}

.chapter-editor{font-size:17px;line-height:1.8;min-height:55vh;resize:vertical} [hidden]{display:none!important} #append-area{margin-top:1rem} .draft-prose{white-space:pre-wrap;overflow-wrap:anywhere}
.reading{padding:24px 22px}.reading-paragraph{font-size:17px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 1.3em}.ai-label{font-size:13px;color:#7a5c3e;background:#f2e9dc;border-radius:10px;padding:10px 14px}.poster-preview{margin:20px auto;max-width:420px}.poster-preview img{display:block;width:100%;height:auto;border-radius:14px}.poster-preview figcaption{font-size:14px;margin-top:12px;color:#6b625a}.qr-display{max-width:220px;margin:20px auto}.qr-display svg{width:100%;height:auto}.dialog-poster{display:block;width:100%;max-width:300px;height:auto;margin:16px auto}.story-link{overflow-wrap:anywhere}.share-actions{display:flex;flex-wrap:wrap;gap:10px}.chapter-list p{margin:8px 0}#publish-form label{display:block;margin-top:18px}#publish-form button{margin-top:24px}#share-caption{width:100%}.share-card details{margin-top:20px}@media(max-width:480px){.reading{padding:20px 16px}.share-card{padding:18px}.share-actions>*{min-height:44px}.site-header{padding-inline:20px}}

/* T3: readable cards on narrow screens, with the same warm palette. */
.platform-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fit,minmax(min(100%,290px),1fr))}.platform-card{margin:0;min-width:0}.platform-card label{display:flex;align-items:center;gap:.65rem}.platform-card input,.format-option input{width:auto}.platform-card small{line-height:1.5;display:inline-block}.format-option{display:block;padding:.6rem 0}.patch-card{border-top:1px solid #ded6cb;margin-top:1rem;padding-top:1rem}.check-report blockquote{margin:1rem 0;padding:.7rem 1rem;background:#f4eee4;border-left:3px solid #b79576;overflow-wrap:anywhere}.check-report li{margin:1.1rem 0}.check-report h4{margin-bottom:.5rem}.check-report dd{margin:0 0 .8rem}.guide-prompt{margin:.8rem 0}.format-guide ul{padding-left:1.4rem}.default-card select{width:100%}.default-card summary{padding:.5rem 0}.platform-card:has(input:checked){border-color:#ae805a;box-shadow:0 0 0 1px #ae805a}dialog{max-width:min(90vw,540px);background:#faf7f2;color:#594f45;border:1px solid #d6c6b2;border-radius:18px;padding:1.5rem}dialog::backdrop{background:rgba(75,57,40,.3)}

input[type="radio"], input[type="checkbox"] { accent-color: #7a5c3e; }

/* T4: calm, touch-friendly chapter loop. */
.chapter-row,.milestone-row{padding:1rem 0;border-bottom:1px solid #e9e1d7}.chapter-row:last-child,.milestone-row:last-child{border-bottom:0}.direction-choice{display:flex;gap:.65rem;align-items:flex-start;padding:.8rem;border:1px solid #e9e1d7;border-radius:.8rem;margin:.6rem 0}.direction-choice input{flex:0 0 auto;width:auto;margin-top:.3rem}.memory-field{padding:.7rem 0;border-bottom:1px solid #ede6dd}.memory-field button{min-height:44px}.seven-stations{display:flex;flex-wrap:wrap;gap:.6rem;padding:0;list-style:none}.seven-stations li{background:#f1e9df;border-radius:1rem;padding:.35rem .65rem}.goal-stats{display:grid;grid-template-columns:1fr auto;gap:.5rem}.goal-stats dd{font-weight:700}.daily-chart{height:130px;display:flex;gap:5px;padding-bottom:25px;align-items:stretch;margin:1.5rem 0}.daily-chart>div{flex:1;position:relative;display:flex;align-items:flex-end;min-width:0}.daily-chart span{width:100%;background:#a9815a;border-radius:4px 4px 0 0;min-height:2px}.daily-chart small{position:absolute;bottom:-24px;font-size:.65rem;width:100%;text-align:center}progress{accent-color:#a9815a;width:100%;height:1rem}fieldset{border:1px solid #e9e1d7;border-radius:.7rem;min-width:0}pre{white-space:pre-wrap;overflow-wrap:anywhere}#next-prompt{width:100%;font-size:1rem;line-height:1.65}.project-navigation{display:flex;flex-wrap:wrap;gap:.4rem}input[type=checkbox],input[type=radio]{min-width:18px;min-height:18px}details+details{margin-top:.6rem}

.table-scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;font-size:.9rem}th,td{text-align:left;border-bottom:1px solid var(--line);padding:8px;overflow-wrap:anywhere}th{color:#594f46}a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #7a5c3e;outline-offset:3px}

.step-tile img{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:12px;margin-top:20px}.example-grid{display:grid;gap:18px}.example-grid img{display:block;width:100%;height:auto;border-radius:12px}.examples,.faq{margin-top:48px}.idea-card{background:#faf7f2}.recovery-card{margin-bottom:20px}@media(min-width:680px){.example-grid{grid-template-columns:repeat(3,1fr)}}

input::placeholder,textarea::placeholder{color:#6b625a;opacity:1}
