:root {
  color-scheme: light;
  --ink: #21352f;
  --muted: #596c65;
  --line: #cbd6cf;
  --paper: #f6f4ee;
  --card: #fffefa;
  --green: #245b46;
  --green-dark: #194733;
  --soft-green: #d9ebe1;
  --soft-peach: #efc7a1;
  --soft-gold: #e8d8b7;
  --corner: #c98f63;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; line-height: 1.55; }
a { color: #175942; }
.site-header, main, footer { width: min(100% - 2rem, 920px); margin-inline: auto; }
.site-header { padding: 1.2rem 0 0.5rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.brand { font-weight: 750; font-size: 1.1rem; text-decoration: none; color: var(--ink); }
nav { display: flex; gap: 0.55rem; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
nav a { color: inherit; }
main { padding-bottom: 2.5rem; }
.intro { padding: 1.2rem 0 0.7rem; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; color: var(--green); font-size: 0.78rem; font-weight: 700; }
h1, h2, h3, h4 { line-height: 1.2; }
h1 { margin: 0.35rem 0 0.8rem; font-size: clamp(2rem, 5vw, 3rem); max-width: 20ch; }
h2 { font-size: 1.45rem; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; margin: 1.1rem 0 0.55rem; }
.example, .limit-note { border-radius: 0.65rem; padding: 0.85rem 1rem; }
.example { background: #e8efe8; border-left: 4px solid var(--green); margin: 1rem 0; }
.example p { margin: 0.25rem 0 0; }
.limit-note { background: #f0ede3; color: #394b44; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 0.85rem; padding: clamp(1rem, 3vw, 1.5rem); margin: 1rem 0; box-shadow: 0 2px 8px rgb(27 51 41 / 5%); }
.fields { display: grid; gap: 1rem; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 0.35rem; font-weight: 650; }
input, select { width: 100%; min-height: 2.8rem; border: 1px solid #9caf9f; border-radius: 0.45rem; background: #fff; color: var(--ink); padding: 0.55rem 0.7rem; font: inherit; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #8bb79e; outline-offset: 2px; }
.input-with-unit { display: flex; align-items: center; border: 1px solid #9caf9f; border-radius: 0.45rem; background: #fff; }
.input-with-unit input { border: 0; min-width: 0; }
.input-with-unit span { padding: 0 0.8rem; color: var(--muted); }
.field-help { color: var(--muted); font-size: 0.92rem; margin: 0.65rem 0 1rem; }
fieldset { border: 1px solid var(--line); border-radius: 0.55rem; padding: 0.8rem; margin: 1.1rem 0; }
legend { font-weight: 700; padding: 0 0.35rem; }
button { border: 0; border-radius: 0.45rem; padding: 0.72rem 1rem; min-height: 2.85rem; font: inherit; font-weight: 700; color: white; background: var(--green); cursor: pointer; }
button:hover:not(:disabled) { background: var(--green-dark); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
button.secondary { color: var(--green-dark); background: #e1eee5; border: 1px solid #94b6a0; }
.error { margin: 1rem 0 0; padding: 0.75rem; border-radius: 0.45rem; background: #fff0ee; border: 1px solid #bf6459; color: #762a22; font-weight: 650; }
.results { border-top: 5px solid var(--green); }
.result-summary { background: #f1f5f0; padding: 0.9rem 1rem; border-radius: 0.55rem; }
.result-summary ul, .spacer-results ul { padding-left: 1.3rem; }
.finished-size { font-size: 1.15rem; margin-top: 0; }
.diagram-panel { margin-top: 1rem; }
.diagram-wrap { background: #f8f7f2; border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.65rem; }
.assembly-diagram { display: block; width: 100%; max-height: 540px; min-height: 190px; }
.diagram-caption, .rounding-note { font-size: 0.9rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 0.65rem 1.2rem; list-style: none; padding: 0; }
.legend li { display: flex; gap: 0.45rem; align-items: center; }
.swatch { width: 1rem; height: 1rem; border: 1px solid #5f6e63; border-radius: 0.2rem; }
.center-swatch { background: var(--soft-green); }
.spacer-swatch { background: var(--soft-peach); }
.block-swatch { background: var(--soft-gold); }
.corner-swatch { background: var(--corner); }
.cut-list { padding-left: 1.3rem; }
.cut-list li { margin: 0.4rem 0; }
.steps { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.4rem; }
.privacy { font-size: 0.92rem; }
.privacy h2 { font-size: 1.2rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding: 1rem 0 1.5rem; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 620px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .two-columns { grid-template-columns: 1fr; }
  .panel { border-radius: 0.65rem; }
  footer { flex-direction: column; gap: 0.2rem; }
}

@media print {
  body { background: #fff; color: #000; font-size: 9pt; line-height: 1.25; }
  .site-header, .intro, .planner, .guide, .privacy, footer, .actions { display: none !important; }
  main { width: 100%; padding: 0; }
  .results { display: grid !important; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0.06in 0.22in; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .results > h2, .result-summary, .steps, .rounding-note { grid-column: 1 / -1; }
  .results > h2 { font-size: 16pt; margin: 0 0 0.06in; }
  .result-summary { padding: 0.08in 0.12in; }
  .result-summary ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.2in; margin: 0.04in 0 0; }
  .result-summary li { margin: 0; }
  .finished-size { font-size: 10pt; margin: 0; }
  .diagram-panel { grid-column: 1; margin: 0; break-inside: avoid; }
  .spacer-results, .cutting-results { grid-column: 2; margin: 0; break-inside: avoid; }
  .diagram-panel h3, .spacer-results h3, .cutting-results h3, .steps h3 { font-size: 10pt; margin: 0.05in 0 0.03in; }
  .diagram-caption { font-size: 7.5pt; margin: 0.02in 0 0.04in; }
  .diagram-wrap { border: 0; padding: 0; }
  .assembly-diagram { display: block; width: 100%; height: 2.8in; max-height: 2.8in; min-height: 0; margin: 0 auto; }
  .legend { gap: 0.02in 0.12in; margin: 0.04in 0; font-size: 7.5pt; }
  .legend li { gap: 0.03in; }
  .swatch { width: 0.12in; height: 0.12in; }
  .spacer-results ul, .cut-list { margin: 0.03in 0; padding-left: 0.18in; }
  .spacer-results li, .cut-list li { margin: 0.03in 0; }
  .spacer-results p, .cutting-results p, .steps li { margin: 0.03in 0; }
  .steps { border-top: 1px solid #777; margin-top: 0.04in; padding-top: 0.03in; break-inside: avoid; }
  .steps ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.15in; padding-left: 0.2in; margin: 0; }
  .rounding-note { margin: 0.02in 0 0; font-size: 7.5pt; }
  .result-summary, .diagram-panel, .spacer-results, .cutting-results, .steps { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
