:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --surface: #fffdf9;
  --ink: #20241f;
  --muted: #656c64;
  --line: #d9ddd4;
  --green: #1f5944;
  --green-soft: #dcebe2;
  --amber: #a85f21;
  --amber-soft: #fff0df;
  --shadow: 0 18px 45px rgba(34, 48, 40, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% -10%, rgba(205, 224, 211, .72), transparent 35rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input { font: inherit; }
button { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
}

.brand, .quiet-button, .text-button {
  border: 0;
  background: none;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  letter-spacing: 0;
}

.quiet-button, .text-button {
  padding: 8px 10px;
  color: var(--green);
  font-weight: 700;
}

#app {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 190px);
  margin: 0 auto;
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 52px;
  align-items: center;
  padding: 68px 0 56px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 7vw, 6.7rem);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.055em;
}

.lede {
  max-width: 650px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.6vw, 1.28rem);
}

.search-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-box label {
  display: block;
  padding: 4px 8px 8px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.search-row { display: flex; gap: 8px; }

.search-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 14px;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.primary-button, .option-button {
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  padding: 14px 20px;
  background: var(--green);
  color: white;
}

.hero-note {
  padding: 30px;
  border: 1px solid rgba(31, 89, 68, .18);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.hero-note blockquote {
  margin: 20px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  line-height: 1.25;
}

.hero-note p { color: #355c4d; }

.section { padding: 24px 0 64px; }
.keyword-search-section { max-width: 880px; }
.section-header { margin-bottom: 24px; }
.section-header h2, .page-title {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.section-header p, .page-intro { color: var(--muted); }

.book-title {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: .9rem;
}

.topic-grid, .situation-grid {
  display: grid;
  gap: 16px;
}

.topic-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.situation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.topic-card, .situation-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 249, .78);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.topic-card { padding: 24px; }
.situation-card { padding: 22px; }

.topic-card:hover, .situation-card:hover,
.topic-card:focus-visible, .situation-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--green);
  box-shadow: var(--shadow);
  outline: none;
}

.topic-card strong, .situation-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.topic-card span, .situation-card span { color: var(--muted); }

.book-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.book-choice {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 116px;
  padding: 14px;
  overflow: hidden;
  text-align: left;
}
.book-cover {
  display: block;
  width: 72px;
  height: 116px;
  margin: 0;
  aspect-ratio: 369 / 594;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.book-choice-copy { display: grid; gap: 5px; }
.book-choice-copy strong { margin: 0; font-size: 1.08rem; }
.book-choice-copy .book-hint {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.book-choice-copy small { color: var(--muted); font-size: .88rem; }

.book-choice.selected-book {
  border-color: var(--green);
  background: var(--green);
  color: white;
  box-shadow: var(--shadow);
}

.book-choice.selected-book span,
.book-choice.selected-book small { color: rgba(255, 255, 255, .82); }

.selected-badge {
  display: inline-block;
  justify-self: start;
  margin: 4px 0 0;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: white !important;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.selected-book-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--green);
  color: white;
  box-shadow: var(--shadow);
}

.selected-book-banner span,
.selected-book-banner strong { display: block; }
.selected-book-banner span { margin-bottom: 3px; color: rgba(255, 255, 255, .75); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.selected-book-banner strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; font-weight: 500; }

.change-book-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 12px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.change-book-button:hover,
.change-book-button:focus-visible { background: rgba(255, 255, 255, .12); outline: 2px solid white; outline-offset: 2px; }

.search-results {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.search-result-copy { display: block; min-width: 0; }
.search-result-copy strong { display: block; margin-bottom: 5px; color: var(--ink); }
.search-result-meta { display: block; margin-bottom: 5px; color: var(--green); font-size: .76rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.search-result-summary { display: block; color: var(--muted); font-size: .88rem; font-weight: 500; line-height: 1.45; }
.search-result-button { align-items: center; }

.page-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 0 72px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  border: 0;
  background: none;
  color: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.meta-pill {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.anchor-card, .content-card, .notice-card {
  margin: 22px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.anchor-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.option-button {
  padding: 13px;
  border-color: var(--line);
  background: white;
}

.option-button.selected {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.script-card {
  margin: 24px 0;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 26px;
  background: var(--green);
  color: white;
  box-shadow: var(--shadow);
}

.script-card .eyebrow { color: #bfe0d0; }
.script-options { display: grid; gap: 24px; }

.script-option + .script-option {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.28);
}

.script-label {
  margin-bottom: 8px;
  color: #bfe0d0;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.script-card blockquote {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.script-note { max-width: 760px; margin: 10px 0 0; color: rgba(255, 255, 255, .78); }

.medical-card {
  margin-top: 24px;
  padding: 28px;
  border: 2px solid #a65b32;
  border-radius: var(--radius);
  background: #fff4e8;
}
.medical-card h2 { margin: 5px 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; }
.medical-card li + li { margin-top: 8px; }

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.content-card h2, .notice-card h2 {
  margin-bottom: 14px;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.content-card ul { margin: 0; padding-left: 20px; }
.content-card li + li { margin-top: 9px; }
.avoid-card { background: #fffaf3; }

.notice-card {
  border-color: #e9c8a9;
  background: var(--amber-soft);
}
.notice-card h2 { color: var(--amber); }

details {
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

details + details { border-top: 0; margin-top: -15px; }
summary {
  padding: 18px 4px;
  cursor: pointer;
  color: var(--green);
  font-weight: 800;
}
.details-body { padding: 0 4px 18px; color: var(--muted); }

.next-card {
  margin-top: 30px;
  padding: 28px;
  border-radius: var(--radius);
  background: #e9eee9;
}
.next-card h2 {
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 500;
}

.next-list { display: grid; gap: 10px; margin-top: 18px; }
.next-button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-weight: 750;
}

.done-card {
  display: grid;
  place-items: center;
  min-height: 60vh;
  text-align: center;
}
.done-symbol {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 2rem;
}

.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 45px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}
.site-footer p { margin-bottom: 4px; }

.empty-state { color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: .9rem;
}
.breadcrumbs button {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }

.amazon-book-list { display: grid; gap: 12px; }
.amazon-book-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.amazon-book-card p { margin: 0; }
.amazon-book-card .eyebrow { margin-bottom: 7px; }
.amazon-book-cover { width: 76px; border-radius: 6px; box-shadow: 0 5px 16px rgba(0, 0, 0, .14); }
.amazon-book-copy { flex: 1 1 auto; }
.amazon-link {
  flex: 0 0 auto;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-weight: 800;
  text-decoration: none;
}
.amazon-link.unavailable { background: #e8e8e2; color: var(--muted); cursor: default; }

.steps-list { padding-left: 1.3rem; }
.steps-list li + li { margin-top: 12px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.footer-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .site-header, #app, .site-footer { width: min(100% - 24px, 680px); }
  .site-header { padding: 12px 0; }
  .hero { grid-template-columns: 1fr; gap: 26px; padding: 38px 0 42px; }
  h1 { font-size: clamp(3.25rem, 16vw, 5.3rem); }
  .search-row { flex-direction: column; }
  .primary-button { width: 100%; }
  .topic-grid, .situation-grid, .split-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr; }
  .anchor-options { grid-template-columns: 1fr; }
  .page-shell { padding-top: 24px; }
  .page-title { font-size: 2.55rem; }
  .script-card blockquote { font-size: 2.05rem; }
  .selected-book-banner { align-items: flex-start; flex-direction: column; }
  .amazon-book-card { align-items: flex-start; flex-direction: column; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
