:root {
  --ink: #1c2b33;
  --muted: #5d6b73;
  --paper: #f6f3ee;
  --card: #fffdf9;
  --line: #e5ddd2;
  --accent: #0e6b62;
  --accent-dark: #0a524b;
  --bad: #8d2f2f;
  --bad-bg: #f8ece8;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0 auto;
  max-width: 40rem;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 1rem calc(1.5rem + env(safe-area-inset-bottom));
  color: var(--ink);
  background: var(--paper);
  font: 17px/1.5 "Segoe UI", system-ui, sans-serif;
}

a { color: inherit; }

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -1rem;
  padding: 0.85rem 1rem;
  background: rgba(246, 243, 238, 0.94);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  text-decoration: none;
}

.brand span {
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  font-weight: 700;
}

.brand small,
.progress,
.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0.2rem 0 0.7rem;
  font-size: 1.7rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h2 { font-size: 1.15rem; }

.hero,
.sheet,
.reading,
.card,
fieldset {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.hero,
.sheet,
.reading { padding: 1.15rem 1.1rem 1.25rem; }

.hero p:last-of-type,
.sheet > p,
.reading p { margin-top: 0; }

.button,
.pager a,
.pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
}

.button.quiet,
.pager a {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.list { display: grid; gap: 0.7rem; margin-top: 1rem; }

.card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.05rem;
  text-decoration: none;
}

.card small { color: var(--muted); }

.empty { color: var(--muted); }

form { display: grid; gap: 0.9rem; }

label { display: grid; gap: 0.35rem; font-weight: 650; }

input[type="text"],
input:not([type]),
textarea,
input[type="file"] {
  width: 100%;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 450;
}

textarea { resize: vertical; }

.note {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
}

.note.bad { background: var(--bad-bg); color: var(--bad); }

.contents { margin: 0; padding-left: 1.2rem; }

.contents li { margin: 0.55rem 0; }

.contents a { text-underline-offset: 0.18em; }

.reading p {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.16rem;
  line-height: 1.65;
}

.pager {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.8rem -1rem 0;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(246, 243, 238, 0.96);
}

.pager .next,
.pager button {
  background: var(--accent);
  color: white;
  border: 0;
}

.pager form { margin: 0; }

fieldset {
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
}

legend { padding: 0 0.2rem; font-weight: 700; }

.choice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: 0.55rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: #f7f4ef;
  font-weight: 450;
}

.choice input { margin-top: 0.25rem; width: 1.15rem; height: 1.15rem; }

.score { font-size: 1.15rem; }

.returns { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.returns a { font-weight: 700; }

.returns small { display: block; color: var(--muted); font-weight: 450; }

.text-button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
}

footer {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (min-width: 720px) {
  body { padding-top: 1.2rem; }
  h1 { font-size: 2rem; }
}
