:root {
  --bg: #f3f0e8;
  --bg-elev: #e7e1d4;
  --bg-row: #f7f4ee;
  --line: #d4cec2;
  --text: #1a1a1a;
  --muted: #5e5a53;
  --accent: #3d5270;
  --warn: #8d2f2f;
  --radius: 10px;
  --max: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.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;
}

.banner {
  margin: 0;
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.15rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

body.wide .top,
body.wide main,
body.wide footer {
  max-width: 76rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

.top-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.top-nav,
.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.top-nav a,
.foot-nav a,
.family {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.family {
  font-size: 0.75rem;
}

.top-nav a:hover,
.foot-nav a:hover,
.family:hover,
.top-nav a[aria-current="page"] {
  color: var(--text);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

main.home h1 {
  margin: 0 0 0.2rem;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.lede a,
.prose a,
.table-note a,
.facts a,
.scenario h2 a {
  color: var(--accent);
}

.board-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-row);
}

.fees {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.92rem;
}

.fees th,
.fees td {
  padding: 0.68rem 0.75rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: middle;
  background: var(--bg-row);
}

.fees tr > :last-child {
  border-right: 0;
}

.fees tbody tr:last-child > * {
  border-bottom: 0;
}

.fees thead th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-elev);
  text-align: left;
}

.fees thead th:first-child,
.fees tbody th[scope="row"] {
  position: sticky;
  left: 0;
  min-width: 11.5rem;
  text-align: left;
}

.fees thead th:first-child {
  z-index: 2;
  background: var(--bg-elev);
}

.fees tbody th[scope="row"] {
  z-index: 1;
  font-weight: 600;
}

.fees .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.fees td.num .val,
.fees td.num .hint {
  white-space: nowrap;
}

.fees td.num .chip {
  display: block;
  width: max-content;
  margin: 0.22rem 0 0 auto;
}

.fees thead .num {
  text-align: right;
}

.fees .val {
  font-variant-numeric: tabular-nums;
}

.fees td.num .val,
.score {
  font-weight: 600;
}

.score,
.checked {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

td.waiver {
  width: 14rem;
  min-width: 11rem;
}

.chip {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.4rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  background: transparent;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  line-height: 1.4;
  vertical-align: 0.12em;
  white-space: nowrap;
}

.hint {
  margin-left: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
  border: 1px solid var(--text);
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.82rem;
}

.visit:hover {
  background: var(--text);
  color: var(--bg);
}

.table-note {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.prose h1,
.prose h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 650;
}

.prose h2 {
  margin-top: 1.25rem;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 0.92rem;
}

.prose p,
.prose ul {
  margin: 0 0 0.75rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.facts {
  margin: 0 0 1rem;
}

.facts div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.seg-label {
  margin-right: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.seg button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.seg button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.scenario {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.scenario h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
}

.scenario h2 a {
  text-decoration: none;
}

.scenario h2 a:hover {
  text-decoration: underline;
}

.prose p.math,
.prose p.math strong,
.prose p.insufficient {
  color: var(--text);
}

.math {
  margin: 0.2rem 0;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.math .k {
  font-weight: 650;
}

.prose p.warn,
.warn {
  margin: 0.35rem 0 0;
  color: var(--warn);
  font-size: 0.82rem;
  font-weight: 650;
}

.insufficient {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

footer p {
  margin: 0;
  padding-top: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
}

footer > p:first-child {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

footer p a {
  color: var(--accent);
}

.foot-nav {
  margin-top: 0.75rem;
}

.foot-nav a + a::before {
  content: "·";
  margin: 0 0.55rem 0 0;
  color: var(--muted);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 699.98px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }

  .top-side {
    align-items: flex-start;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .visit {
    min-height: 44px;
  }
}
