* {
  box-sizing: border-box;
}
body {
  --ink: #352b30;
  --paper: #fffafb;
  --rose: #803449;
  --pink: #fae4e9;
  --line: #947680;
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  font:
    1rem/1.55 "Atkinson Hyperlegible Next",
    "Segoe UI",
    sans-serif;
}
body.high {
  --ink: #111;
  --paper: white;
  --rose: #490822;
  --pink: #fff;
  --line: #111;
}
body.large {
  font-size: 1.25rem;
}
header,
footer,
main {
  padding: 1.2em max(5vw, calc((100vw - 68rem) / 2));
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
  background: var(--ink);
  color: white;
}
header strong {
  font-size: 1.35em;
}
nav {
  display: flex;
  flex-wrap: wrap;
}
button,
select,
input {
  font: inherit;
}
button,
select,
input[type="text"],
input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.55em 0.85em;
  background: var(--paper);
  color: var(--ink);
  max-width: 100%;
}
button {
  cursor: pointer;
  min-height: 44px;
}
button:hover {
  border-color: var(--rose);
  box-shadow: inset 0 0 0 1px var(--rose);
}
header button {
  color: white;
  background: transparent;
  border: 0;
}
.primary {
  background: var(--rose);
  color: white;
  font-weight: 650;
}
.hero,
.card,
fieldset,
aside,
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(14px, 2.2vw, 28px);
  margin: 1em 0;
}
.hero {
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}
.hero img {
  width: clamp(72px, 18vw, 190px);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  margin: 0.2em 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
}
h2 {
  margin-top: 1.5em;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  gap: 0.8em;
}
.grid .card {
  margin: 0;
  text-align: left;
}
.card b {
  display: block;
}
.actions,
.tools {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  align-items: center;
}
.eyebrow,
small {
  font-size: 0.88em;
}
.eyebrow {
  font-weight: 700;
  color: var(--rose);
  letter-spacing: 0.05em;
}
.choice {
  display: block;
  padding: 0.7em;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: 0.5em 0;
}
.choice:has(:checked) {
  background: var(--pink);
}
.layout {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, 3fr);
  gap: 1em;
}
.navigator {
  max-height: 14em;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}
.navigator button {
  min-width: 44px;
  padding: 0.3em;
}
.current {
  outline: 2px solid var(--rose);
}
.passage {
  white-space: pre-line;
  background: var(--pink);
  padding: 1em;
  border-radius: 7px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  background: white;
  padding: 8px;
}
a {
  color: var(--rose);
}
:focus-visible {
  outline: 3px solid #005ac4;
  outline-offset: 3px;
}
footer {
  border-top: 1px solid var(--line);
  font-size: 0.9em;
  margin-top: 2em;
}
dialog {
  color: var(--ink);
  background: var(--paper);
  border-radius: 12px;
  max-width: 95vw;
}
summary {
  cursor: pointer;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--rose);
}
.calc {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.diagram {
  position: relative;
  display: flex;
  max-width: 420px;
  align-items: flex-end;
  gap: 8px;
  padding: 15px;
  border-bottom: 3px solid var(--ink);
  background: var(--pink);
}
.diagram button {
  background: var(--rose);
  color: white;
  flex: 1;
}
.diagram button[aria-pressed="true"] {
  outline: 4px solid var(--ink);
}
@media (max-width: 720px) {
  .layout {
    display: block;
  }
  .hero img {
    width: 75px;
  }
  .navigator {
    max-height: 8em;
  }
  header,
  main,
  footer {
    padding: 1em;
  }
  .tools {
    gap: 0.3em;
  }
}
.diagram {
  width: 100%;
  min-width: 0;
}
.diagram button {
  min-width: 0;
  padding: 0.2em;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
fieldset {
  min-inline-size: 0;
}
.choice,
article,
aside {
  min-width: 0;
  overflow-wrap: anywhere;
}
