@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap");

:root {
  color-scheme: light;
  --bg: #eef2ec;
  --ink: #1a211c;
  --muted: #5a645c;
  --accent: #1f6b4f;
  --accent-soft: #d7ebe1;
  --card: #fffdf8;
  --line: #d5ddd6;
  --danger: #8b2e2e;
  --ok: #1f6b4f;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-ui: "IBM Plex Sans", "Segoe UI", sans-serif;
  --focus: #0b5fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, #cfe3d6 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, #f1e4cf 0%, transparent 36%),
    linear-gradient(180deg, #f7f5ef 0%, var(--bg) 55%);
}

.app {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.1rem 2.5rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

html.embed-mode .site-nav {
  display: none;
}

.top {
  margin-bottom: 1.25rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 0 0 0.35rem;
  line-height: 1.1;
}

.tagline {
  margin: 0;
  max-width: 36rem;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
  font-size: 1.4rem;
}

h3 {
  font-family: var(--font-display);
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.panel {
  background: color-mix(in srgb, var(--card) 92%, white);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.15rem 1.15rem 1.3rem;
  box-shadow: 0 10px 30px rgba(26, 33, 28, 0.05);
}

.progress {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 0.35rem;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.4rem;
}

.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.hint {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.9rem;
}

.options {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
}

.option {
  font-family: var(--font-ui);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.option-disabled:hover {
  border-color: var(--line);
}

.option input {
  margin-top: 0.15rem;
  accent-color: var(--accent);
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.option span {
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.btn:hover {
  filter: brightness(0.96);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border-color: transparent;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.btn:focus-visible,
.option:focus-within,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.error {
  font-family: var(--font-ui);
  color: var(--danger);
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.welcome-list {
  margin: 0.75rem 0 1.2rem;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.5;
}

.results-meta {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.book-list {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.book {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: #fff;
}

.book .meta {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.book .desc,
.book .why {
  margin: 0.2rem 0 0;
  line-height: 1.45;
  font-size: 0.98rem;
}

.book .why {
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  margin-top: 0.45rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.35rem 0 1rem;
}

.chip {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.script-box {
  font-family: var(--font-ui);
  background: #f7faf7;
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 0.75rem;
  padding: 0.85rem 0.95rem;
  line-height: 1.5;
  margin: 0 0 0.85rem;
  white-space: pre-wrap;
}

.status {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--ok);
  min-height: 1.2em;
}

html.embed-mode .app {
  padding-top: 0.75rem;
}

html.embed-mode .brand {
  font-size: 1.7rem;
}

@media (max-width: 480px) {
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}
