.tools-page {
  padding-block: 36px 64px;
}
.tool-hero {
  max-width: 1000px;
  padding-block: 16px 42px;
}
.tool-hero .eyebrow {
  color: var(--oxblood);
}
.tool-hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  max-width: 980px;
}
.tool-hero .deck {
  max-width: 720px;
  font-size: 1.2rem;
  margin-top: 24px;
}
.tool-hero > a {
  display: inline-block;
  margin-bottom: 24px;
}
.tools-index {
  border-top: 2px solid var(--ink);
}
.tool-entry {
  display: grid;
  grid-template-columns: 70px 1.2fr 1fr;
  gap: 28px;
  padding-block: 32px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.tool-entry .number {
  color: var(--oxblood);
  font-size: 0.8rem;
}
.tool-entry h2 {
  font-size: 2.2rem;
  line-height: 1.15;
}
.tool-entry a {
  display: inline-block;
  margin-top: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tools-note {
  max-width: 760px;
  padding-block: 32px;
}
.tools-note p + p {
  margin-top: 16px;
}
.calc-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  border-top: 2px solid var(--ink);
  padding-top: 24px;
}
.calc-controls button,
.step-actions > button:not(.button),
.levels button,
.calc-field button {
  background: transparent;
  border: 1px solid var(--rule);
  padding: 10px 15px;
  min-height: 44px;
  color: var(--ink);
}
.levels {
  display: flex;
  flex-wrap: wrap;
}
.levels button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.calc-controls > button {
  font-size: 0.8rem;
}
.field-note {
  font-size: 0.875rem;
  color: #485054;
  margin-block: 12px 20px;
  max-width: 800px;
}
.calc-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--rule);
  margin-block: 24px 32px;
  gap: 0;
}
.calc-progress button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  text-align: left;
  padding: 16px 12px;
  color: var(--ink);
  font-size: 0.85rem;
  min-height: 64px;
}
.calc-progress button span {
  display: block;
  color: var(--oxblood);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}
.calc-progress button[aria-current] {
  border-bottom-color: var(--oxblood);
  background: #e9e4d8;
}
.calc-step > h2 {
  font-size: 2.5rem;
  margin-bottom: 24px;
}
.input-group {
  padding: 24px 0 32px;
  border-top: 1px solid var(--rule);
}
.input-group h3 {
  font-size: 1.8rem;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.calc-field label {
  font-size: 0.875rem;
  line-height: 1.35;
  font-weight: 600;
}
.calc-field input,
.calc-field select {
  width: 100%;
  min-height: 48px;
  background: #faf8f2;
  color: var(--ink);
  border: 1px solid #8b8d85;
  border-radius: 0;
  padding: 10px 12px;
  font: 1rem var(--sans);
  font-variant-numeric: tabular-nums;
}
.calc-field input:focus-visible,
.calc-field select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
}
.calc-field input:invalid:not(:placeholder-shown) {
  border-color: var(--oxblood);
}
.calc-field small {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #485054;
}
.calc-field small a,
.methodology a,
.explanation a,
.calc-meta a,
.result-note a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.check-field {
  justify-content: start;
}
.check-field input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--oxblood);
}
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
}
.step-actions .button {
  margin: 0;
}
.step-actions span {
  font-size: 0.8rem;
}
.calc-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  border-top: 1px solid var(--ink);
  padding-top: 24px;
  margin-top: 48px;
}
.result-lead {
  font: clamp(2.3rem, 4.6vw, 4.1rem)/1.15 var(--serif);
  letter-spacing: -0.035em;
  max-width: 1050px;
  margin-block: 20px;
}
.result-lead strong {
  color: var(--oxblood);
  font-weight: 400;
}
.result-lead em {
  color: var(--olive);
  font-style: normal;
}
#result > p {
  margin-bottom: 20px;
}
#result > h3 {
  font-size: 2rem;
  margin-top: 36px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
  margin-block: 36px;
}
.metric {
  border-top: 1px solid var(--ink);
  padding-top: 20px;
}
.metric h3 {
  font: 0.85rem var(--sans);
  letter-spacing: 0.03em;
}
.metric-value {
  font: clamp(1.8rem, 3.5vw, 3rem)/1.2 var(--serif);
  margin-block: 16px;
  overflow-wrap: anywhere;
}
.explanation {
  margin-block: 16px;
  border-block: 1px solid var(--rule);
  font-size: 0.875rem;
}
.explanation summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
}
.explanation > div {
  padding-bottom: 18px;
}
.explanation p + p {
  margin-top: 12px;
}
.table-scroll {
  max-width: 100%;
  overflow: auto;
  margin-block: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
caption {
  text-align: left;
  padding-bottom: 10px;
  font-size: 0.75rem;
  color: #485054;
}
td,
th {
  padding: 12px 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  text-align: left;
  font-weight: 400;
}
td {
  text-align: right;
}
thead th {
  font-weight: 600;
}
thead th:not(:first-child) {
  text-align: right;
}
.path-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-block: 32px;
}
.path-results > section {
  border-top: 2px solid var(--ink);
  padding-top: 20px;
}
.path-results h3 {
  font-size: 2rem;
}
.projection-chart {
  margin-top: 30px;
}
.projection-chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.projection-chart text {
  font: 13px var(--sans);
  fill: var(--ink);
}
.projection-chart figcaption {
  justify-content: start;
  gap: 24px;
  color: var(--ink);
}
.notice {
  border-left: 4px solid var(--oxblood);
  padding: 18px 22px;
  background: #eae3d6;
  margin-block: 20px;
}
.notice h3 {
  font-size: 1.7rem;
  margin-bottom: 12px;
}
.result-note {
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  margin-top: 32px;
  font-size: 0.875rem;
}
.methodology {
  max-width: 880px;
}
.methodology h2 {
  font-size: 2rem;
  margin-block: 36px 16px;
}
.methodology p,
.methodology dd {
  margin-bottom: 18px;
}
.definitions dt {
  font-weight: 600;
}
.definitions dd {
  margin-left: 0;
}
.source-entry {
  border-top: 1px solid var(--rule);
  padding: 20px 0;
}
.source-entry h3 {
  font: 1rem var(--sans);
  margin-bottom: 12px;
}
.source-entry p {
  font-size: 0.875rem;
}
.calc-field small button {
  padding: 4px 8px;
  font-size: 0.8rem;
  margin-top: 4px;
}
.calculator-noscript {
  border-left: 3px solid var(--oxblood);
  padding: 20px;
}
@media (max-width: 900px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-entry {
    grid-template-columns: 40px 1fr;
  }
  .tool-entry > div:last-child {
    grid-column: 2;
  }
  .calc-progress button {
    font-size: 0.75rem;
  }
}
@media (max-width: 600px) {
  .tools-page.wrap {
    width: calc(100% - 36px);
  }
  .tools-page {
    padding-top: 20px;
  }
  .tool-hero {
    padding-bottom: 30px;
  }
  .field-grid,
  .metrics,
  .path-results {
    grid-template-columns: 1fr;
  }
  .tool-entry {
    gap: 16px;
  }
  .tool-entry h2 {
    font-size: 1.9rem;
  }
  .calc-progress {
    grid-template-columns: 1fr 1fr;
  }
  .calc-progress button {
    padding: 12px;
  }
  .calc-controls {
    align-items: stretch;
  }
  .calc-controls > button {
    flex: 1;
  }
  .levels {
    width: 100%;
  }
  .levels button {
    flex: 1;
    padding-inline: 8px;
  }
  .step-actions {
    flex-wrap: wrap;
  }
  .calc-meta {
    line-height: 1.5;
  }
  .table-scroll th {
    min-width: 130px;
  }
  .projection-chart figcaption {
    flex-wrap: wrap;
    gap: 8px 20px;
  }
  .metric-value {
    font-size: 2.4rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
@media print {
  .site-header,
  .site-footer,
  .calc-controls,
  .calc-progress,
  .step-actions {
    display: none;
  }
  .calc-step[hidden] {
    display: none !important;
  }
  .wrap {
    width: 100%;
  }
  details > div {
    display: block;
  }
  .projection-chart {
    break-inside: avoid;
  }
}

.tool-explanation {
  max-width: 760px;
  margin-top: 64px;
  padding-top: 36px;
  border-top: 2px solid var(--ink);
}
.tool-explanation h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-block: 32px 16px;
}
.tool-explanation h3 {
  font-size: 1.35rem;
  margin-block: 28px 12px;
}
.tool-explanation p,
.tool-explanation li {
  line-height: 1.75;
}
.tool-explanation p {
  margin-bottom: 16px;
}
.tool-explanation ul {
  padding-left: 1.4rem;
}
.tool-explanation li {
  margin-bottom: 12px;
}
.tool-explanation a {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tool-next {
  border-top: 1px solid var(--rule);
  margin-top: 32px;
  padding-bottom: 16px;
}
.tool-question {
  color: var(--oxblood);
  margin-bottom: 12px;
  font-weight: 600;
}
