:root {
  --bg: #fbf8f2; --surface: #ffffff; --surface-2: #f3eee3; --ink: #1d2433; --muted: #5f6676;
  --line: #e4dccb; --accent: #22304f; --accent-ink: #ffffff; --gold: #b07d1c; --gold-soft: #f6ead0;
  --ok: #1f7a55; --err: #b3261e; --radius: 14px;
  --shadow: 0 1px 2px rgba(29,36,51,.05), 0 10px 30px rgba(29,36,51,.07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151d; --surface: #1a1f2b; --surface-2: #222838; --ink: #eceef3; --muted: #a6adbd; --line: #2e3546;
    --accent: #d9b25c; --accent-ink: #12151d; --gold: #e3b95a; --gold-soft: #2c2718; --ok: #5fcf9c; --err: #ff8a80;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
a { color: var(--gold); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 0 0 .5rem; }
h2 { font-size: 1.55rem; margin: 2.2rem 0 .7rem; }
h3 { font-size: 1.2rem; margin: 1.5rem 0 .4rem; }
img, svg { max-width: 100%; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--muted); }

/* header & footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; }
.brand svg { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current] { background: var(--surface-2); }
.nav .nav-account { border: 1px solid var(--line); }
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 36px; font-size: .9rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; }
.site-footer a { color: var(--muted); }
.disclaimer { font-style: italic; }

/* hero */
.hero { text-align: center; padding: 40px 0 18px; }
.hero-small { padding-bottom: 8px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 720px; margin: 0 auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font: 600 1rem var(--sans); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-link { background: none; border: none; color: var(--gold); padding: 6px 4px; font-weight: 500; }
.btn-lg { padding: 14px 24px; font-size: 1.08rem; width: 100%; }
.btn-small { padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.danger { color: var(--err); }

/* tool */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 18px auto 10px; max-width: 760px; }
.tool-label { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
textarea, input[type=email], input[inputmode] { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
textarea { resize: vertical; min-height: 150px; }
textarea:focus, input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.tool-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: 6px 0 12px; }
.modes { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.mode:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.mode input { margin-top: 5px; accent-color: var(--gold); }
.mode small { display: block; color: var(--muted); font-size: .85rem; }
.save { display: flex; gap: 8px; align-items: center; font-size: .95rem; margin: 0 0 12px; }
.turnstile { min-height: 0; margin: 0 0 10px; }
.tool-status { font-size: .92rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
.tool-status.err { color: var(--err); }
.tool-disclaimer { text-align: center; font-size: .88rem; color: var(--muted); font-style: italic; max-width: 760px; margin: 6px auto 0; }
.busy { text-align: center; padding: 28px 10px 8px; color: var(--muted); }
.spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* result */
.result { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
.result:focus { outline: none; }
.result h2 { font-size: 1.3rem; margin: 1.4rem 0 .4rem; }
.result .summary { font-family: var(--serif); font-size: 1.15rem; }
.result .note { background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; font-size: .95rem; }
.result ol.questions li { margin: 4px 0; }
.result .themes dt { font-weight: 600; }
.result .themes dd { margin: 0 0 10px; }
.check { font-size: .85rem; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 16px; }
.check::before { content: "\2713"; color: var(--ok); font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cta { border: 1px dashed var(--gold); border-radius: 10px; padding: 12px 14px; margin-top: 16px; }
.crisis { border: 2px solid var(--err); border-radius: var(--radius); padding: 18px; margin-top: 18px; }
.crisis ul { padding-left: 1.2rem; }
blockquote.verse { margin: 12px 0; padding: 12px 16px; border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 0 10px 10px 0; }
blockquote.verse p { margin: 0 0 4px; font-family: var(--serif); font-size: 1.06rem; }
blockquote.verse cite { font-style: normal; font-size: .88rem; color: var(--muted); font-weight: 600; }
blockquote.verse .why { margin: 6px 0 0; font-family: var(--sans); font-size: .95rem; color: var(--ink); }

/* content */
.content { max-width: 760px; margin: 0 auto; }
.content p, .content li { color: var(--ink); }
.steps li { margin: 6px 0; }
.symbols { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.symbols li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.symbols strong { display: block; font-family: var(--serif); font-size: 1.05rem; }
.symbols span { font-size: .95rem; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 4px; }
.legal h2 { font-size: 1.25rem; }

/* pricing */
.billing-toggle { display: flex; justify-content: center; gap: 4px; margin: 18px auto; background: var(--surface-2); border-radius: 999px; padding: 4px; width: max-content; max-width: 100%; }
.billing-toggle button { border: 0; background: transparent; color: var(--ink); font: 600 .95rem var(--sans); padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.billing-toggle button.active { background: var(--surface); box-shadow: var(--shadow); }
.save-badge { color: var(--ok); font-size: .8rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--gold); box-shadow: var(--shadow); }
.plan h2 { margin: 0 0 4px; font-size: 1.35rem; }
.plan .price { font-size: 1.9rem; font-weight: 700; margin: 4px 0; font-family: var(--serif); }
.plan .price small { font-size: .9rem; font-weight: 500; color: var(--muted); font-family: var(--sans); }
.plan .price-note { font-size: .85rem; color: var(--muted); margin: 0; }
.plan ul { padding-left: 1.1rem; flex: 1; font-size: .95rem; }
.plan .btn { width: 100%; }
.tag { position: absolute; top: -12px; left: 16px; background: var(--gold); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin: 0; }
.tag-soon { background: var(--muted); }
.checkout-msg { text-align: center; min-height: 1.5em; color: var(--err); }
.fine { text-align: center; font-size: .85rem; color: var(--muted); }

/* account */
.account { max-width: 760px; margin: 0 auto; padding-top: 30px; }
.signin { display: grid; gap: 10px; max-width: 420px; margin: 18px 0; }
.signin label { font-weight: 600; }
.form-msg { min-height: 1.5em; }
.form-msg.err { color: var(--err); }
.notice { background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card h2 { font-size: 1rem; margin: 0; font-family: var(--sans); color: var(--muted); font-weight: 600; }
.card .big { font-size: 1.6rem; font-weight: 700; margin: 4px 0; font-family: var(--serif); }
.card .muted { font-size: .88rem; margin: 0 0 6px; }
.journal-list { list-style: none; padding: 0; }
.journal-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.journal-list button { flex: none; }
.journal-list .when { font-size: .82rem; color: var(--muted); display: block; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.journal-entry { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .modes { grid-template-columns: 1fr; }
  .tool { padding: 14px; }
  .hero { padding-top: 26px; }
  .nav a { padding: 6px 8px; }
}

/* symbol pages */
.crumbs { font-size: .88rem; color: var(--muted); margin: 18px auto 0; max-width: 760px; }
.crumbs a { color: var(--muted); }
.symbol-page h1 { margin-top: 14px; }
.answer { margin: 0 0 8px; text-align: left; font-size: 1.1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0; padding: 14px 16px; max-width: none; }
.jump { font-size: .95rem; }
.content p.note { background: var(--gold-soft); border-radius: 10px; padding: 10px 14px; font-size: .95rem; }
.related ul, .guides { padding-left: 1.2rem; }
.related li, .guides li { margin: 4px 0; }
