:root {
  --ink: #17201d;
  --muted: #66716d;
  --paper: #f4f4ef;
  --card: #ffffff;
  --line: #d9ded9;
  --green: #173f34;
  --green-2: #2f6f56;
  --sage: #dfe8df;
  --sand: #e8decf;
  --danger: #8e3d2f;
  --warn: #8c622c;
  --shadow: 0 20px 70px rgba(24, 43, 35, 0.1);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: linear-gradient(180deg, #f7f7f3 0%, #f0f2ed 100%); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, label, select, input[type="range"] { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

.loading-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.studio-shell { min-height: 100vh; }
.topbar { min-height: 78px; padding: 16px clamp(18px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .15em; color: var(--muted); font-weight: 800; }
.brand-title { margin-top: 3px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(22px, 3vw, 31px); letter-spacing: -.02em; }
.sandbox-badge { padding: 9px 13px; border-radius: 999px; background: var(--sage); color: var(--green); font-weight: 800; font-size: 12px; white-space: nowrap; }
.hero-strip { max-width: 1180px; margin: 0 auto; padding: 42px clamp(18px, 4vw, 42px) 24px; display: flex; justify-content: space-between; gap: 32px; align-items: end; }
.hero-strip h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(34px, 6vw, 64px); line-height: .98; letter-spacing: -.035em; max-width: 680px; }
.hero-strip p { margin: 16px 0 0; color: var(--muted); max-width: 650px; line-height: 1.6; }
.privacy-note { max-width: 320px; color: var(--muted); font-size: 12px; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.58); }

.stepper { max-width: 1180px; margin: 0 auto; padding: 12px clamp(18px, 4vw, 42px) 22px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; overflow-x: auto; }
.step { min-width: 84px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; color: #8a9390; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 0; }
.step span { width: 100%; min-height: 6px; border-radius: 99px; background: #dce1dc; overflow: hidden; color: transparent; font-size: 0; }
.step.done span { background: #8aa794; }
.step.active { color: var(--green); }
.step.active span { background: var(--green); }
.message-bar { max-width: 1100px; margin: 0 auto 14px; padding: 12px 16px; background: #fff4df; border: 1px solid #e7d5b2; border-radius: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.message-bar button { border: 0; background: transparent; font-size: 24px; line-height: 1; }
.workspace { max-width: 1100px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 30px) 70px; }
.panel { background: rgba(255,255,255,.94); border: 1px solid rgba(220,225,220,.95); border-radius: var(--radius); padding: clamp(20px, 4vw, 42px); box-shadow: var(--shadow); }
.intro-panel { padding-bottom: 30px; }
.section-heading { display: grid; grid-template-columns: 54px 1fr; gap: 16px; margin-bottom: 28px; align-items: start; }
.section-heading > span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 12px; font-weight: 900; }
.section-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 5vw, 44px); font-weight: 500; letter-spacing: -.025em; }
.section-heading p { margin: 9px 0 0; color: var(--muted); line-height: 1.6; }

.path-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.path-card { min-height: 245px; border: 1px solid var(--line); border-radius: 20px; background: #fafaf7; padding: 26px; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; transition: .18s ease; }
.path-card:hover { transform: translateY(-2px); border-color: #9eb0a6; }
.path-card.selected { border-color: var(--green); box-shadow: inset 0 0 0 2px var(--green); background: #f3f7f3; }
.path-icon { font-family: Georgia, serif; font-size: 58px; line-height: 1; color: var(--green); margin-bottom: auto; }
.path-card strong { font-size: 25px; font-family: Georgia, serif; font-weight: 500; }
.path-card small { color: var(--muted); line-height: 1.55; margin-top: 8px; font-size: 14px; }

.form-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 800; color: #39433f; }
input, select, textarea { width: 100%; border: 1px solid #cfd6d1; border-radius: 13px; min-height: 48px; padding: 11px 13px; background: #fff; color: var(--ink); outline: none; }
textarea { min-height: 104px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(47,111,86,.13); }
fieldset { border: 0; padding: 0; margin: 26px 0; }
legend { font-size: 14px; font-weight: 900; margin-bottom: 12px; }
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.check-card { flex-direction: row; align-items: center; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 11px; background: #fafaf7; font-weight: 700; }
.check-card input { width: 18px; min-height: 18px; height: 18px; margin: 0; }

.button-row { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.primary, .secondary { border-radius: 999px; min-height: 49px; padding: 12px 22px; font-weight: 900; border: 1px solid transparent; }
.primary { background: var(--green); color: #fff; }
.primary.ghost { background: #e9efe9; color: var(--green); }
.secondary { border-color: #cbd4ce; background: #fff; color: var(--green); }
.text-button { border: 0; background: transparent; color: var(--green); font-weight: 900; padding: 10px 4px; }
.block-note { text-align: right; color: var(--danger); font-size: 12px; margin: 10px 5px 0; }

.upload-zone { min-height: 150px; border: 1.5px dashed #aebbb3; border-radius: 18px; background: #f8faf7; display: grid; place-items: center; align-content: center; text-align: center; padding: 22px; position: relative; cursor: pointer; margin-bottom: 20px; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-plus { width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 26px; line-height: 1; margin-bottom: 8px; }
.upload-zone strong { font-size: 16px; color: var(--green); }
.upload-zone small { font-weight: 500; color: var(--muted); margin-top: 5px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.photo-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fafaf7; }
.photo-preview, .photo-placeholder { position: relative; min-height: 230px; background: #dfe5df; }
.photo-preview img { object-fit: cover; }
.photo-placeholder { display: grid; place-items: center; align-content: center; text-align: center; padding: 20px; color: var(--muted); }
.photo-placeholder small { margin-top: 6px; }
.photo-body { padding: 16px; display: grid; gap: 14px; }
.photo-body > strong { overflow-wrap: anywhere; }
.tip-card, .caution-card { padding: 15px 17px; border-radius: 14px; margin-top: 18px; line-height: 1.55; font-size: 13px; }
.tip-card { background: #eff3ef; color: #52605a; }
.caution-card { background: #fff8ec; border: 1px solid #ead9bb; }
.caution-card p { margin: 6px 0 0; color: #665c4d; }

.interpretation-card { border: 1px solid #cfd9d2; background: #f2f6f2; border-radius: 18px; padding: 20px; margin-bottom: 18px; }
.interpretation-card h3 { margin: 0 0 8px; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.interpretation-card > p { line-height: 1.6; color: #46534d; }
.interpret-row { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; border-top: 1px solid #d7e1d9; padding: 12px 0; font-size: 13px; }
.interpret-row span { color: var(--muted); }
.confirm-box { flex-direction: row; border: 1px solid #bccdc1; border-radius: 16px; padding: 16px; background: #f8fbf8; margin-top: 16px; align-items: flex-start; }
.confirm-box input { width: 22px; height: 22px; min-height: 22px; margin: 1px 0 0; }
.confirm-box span { display: flex; flex-direction: column; gap: 4px; }
.confirm-box small { color: var(--muted); font-weight: 500; }

.constraint-field { display: grid; grid-template-columns: minmax(180px,.7fr) 1.3fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid #edf0ed; }
.constraint-field span { display: flex; flex-direction: column; gap: 5px; }
.constraint-field strong { font-size: 15px; color: var(--green); }
.constraint-field small { font-weight: 500; color: var(--muted); line-height: 1.5; }
.warning-stack { display: grid; gap: 8px; margin-top: 22px; }
.warning { border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 13px; line-height: 1.45; }
.warning strong { text-transform: uppercase; font-size: 10px; letter-spacing: .08em; }
.warning.info { background: #edf3f0; color: #42564d; }
.warning.warning { background: #fff4df; color: #6b542e; }
.warning.blocker { background: #fae8e4; color: #783d32; }

.aerial-shell { margin: 24px 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #f6f7f3; }
.aerial-toolbar { display: flex; gap: 7px; overflow-x: auto; padding: 11px; border-bottom: 1px solid var(--line); background: #fff; }
.tool-chip { border: 1px solid #cdd5d0; border-radius: 999px; background: #fff; color: #425149; min-height: 42px; padding: 8px 14px; font-weight: 800; white-space: nowrap; }
.tool-chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.aerial-instructions { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.aerial-instructions strong { color: var(--ink); }
.map-frame { margin: 0 12px; border-radius: 14px; overflow: hidden; height: clamp(330px, 55vw, 560px); background: #799167; touch-action: none; }
.map-transform { width: 100%; height: 100%; transform-origin: 50% 50%; transition: transform .12s ease; }
.aerial-svg { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: manipulation; }
.map-controls { padding: 12px 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.map-controls > label { flex: 1; min-width: 180px; flex-direction: row; align-items: center; }
.map-controls input[type="range"] { padding: 0; min-height: 30px; border: 0; }
.pan-pad { display: flex; gap: 5px; }
.pan-pad button { width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 10px; color: var(--green); font-weight: 900; }

.concept-card { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #eee; }
.concept-card img { display: block; width: 100%; height: auto; }
.compare-shell { margin-top: 22px; }
.compare-shell h3 { font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.compare-stage { position: relative; min-height: clamp(300px, 55vw, 560px); overflow: hidden; border-radius: 18px; background: #ddd; }
.compare-stage img { object-fit: cover; }
.compare-before { position: absolute; inset: 0 auto 0 0; overflow: hidden; border-right: 2px solid #fff; z-index: 2; }
.compare-before img { object-fit: cover; object-position: left center; width: 100vw !important; max-width: none !important; }
.compare-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 3; }
.compare-shell > input[type="range"] { border: 0; padding: 8px 0; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.usage-meter { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: right; }
.empty-state { min-height: 230px; border: 1px dashed var(--line); border-radius: 18px; display: grid; place-items: center; color: var(--muted); }

.package-summary { border: 1px solid var(--line); border-radius: 18px; padding: 19px; margin-top: 20px; }
.package-summary h3 { font-family: Georgia, serif; margin: 0 0 14px; font-size: 24px; font-weight: 500; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 13px; }
.summary-grid span { color: var(--muted); }
.summary-grid strong { text-align: right; }
.studio-footer { max-width: 1100px; margin: -40px auto 0; padding: 0 clamp(18px, 4vw, 42px) 34px; display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--muted); font-size: 12px; }

@media (max-width: 780px) {
  .topbar { min-height: 68px; }
  .sandbox-badge { display: none; }
  .hero-strip { display: block; padding-top: 30px; }
  .privacy-note { margin-top: 20px; max-width: none; }
  .stepper { padding-bottom: 16px; grid-template-columns: repeat(8, 76px); }
  .workspace { padding-left: 10px; padding-right: 10px; }
  .panel { border-radius: 18px; padding: 20px 15px; }
  .section-heading { grid-template-columns: 42px 1fr; gap: 10px; }
  .section-heading > span { width: 38px; height: 38px; }
  .path-grid, .form-grid.two, .photo-grid { grid-template-columns: 1fr; }
  .path-card { min-height: 200px; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .constraint-field { grid-template-columns: 1fr; gap: 8px; }
  .interpret-row { grid-template-columns: 1fr; gap: 4px; }
  .button-row { justify-content: stretch; }
  .button-row .primary, .button-row .secondary { flex: 1 1 100%; }
  .review-actions .secondary { flex: 1 1 45%; }
  .photo-preview, .photo-placeholder { min-height: 260px; }
  .map-frame { margin: 0 7px; }
  .map-controls { align-items: stretch; }
  .pan-pad { width: 100%; justify-content: space-between; }
  .pan-pad button { flex: 1; }
}

@media (max-width: 430px) {
  .brand-title { font-size: 22px; }
  .hero-strip h1 { font-size: 40px; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .check-card { font-size: 12px; }
  .photo-preview, .photo-placeholder { min-height: 225px; }
  .summary-grid { grid-template-columns: 1fr auto; }
  .studio-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.address-search{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.address-results{display:grid;gap:8px;margin:8px 0 18px}.address-result{text-align:left}.map-frame{height:460px;min-height:360px}.map-frame #realAerialMap{height:100%;width:100%;border-radius:16px}.maplibregl-ctrl-attrib{font-size:10px}.map-draw-note div{padding:4px 0}@media(max-width:640px){.address-search{grid-template-columns:1fr}.map-frame{height:58vh;min-height:380px}}
/* Point-by-point aerial drawings and edit controls. */
.drawing-row{display:flex;align-items:center;gap:8px;margin:7px 0}
.drawing-row [data-select-shape]{flex:1;text-align:left;min-height:42px}
.drawing-row [aria-pressed="true"]{border-color:var(--green);background:#e6efe8}
.map-controls .secondary{min-height:42px}
@media(max-width:640px){.map-controls{gap:8px}.map-controls .secondary{flex:1 1 42%;font-size:12px}}
/* Compact aerial workflow: tools, instructions and actions stay together. */
.aerial-shell{margin:18px 0}
.draw-tools{padding:9px 10px;gap:5px}
.draw-tools button{min-height:36px;padding:6px 10px;font-size:12px;white-space:nowrap}
.aerial-instructions{padding:9px 12px 5px;gap:2px;line-height:1.35}
.map-action-bar{display:flex;flex-wrap:wrap;gap:6px;padding:6px 12px 10px}
.map-action{min-height:36px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--green);padding:6px 11px;font:inherit;font-size:12px;font-weight:750;cursor:pointer}
.map-action:hover:not(:disabled){border-color:var(--green);background:#f4f8f4}
.map-action:disabled{opacity:.45;cursor:not-allowed}
.map-frame{height:clamp(250px,34vh,340px);min-height:250px;margin:0 10px}
.drawing-results{padding:8px 12px 10px}
.drawing-results-head{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px}
.drawing-results-head .text-button{min-height:30px;padding:2px 4px;font-size:12px}
.drawing-results .map-draw-note{padding:2px 0}
.drawing-results .drawing-row{margin:4px 0}
.drawing-results .drawing-row [data-select-shape]{min-height:36px;padding:5px 8px;font-size:12px}
.drawing-edit{display:flex;align-items:end;gap:12px;margin-top:5px}
.drawing-edit[hidden]{display:none}
.drawing-edit label{flex:0 1 260px;font-size:12px}
.drawing-edit select{min-height:34px;padding:4px 8px;margin-top:3px}
.drawing-edit small{padding-bottom:6px;color:var(--muted)}
@media(max-width:640px){.map-frame{height:clamp(235px,32vh,310px);min-height:235px;margin:0 7px}.map-action-bar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.map-action{padding:5px 7px}.drawing-edit{display:block}.drawing-edit small{display:block;padding-top:4px}}
.quote-measurements{margin-top:14px;padding:12px;border-radius:10px;background:#eef3ee}
.quote-measurements h4{margin:0 0 5px;font-size:13px}
.quote-measurements p{margin:0;font-size:12px;line-height:1.55}

@media(max-width:640px){#finishMap{grid-column:1/-1}}

.drawing-edit summary{cursor:pointer;font-size:12px;font-weight:700;color:var(--green);padding:4px 0}
.drawing-edit label{display:block;margin-top:5px}
.drawing-edit small{display:block;margin-top:4px}
/* Compact project choices above the map. */
fieldset{margin:18px 0}
fieldset legend{margin-bottom:8px}
.choice-grid{grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:6px}
.check-card{min-height:42px;padding:6px 9px;gap:7px;border-radius:9px;font-size:12px;line-height:1.25}
.check-card input{width:16px;height:16px;min-height:16px;flex:0 0 16px}
@media(max-width:640px){.choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.check-card{padding:6px 7px}}
