:root {
  color-scheme: light;
  font: 100%/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #192820;
  background: #f5f7f5;
  --paper: #fff;
  --muted: #536159;
  --border: #d5ddd6;
  --accent: #26533e;
  --focus: #2a6e50;
  --tint: #edf5ee;
  --error: #9b272a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

h2,
h3,
legend {
  line-height: 1.25;
}

h2 {
  font-size: 1.375rem;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.shell {
  width: min(73rem, 100% - 3.5rem);
  margin-inline: auto;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-header a {
  font-weight: 650;
}

.preview-notice {
  padding-block: 0.375rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-header nav a {
  display: inline-block;
  padding-block: 0.625rem;
  font-size: 0.9375rem;
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding-block: 0.625rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 1.5rem;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 0.25rem;
  background:
    linear-gradient(var(--paper), var(--paper)) center / 2px 100% no-repeat,
    linear-gradient(var(--paper), var(--paper)) center / 100% 2px no-repeat,
    var(--accent);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 2.625rem 2rem;
}

.hero h1 {
  font: 700 clamp(2.65rem, 5.3vw, 4.4rem)/1.02 Georgia, "Times New Roman", serif;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 37rem;
  margin-top: 0.875rem;
  color: var(--muted);
  font-size: 1.125rem;
}

.tile-sample {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 2.875rem);
  gap: 0.25rem;
  padding: 0.5rem;
  margin-inline-end: 2.75rem;
  transform: rotate(-7deg);
  border-radius: 0.625rem;
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: 0 0.5rem 1.25rem #19282012;
}

.tile-sample span {
  aspect-ratio: 1;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, #ffffff25, transparent), var(--tile);
  box-shadow: inset 0 0 0 1px #19282018;
}

.tile-sample span:nth-child(3n + 1) {
  --tile: #36614c;
}

.tile-sample span:nth-child(3n + 2) {
  --tile: #7b9f8e;
}

.tile-sample span:nth-child(3n) {
  --tile: #c7d7c9;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.96fr);
  gap: 1.375rem;
  align-items: start;
}

.panel {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0 0.25rem 0.875rem #19282008;
}

.panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  gap: 0.5rem 1rem;
  margin-bottom: 1.125rem;
}

#planner-heading,
#estimate-heading {
  scroll-margin-top: 1rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font: 650 0.9375rem/1.25 system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
}

.button-neutral {
  border: 1px solid var(--border);
  color: var(--accent);
  background: var(--paper);
}

.button-neutral:hover {
  background: var(--tint);
  border-color: #aac0b1;
}

.button-primary {
  border: 1px solid var(--accent);
  color: var(--paper);
  background: var(--accent);
}

.button-primary:hover {
  background: #1b4230;
}

.form-section {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.form-section + .form-section,
.quote-toggle + .form-section {
  margin-top: 1.375rem;
}

.form-section legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem 0.875rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.area-mode-field {
  max-width: 18rem;
  margin-bottom: 0.875rem;
}

.room-measurements,
.room {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.room-measurements {
  margin-bottom: 0.875rem;
}

.room-measurements > .field-help {
  margin-top: 0;
}

.room-list {
  display: grid;
  gap: 0.625rem;
  margin-block: 0.625rem;
}

.room {
  padding: 0.5rem 0.75rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #f5f7f5;
}

.room legend {
  margin-bottom: 0;
  padding-inline: 0.25rem;
  font-size: 0.9375rem;
}

.room-dimensions .field-control input {
  padding-inline-end: 2.15rem;
}

.remove-room {
  margin-top: 0.5rem;
}

.optional,
.field-help,
.material-note {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.field-help {
  margin-top: 0.5rem;
}

.field-control {
  position: relative;
}

.field input,
.field select {
  display: block;
  width: 100%;
  min-height: 2.875rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid #aebcb1;
  border-radius: 0.5rem;
  background: var(--paper);
  color: inherit;
  font: inherit;
}

.field input::placeholder {
  color: #64736a;
}

.field-control input {
  padding-inline-end: 4rem;
}

.unit {
  position: absolute;
  inset-inline-end: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--error);
  font-size: 0.875rem;
}

.quote-toggle {
  margin-top: 0.875rem;
}

.quote-details {
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 1rem;
  margin-top: 1.125rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.draft-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.75rem;
  margin-top: 0.625rem;
}

.save-draft {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.save-draft input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--accent);
}

.draft-status {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.875rem;
}

.draft-status:not(:empty) {
  margin-top: 0.375rem;
}

.edit-inputs {
  display: none;
  padding-block: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.empty-estimate,
.target {
  padding: 1rem 1.125rem;
  border-radius: 0.625rem;
  background: #f2f6f2;
}

.empty-estimate {
  color: var(--muted);
}

.empty-title {
  margin-bottom: 0.375rem;
  font-weight: 700;
  color: #192820;
}

.target {
  margin-top: 1rem;
}

.target-label {
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 650;
}

.target-value {
  margin-top: 0.125rem;
  font-size: 1.125rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.target-detail {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.comparison {
  margin-top: 1rem;
  padding-inline-start: 0.875rem;
  border-inline-start: 3px solid #75a389;
}

.comparison-title {
  font-size: 1.125rem;
  font-weight: 750;
  color: var(--accent);
  overflow-wrap: anywhere;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.quote-table thead th:first-child {
  width: 40%;
}

.quote-table th,
.quote-table td {
  padding: 0.5rem 0.375rem;
  border-bottom: 1px solid var(--border);
  text-align: end;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.quote-table th:first-child {
  padding-inline-start: 0;
  text-align: start;
}

.quote-table th:last-child,
.quote-table td:last-child {
  padding-inline-end: 0;
}

.quote-table th[scope="row"],
.quote-table td {
  font-size: 0.9375rem;
}

.quote-table th[scope="row"] {
  font-weight: 500;
}

.quote-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.quote-table .key-metric th,
.quote-table .key-metric td {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 750;
}

.material-note {
  margin-top: 0.75rem;
}

.checklist {
  margin-top: 1.25rem;
}

.example-dialog {
  width: min(26rem, 100% - 2rem);
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--paper);
  color: inherit;
}

.example-dialog::backdrop {
  background: #19282066;
}

.example-dialog p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.checklist-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

.copy-status:not(:empty) {
  margin-top: 0.5rem;
  color: var(--accent);
  font-size: 0.875rem;
}

.checklist details {
  margin-top: 0.5rem;
}

.checklist summary,
.quote-details summary {
  width: fit-content;
  padding-block: 0.625rem;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.checklist pre,
.print-sheet pre {
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.checklist pre {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: #f2f6f2;
}

.guide {
  margin-block: 2.75rem 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 1rem;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.guide p {
  margin-top: 0.375rem;
  color: var(--muted);
}

.worked-example {
  max-width: 60rem;
  margin-top: 1.5rem;
}

.site-footer {
  padding-block: 1.125rem;
  border-top: 1px solid var(--border);
  background: var(--paper);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.privacy {
  padding-bottom: 3rem;
}

.privacy section {
  max-width: 42rem;
  margin-top: 1.5rem;
}

.privacy section p {
  margin-top: 0.5rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.noscript {
  margin-bottom: 1rem;
  color: var(--error);
}

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

.print-sheet {
  display: none;
}

@media (max-width: 54rem) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .edit-inputs {
    display: inline-block;
  }
}

@media (max-width: 42rem) {
  .shell {
    width: calc(100% - 2rem);
  }

  .hero {
    padding-block: 1.875rem 1.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .tile-sample {
    display: none;
  }

  .panel {
    padding: 1rem;
  }

  .guide-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 32rem) {
  .field-control input {
    padding-inline-end: 3.25rem;
  }

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

  .quote-table thead th:first-child {
    width: 35%;
  }

  .quote-table th,
  .quote-table td {
    padding-inline: 0.25rem;
  }
}

@media (max-width: 24rem) {
  .field-grid:not(.room-dimensions) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@page {
  margin: 16mm;
}

@media print {
  :root,
  body {
    color: #000;
    background: #fff;
  }

  body > :not(.print-sheet) {
    display: none;
  }

  .print-sheet {
    display: block;
    font-size: 11pt;
  }
}
