* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font-body); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button { cursor: pointer; min-width: 44px; }
button:disabled { cursor: wait; }
button, input, select, textarea, summary { border-radius: var(--radius); }
button, select, input:not([type=hidden]), summary { min-height: 44px; }
summary { cursor: pointer; padding: 10px 0; }
main { max-width: var(--page-width); margin: auto; padding: 0 32px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; margin: 0; }
h1, h2 { text-wrap: balance; }
h1 { font-size: clamp(44px, 5.4vw, 76px); letter-spacing: -.03em; }
h2 { font-size: clamp(32px, 3.2vw, 40px); letter-spacing: -.025em; }
h3 { font-size: 28px; letter-spacing: -.015em; }
em { color: inherit; font-style: normal; }
.eyebrow, .select-label { font-size: 13px; font-weight: 500; letter-spacing: 0; }
.eyebrow { margin: 0 0 16px; }
.select-label { display: block; margin: 0 0 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 16px; min-height: 48px; padding: 12px 20px; border: 1px solid transparent; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600; text-decoration: none; }
.button:hover { background: var(--hover); color: var(--on-hover); text-decoration: none; }
.button:disabled { background: var(--muted); color: var(--paper); }
.button-secondary, .text-button, .secondary button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--control-border); padding: 8px 12px; background: transparent; color: var(--ink); font-size: 14px; border-radius: var(--radius); }
.button-secondary:hover, .text-button:hover, .secondary button:hover { background: var(--panel); }
.full { width: 100%; margin-top: 24px; }
.secondary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }

/* Phase 1 retains the existing sections and live previews. */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; min-height: 600px; padding: 72px 0 80px; }
.hero-copy { align-self: center; min-width: 0; }
.hero-copy > p:not(.eyebrow) { font-size: 19px; line-height: 1.6; color: var(--muted); margin: 24px 0; }
.hero-note { font-size: 13px; margin-top: 32px; color: var(--muted); }
.hero-note span { margin-right: 12px; }
.hero-stage { position: relative; min-width: 0; background: var(--soft); border-radius: var(--radius); overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; }
.hero-stage canvas { position: absolute; inset: 0; }
.hero-caption { position: absolute; bottom: 16px; left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.round-label { position: absolute; top: 20px; right: 20px; padding: 12px; border: 1px solid var(--control-border); border-radius: var(--radius); font-size: 13px; background: var(--soft); }
.manifesto { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 24px 0; border-block: 1px solid var(--line); font-size: 15px; }
.collection, .studio-section, #saved { padding: 80px 0 0; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.section-heading > p { font-size: 15px; color: var(--muted); margin: 0; max-width: 360px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { background: none; border: 1px solid transparent; border-radius: var(--radius); text-align: left; padding: 0; min-width: 0; overflow: hidden; }
.card[aria-pressed=true] { border-color: var(--ink); background: var(--panel); }
.card-art { aspect-ratio: 1; background: var(--soft); position: relative; overflow: hidden; border-radius: var(--radius); }
.card canvas { transition: transform .3s; }
.card:hover canvas { transform: scale(1.03); }
.number { position: absolute; top: 16px; left: 16px; font-size: 13px; }
.arrow { position: absolute; right: 16px; bottom: 16px; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--control-border); border-radius: var(--radius); }
.card-copy { padding: 20px 12px; }
.card-copy p { font-size: 15px; color: var(--muted); margin: 12px 0; }
.card-copy > span { display: block; font-size: 13px; margin-top: 12px; }

.studio { display: grid; grid-template-columns: 360px minmax(0, 1fr); border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
aside { min-width: 0; padding: 24px; border-right: 1px solid var(--line); }
select { width: 100%; border: 1px solid var(--control-border); background: var(--panel); padding: 8px 12px; font-size: 15px; }
.control-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 24px 0; padding-bottom: 4px; }
.control-tabs button, .view-tabs button, .unit-bar button, .finish-targets button { border: 1px solid transparent; border-radius: var(--radius); background: transparent; font-size: 13px; padding: 8px 12px; }
.control-tabs button { flex: 1; font-size: 14px; }
.control-tabs button[aria-pressed=true], .view-tabs > button[aria-pressed=true], .plant-picker > button[aria-pressed=true], .unit-bar button[aria-pressed=true], .finish-targets button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.control { margin-bottom: 24px; }
.control label { font-size: 14px; }
.control-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.control-heading > label { flex: 1; min-width: 0; }
.number-value { display: flex; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); }
.control input[type=number] { width: 88px; padding: 8px; border: 1px solid var(--control-border); background: var(--panel); font-size: 15px; }
.control .number-value input { width: 80px; text-align: right; }
.control input[type=range] { width: 100%; height: 44px; margin: 4px 0 0; accent-color: var(--accent); cursor: pointer; }
.control small, .control output, .control-intro, .range-ends, .range-info { font-size: 13px; color: var(--muted); }
.control-intro { margin: 0 0 24px; }
.range-ends { display: flex; justify-content: space-between; }
.range-info { border-top: 1px solid var(--line); padding-top: 8px; }
.range-info summary { color: var(--ink); }
.unit-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; font-size: 13px; }
.unit-bar > div, .finish-targets { display: flex; gap: 4px; border: 1px solid var(--control-border); padding: 4px; border-radius: var(--radius); }
.finish { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.finish .select-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.finish .select-label span, .finish small { font-size: 13px; color: var(--muted); }
.finish-targets { margin: 12px 0; }
.finish-targets button { flex: 1; }
#swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; padding: 4px; }
#swatches button { width: 44px; height: 44px; flex: 0 0 44px; background: var(--swatch); border: 1px solid var(--control-border); border-radius: var(--radius); }
#swatches button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
#swatches button:focus-visible { outline-offset: 2px; }
#status { font-size: 13px; color: var(--muted); margin: 12px 0 0; min-height: 44px; }
#print-notes { padding: 12px; margin-top: 12px; background: var(--soft); border-radius: var(--radius); font-size: 13px; }
#print-notes p { margin: 0 0 8px; }
#print-notes p:last-child { margin: 0; }
#drainage-panel { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
#drainage-panel small { font-size: 13px; color: var(--muted); }
.drain-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 8px; }
.drain-fields label { font-size: 13px; }
.drain-fields input { display: block; width: 100%; padding: 8px; margin-top: 8px; background: var(--panel); border: 1px solid var(--control-border); }
.preview { display: flex; flex-direction: column; min-width: 0; background: var(--soft); border-radius: var(--radius); }
.preview-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; align-items: center; padding: 20px 24px; position: relative; z-index: 2; }
.preview-top > span { font-size: 13px; }
.view-tabs { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--control-border); padding: 4px; border-radius: var(--radius); }
.viewport { position: relative; min-height: 440px; flex: 1; }
.viewport canvas { position: absolute; inset: 0; }
.viewport-hint { position: absolute; bottom: 16px; left: 24px; right: 80px; font-size: 13px; color: var(--muted); pointer-events: none; }
#camera-reset { position: absolute; right: 24px; bottom: 12px; background: var(--panel); border: 1px solid var(--control-border); width: 44px; height: 44px; }
.preview-bottom { border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; margin: 0 24px; padding: 20px 0; gap: 16px; font-variant-numeric: tabular-nums; }
.preview-bottom small { display: block; font-size: 13px; color: var(--muted); }
.preview-bottom strong { display: block; font-size: 16px; font-weight: 400; margin-top: 4px; }
#view-note { font-size: 13px; color: var(--muted); padding: 0 24px 20px; margin: 0; }
.plant-picker { position: relative; display: flex; }
.plant-picker > button span { margin-left: 4px; }
.plant-menu { position: absolute; top: calc(100% + 8px); left: 0; width: 184px; padding: 4px; border: 1px solid var(--control-border); border-radius: var(--radius); background: var(--panel); box-shadow: 0 12px 32px #13261d20; z-index: 30; }
.view-tabs .plant-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; }
.view-tabs .plant-menu button:hover { background: var(--soft); }
.view-tabs .plant-menu button[aria-checked=true] { background: var(--ink); color: var(--paper); }
.plant-menu button[aria-checked=true]::after { content: '✓'; }
.print-note { display: flex; gap: 32px; padding: 24px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.print-note span { flex-shrink: 0; font-size: 13px; font-weight: 500; }
.print-note p { font-size: 13px; color: var(--muted); max-width: 850px; margin: 0; }
#saved { padding-bottom: 80px; }
#saved-list { display: flex; flex-wrap: wrap; gap: 12px; }
#saved-list > p { color: var(--muted); }
.saved-item { border: 1px solid var(--control-border); background: var(--panel); padding: 16px 20px; text-align: left; min-width: 210px; max-width: 100%; }
.saved-item strong { display: block; font: 400 24px/1.2 var(--font-display); }
.saved-item small { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.storage-note { font-size: 13px; color: var(--muted); margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.thumbnail-stage { position: fixed; left: -10000px; top: 0; width: 640px; height: 480px; pointer-events: none; }
@media (min-width: 701px) {
  .studio { align-items: start; }
  .preview { position: sticky; top: 20px; height: min(860px, calc(100vh - 40px)); }
  .viewport { min-height: 260px; }
}
@media (max-width: 1000px) {
  .hero { gap: 24px; }
  .hero-stage { min-height: 480px; }
  .hero-caption > span { display: none; }
  .preview-top { align-items: flex-start; flex-direction: column; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  main { padding: 0 16px; }
  .hero { grid-template-columns: 1fr; padding-block: 48px; }
  .hero-stage { min-height: 400px; }
  .hero-copy > p:not(.eyebrow) { font-size: 18px; }
  .hero-caption { left: 16px; right: 16px; }
  .manifesto { flex-direction: column; }
  .collection, .studio-section, #saved { padding-top: 72px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .cards { grid-template-columns: 1fr; }
  .studio { display: flex; flex-direction: column; }
  .preview { order: -1; width: 100%; }
  .preview-top { padding: 16px; }
  .view-tabs { gap: 0; }
  .view-tabs > button, .plant-picker > button { padding-inline: 8px; }
  .viewport { min-height: 360px; }
  .viewport-hint { left: 16px; }
  .preview-bottom { margin-inline: 16px; }
  #view-note { padding-inline: 16px; }
  aside { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 20px; }
  .print-note { flex-direction: column; gap: 12px; }
  #saved { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card canvas { transition: none; }
}
