:root {
  color-scheme: light;
  --page: #f6f4eb;
  --surface: #fffcf3;
  --ink: #162f30;
  --muted: #435852;
  --line: #c8d2c6;
  --light-line: #dbe0d4;
  --tint: #e9ede3;
  --accent: #a43721;
  --accent-dark: #762717;
  --accent-tint: #fae9dd;
  --focus: #235e8a;
  --display: "Avenir Next Condensed", "Arial Narrow", "Liberation Sans Narrow", system-ui, sans-serif;
  --body: "Avenir Next", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--body);
  color: var(--ink);
  background: var(--page);
  font-size: 16px;
  line-height: 1.5;
}

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

body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.05;
  font-weight: 770;
  letter-spacing: -.025em;
}

h1 { font-size: clamp(2.5rem, 5.5vw, 5.25rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { max-width: 70ch; }

.shell { width: min(100% - 4rem, 76rem); margin-inline: auto; }
.skip {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: .6rem .8rem;
  transform: translateY(-175%);
  z-index: 3;
  background: var(--surface);
  border: 1px solid var(--ink);
}
.skip:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }
.head-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.5rem;
  min-height: 4.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.42rem;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -.035em;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 5px;
  background: var(--ink);
  color: var(--surface);
  flex: none;
}
.brand-mark i {
  display: block;
  width: 1.28rem;
  height: .52rem;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  border-inline: 3px solid currentColor;
  position: relative;
  border-radius: 1px;
}
.brand-mark i::after {
  content: "";
  position: absolute;
  inset: -.18rem .06rem;
  border-inline: 3px solid currentColor;
  border-radius: 1px;
}
.site-nav, .footer-nav { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1.25rem; }
.site-nav a { font-size: .88rem; font-weight: 680; padding-block: .35rem; text-decoration: none; }
.site-nav a:hover, .footer-nav a:hover { text-decoration: underline; text-underline-offset: .22em; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: center;
  gap: clamp(1.2rem, 4vw, 4.8rem);
  padding-block: clamp(2.65rem, 7vw, 6.65rem) clamp(2.7rem, 6vw, 5rem);
}
.hero h1 { max-width: 13ch; }
.hero p, .page-lede { margin-top: 1rem; font-size: clamp(1rem, 1.5vw, 1.12rem); color: var(--muted); max-width: 52ch; }
.hero .button-line { margin-top: 1.45rem; }
.hero-board {
  border-radius: 13px;
  border: 1px solid #a8bdaf;
  background: var(--tint);
  overflow: hidden;
  min-width: 0;
}
.hero-board-head {
  padding: 1.05rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .65rem 1rem;
  flex-wrap: wrap;
  background: var(--ink);
  color: var(--surface);
}
.hero-board-head strong { font-size: 1.05rem; font-weight: 710; }
.hero-board-head a { color: inherit; font-size: .85rem; text-underline-offset: .25em; }
.hero-board-body { padding: .7rem; }
.hero-board figcaption { padding: .2rem .5rem .45rem; font-size: .85rem; color: var(--muted); }
.hero-board svg { display: block; width: 100%; height: auto; }

.button-line { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  min-height: 2.62rem;
  padding: .5rem .79rem;
  border: 1px solid #acbcb1;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 690;
  text-decoration: none;
  line-height: 1.22;
}
.button:hover:not(:disabled) { background: var(--tint); color: var(--ink); border-color: var(--ink); }
.button-primary { background: var(--accent); color: #fff9f1; border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); color: #fff9f1; border-color: var(--accent-dark); }
.button-small { min-height: 2.18rem; padding: .4rem .6rem; font-size: .8rem; }

.directory { padding-bottom: 3rem; }
.directory > h2 { border-top: 2px solid var(--ink); padding-top: 1.1rem; }
.topic {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 14rem) 1fr;
  gap: .8rem clamp(1rem, 4vw, 2.5rem);
  padding-block: 1.2rem;
}
.topic:first-of-type { margin-top: 1rem; }
.topic-heading h3 { font-size: 1.46rem; }
.topic-heading p { color: var(--muted); font-size: .92rem; margin-top: .42rem; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.tool-card {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .65rem;
  padding: 1rem .88rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.tool-card h4 { font-family: var(--display); font-size: 1.28rem; letter-spacing: -.02em; line-height: 1.12; margin: 0; }
.tool-card h4 a { text-decoration: none; }
.tool-card h4 a::after { content: ""; position: absolute; inset: 0; }
.tool-card:hover { border-color: #829d90; }
.tool-card p { font-size: .86rem; color: var(--muted); }
.tool-go { font-size: .84rem; font-weight: 730; color: var(--accent); }

.examples-grid {
  display: grid;
  gap: 1.4rem 1.6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}
.examples-group { border-top: 2px solid var(--ink); padding-top: .85rem; }
.examples-group > a { font-weight: 760; text-underline-offset: .18em; }
.examples-group ul, .file-notes ul { padding-left: 1.18rem; margin-block: .6rem 0; }
.examples-group li, .file-notes li { margin-block: .42rem; }
.examples-group li a { text-decoration-color: #758a7d; text-underline-offset: .19em; }
.examples-group li { font-size: .92rem; }

.breadcrumbs { color: var(--muted); font-size: .84rem; margin: 1.35rem 0 .95rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .2rem .5rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; color: #6e897a; }
.breadcrumbs a { text-underline-offset: .2em; }
.page-heading { padding-bottom: 1.6rem; }
.page-heading h1 { font-size: clamp(2.3rem, 4.7vw, 4.4rem); max-width: 24ch; }
.page-lede { max-width: 68ch; }
.guide-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  background: var(--tint);
  border-block: 1px solid var(--line);
  gap: .75rem 2rem;
  padding: 1rem 1.2rem;
}
.guide-intro h2 { font-size: 1.38rem; margin-bottom: .36rem; }
.guide-intro p { color: var(--muted); font-size: .92rem; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: .9rem;
  align-items: start;
  margin-top: .95rem;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.setup, .results { padding: clamp(.88rem, 2vw, 1.35rem); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: .55rem .8rem; margin-bottom: 1rem; }
.panel-heading h2 { font-size: 1.8rem; }
.unit-toggle { display: inline-flex; gap: 1px; padding: 2px; background: var(--tint); border: 1px solid var(--line); border-radius: 7px; }
.unit-toggle button {
  min-height: 2.15rem;
  border: 0;
  border-radius: 4px;
  padding: .22rem .72rem;
  color: var(--ink);
  background: transparent;
  font: 700 .79rem/1.2 var(--mono);
}
.unit-toggle button[aria-pressed="true"] { color: var(--surface); background: var(--ink); }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem .65rem; }
.field { min-width: 0; }
.field label, .share-controls label {
  display: block;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 690;
  margin-bottom: .25rem;
}
.field input, .field select, .share-controls input, .share-controls select {
  display: block;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  padding: .46rem .51rem;
  min-height: 2.6rem;
  border: 1px solid #a6b8ae;
  border-radius: 5px;
  background: #fffefa;
  color: var(--ink);
  font: 500 .88rem/1.28 var(--body);
}
.field input[type="number"], .field input[name="split"], .field input[name="finish"], .field input[name="pace"] {
  font-family: var(--mono);
  letter-spacing: -.025em;
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--accent); background: #fff5ef; }
.field-hint, .field-error { margin-top: .25rem; font-size: .78rem; line-height: 1.4; }
.field-hint { color: var(--muted); }
.field-error { color: var(--accent-dark); font-weight: 650; }
.error-summary, .result-note {
  border-left: 3px solid var(--accent);
  padding: .6rem .7rem;
  background: var(--accent-tint);
  color: #642817;
  font-size: .86rem;
  margin-block: .6rem;
  overflow-wrap: anywhere;
}
.setup-footer { margin-top: 1.1rem; padding-top: .85rem; border-top: 1px solid var(--light-line); }
.jump-result { display: none; }

.entry-list { margin-top: 1rem; }
.entry-list h3 { margin-bottom: .2rem; }
.entry-list .button-line { margin-top: .65rem; }
.inventory-details { border: 1px solid var(--light-line); border-radius: 6px; padding: .55rem .65rem; }
.inventory-details summary { font-size: .92rem; }
.inventory-details summary span { color: var(--muted); font-size: .8rem; margin-left: .25rem; }
.entry-row {
  min-inline-size: 0;
  margin: .55rem 0 0;
  padding: .5rem .55rem .55rem;
  display: grid;
  align-items: start;
  gap: .55rem;
  border: 1px solid var(--light-line);
  border-radius: 6px;
}
.entry-row legend { font-size: .76rem; color: var(--muted); padding-inline: .25rem; font-weight: 700; }
.inventory-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.row-remove { align-self: end; }
.inventory-grid .row-remove { min-height: 2.6rem; }
.exercise-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.exercise-grid .field:first-of-type { grid-column: span 2; }
.exercise-grid .row-remove { justify-self: start; }

.results .panel-heading { margin-bottom: .55rem; }
.metrics { min-width: 0; }
.primary-metric { padding: .72rem 0 .85rem; border-top: 1px solid var(--light-line); }
.primary-metric dt, .metric dt { font-size: .84rem; font-weight: 710; color: var(--muted); }
.primary-metric strong {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.2vw, 3.75rem);
  font-weight: 810;
  line-height: 1.12;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.metric-unit { margin-left: .3rem; font-size: .76rem; color: var(--muted); font-weight: 680; }
.primary-metric .metric-unit { font-size: 1rem; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.4rem), 1fr)); gap: .5rem; margin-bottom: .8rem; }
.metric-grid > dl { min-width: 0; background: var(--tint); padding: .55rem .58rem; border-radius: 5px; }
.metric strong { font-family: var(--display); font-size: 1.46rem; line-height: 1.08; font-weight: 780; overflow-wrap: anywhere; }
.metric-detail { color: var(--muted); font-size: .74rem; margin-top: .08rem; overflow-wrap: anywhere; }
[data-empty-result] { color: var(--muted); padding-block: .65rem 1rem; }
.chart { margin-block: .8rem .95rem; }
.chart svg { display: block; width: 100%; height: auto; }
.chart figcaption { margin-top: .42rem; color: var(--muted); font-size: .82rem; }
.table-section { margin-top: 1rem; min-width: 0; }
.table-section h3 { margin-bottom: .45rem; }
.table-note { color: var(--muted); font-size: .8rem; margin-block: -.15rem .38rem; }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--light-line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: .8rem; text-align: left; }
.table-wide table { min-width: 30rem; font-variant-numeric: tabular-nums; }
.table-wide td, .table-wide th { text-align: center; }
th, td { padding: .42rem .44rem; border-bottom: 1px solid var(--light-line); overflow-wrap: anywhere; }
td { font-variant-numeric: tabular-nums; }
thead th { background: var(--tint); font-weight: 740; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 690; }
tbody tr:nth-child(2n) { background: #f8f7ed; }

.result-actions { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .75rem; }
.share-controls { padding: .75rem; margin-top: .72rem; border: 1px solid var(--line); background: var(--tint); border-radius: 7px; }
.share-controls select { max-width: 15rem; margin-bottom: .65rem; }
.share-controls .button-line { flex-wrap: nowrap; }
.share-controls .button-line input { flex: 1; min-width: 0; }
.share-controls .button { flex: none; }
.status { color: var(--muted); font-size: .81rem; margin-top: .48rem; }
.status:empty { display: none; }
.print-only { display: none; }
.noscript { margin: .65rem 0; color: var(--accent-dark); }

.reading-band { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1.5rem 2rem; margin-block: 2rem; }
.reading-band > section { border-top: 1px solid var(--line); padding-top: .9rem; min-width: 0; }
.reading-band h2, .faq h2, .prose h2, .home-examples h2 { font-size: clamp(1.7rem, 2.8vw, 2.25rem); }
.reading-band p, .prose p { margin-top: .75rem; color: var(--muted); }
.method-links { margin: .65rem 0 0; padding-left: 1.15rem; }
.method-links li { margin: .38rem 0; }
.method-links a { color: var(--muted); text-underline-offset: .16em; overflow-wrap: anywhere; }
.reading-band ul { padding-left: 1.1rem; }
.reading-band li { margin: .4rem 0; }
.reading-band a { text-underline-offset: .18em; }
.faq { margin-block: 2.1rem 2.65rem; }
.faq h2 { margin-bottom: .7rem; }
.faq details { padding: .68rem .15rem; border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { font-weight: 690; font-size: .98rem; line-height: 1.4; }
.faq details p { margin: .45rem 0 .18rem 1.08rem; color: var(--muted); }
.prose { margin-bottom: 3rem; }
.prose > section { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.prose > section + section { margin-top: 1.5rem; }
.prose code { font-family: var(--mono); font-size: .91em; }

.site-footer { border-top: 1px solid var(--line); margin-top: 1.2rem; }
.foot-inner { padding-block: 1.25rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem 1.4rem; }
.foot-inner p, .footer-nav a { font-size: .85rem; color: var(--muted); }
.footer-nav a { text-underline-offset: .16em; }

@media (max-width: 1080px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
  .shell { width: min(100% - 2.5rem, 76rem); }
  .hero { gap: 1.25rem; }
  .topic { grid-template-columns: minmax(0, 11rem) 1fr; }
  .workbench { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
  .results .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 1.6rem); }
  .head-inner { align-items: flex-start; flex-direction: column; gap: .3rem; padding-block: .6rem .48rem; }
  .site-nav { gap: .28rem 1rem; }
  .site-nav a { font-size: .83rem; padding-block: .28rem; }
  .hero { grid-template-columns: 1fr; align-items: start; padding-block: 2rem 2.35rem; }
  .hero h1 { max-width: 15ch; }
  .hero-board { max-width: 31rem; }
  .topic, .workbench, .guide-intro, .reading-band { grid-template-columns: 1fr; }
  .topic { gap: .65rem; }
  .topic-heading p { margin-top: .17rem; }
  .field-grid .field[data-field-wrap="preset"] { grid-column: 1 / -1; }
  .field #field-mode { padding-inline: .4rem; }
  .exercise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-tool="plates"] :is(th, td) { overflow-wrap: normal; }
  .examples-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { padding-bottom: 1rem; }
  .breadcrumbs { margin-top: .8rem; }
  .reading-band { gap: 1.15rem; }
  .jump-result { display: inline-block; margin: 0 0 .7rem; font-size: .84rem; text-underline-offset: .18em; }
}
@media (max-width: 370px) {
  .tool-grid, .examples-grid { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-grid .row-remove { justify-self: start; min-height: 2.18rem; }
}
@media print {
  @page { margin: 13mm; size: A4; }
  :root, body { background: #fff; color: #182526; line-height: 1.32; }
  .shell { width: 100%; }
  .site-header, .site-footer, .skip, .breadcrumbs, .guide-intro, .setup, .result-actions, .status, .noscript { display: none !important; }
  .page-heading { padding: 0 0 .6rem; }
  .page-heading h1 { font-size: 1.9rem; max-width: none; }
  .page-lede { display: none; }
  .workbench { display: block; margin: 0; }
  .results { border: 0; background: white; padding: 0; }
  .print-only { display: block; }
  .print-only h2 { font-size: 1.08rem; }
  .print-only dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .22rem .62rem; margin: .35rem 0 .65rem; }
  .print-only dt { font-weight: 740; font-size: .75rem; }
  .print-only dd { font-size: .76rem; }
  .results .metric-grid { grid-template-columns: repeat(auto-fit, minmax(7.4rem, 1fr)); }
  .results .panel-heading h2 { font-size: 1.45rem; }
  .primary-metric strong { font-size: 2rem; }
  .metric strong { font-size: 1.14rem; }
  .chart { max-width: 31rem; break-inside: avoid; margin: .5rem 0; }
  .panel-heading, h2, h3, .table-note { break-after: avoid; }
  .table-section, .table-note { break-inside: avoid; }
  table { font-size: .72rem; }
  .table-scroll { overflow: visible; }
  .table-wide table { min-width: 0; }
  .table-wide th, .table-wide td { padding: .22rem .16rem; }
  tr { break-inside: avoid; }
  .workbench ~ .reading-band, .workbench ~ .faq { display: none; }
  .results, .hero-board, .tool-card { print-color-adjust: exact; }
  a { text-decoration: none; }
}
