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

[hidden] {
  display: none !important;
}

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #cfe0d8;
  color: #0a2a22;
}

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--pine-dark);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.skip {
  position: absolute;
  top: -64px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.site-header {
  border-bottom: 1px solid var(--line-strong);
  background: var(--ground);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 26px;
  height: 26px;
  color: var(--pine);
  flex: 0 0 auto;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 9px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--ink);
}

.site-header nav a[aria-current="page"] {
  border-bottom-color: var(--pine);
  color: var(--ink);
  font-weight: 600;
}

main {
  flex: 1;
  padding-bottom: 24px;
}

.intro {
  max-width: 760px;
  margin: 42px 0 24px;
}

h1 {
  margin: 0 0 10px;
  font-size: 2.125rem;
  font-weight: 680;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.editor-pane {
  min-width: 0;
  padding: 16px 20px 14px;
  border-right: 1px solid var(--line);
}

.readout-pane {
  min-width: 0;
  padding: 16px 20px 18px;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 3px;
}

.pane-head label,
.pane-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.live-mini {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

textarea#source {
  display: block;
  width: 100%;
  min-height: 330px;
  margin: 0;
  padding: 10px 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.9;
  resize: vertical;
}

textarea#source::placeholder {
  color: var(--muted);
  opacity: 1;
}

textarea#source:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.editor-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.text-button {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--pine);
  font-size: 0.8125rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-button:hover {
  background: var(--surface-2);
  color: var(--pine-dark);
}

.text-button:disabled {
  color: var(--muted);
  text-decoration: none;
  cursor: not-allowed;
}

.small {
  margin: 0;
  color: var(--muted);
  font-size: 0.78125rem;
  line-height: 1.6;
}

.readout-label {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.readout-label span {
  color: var(--muted);
}

.readout-number {
  margin: 5px 0 7px;
  font-family: var(--mono);
  font-size: 3.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.formula {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.limit-block {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.limit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.limit-head h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
}

.limit-head .small {
  margin: 0;
}

.metric-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 6px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}

.metric-choice legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.metric-choice label {
  position: relative;
  display: block;
  min-width: 0;
}

.metric-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.metric-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 6px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.metric-choice label:last-child span {
  border-right: 0;
}

.metric-choice input:hover + span {
  background: var(--surface-2);
  color: var(--ink);
}

.metric-choice input:checked + span {
  background: var(--pine);
  color: #fff;
}

.metric-choice input:checked:hover + span {
  background: var(--pine-dark);
  color: #fff;
}

.metric-choice input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: -4px;
}

.metric-help {
  margin: 0 0 10px;
}

.limit-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.limit-input-row > label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.number-field {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.number-field input {
  width: 118px;
  height: 44px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}

.number-field input::-webkit-outer-spin-button,
.number-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.number-field input:focus {
  border-color: var(--pine);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.number-field input[aria-invalid="true"] {
  border-color: var(--rust);
}

.number-field span {
  position: absolute;
  right: 9px;
  color: var(--muted);
  font-size: 0.75rem;
  pointer-events: none;
}

.presets-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.presets-label {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.presets button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.8125rem;
  cursor: pointer;
}

.presets button:hover {
  border-color: var(--pine);
  color: var(--pine);
}

.presets button[aria-pressed="true"] {
  border-color: var(--pine);
  background: var(--pine);
  color: #fff;
}

.error {
  margin: 6px 0 0;
  color: var(--rust);
  font-size: 0.8125rem;
  font-weight: 600;
}

.gauge {
  margin-top: 10px;
}

.gauge-track {
  position: relative;
  height: 10px;
  border-radius: 1px;
  background: var(--surface-2);
}

.gauge-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 1px;
  background: var(--pine);
  transition: width 0.18s var(--ease), background-color 0.18s var(--ease);
}

.gauge-marker {
  position: absolute;
  top: -4px;
  left: 0;
  width: 2px;
  height: 18px;
  background: var(--ink);
  transform: translateX(-1px);
  transition: left 0.18s var(--ease), background-color 0.18s var(--ease);
}

.gauge.is-over .gauge-fill,
.gauge.is-over .gauge-marker {
  background: var(--rust);
}

.gauge-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.gauge-ticks span {
  position: relative;
  min-width: 1px;
}

.gauge-ticks span::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 1px;
  height: 4px;
  background: var(--line-strong);
}

.gauge-ticks span:first-child::before {
  left: 0;
}

.gauge-ticks span:last-child::before {
  right: 0;
  left: auto;
}

.gauge-status {
  margin: 6px 0 0;
  color: var(--pine);
  font-size: 0.8125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.gauge-status.is-at {
  color: var(--pine-dark);
}

.gauge-status.is-over {
  color: var(--rust);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
}

.metric:nth-child(odd) {
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.metric:nth-child(even) {
  padding-left: 14px;
}

.metric-extra {
  grid-column: 1 / -1;
}

.metric-extra,
.metric-extra:nth-child(odd) {
  padding-right: 0;
  padding-left: 0;
  border-right: 0;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.metric dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.copy-block {
  margin-top: 14px;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 2px;
  background: var(--pine);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 650;
  cursor: pointer;
}

.primary:hover {
  background: var(--pine-dark);
}

.primary:disabled {
  background: var(--line);
  color: #5d665f;
  cursor: not-allowed;
}

.copy-status {
  min-height: 1.4em;
  margin-top: 4px;
}

.manual-copy {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.manual-copy label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.manual-copy textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  resize: vertical;
}

.manual-actions {
  display: flex;
  gap: 2px;
  margin-top: 6px;
}

.manual-actions button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  cursor: pointer;
}

.manual-actions button:hover {
  border-color: var(--pine);
  color: var(--pine);
}

.paragraphs {
  margin-top: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.paragraphs summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 16px;
  list-style: none;
  cursor: pointer;
}

.paragraphs summary::-webkit-details-marker {
  display: none;
}

.paragraphs summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -3px;
}

.summary-title {
  font-size: 0.875rem;
  font-weight: 650;
}

.summary-meta {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-align: right;
}

.chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.18s var(--ease);
}

.paragraphs[open] .chevron {
  transform: rotate(180deg);
}

.paragraph-list {
  padding: 0 10px 10px;
  border-top: 1px solid var(--line);
}

.paragraph-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}

.paragraph-row:last-child {
  border-bottom: 0;
}

.paragraph-row.is-crossing {
  background: var(--rust-soft);
}

.paragraph-index {
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.paragraph-body {
  min-width: 0;
}

.paragraph-text {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paragraph-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 3px 0 0;
}

.tag {
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.6;
  white-space: nowrap;
}

.tag-cross {
  border-color: #d9b4aa;
  background: var(--surface);
  color: var(--rust);
}

.paragraph-value {
  padding-top: 1px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.is-longest .paragraph-value {
  font-weight: 700;
}

.paragraph-empty {
  margin: 10px 0 2px;
}

.ad-wrap {
  margin-top: 24px;
}

[data-tool-ad-slot] {
  max-width: 728px;
  margin-inline: auto;
}

[data-tool-ad-slot]:not([hidden]) {
  display: block;
  min-height: 120px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

[data-tool-ad-slot] small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.6875rem;
}

.th-ad-content strong {
  display: block;
  font-size: 0.875rem;
}

.th-ad-content p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.ad-wrap a {
  color: var(--ink);
}

.prose-block {
  max-width: 780px;
  margin-top: 46px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.prose-block h2 {
  margin: 0 0 12px;
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.prose-block p {
  max-width: 68ch;
  margin: 0 0 12px;
  font-size: 0.9375rem;
  line-height: 1.85;
}

.prose-block > p:last-child {
  margin-bottom: 0;
}

.note {
  padding: 12px 14px;
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.875rem !important;
  line-height: 1.7 !important;
}

.definitions {
  margin: 18px 0 16px;
  border-top: 1px solid var(--line);
}

.definitions > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.definitions dt {
  font-size: 0.875rem;
  font-weight: 650;
}

.definitions dd {
  margin: 0;
}

.definitions p {
  max-width: 68ch;
  margin: 0 0 2px;
  font-size: 0.875rem;
  line-height: 1.7;
}

.definitions .example {
  color: var(--muted);
  font-size: 0.8125rem;
}

code {
  padding: 1px 4px;
  border-radius: 2px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.875em;
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  min-height: 48px;
  padding: 12px 0;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.faq summary::marker {
  color: var(--pine);
}

.faq p {
  padding: 0 0 12px;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.reading-shell {
  padding-bottom: 28px;
}

.article-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-top: 36px;
}

.toc {
  position: sticky;
  top: 24px;
  padding-top: 4px;
}

.toc-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.toc ol {
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
  list-style: none;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 5px 0 5px 12px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
}

.toc-mobile {
  display: none;
}

.back-top {
  margin-top: 24px !important;
  font-size: 0.875rem !important;
}

.article {
  min-width: 0;
  max-width: 760px;
}

.article .intro {
  margin: 0 0 24px;
}

.article h1 {
  font-size: 2rem;
}

.article h2 {
  margin: 40px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 1.375rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.article h3 {
  margin: 24px 0 8px;
  font-size: 1.0625rem;
}

.article p {
  max-width: 68ch;
  margin: 0 0 14px;
  font-size: 1rem;
  line-height: 1.9;
}

.article ul,
.article ol {
  max-width: 68ch;
  margin: 0 0 16px;
  padding-left: 1.3em;
}

.article li {
  margin: 5px 0;
  font-size: 1rem;
  line-height: 1.8;
}

.table-scroll {
  margin: 16px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.article table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.article th,
.article td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article th {
  background: var(--surface-2);
  font-weight: 650;
}

.article tr:last-child td {
  border-bottom: 0;
}

.article pre {
  margin: 10px 0 16px;
  padding: 12px 14px;
  overflow-x: auto;
  border-radius: 2px;
  background: var(--ink);
  color: #eef1ec;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.article pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: 1em;
}

.inline-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--pine);
  border-radius: 2px;
  color: var(--pine);
  font-weight: 600;
  text-decoration: none;
}

.inline-cta:hover {
  background: var(--pine);
  color: #fff;
}

.narrow {
  max-width: 720px;
  margin: 40px auto 0;
}

.not-found {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  max-width: 600px;
  min-height: 55vh;
  padding: 60px 0;
}

.not-found-code {
  margin: 0;
  color: var(--line-strong);
  font-family: var(--mono);
  font-size: 4rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.not-found h1 {
  margin-top: 10px;
  font-size: 2rem;
}

.site-footer {
  margin-top: 56px;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line-strong);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

.footer-inner p .small {
  margin-left: 5px;
  font-weight: 400;
}

.footer-inner nav {
  display: flex;
  gap: 12px;
}

.footer-inner a {
  color: var(--muted);
  font-size: 0.8125rem;
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--ink);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .shell {
    width: min(calc(100% - 32px), var(--shell));
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .editor-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .readout-number {
    font-size: 3rem;
  }

  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc {
    display: none;
  }

  .toc-mobile {
    display: block;
    margin: 0 0 26px;
    border: 1px solid var(--line-strong);
    border-radius: 2px;
    background: var(--surface);
  }

  .toc-mobile summary {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.875rem;
    font-weight: 650;
    cursor: pointer;
  }

  .toc-mobile ol {
    margin: 0;
    padding: 0 14px 12px 32px;
    border-top: 1px solid var(--line);
  }

  .toc-mobile li {
    margin: 4px 0;
  }

  .toc-mobile a {
    color: var(--muted);
    font-size: 0.8125rem;
    text-decoration: none;
  }

  .toc-mobile a:hover {
    color: var(--ink);
  }
}

@media (max-width: 640px) {
  .header-inner {
    height: 58px;
  }

  .brand {
    font-size: 1rem;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .site-header nav a {
    padding: 8px 6px;
    font-size: 0.8125rem;
  }

  .intro {
    margin-top: 30px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .article h1 {
    font-size: 1.75rem;
  }

  .lede {
    font-size: 1rem;
  }

  .editor-pane,
  .readout-pane {
    padding: 14px 14px 12px;
  }

  textarea#source {
    min-height: 240px;
  }

  .readout-number {
    font-size: 2.75rem;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric:nth-child(odd) {
    padding-right: 0;
    border-right: 0;
  }

  .metric:nth-child(even) {
    padding-left: 0;
  }

  .metric dt {
    font-size: 0.75rem;
  }

  .metric dd {
    font-size: 0.75rem;
  }

  .definitions > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .prose-block {
    margin-top: 36px;
  }

  .article h2 {
    margin-top: 32px;
  }

  .article p,
  .article li {
    font-size: 0.9375rem;
  }

  .table-scroll {
    overflow: visible;
    border: 0;
  }

  .article table {
    min-width: 0;
  }

  .article thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .article tbody,
  .article tr {
    display: block;
  }

  .article tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface);
  }

  .article td {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-size: 0.8125rem;
  }

  .article tr td:last-child {
    border-bottom: 0;
  }

  .article td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .metric-choice span {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gauge-fill,
  .gauge-marker,
  .chevron {
    transition: none;
  }
}
