@font-face {
  font-family: "DM Sans";
  src: url("dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f7f7ef;
  --white: #fffefa;
  --ink: #21392b;
  --muted: #566456;
  --pine: #1d3a2b;
  --green: #375a40;
  --sage: #edf2e7;
  --line: #dce2d5;
  --input-line: #c7d0c1;
  --display: "Instrument Serif", Georgia, serif;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  scroll-padding-top: 118px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
a { color: inherit; }
input, select, textarea, button { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid #537b51;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell {
  width: min(100% - 28px, 1240px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 12px;
  padding-block: 9px 7px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.035em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: var(--pine);
}

.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 9px;
  height: 15px;
  border-radius: 85% 0 85% 0;
}

.brand-mark::before {
  left: 9px;
  background: #afc4a4;
  transform: rotate(-52deg) scale(.8);
  transform-origin: bottom right;
}

.brand-mark::after {
  left: 15px;
  background: #e0ebd5;
  transform: rotate(13deg);
}

.mobile-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 6px;
  color: var(--muted);
  font-size: .75rem;
}

.mobile-total strong {
  font-size: .96rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.header-inner nav {
  display: flex;
  align-items: center;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 4px;
}

.header-inner nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}

.header-inner nav a:hover { background: var(--sage); }
.header-inner .nav-proposal { color: var(--white); background: var(--pine); }
.header-inner .nav-proposal:hover { background: var(--green); }
.page { padding-block: 16px 48px; }

.hero {
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  background: var(--pine);
  color: var(--white);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(92deg, #193527 0%, #193527e8 32%, #1935278a 100%),
    url("garden.webp") 62% 58% / cover no-repeat;
}

.hero-content { padding: 24px 18px 20px; }

.hero h1, .section-title, .proposal-paper > h3 {
  font-family: var(--display);
  font-weight: 400;
}

.hero h1 {
  font-size: clamp(2.55rem, 8.7vw, 4.45rem);
  line-height: .99;
  letter-spacing: -.012em;
}

.hero p {
  max-width: 28em;
  margin-top: 10px;
  color: #eef3e8;
  font-size: .94rem;
}

.samples {
  margin-top: 22px;
  display: grid;
  gap: 8px;
}

.samples > span {
  color: #e0ebd5;
  font-size: .78rem;
  font-weight: 650;
}

.sample-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sample-buttons button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #dfeadd70;
  border-radius: 7px;
  color: var(--white);
  background: #193527aa;
  font-size: .82rem;
  font-weight: 650;
}

.sample-buttons button:hover { background: #325742; }
.sample-buttons [aria-current="true"] {
  background: #edf2e7;
  border-color: #edf2e7;
  color: var(--pine);
}

.sample-buttons [aria-current="true"]:hover { background: #dfead7; }
.sample-buttons button:focus-visible { outline-color: #e0ebd5; }

.workbench {
  display: grid;
  gap: 28px;
  margin-block: 26px 32px;
}

.workbench > section, .proposal-layout > * { min-width: 0; }
.section-title { font-size: clamp(1.9rem, 5.7vw, 2.4rem); line-height: 1.08; }
.workbench .section-title { margin-bottom: 13px; }
.panel-stack, .proposal-layout { display: grid; gap: 12px; }

.panel, .proposal-paper {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  padding: 15px;
}

.panel h3 {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.02em;
}

.panel > h3 { margin-bottom: 12px; }

.card-heading, .row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-heading { margin-bottom: 10px; }
.card-heading h3 { min-width: 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--green);
  background: transparent;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.button-outline { border-color: var(--input-line); }
.button-outline:hover, .button-subtle:hover { background: var(--sage); }
.button-primary { background: var(--pine); color: var(--white); }
.button-primary:hover { background: var(--green); }

.field-grid, .garden-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.field {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  font-size: .83rem;
  font-weight: 650;
}

input, textarea, select, .unit-input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--input-line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

input::placeholder, textarea::placeholder { color: #69776b; opacity: 1; }
input[type="number"] { appearance: textfield; font-variant-numeric: tabular-nums; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input:invalid { border-color: #9d4b31; }
textarea { display: block; resize: vertical; }
select { padding-right: 18px; }

.unit-input {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-block: 0;
}

.unit-input:focus-within {
  outline: 2px solid #537b51;
  outline-offset: 2px;
}

.unit-input:has(input:invalid) { border-color: #9d4b31; }
.unit-input > input {
  min-height: 42px;
  padding: 7px 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
}

.unit-input > span {
  flex: none;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
}

.count-input > input::placeholder { color: var(--ink); }
.count-input > input:not(:placeholder-shown) + span { display: none; }
.currency-input > input { text-align: right; }

.metric {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.garden-grid > .metric {
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--sage);
}

.metric dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.25;
}

.metric dd {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.patio-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  border-radius: 8px;
  background: var(--sage);
}

.patio-metrics .metric { align-content: space-between; gap: 4px; padding: 9px 8px; }
.patio-metrics .metric + .metric { border-left: 1px solid #d9e3d6; }
.patio-metrics dt { font-size: .74rem; }

.measure-list { display: grid; gap: 8px; }
.measure-row {
  min-width: 0;
  padding: 0 10px 10px;
  background: #f8f9f3;
  border: 1px solid #e4e9df;
  border-radius: 9px;
}

.row-heading h4 { font-size: .83rem; font-weight: 700; }
.row-heading .button { padding-inline: 6px; }
.garden-grid > .measure-area { background: #e9eee3; }
.hint { color: var(--muted); font-size: .82rem; }
.measure-list:not(:empty), #fence-help { margin-bottom: 10px; }
#fence-runs { margin-bottom: 0; }
.patio-settings { margin-top: 11px; }
.fence-height { grid-column: 1 / -1; }
.fence-counts { margin-top: 10px; }

.optional {
  margin-left: 4px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 500;
}

.extras-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }

.cost-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px 10px;
  margin-bottom: 10px;
  padding: 13px 15px;
  background: var(--pine);
  border: 1px solid var(--pine);
  border-radius: 11px;
  color: var(--white);
}

.cost-total span { font-size: .88rem; font-weight: 600; }
.cost-total strong {
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.rate-panel .card-heading { margin-bottom: 1px; }
.rate-panel > .hint { margin-bottom: 16px; }

.rate-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rate-group + .rate-group { margin-top: 13px; }

.rate-group legend {
  width: 100%;
  padding: 7px 0 3px;
  border-top: 1px solid var(--line);
  color: var(--green);
  font-size: .79rem;
  font-weight: 700;
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(95px, 29%);
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: .88rem;
  font-weight: 650;
}

.rate-row small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.proposal-editor .field + .field { margin-top: 11px; }
.proposal-paper { padding: 15px 12px; }
.proposal-paper > h3 { font-size: clamp(1.9rem, 6vw, 2.8rem); line-height: 1.05; }

.proposal-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 10px;
  margin-block: 14px;
}

.proposal-details dt, .proposal-scope h4 { color: var(--muted); font-size: .79rem; font-weight: 700; }
.proposal-details dd, .proposal-scope p {
  font-size: .9rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.proposal-scope { margin-bottom: 16px; }
.proposal-scope p { margin-top: 3px; }
.quote-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .78rem;
  line-height: 1.32;
  font-variant-numeric: tabular-nums;
}

.quote-table thead { background: var(--sage); }
.quote-table :is(th, td) { padding: 7px 4px; text-align: right; overflow-wrap: anywhere; vertical-align: top; }
.quote-table :is(th, td):first-child { text-align: left; }
.quote-table thead th:first-child { width: 35%; }
.quote-table thead th:nth-child(2) { width: 18%; }
.quote-table thead th:nth-child(4) { width: 24%; }
.quantity-short { display: none; text-decoration: none; }
.quote-table tbody tr { border-bottom: 1px solid var(--line); }
.quote-table tbody th { font-weight: 650; }
.quote-table tbody small { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; font-weight: 400; }
.quote-table tfoot { background: var(--sage); font-weight: 700; }
.quote-table tfoot :is(th, td) { padding-block: 10px; }

@media screen and (max-width: 639px) {
  .quote-table { font-size: .75rem; }
  .quote-table :is(th, td) { padding-inline: 3px; }
  .quote-table thead th:first-child { width: 29%; }
  .quote-table thead th:nth-child(2) { width: 24%; }
  .quote-table thead th:nth-child(4) { width: 26%; }
  .quantity-full { display: none; }
  .quantity-short { display: inline; }
}

@media (min-width: 420px) {
  .shell { width: min(100% - 40px, 1240px); }
  .hero-content { padding-inline: 24px; }
  .panel, .proposal-paper { padding-inline: 18px; }
}

@media (min-width: 640px) {
  :root { scroll-padding-top: 80px; }
  .shell { width: min(100% - 52px, 1240px); }
  .header-inner { display: flex; justify-content: space-between; min-height: 64px; }
  .brand { font-size: 1.05rem; }
  .mobile-total { display: none; }
  .header-inner nav { gap: 11px; }
  .header-inner nav a { padding-inline: 13px; }
  .page { padding-top: 22px; }
  .hero { border-radius: 19px; }
  .hero::before {
    background:
      linear-gradient(90deg, #193527 0%, #193527 37%, #193527bd 49%, #1935271a 80%),
      url("garden.webp") right 57% / 65% auto no-repeat;
  }
  .hero-content { padding: 37px 34px 31px; }
  .hero p { font-size: 1rem; }
  .sample-buttons button { padding-inline: 14px; font-size: .88rem; }
  .section-title { letter-spacing: -.018em; }
  .panel { padding: 17px 20px; }
  .garden-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(107px, .85fr); }
  .garden-grid > .metric {
    grid-column: auto;
    grid-template-columns: auto;
    align-self: stretch;
    gap: 1px;
    padding: 6px 11px;
  }
  .field-grid, .garden-grid { gap: 12px; }
  .fence-dimensions { grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(143px, 1.3fr); }
  .fence-height { grid-column: auto; }
  .patio-metrics .metric { padding: 10px 12px; }
  .patio-metrics dt { font-size: .8rem; }
  .proposal-paper { padding: 22px; }
  .quote-table { font-size: .875rem; }
  .quote-table :is(th, td) { padding-inline: 8px; }
  .quote-table tbody small { font-size: .78rem; }
}

@media (min-width: 900px) {
  .shell { width: min(100% - 80px, 1240px); }
  .hero-content { padding: 38px 44px 32px; }
  .hero h1 { font-size: clamp(3.45rem, 5vw, 4.45rem); }
  .samples { margin-top: 25px; }
  .workbench {
    grid-template-columns: minmax(0, 1.75fr) minmax(315px, 1fr);
    align-items: start;
    gap: 22px;
    margin-block: 29px 36px;
  }
  .proposal-layout { grid-template-columns: minmax(250px, 1fr) minmax(0, 1.9fr); align-items: start; gap: 20px; }
  .proposal-paper { padding: 25px; }
  .rate-row .unit-input { min-height: 36px; }
  .rate-row input { min-height: 34px; padding-block: 5px; font-size: .95rem; }
  .cost-total { padding: 14px 20px; }
}

@media (min-width: 1120px) {
  .workbench { grid-template-columns: minmax(0, 1.95fr) minmax(350px, 1fr); gap: 25px; }
  .logistics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@page { size: A4 portrait; margin: 15mm; }

@media print {
  :root { background: white; color: #17251b; }
  .site-header, .hero, noscript, .workbench, .section-heading, .proposal-editor { display: none !important; }
  .page { width: auto; margin: 0; padding: 0; }
  .proposal-layout { display: block; }
  .proposal-paper { padding: 0; border: 0; background: transparent; }
  .proposal-paper > h3 { font-size: 29pt; }
  .proposal-details { margin-block: 13pt; break-inside: avoid; }
  .proposal-scope h4 { break-after: avoid; }
  .proposal-details dd, .proposal-scope p { font-size: 10.5pt; }
  .quote-table { font-size: 10pt; }
  .quote-table :is(th, td) { padding: 6pt; }
  .quote-table thead, .quote-table tfoot { border-block: 1px solid #b5beb4; }
  .quote-table tfoot { display: table-row-group; }
  .quote-table tr { break-inside: avoid; }
}
