:root {
  color-scheme: light;
  --color-background: #f6f4ef;
  --color-surface: #ffffff;
  --color-ink: #263244;
  --color-muted: #526071;
  --color-primary: #294c73;
  --color-primary-hover: #203d5c;
  --color-tint: #e3ebf2;
  --color-accent: #8c4356;
  --color-border: #cdd4dc;
  --color-warning: #855a16;
  --color-danger: #a12f3b;
  --font-heading: "Trebuchet MS", Arial, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;
  --container: 75rem;
  --reading: 65ch;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { background: var(--color-background); scroll-behavior: smooth; }
body { margin: 0; color: var(--color-ink); background: var(--color-background); font: 18px/1.65 var(--font-body); }
body, button, input, select { font-family: var(--font-body); }
img, svg { max-width: 100%; }
a { color: var(--color-primary); }
a:hover { color: var(--color-primary-hover); }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }

.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;
}
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: .65rem 1rem; color: #fff; background: var(--color-primary); }
.skip-link:focus { top: 1rem; }

.site-header { min-height: 80px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.header-inner, .footer-inner { display: flex; align-items: center; gap: 1.5rem; max-width: var(--container); margin: 0 auto; padding: 1rem 1.5rem; }
.header-inner { justify-content: space-between; min-height: 80px; }
.site-brand, .footer-brand { display: block; flex: 0 1 auto; line-height: 0; }
.site-brand img { display: block; width: min(230px, 52vw); height: auto; }
.site-nav { display: flex; align-items: center; justify-content: flex-end; gap: 1.15rem; }
.site-nav a { flex-shrink: 0; color: var(--color-ink); font-size: 16px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a[aria-current="page"] { color: var(--color-primary); text-decoration: underline; text-underline-offset: 4px; }
.nav-toggle { display: none; min-height: 48px; padding: .5rem .85rem; border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-ink); background: var(--color-surface); font-size: 16px; font-weight: 700; cursor: pointer; }

.page-shell { max-width: var(--container); margin: 0 auto; padding-right: 1.5rem; padding-left: 1.5rem; }
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr); align-items: center; gap: 4rem; padding-top: 5rem; padding-bottom: 5.5rem; }
.hero-copy { max-width: 640px; }
.eyebrow, .annotation, .card-number { margin: 0; color: var(--color-accent); font-size: 14px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; color: var(--color-ink); font-family: var(--font-heading); font-weight: 700; }
h1 { max-width: 12ch; margin-top: .6rem; font-size: clamp(2.25rem, 4.3vw, 3.75rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { font-size: clamp(2rem, 3vw, 2.55rem); line-height: 1.18; letter-spacing: -.025em; }
h3 { font-size: 1.45rem; line-height: 1.3; }
.lede { max-width: 48rem; margin: 1.5rem 0 0; color: var(--color-muted); font-size: 1.25rem; line-height: 1.55; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .65rem 1rem; border: 1px solid transparent; border-radius: var(--radius); font-size: 16px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
.button-primary { color: #fff; background: var(--color-primary); }
.button-primary:hover { color: #fff; background: var(--color-primary-hover); }
.button-secondary { color: var(--color-primary); border-color: var(--color-primary); background: var(--color-surface); }
.button-secondary:hover { color: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.text-action { font-size: 16px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.hero-footnote { max-width: 42rem; margin: 2rem 0 0; padding-left: 1rem; border-left: 3px solid var(--color-accent); color: var(--color-muted); font-size: 16px; }

.hero-image { min-width: 0; margin: 0; }
.hero-image img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1rem 2.5rem rgba(38, 50, 68, .12); }

.section { padding-top: 5rem; padding-bottom: 5rem; }
.section-top-border { border-top: 1px solid var(--color-border); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-heading h2 { margin-top: .5rem; }
.section-heading-narrow { align-items: start; }
.section-intro { max-width: 34rem; margin: 0; color: var(--color-muted); }
.table-scroll { overflow-x: auto; }
.decision-table, .example-table { width: 100%; min-width: 680px; border-collapse: collapse; background: var(--color-surface); }
.decision-table th, .decision-table td, .example-table th, .example-table td { padding: 1rem; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.decision-table thead th, .example-table thead th { color: var(--color-ink); background: var(--color-tint); font-size: 16px; }
.decision-table tbody th, .example-table tbody th { width: 22%; font-weight: 700; }
.decision-table tbody tr:last-child th, .decision-table tbody tr:last-child td, .example-table tbody tr:last-child th, .example-table tbody tr:last-child td { border-bottom: 0; }
.decision-table a { font-weight: 700; }
.editorial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.editorial-card { display: flex; flex-direction: column; min-width: 0; padding: 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.editorial-card-accent { border-top: 4px solid var(--color-accent); }
.editorial-card .card-number { margin-top: 1.5rem; }
.editorial-card h3 { margin-top: .5rem; }
.editorial-card p:not(.card-number) { margin: .75rem 0 1.25rem; color: var(--color-muted); }
.editorial-card .text-action { margin-top: auto; }
.layer-mini { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 72px; padding: 10px 16px; border: 1px solid var(--color-border); background: var(--color-background); }
.layer-line { display: block; width: 74%; height: 10px; border: 1px solid var(--color-primary); }
.layer-fabric { background: repeating-linear-gradient(135deg, #fff 0, #fff 5px, #dbe6ec 5px, #dbe6ec 8px); }
.layer-backing { width: 84%; background: #6f8ba1; }
.layer-topper { width: 63%; background: #f1d8de; border-color: var(--color-accent); }
.measure-box { display: block; width: 55%; height: 36px; margin: auto; border: 2px solid var(--color-primary); }
.measure-arrow { position: absolute; top: 18px; width: 24%; height: 2px; background: var(--color-accent); }
.measure-arrow::after { position: absolute; top: -4px; width: 8px; height: 8px; border-top: 2px solid var(--color-accent); border-right: 2px solid var(--color-accent); content: ""; }
.measure-arrow-left { left: 5%; }
.measure-arrow-left::after { right: 0; transform: rotate(45deg); }
.measure-arrow-right { right: 5%; }
.measure-arrow-right::after { left: 0; transform: rotate(-135deg); }
.next-step-section { padding-bottom: 6rem; }
.next-step-panel { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding: 2rem; border-radius: var(--radius); color: #fff; background: var(--color-primary); }
.next-step-panel h2 { max-width: 18ch; margin-top: .5rem; color: #fff; }
.next-step-panel p:not(.eyebrow) { max-width: 62ch; margin: 1rem 0 0; color: #e2ebf3; }
.next-step-panel .eyebrow { color: #f0cbd4; }
.next-step-panel .button { flex: 0 0 auto; color: var(--color-primary); background: #fff; }
.next-step-panel .button:hover { color: var(--color-primary-hover); background: #f0f4f7; }
.quiet-note { max-width: 72ch; margin: 1.5rem 0 0; color: var(--color-muted); font-size: 16px; }

.site-footer { color: #f4f7fa; background: var(--color-ink); }
.footer-inner { flex-wrap: wrap; justify-content: space-between; min-height: 136px; }
.footer-brand img { display: block; width: min(220px, 52vw); height: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: #f4f7fa; font-size: 16px; }
.footer-inner > span { color: #cbd6df; font-size: 14px; }

.breadcrumbs { max-width: var(--reading); padding-top: 2rem; color: var(--color-muted); font-size: 14px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem .65rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { margin-left: .65rem; color: var(--color-border); content: "/"; }
.article-header { max-width: 820px; padding-top: 2.5rem; }
.article-header h1 { max-width: 18ch; margin-top: .6rem; font-size: clamp(2.25rem, 4vw, 3.5rem); }
.article-intro { max-width: 54rem; margin: 1.25rem 0 0; color: var(--color-muted); font-size: 1.2rem; }
.byline { margin: 1.25rem 0 0; color: var(--color-muted); font-size: 14px; }
.article-actions { margin-top: 1.5rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 720px) minmax(180px, 240px); align-items: start; gap: 4rem; padding-top: 3rem; padding-bottom: 6rem; }
.article-main { min-width: 0; }
.article-main h2 { margin-top: 4.5rem; font-size: 2rem; }
.article-main h3 { margin-top: 2rem; }
.article-main p { max-width: var(--reading); }
.section-answer { margin: 1rem 0 1.25rem; color: var(--color-ink); }
.answer-panel, .callout, .reference-note { margin: 1.5rem 0; padding: 1.25rem 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.answer-panel { border-left: 4px solid var(--color-primary); }
.callout { border-color: transparent; background: var(--color-tint); }
.callout h3, .reference-note h3 { margin-top: 0; font-size: 1.2rem; }
.callout p:last-child, .reference-note p:last-child { margin-bottom: 0; }
.reference-note { color: var(--color-muted); font-size: 16px; }
.catalog-jump { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: end; gap: 1.5rem; margin: 2rem 0; padding: 1.25rem 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.catalog-jump h2 { margin-top: .35rem; font-size: 1.45rem; }
.catalog-jump-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.catalog-jump-links a { display: flex; min-height: 72px; flex-direction: column; justify-content: space-between; gap: .35rem; padding: .8rem .9rem; border: 1px solid var(--color-border); color: var(--color-ink); background: var(--color-background); text-decoration: none; }
.catalog-jump-links a:hover, .catalog-jump-links a:focus-visible { color: var(--color-primary-hover); border-color: var(--color-primary); background: var(--color-tint); }
.catalog-jump-links strong { font-family: var(--font-heading); font-size: 1rem; line-height: 1.25; }
.catalog-jump-links span { color: var(--color-muted); font-size: 14px; font-weight: 700; }
.contents { position: sticky; top: 1rem; padding: 1rem; border-left: 2px solid var(--color-border); }
.contents h2 { margin: 0 0 .75rem; font-size: 1rem; }
.contents ol { margin: 0; padding-left: 1.25rem; font-size: 16px; }
.contents li + li { margin-top: .45rem; }
.layer-diagram { margin: 1.5rem 0; padding: 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-background); }
.layer-diagram-stack { display: grid; gap: .65rem; max-width: 30rem; margin: 0 auto; }
.diagram-layer { padding: .8rem 1rem; border: 1px solid var(--color-primary); text-align: center; font-weight: 700; }
.diagram-topping { color: var(--color-ink); border-color: var(--color-accent); background: #f1d8de; }
.diagram-fabric { background: repeating-linear-gradient(135deg, #fff 0, #fff 7px, #e0e9ee 7px, #e0e9ee 11px); }
.diagram-backing { color: #fff; background: #6f8ba1; }
.layer-diagram figcaption { margin-top: 1rem; color: var(--color-muted); font-size: 16px; }
.limits-callout { border-left: 4px solid var(--color-warning); }
.next-link { display: flex; align-items: start; justify-content: space-between; gap: 1.5rem; margin-top: 2rem; padding: 1.5rem; border: 1px solid var(--color-border); background: var(--color-surface); }
.next-link h3 { margin-top: 0; }
.next-link p { margin-bottom: 0; color: var(--color-muted); }
.product-note { margin-top: 1.25rem; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.product-card { display: flex; flex-direction: column; min-width: 0; padding: 1.35rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.product-image { display: flex; align-items: center; justify-content: center; min-height: 12rem; margin: -1.35rem -1.35rem 1.25rem; padding: 1rem; border-bottom: 1px solid var(--color-border); background: #fff; }
.product-image img { display: block; width: 100%; max-width: 12rem; height: 11rem; object-fit: contain; }
.comparison-product { display: inline-flex; align-items: center; gap: .75rem; vertical-align: middle; }
.comparison-product img { display: block; flex: 0 0 4.5rem; width: 4.5rem; height: 4.5rem; object-fit: contain; background: #fff; }
.product-label { margin: 0; color: var(--color-accent); font-size: 14px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.product-card h3 { margin-top: .5rem; font-size: 1.35rem; }
.product-card > p:not(.product-label):not(.product-limit) { color: var(--color-muted); }
.product-specs { display: grid; gap: .75rem; margin: 1.25rem 0; padding: 1rem 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.product-specs div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .75rem; }
.product-specs dt { color: var(--color-muted); font-size: 14px; font-weight: 700; }
.product-specs dd { margin: 0; font-size: 16px; }
.product-limit { margin-top: 0; color: var(--color-muted); font-size: 16px; }
.product-card > .button { margin-top: auto; }
.product-card .text-action { margin-top: auto; padding-top: .75rem; }
.product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1rem; margin-top: auto; padding-top: .75rem; }
.product-actions .button { margin-top: 0; }
.catalog-subheading { margin-top: 3.5rem !important; padding-top: 1.5rem; border-top: 1px solid var(--color-border); font-size: 1.65rem !important; }
.catalog-subintro { color: var(--color-muted); }
.affiliate-disclosure { margin-top: 1.5rem; }
.affiliate-disclosure h2 { margin-top: 0; }

.worksheet-card { margin: 1.5rem 0; padding: 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.worksheet-card h3 { margin-top: 0; }
.worksheet-group { margin: 1.5rem 0 0; padding: 1.25rem; border: 1px solid var(--color-border); }
.worksheet-group legend { padding: 0 .5rem; font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; }
.worksheet-details { display: block; }
.worksheet-details summary { cursor: pointer; font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; }
.worksheet-details[open] summary { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: .35rem; font-size: 16px; font-weight: 700; }
.required { color: var(--color-muted); font-size: 13px; font-weight: 400; }
.field input, .field select { display: block; width: 100%; min-height: 48px; padding: .65rem .75rem; border: 1px solid var(--color-muted); border-radius: var(--radius); color: var(--color-ink); background: var(--color-surface); font-size: 16px; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border: 2px solid var(--color-danger); }
.field-hint { display: block; margin-top: .35rem; color: var(--color-muted); font-size: 14px; line-height: 1.45; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.form-errors { margin: 1rem 0 0; padding: .85rem 1rem; border-left: 4px solid var(--color-danger); color: var(--color-danger); background: #fcecef; font-size: 16px; }
.form-errors:empty { display: none; }
.form-errors ul { margin: 0; padding-left: 1.25rem; }
.result-card { margin-top: 1.5rem; padding: 1.5rem; border: 2px solid var(--color-primary); border-radius: var(--radius); background: var(--color-tint); }
.result-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.result-header h3 { margin-top: .4rem; }
.result-badge { display: inline-flex; align-items: center; min-height: 32px; padding: .3rem .6rem; border-radius: 999px; color: var(--color-primary); background: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; }
.result-badge.is-fail { color: var(--color-danger); }
.result-badge.is-success { color: #285c45; }
.result-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 1.5rem 0 0; border: 1px solid var(--color-border); background: var(--color-border); }
.result-metrics div { min-width: 0; padding: 1rem; background: var(--color-surface); }
.result-metrics dt { color: var(--color-muted); font-size: 14px; }
.result-metrics dd { margin: .2rem 0 0; font-size: 1.2rem; font-weight: 700; }
.result-message { margin: 1.25rem 0 0; }
.precut-result { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.precut-result[hidden] { display: none; }
.example-label { margin: 1.25rem 0 .75rem; color: var(--color-accent); font-size: 14px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.trust-page { max-width: 54rem; padding-bottom: 6rem; }
.trust-page > .breadcrumbs { padding-right: 0; padding-left: 0; }
.trust-page > .article-header { padding-top: 2.5rem; }
.trust-content { max-width: var(--reading); margin-top: 3rem; }
.trust-content > section + section { margin-top: 3.5rem; }
.trust-content h2 { font-size: 2rem; }
.trust-content .answer-panel h2, .trust-content .next-link h2 { margin-top: 0; font-size: 1.45rem; }
.error-page { min-height: calc(100vh - 216px); padding-top: 6rem; padding-bottom: 6rem; }
.error-page h1 { margin-top: .5rem; }

@media (max-width: 1023px) {
  .hero { gap: 2.5rem; }
  .article-layout { grid-template-columns: 1fr; gap: 2rem; }
  .contents { position: static; max-width: 720px; order: -1; }
}

@media (max-width: 1180px) {
  .site-header, .header-inner { min-height: 68px; }
  .header-inner { flex-wrap: wrap; padding-top: .75rem; padding-bottom: .75rem; }
  .site-brand img { width: min(210px, 62vw); }
  .nav-toggle { display: block; margin-left: auto; }
  .site-nav { display: none; flex: 0 0 100%; flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 0 0; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .7rem 0; border-top: 1px solid var(--color-border); }
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  .page-shell { padding-right: 1.25rem; padding-left: 1.25rem; }
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 3.25rem; padding-bottom: 3.5rem; }
  h1 { max-width: 15ch; font-size: clamp(2.25rem, 11vw, 3rem); }
  h2 { font-size: 2rem; }
  .lede { font-size: 1.1rem; }
  .hero-image { max-width: 560px; }
  .section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .section-heading { display: block; }
  .section-heading > .text-action { display: inline-block; margin-top: 1rem; }
  .catalog-jump { display: block; }
  .catalog-jump-links { grid-template-columns: 1fr; margin-top: 1rem; }
  .editorial-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .product-actions { align-items: flex-start; flex-direction: column; }
  .next-step-panel { display: block; padding: 1.5rem; }
  .next-step-panel .button { margin-top: 1.25rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; padding-top: 2rem; padding-bottom: 2rem; }
  .footer-links { gap: .75rem 1rem; }
  .article-header { padding-top: 2rem; }
  .article-header h1 { max-width: 16ch; font-size: 2.25rem; }
  .article-actions { align-items: flex-start; }
  .article-layout { padding-top: 2rem; padding-bottom: 4rem; }
  .article-main h2 { margin-top: 3.25rem; font-size: 1.8rem; }
  .worksheet-card { padding: 1rem; }
  .worksheet-group { padding: 1rem; }
  .form-grid, .result-metrics { grid-template-columns: 1fr; }
  .result-header, .next-link { display: block; }
  .result-badge { margin-top: .75rem; }
  .next-link .text-action { display: inline-block; margin-top: 1rem; }
  .product-specs div { grid-template-columns: 1fr; gap: .1rem; }
  .trust-page { padding-bottom: 4rem; }
  .trust-content { margin-top: 2rem; }
  .trust-content > section + section { margin-top: 2.75rem; }
  .error-page { min-height: calc(100vh - 204px); padding-top: 4rem; padding-bottom: 4rem; }
}

@media (max-width: 350px) {
  .site-brand img { width: min(170px, 55vw); }
  .header-inner { gap: 1rem; }
}

@media (max-width: 360px) {
  .page-shell { padding-right: 1rem; padding-left: 1rem; }
  .action-row { align-items: stretch; flex-direction: column; }
  .action-row .button { width: 100%; }
}

@media print {
  body { color: #000; background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .skip-link, .breadcrumbs, .contents, .form-actions, .form-errors, .reference-note, .next-link { display: none !important; }
  .page-shell { max-width: none; padding: 0; }
  .article-header { padding-top: 0; }
  .article-layout { display: block; padding: 0; }
  .article-main h2 { margin-top: 2rem; }
  .worksheet-card, .worksheet-group, .result-card { border-color: #777; }
  input, select { border-color: #777; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
