:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
  color: #19343c;
  background: #f3f1eb;
  --ink: #19343c;
  --muted: #40585d;
  --paper: #fffefa;
  --edge: #c9ccc3;
  --teal: #126459;
  --focus: #b84e21;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.52; }
a { color: var(--teal); text-underline-offset: .23em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; line-height: 1.12; }
h2 { font-size: 1.33rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; }

.shell { width: min(72rem, calc(100% - 4rem)); margin-inline: auto; }
.site-header {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--edge);
}
.site-header > a:last-child { font-size: .91rem; }
.brand {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 720;
  letter-spacing: -.025em;
  text-decoration: none;
}
.mark {
  width: 1.15rem;
  height: 1.15rem;
  background: #c45528;
  clip-path: polygon(0 0, 100% 0, 100% 42%, 45% 42%, 45% 100%, 0 100%);
}
.intro { padding: 2.6rem 0 2.15rem; }
.intro h1 {
  font-size: clamp(2.55rem, 6vw, 4.85rem);
  font-weight: 750;
  letter-spacing: -.066em;
}
.intro p { max-width: 39rem; margin-top: .85rem; color: var(--muted); font-size: 1.07rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.46fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.worksheet, .estimate { border-radius: .9rem; padding: clamp(1rem, 2.55vw, 1.8rem); }
.worksheet { background: var(--paper); border: 1px solid var(--edge); }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.mobile-estimate { display: none; }
.unit-switch { display: flex; align-items: center; gap: .45rem; }
.sample-label, .placement-toggle p, .options p, .plan p { margin-top: .6rem; color: var(--muted); font-size: .88rem; }
.section {
  margin: 1rem 0 0;
  min-width: 0;
  padding: .7rem .95rem .95rem;
  border: 1px solid var(--edge);
  border-radius: .45rem;
}
.section legend { padding: 0 .34rem; font-size: .89rem; font-weight: 700; }
.section-top { display: flex; align-items: end; justify-content: space-between; gap: .6rem; margin-bottom: .8rem; }
.section-top label { flex: 1; max-width: 17rem; }
.section-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .95rem; margin-top: .9rem; }
.measurements, .settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.offsets { border-top: 1px solid var(--edge); padding-top: .7rem; margin-top: .75rem; }
label { color: var(--ink); font-size: .88rem; font-weight: 650; }
.unit { color: var(--muted); font-weight: 500; }
input[type=number], select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  border: 1px solid #aab4ad;
  border-radius: .3rem;
  background-color: #fff;
  color: var(--ink);
  padding: .43rem .55rem;
  margin-top: .27rem;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 550;
}
select { appearance: none; padding-right: 1.45rem; background-image: linear-gradient(46deg, transparent 50%, var(--ink) 51%), linear-gradient(134deg, var(--ink) 50%, transparent 51%); background-position: calc(100% - .83rem) center, calc(100% - .53rem) center; background-size: .33rem .32rem; background-repeat: no-repeat; }
.unit-switch select { width: auto; margin-top: 0; font-size: .9rem; }
.primary, .copy { border: 0; border-radius: .3rem; padding: .6rem .9rem; font-size: .91rem; font-weight: 700; }
.primary { background: var(--teal); color: #fff; }
.text-button, .remove { border: 0; background: transparent; color: var(--teal); font-size: .85rem; padding: .45rem 0; font-weight: 650; text-decoration: underline; text-underline-offset: .25em; }
.remove { flex: 0 0 auto; }
.placement-toggle { margin-top: 1rem; }
.check { display: inline-flex; align-items: center; min-height: 2rem; gap: .55rem; font-size: .96rem; }
.check input { width: 1.12rem; height: 1.12rem; accent-color: var(--teal); margin: 0; }
.placement-toggle p { margin-top: .18rem; }
.options { border-top: 1px solid var(--edge); margin-top: 1rem; padding-top: .65rem; }
.options summary { font-size: .99rem; font-weight: 700; cursor: pointer; padding: .3rem 0; }
.settings-grid { margin-top: .65rem; }
.settings-grid input::placeholder { font-weight: 420; }

.estimate { position: sticky; top: 1rem; color: #fbfcf8; background: #19343c; }
.estimate h2 { font-size: 1.05rem; color: #d6e9e3; }
.headline-number {
  min-height: 4.2rem;
  font-size: clamp(2.85rem, 6.5vw, 4.8rem);
  line-height: 1;
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  overflow-wrap: anywhere;
  margin-top: .7rem;
}
.headline-number span { font-size: .48em; letter-spacing: -.02em; color: #adDcd1; }
.equivalent { color: #d6e9e3; font-size: 1rem; margin-top: .35rem; }
.tally { margin: 1.1rem 0; }
.tally div { display: flex; gap: .7rem; justify-content: space-between; align-items: baseline; padding: .56rem 0; border-top: 1px solid #527379; }
.tally dt { color: #e2ebe6; font-size: .93rem; }
.tally dd { text-align: right; margin: 0; font-variant-numeric: tabular-nums; font-size: .93rem; font-weight: 680; overflow-wrap: anywhere; }
.error { padding: .6rem; background: #f8ded0; color: #652c17; border-radius: .25rem; margin-top: .7rem; }
.copy { color: #123c39; background: #c7e8db; }
.copy:focus-visible { outline-color: #fff; }
#copy-status { margin-inline-start: .4rem; font-size: .84rem; }
.plan { margin: 1rem 0; }
.plan canvas { display: block; width: 100%; height: auto; border-radius: .25rem; border: 1px solid #57747b; background-color: #213e47; }
.plan p { color: #d6e9e3; margin-top: .25rem; }

.method { padding: 2.6rem 0; border-bottom: 1px solid var(--edge); scroll-margin: 1rem; }
main.method > p { max-width: 42rem; margin: 1rem 0 0; }
.methods { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); margin: 1rem 0; }
.methods p { color: var(--muted); margin-top: .5rem; }
.limit { color: var(--muted); font-size: .92rem; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding-block: 1.3rem; font-size: .9rem; }
.notice { padding: .7rem; background: #f8ded0; margin-bottom: 1rem; }

@media (max-width: 49rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .estimate { position: static; }
  .mobile-estimate {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .65rem;
    margin-top: .8rem;
    padding: .5rem .7rem;
    background: #e4f0e9;
    border-radius: .3rem;
    font-size: .87rem;
  }
  #mobile-total { color: var(--ink); font-size: 1.05rem; font-weight: 720; font-variant-numeric: tabular-nums; }
}

@media (max-width: 37rem) {
  .shell { width: calc(100% - 1.8rem); }
  .site-header { min-height: 3.7rem; }
  .intro { padding-block: 1.55rem 1.3rem; }
  .intro p { font-size: 1rem; }
  .measurements, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .methods { grid-template-columns: 1fr; }
}

@media (max-width: 22rem) {
  .section-bar { align-items: start; flex-direction: column; }
  .section { padding-inline: .6rem; }
  .section-top { align-items: start; flex-direction: column; }
  .section-top label { width: 100%; }
}
