:root {
  --paper: #f4f1e8;
  --paper-light: #faf8f2;
  --paper-deep: #e6e0d4;
  --concrete: #d6d2c8;
  --concrete-dark: #a9a69d;
  --ink: #26343b;
  --ink-soft: #48575e;
  --muted: #6c7778;
  --survey-blue: #246783;
  --survey-blue-deep: #17495f;
  --survey-blue-soft: #c3dce3;
  --survey-blue-faint: #e4eff0;
  --orange: #e66f3e;
  --orange-deep: #b64e2d;
  --orange-wash: #f8d9ca;
  --line: #c9d2d1;
  --line-strong: #97abad;
  --good: #2e6c5b;
  --danger: #ad442f;
  --shadow: 0 1.5rem 3rem rgba(38, 52, 59, .12), 0 .25rem .7rem rgba(38, 52, 59, .08);
  --shadow-soft: 0 .5rem 1.5rem rgba(38, 52, 59, .08);
  --display: "Baskerville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  --mono: "Courier New", "Liberation Mono", monospace;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: .25rem;
  --radius-md: .625rem;
  --radius-lg: 1rem;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 11% 19%, rgba(36, 103, 131, .055) 0 .11rem, transparent .13rem),
    radial-gradient(circle at 73% 46%, rgba(38, 52, 59, .04) 0 .09rem, transparent .11rem),
    radial-gradient(circle at 39% 79%, rgba(230, 111, 62, .035) 0 .08rem, transparent .1rem);
  background-size: 1.8rem 1.8rem, 2.4rem 2.4rem, 3.1rem 3.1rem;
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .4;
  background: repeating-linear-gradient(0deg, transparent 0 3.95rem, rgba(36, 103, 131, .025) 4rem), repeating-linear-gradient(90deg, transparent 0 3.95rem, rgba(36, 103, 131, .025) 4rem);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: .1875rem solid var(--orange);
  outline-offset: .1875rem;
}

input:focus-visible {
  border-color: var(--survey-blue);
  box-shadow: 0 0 0 .1875rem var(--survey-blue-soft);
  outline: .125rem solid transparent;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  background-color: #fff6f1;
}

input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 .1875rem var(--orange-wash);
}

.skip-link {
  position: absolute;
  z-index: 20;
  top: -5rem;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  color: var(--paper-light);
  background: var(--survey-blue-deep);
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}

.site-header {
  border-bottom: .0625rem solid var(--line-strong);
  background: rgba(250, 248, 242, .9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 3rem, 76rem);
  min-height: 5rem;
  margin: 0 auto;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
}

.brand strong {
  color: var(--survey-blue);
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--paper-light);
  background: var(--survey-blue);
  border: .0625rem solid var(--survey-blue-deep);
  box-shadow: .25rem .25rem 0 var(--orange);
  font-size: .68rem;
  letter-spacing: -.06em;
}

.header-note {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .63rem;
  letter-spacing: .08em;
  white-space: nowrap;
}

.status-dot {
  display: inline-block;
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 .2rem rgba(46, 108, 91, .12);
}

.header-divider {
  width: 1.5rem;
  height: .0625rem;
  background: var(--line-strong);
}

.page-shell {
  width: min(100% - 3rem, 76rem);
  margin: 0 auto;
  padding: var(--space-12) 0 var(--space-10);
}

.intro {
  margin-bottom: var(--space-6);
  border-left: .25rem solid var(--orange);
  padding-left: var(--space-6);
}

.intro-copy {
  max-width: 50rem;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--survey-blue);
  font-family: var(--mono);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.eyebrow-rule {
  display: inline-block;
  width: 2rem;
  height: .125rem;
  background: var(--orange);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 34rem;
  margin-bottom: var(--space-3);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .96;
}

h1 em {
  color: var(--survey-blue);
  font-style: italic;
}

.lede {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}


.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: start;
  gap: var(--space-6);
}

.panel {
  position: relative;
  background: rgba(250, 248, 242, .88);
  border: .0625rem solid var(--line);
  box-shadow: var(--shadow-soft);
}

.input-panel {
  padding: var(--space-6);
  border-top: .2rem solid var(--survey-blue);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.panel-heading h2,
.table-heading h3 {
  margin: var(--space-2) 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: 1.05;
}

.panel-index {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--survey-blue);
  border: .0625rem solid var(--survey-blue-soft);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}


.field,
.unit-field {
  display: block;
  min-width: 0;
  margin: 0;
}

.field-label,
.unit-field legend {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 1.25rem;
  margin-bottom: var(--space-2);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.field-label small {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: lowercase;
}

.unit {
  color: var(--survey-blue);
  font-size: .64rem;
  letter-spacing: .02em;
  white-space: nowrap;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  color: var(--ink);
  background: var(--paper-light);
  border: .0625rem solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

input::placeholder {
  color: #89908e;
}

input[type="number"] {
  font-family: var(--mono);
  font-size: .92rem;
  font-variant-numeric: tabular-nums;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  opacity: .45;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.field-error {
  display: block;
  min-height: 1.05rem;
  margin-top: var(--space-1);
  color: var(--danger);
  font-size: .68rem;
  line-height: 1.35;
}

.prefix-input {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding-left: var(--space-3);
  color: var(--survey-blue-deep);
  background: var(--paper-light);
  border: .0625rem solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .9rem;
}

.prefix-input:focus-within {
  border-color: var(--survey-blue);
  box-shadow: 0 0 0 .1875rem var(--survey-blue-soft);
}

.prefix-input input {
  min-height: 2.62rem;
  padding-left: var(--space-1);
  border: 0;
  box-shadow: none;
}

.prefix-input input:focus-visible {
  box-shadow: none;
}

.form-section {
  margin: var(--space-6) 0 0;
  padding: var(--space-5) 0 0;
  border: 0;
  border-top: .0625rem solid var(--line);
}

.section-legend {
  float: left;
  width: 100%;
  margin: 0 0 var(--space-4);
  color: var(--survey-blue-deep);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.section-legend + * {
  clear: both;
}

.section-help {
  clear: both;
  margin: 0 0 var(--space-4);
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.55;
}

.shape-section {
  padding-top: var(--space-5);
}

.shape-options {
  clear: both;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.shape-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2);
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: .0625rem solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

.shape-option:has(input:checked) {
  color: var(--survey-blue-deep);
  background: var(--survey-blue-faint);
  border-color: var(--survey-blue);
}

.shape-option input,
.segment input {
  position: absolute;
  width: .0625rem;
  height: .0625rem;
  padding: 0;
  margin: -.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shape-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  border: .125rem solid currentColor;
}

.shape-icon-circle {
  border-radius: 50%;
}

.shape-icon-custom {
  border-style: dashed;
  transform: rotate(20deg);
}

.shape-inputs {
  clear: both;
}

.shape-fields[hidden] {
  display: none;
}

.segmented {
  display: flex;
  min-height: 2.75rem;
  padding: .1875rem;
  background: var(--paper-deep);
  border: .0625rem solid var(--line);
  border-radius: var(--radius-sm);
}

.segment {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  padding: var(--space-2) var(--space-3);
  color: var(--muted);
  border-radius: .125rem;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.segment:has(input:checked) {
  color: var(--paper-light);
  background: var(--survey-blue);
  box-shadow: 0 .125rem .25rem rgba(38, 52, 59, .16);
}

.segment:has(input:focus-visible),
.shape-option:has(input:focus-visible) {
  outline: .1875rem solid var(--orange);
  outline-offset: .125rem;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: .0625rem solid var(--line);
}


.form-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  border: .0625rem solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
  transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

.button:hover {
  transform: translateY(-.125rem);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: var(--paper-light);
  background: var(--orange-deep);
  border-color: var(--orange-deep);
}

.button-primary:hover {
  background: #913c26;
  border-color: #913c26;
}

.button-quiet {
  color: var(--survey-blue-deep);
  background: transparent;
  border-color: transparent;
}

.button-quiet:hover {
  background: var(--survey-blue-faint);
}

.button-outline {
  color: var(--survey-blue-deep);
  background: var(--paper-light);
  border-color: var(--survey-blue);
}

.button-outline:hover {
  color: var(--paper-light);
  background: var(--survey-blue);
}

.results-column {
  display: grid;
  gap: var(--space-4);
}

.plan-panel {
  overflow: hidden;
  border-top: .2rem solid var(--orange);
}

.plan-heading {
  margin: 0;
  padding: var(--space-5) var(--space-5) var(--space-4);
}

.plan-heading .section-kicker {
  overflow: hidden;
  max-width: 22rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-status {
  padding: var(--space-1) var(--space-2);
  color: var(--good);
  border: .0625rem solid rgba(46, 108, 91, .4);
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .09em;
}

.plan-surface {
  position: relative;
  min-height: 18rem;
  overflow: hidden;
  background-color: var(--concrete);
  background-image:
    linear-gradient(rgba(36, 103, 131, .16) .0625rem, transparent .0625rem),
    linear-gradient(90deg, rgba(36, 103, 131, .16) .0625rem, transparent .0625rem),
    radial-gradient(circle at 24% 40%, rgba(255, 255, 255, .2) 0 .12rem, transparent .14rem),
    radial-gradient(circle at 68% 70%, rgba(38, 52, 59, .11) 0 .1rem, transparent .13rem);
  background-position: 0 0, 0 0, .6rem .5rem, 1.5rem 1.2rem;
  background-size: 2.5rem 2.5rem, 2.5rem 2.5rem, 2.15rem 2.15rem, 3.3rem 3.3rem;
}

.plan-surface::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .33;
  background-image: radial-gradient(circle at 10% 80%, var(--paper-light) 0 .1rem, transparent .12rem), radial-gradient(circle at 86% 18%, var(--survey-blue-deep) 0 .08rem, transparent .11rem);
  background-size: 1.6rem 1.9rem, 2.6rem 2.4rem;
}

.plan-svg {
  position: relative;
  display: block;
  width: 100%;
  min-height: 18rem;
  max-height: 21rem;
}

.svg-outline {
  fill: none;
  stroke: var(--survey-blue-deep);
  stroke-width: 1.5;
}

.dimension-line,
.bedding-line {
  stroke: var(--orange);
  stroke-width: 1.4;
}

.extension-line {
  stroke: var(--survey-blue-deep);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: .72;
}

.dimension-text,
.plan-annotation {
  fill: var(--survey-blue-deep);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.dimension-text-accent {
  fill: var(--orange-deep);
}

.plan-annotation {
  font-size: 12px;
  letter-spacing: .06em;
}

.plan-annotation-muted {
  fill: var(--ink-soft);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .03em;
}

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  color: var(--muted);
  border-top: .0625rem solid var(--line);
  font-family: var(--mono);
  font-size: .61rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.plan-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.legend-swatch {
  display: inline-block;
  width: .85rem;
  height: .55rem;
  border: .0625rem solid var(--survey-blue-deep);
}

.swatch-paver {
  background: var(--concrete);
}

.swatch-joint {
  background: var(--orange);
  border-color: var(--orange-deep);
}

.swatch-bed {
  background: repeating-linear-gradient(135deg, var(--survey-blue-soft) 0 .14rem, transparent .14rem .3rem);
}

.status-message,
.error-summary {
  padding: var(--space-3) var(--space-4);
  color: var(--survey-blue-deep);
  background: var(--survey-blue-faint);
  border-left: .2rem solid var(--survey-blue);
  font-size: .77rem;
}

.status-message:empty {
  display: none;
}

.error-summary {
  color: var(--danger);
  background: #fae8de;
  border-left-color: var(--danger);
}

.metrics-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--survey-blue-deep);
  border-color: var(--survey-blue-deep);
  box-shadow: var(--shadow);
}

.metrics-panel .section-kicker,
.metrics-panel .metric-label {
  color: var(--survey-blue-soft);
}

.metric-lead {
  min-width: 0;
  padding-right: var(--space-4);
  border-right: .0625rem solid rgba(195, 220, 227, .3);
}

.metric-value {
  margin: var(--space-2) 0 0;
  color: var(--paper-light);
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  line-height: 1;
}

.metric-sub {
  margin: var(--space-2) 0 0;
  color: var(--survey-blue-soft);
  font-family: var(--mono);
  font-size: .72rem;
}

.metric-grid {
  display: grid;
  align-content: center;
  gap: var(--space-4);
}

.metric-cell {
  display: grid;
  gap: var(--space-1);
}

.metric-cell strong {
  color: var(--paper-light);
  font-family: var(--mono);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.metric-cell small {
  color: var(--survey-blue-soft);
  font-size: .67rem;
}

.table-panel {
  overflow: hidden;
}

.table-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
}

.table-note {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .58rem;
  text-align: right;
}

.table-wrap {
  overflow-x: auto;
  border-top: .0625rem solid var(--line);
}

.results-table {
  width: 100%;
  min-width: 31rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.results-table th,
.results-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: .0625rem solid var(--line);
  text-align: right;
  vertical-align: top;
}

.results-table thead th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.results-table thead th:first-child,
.results-table tbody th {
  text-align: left;
}

.results-table tbody th {
  min-width: 9rem;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

.results-table td {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: .77rem;
}

.results-table td small {
  color: var(--muted);
  font-size: .64rem;
  white-space: nowrap;
}

.row-dot {
  display: inline-block;
  width: .48rem;
  height: .48rem;
  margin-right: var(--space-2);
  vertical-align: .04rem;
  border-radius: 50%;
}

.dot-bed {
  background: var(--survey-blue);
}

.dot-joint {
  background: var(--orange);
}

.row-total th,
.row-total td {
  color: var(--survey-blue-deep);
  background: var(--survey-blue-faint);
  border-bottom: 0;
  font-weight: 700;
}

.cost-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-5);
  background: var(--orange-wash);
}

.cost-strip span {
  color: var(--orange-deep);
  font-family: var(--mono);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cost-strip strong {
  color: var(--orange-deep);
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -.03em;
}

.cost-strip small {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: .66rem;
}

.result-actions {
  padding: 0 var(--space-1);
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: .0625rem solid var(--line-strong);
}


.details-content p {
  color: var(--ink-soft);
  font-size: .77rem;
  line-height: 1.65;
}


.note-details {
  border: .0625rem solid var(--line);
  background: rgba(250, 248, 242, .55);
}

.note-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  color: var(--survey-blue-deep);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  list-style: none;
  text-transform: uppercase;
}

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

.note-details summary span {
  color: var(--orange-deep);
  font-size: 1rem;
}

.details-content {
  padding: 0 var(--space-4) var(--space-4);
  border-top: .0625rem solid var(--line);
}

.details-content p {
  margin: var(--space-3) 0 0;
  font-size: .72rem;
}

.details-content strong {
  color: var(--ink);
}


.site-footer {
  display: flex;
  justify-content: space-between;
  width: min(100% - 3rem, 76rem);
  margin: 0 auto;
  padding: var(--space-5) 0 var(--space-8);
  color: var(--muted);
  border-top: .0625rem solid var(--line);
  font-family: var(--mono);
  font-size: .59rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.noscript-message {
  position: fixed;
  z-index: 10;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  padding: var(--space-4);
  color: var(--paper-light);
  background: var(--danger);
  border-radius: var(--radius-sm);
  text-align: center;
}

@media (max-width: 62rem) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .results-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .plan-panel,
  .metrics-panel,
  .status-message,
  .error-summary,
  .table-panel,
  .result-actions {
    grid-column: 1 / -1;
  }

  .results-column .metrics-panel {
    order: 2;
  }

  .results-column .table-panel {
    order: 3;
  }

  .results-column .result-actions {
    order: 4;
  }
}

@media (max-width: 48rem) {
  .header-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 2rem, 76rem);
  }

  .page-shell {
    padding-top: var(--space-8);
  }

  .intro {
    align-items: flex-start;
    margin-bottom: var(--space-8);
    padding-left: var(--space-4);
  }

  .intro-stamp {
    display: none;
  }

  .notes-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

@media (max-width: 38rem) {
  .header-inner {
    min-height: 4.25rem;
  }

  .header-note {
    gap: var(--space-2);
    font-size: .54rem;
  }

  .header-note .header-divider,
  .header-note span:last-child {
    display: none;
  }

  h1 {
    font-size: clamp(2.7rem, 15vw, 4.2rem);
  }

  .lede {
    font-size: .91rem;
  }

  .input-panel {
    padding: var(--space-4);
  }

  .field-row,
  .field-row-top {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .unit-field {
    max-width: none;
  }

  .shape-options {
    gap: var(--space-1);
  }

  .shape-option {
    flex-direction: column;
    gap: var(--space-1);
    min-height: 3.5rem;
    padding: var(--space-2) var(--space-1);
    font-size: .57rem;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .button {
    flex: 1 1 auto;
  }

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

  .metric-lead {
    padding-right: 0;
    padding-bottom: var(--space-4);
    border-right: 0;
    border-bottom: .0625rem solid rgba(195, 220, 227, .3);
  }

  .plan-heading,
  .table-heading,
  .plan-legend,
  .cost-strip {
    padding-right: var(--space-4);
    padding-left: var(--space-4);
  }

  .plan-surface,
  .plan-svg {
    min-height: 15rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .button {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-2);
  }
}

@media print {
  :root {
    --paper: #fff;
    --paper-light: #fff;
    --ink: #000;
    --ink-soft: #222;
    --line: #aaa;
  }

  body {
    background: #fff;
    font-size: 10pt;
  }

  body::before,
  .site-header,
  .intro-stamp,
  .input-panel,
  .status-message,
  .error-summary,
  .result-actions,
  .notes-grid,
  .site-footer,
  .skip-link,
  .no-print {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .intro {
    display: block;
    margin: 0 0 1rem;
    border-left: .2rem solid #000;
    padding-left: .75rem;
  }

  h1 {
    margin-bottom: .3rem;
    font-size: 2.1rem;
  }

  .lede {
    font-size: .8rem;
  }

  .app-grid,
  .results-column {
    display: block;
  }

  .plan-panel,
  .metrics-panel,
  .table-panel {
    margin-bottom: 1rem;
    box-shadow: none;
  }

  .plan-panel {
    break-inside: avoid;
  }

  .plan-surface {
    min-height: 12rem;
  }

  .plan-svg {
    min-height: 12rem;
  }

  .metrics-panel {
    color: #000;
    background: #eee;
    border-color: #888;
  }

  .metrics-panel .section-kicker,
  .metrics-panel .metric-label,
  .metric-value,
  .metric-cell strong,
  .metric-sub,
  .metric-cell small {
    color: #000;
  }

  .results-table th,
  .results-table td {
    padding: .4rem;
  }

  .cost-strip {
    background: #eee;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
