:root {
  --bg: #f3f4ef;
  --panel: #ffffff;
  --line: #dfe3da;
  --ink: #1e2721;
  --muted: #66706a;
  --accent: #1f7a4d;
  --accent-soft: #e4f2e9;
  --danger: #b3412f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
}
button:hover { background: #f5f7f2; border-color: #cbd2c6; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #196842; }
button.danger { color: var(--danger); }
input[type=number], input[type=text], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; background: #fff;
}
textarea { resize: vertical; min-height: 54px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); }
input[type=color] { width: 44px; height: 28px; padding: 1px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* top bar */
.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; flex: none; }
.project-name { max-width: 210px; }
.saved { color: var(--muted); font-size: 12px; min-width: 64px; }
.toolbar { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toggle { display: flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; }

/* layout */
.layout { flex: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr) 300px; min-height: 0; }
.palette { overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 10px 10px 28px; }
.pal-group h3 { margin: 16px 2px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pal-hint { margin: 0 2px 6px; font-size: 11.5px; color: var(--muted); }
.fill-tools { margin: 12px 0 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcf9; }
.fill-tools h3 { margin: 0 2px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fill-tool-buttons { display: flex; gap: 4px; }
.fill-tool-buttons button { flex: 1; padding: 5px 3px; font-size: 11px; }
.pal-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 1px solid transparent; background: none; padding: 5px 6px; border-radius: 6px; white-space: normal;
}
.pal-item:hover { background: #f4f6f1; border-color: var(--line); }
.pal-item.active { background: var(--accent-soft); border-color: var(--accent); }
.pal-item .sw { flex: none; width: 26px; height: 20px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); }
.pal-item .sw.circle { width: 20px; border-radius: 50%; margin: 0 3px; }
.pal-item .sw.line { height: 7px; border-radius: 2px; }
.pal-item .nm { flex: 1; min-width: 0; }
.pal-item .mt { display: block; font-size: 11px; color: var(--muted); }
.select-tool { font-weight: 600; }

.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.canvas-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.statusbar {
  display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px;
  border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12px; white-space: nowrap;
}
#status { overflow: hidden; text-overflow: ellipsis; }
#coords { font-variant-numeric: tabular-nums; }

/* inspector */
.inspector { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; border: 0; border-radius: 0; background: none; padding: 9px 0; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabpanel { flex: 1; overflow-y: auto; padding: 12px 14px 28px; }
.tabpanel[hidden] { display: none; }
.tabpanel h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.tabpanel h3:first-child { margin-top: 2px; }
.field { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; margin: 7px 0; }
.field > label { color: var(--muted); }
.inline { display: flex; align-items: center; gap: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
.stat { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.stat b { font-variant-numeric: tabular-nums; }
.prop-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.prop-head .sw { width: 30px; height: 30px; border-radius: 6px; border: 1px solid rgba(0,0,0,.2); flex: none; }
.prop-title { font-weight: 650; font-size: 14px; }
.prop-sub { color: var(--muted); font-size: 12px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0; }
.sun-pill { margin: 12px 0 4px; padding: 7px 9px; border-radius: 6px; background: #fff7dc; border: 1px solid #f0dc9a; font-size: 12.5px; }
.sun-pill.partial { background: #f3f6e4; border-color: #d7dfb0; }
.sun-pill.shade { background: #e8eef8; border-color: #c4d2ea; }
.warn { padding: 7px 9px; border-radius: 6px; background: #fdecea; border: 1px solid #f2c4bd; color: #8a2d1f; font-size: 12.5px; margin-top: 6px; }
.ok { padding: 7px 9px; border-radius: 6px; background: var(--accent-soft); border: 1px solid #bfe0cb; color: #185f3c; font-size: 12.5px; margin-top: 6px; }
.check { display: flex; gap: 7px; align-items: center; margin: 8px 0; cursor: pointer; }
.legend .bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #2b3a67 0%, #3f6fb5 22%, #4fb0a5 44%, #f2d14b 67%, #f28e2b 100%); }
.legend .ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 3px; }
.sun-info { margin-top: 10px; }
.help ol { padding-left: 18px; margin: 6px 0; }
.help li { margin: 6px 0; }
.keys { width: 100%; border-collapse: collapse; font-size: 12px; }
.keys td { padding: 3px 0; vertical-align: top; }
.keys td:first-child { white-space: nowrap; padding-right: 10px; }
kbd { font: 11px ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fafbf8; }

/* quote */
.mix { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #ece8dc; margin: 6px 0; }
.mix span { display: block; height: 100%; }
.mix-key { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.mix-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
table.quote { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
table.quote th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
table.quote td { padding: 5px 2px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
table.quote .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.quote input { width: 64px; padding: 2px 4px; text-align: right; }
table.quote .note { display: block; color: var(--muted); font-size: 11px; }
table.quote tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); padding-top: 8px; }
.empty { color: var(--muted); padding: 12px 0; }

/* dialog */
dialog { border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(440px, 92vw); }
dialog::backdrop { background: rgba(20, 30, 25, .35); }
.dlg { padding: 18px 20px; }
.dlg h2 { margin: 0 0 6px; font-size: 17px; }
.dlg-actions { display: flex; gap: 8px; margin-top: 18px; }
.spacer { flex: 1; }

/* ===== screens: sign-in / projects ("portal") vs the editor ===== */
body:not([data-screen="editor"]) > .topbar,
body:not([data-screen="editor"]) > .layout { display: none !important; }
body[data-screen="editor"] > #portal { display: none; }
body:not([data-screen="editor"]) { overflow: auto; height: auto; min-height: 100%; }
.portal { min-height: 100dvh; background: var(--bg); }
.loading { display: grid; place-items: center; min-height: 60dvh; color: var(--muted); }
.design-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.design-id .project-name { padding: 2px 6px; font-weight: 600; }
.proj-addr { font-size: 11.5px; color: var(--muted); padding-left: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; background: linear-gradient(160deg, #e7f2ea, #f3f4ef 60%); }
.auth-card { width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 26px 20px; box-shadow: 0 20px 50px rgba(20,40,30,.12); }
.auth-card h1 { font-size: 20px; margin: 18px 0 12px; }
.auth-brand { display: flex; gap: 10px; align-items: center; }
.auth-brand svg { width: 34px; height: 34px; }
.auth-brand b { display: block; font-size: 16px; }
.auth-brand span { color: var(--muted); font-size: 12.5px; }
.stackform { display: grid; gap: 12px; }
.stackform label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
.stackform input { padding: 8px 10px; font-size: 14px; }
.form-error { color: var(--danger); min-height: 1em; margin: 2px 0; font-size: 12.5px; }
button.big, .btn.big { padding: 10px 14px; font-size: 14px; font-weight: 600; }
code { background: #f1f3ee; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.ptop { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.pbrand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.pbrand svg { width: 26px; height: 26px; }
.pbrand b { display: block; font-size: 14.5px; }
.pbrand small { display: block; color: var(--muted); font-size: 11.5px; }
.pme { color: var(--muted); font-size: 12.5px; margin-right: 4px; }
.pmain { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }
.ptitle { font-size: 24px; margin: 6px 0 14px; }
.psub { font-size: 15px; margin: 26px 0 10px; }
.psubline { margin: -10px 0 12px; color: var(--muted); }
.phead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.backlink { display: inline-block; color: var(--accent); text-decoration: none; margin-bottom: 6px; font-size: 13px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; }

.bigchoices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bigchoice {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  text-align: left; white-space: normal; padding: 20px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; color: inherit; text-decoration: none; cursor: pointer;
}
.bigchoice:hover { border-color: var(--accent); background: #fbfdfb; box-shadow: 0 6px 20px rgba(31,122,77,.08); }
.bigchoice .ic { grid-row: 1 / 3; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 22px; }
.bigchoice b { font-size: 16px; }
.bigchoice small { color: var(--muted); font-size: 12.5px; }
.bigchoices.small .bigchoice { padding: 14px; }

.pfilters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pfilters input { flex: 1 1 240px; padding: 8px 10px; }
.pfilters select { width: auto; padding: 7px 8px; }
.plist { display: grid; gap: 6px; }
.prow {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) auto auto minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 11px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none;
}
.prow:hover { border-color: #b9c4b3; box-shadow: 0 3px 12px rgba(0,0,0,.05); }
.paddr b { display: block; }
.paddr small, .pdes, .pdate, .pcust { color: var(--muted); font-size: 12.5px; }
.pdate { text-align: right; }
.pill, .pill-select { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.pill-select { width: auto; padding: 5px 10px; }
.st-enquiry { background: #eef2f7; color: #3d5470; }
.st-designing { background: #fff4dd; color: #855d0a; }
.st-quoted { background: #e6f0fb; color: #1f5c99; }
.st-won { background: #e3f3e8; color: #1c6b40; }
.st-lost { background: #f4ecea; color: #8a4a3f; }
.st-complete { background: #dfeee4; color: #134d2d; }

.pcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.pinfo { display: grid; gap: 8px; }
.pinfo .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pgrid label { display: grid; gap: 4px; color: var(--muted); font-size: 12.5px; }
.pgrid .full { grid-column: 1 / -1; }
.pgrid input, .pgrid select, .pgrid textarea { padding: 7px 9px; font-size: 14px; }

.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.dcard { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: visible; }
.dthumb { display: grid; place-items: center; aspect-ratio: 480 / 340; background: #e6e9e0; border-radius: 12px 12px 0 0; overflow: hidden; color: var(--muted); text-decoration: none; }
.dthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dbody { padding: 10px 12px 4px; }
.dbody b { display: block; }
.dbody small { color: var(--muted); font-size: 12px; }
.dact { display: flex; gap: 6px; padding: 8px 12px 12px; }
.dact .btn.primary { flex: 1; }
.dmenu { position: absolute; right: 12px; bottom: 50px; z-index: 3; display: grid; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); overflow: hidden; }
.dmenu[hidden] { display: none; }
.dmenu button { border: 0; border-radius: 0; text-align: left; padding: 8px 16px; }
.dnew { justify-content: center; gap: 8px; padding: 18px; border-style: dashed; background: #fbfcf9; min-height: 200px; }
.dnew small { color: var(--muted); margin-bottom: 6px; }
.urow { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.urow span:first-child { flex: 1; }
.urow b { display: block; }
.urow small { color: var(--muted); }
.pdialog { width: min(440px, 94vw); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 50; pointer-events: none;
  background: #1e2721; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; transition: .2s; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #8a2d1f; }

@media (max-width: 700px) {
  .bigchoices { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr auto; }
  .prow .pcust, .prow .pdate { display: none; }
  .pgrid { grid-template-columns: 1fr; }
  .ptop { padding: 8px 12px; flex-wrap: wrap; }
  .pme { display: none; }
  .pmain { padding: 16px 12px 50px; }
  .proj-addr { max-width: 120px; }
}

/* "you are in a mode" bar over the plan */
.modebar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 140px);
  padding: 6px 6px 6px 14px; border-radius: 999px; background: #1e2721; color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 12.5px;
}
.modebar[hidden] { display: none; }
.modebar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modebar button { border-radius: 999px; padding: 4px 12px; border: 0; background: #fff; color: #1e2721; font-weight: 600; }
.modebar button.go { background: #4caf7d; color: #fff; }

/* selection chip (phones) and first-run tips */
.selbar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  padding: 6px 6px 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.18); font-size: 13px;
}
.selbar[hidden] { display: none; }
.selbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.selbar button { border-radius: 999px; padding: 5px 12px; }
.tips {
  position: absolute; top: 12px; left: 12px; z-index: 3; width: min(340px, calc(100% - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.tips[hidden] { display: none; }
.tips h4 { margin: 0 0 6px; font-size: 15px; }
.tips ol { margin: 0 0 10px; padding-left: 18px; }
.tips li { margin: 5px 0; }

/* wizard */
#wizard { width: min(760px, 96vw); max-height: 92dvh; }
.wiz { display: flex; flex-direction: column; max-height: 92dvh; }
.wiz-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.wiz-steps { flex: 1; display: flex; gap: 6px; }
.wiz-steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.wiz-steps span.on { background: var(--accent); }
.wiz-x { border: 0; background: none; font-size: 16px; padding: 4px 8px; }
.wiz-body { padding: 10px 18px 6px; overflow-y: auto; }
.wiz-body h2 { margin: 6px 0 4px; font-size: 20px; }
.wiz-body .lead { color: var(--muted); margin: 0 0 14px; }
.wiz-foot { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.wiz-foot button { padding: 8px 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; white-space: normal;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.card:hover { border-color: #b9c4b3; background: #fbfcf9; }
.card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(31,122,77,.15); }
.card svg { width: 100%; height: 70px; }
.card b { font-size: 14px; }
.card small { color: var(--muted); font-size: 12px; }
.spaces { display: grid; gap: 8px; }
.space { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.space.off { background: #f6f7f3; color: var(--muted); }
.space .check { margin: 0; font-weight: 600; }
.space .dim { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.space .dim input { width: 74px; }
.space.off .dim { opacity: .45; }
.wiz-more { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.wiz-more button { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0 4px; }
.wiz-section { margin: 16px 0 6px; font-size: 13px; font-weight: 650; }
.seg.small span { padding: 5px 6px; }
details.house { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
details.house summary { cursor: pointer; font-weight: 600; }

/* garden switcher above the plan */
.gardenbar { display: flex; gap: 6px; align-items: center; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
.gardenbar .lbl { color: var(--muted); font-size: 12px; margin-right: 2px; }
.chip { border-radius: 999px; padding: 3px 11px; font-size: 12.5px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* site tab */
.garden-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.garden-row .meta { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; margin-top: -2px; }
.garden-row button { padding: 3px 8px; font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 3px; color: var(--muted); margin: 8px 0; }
.callout { background: #fff6ea; border: 1px solid #f0d3a8; border-radius: 8px; padding: 9px 10px; margin: 10px 0; font-size: 12.5px; }
.callout .btnrow { margin-top: 8px; }
.subcard { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 12px; background: #fbfcf9; }
.subcard h4 { margin: 0 0 6px; font-size: 12px; }
.stairs-card .field { margin-top: 7px; }
.stairs-card .warn ul { margin: 4px 0 0; padding-left: 18px; }
.stairs-card .warn li { margin: 2px 0; }

/* dialogs */
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 12px 0; }
.seg label { flex: 1; text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 6px; border-right: 1px solid var(--line); font-size: 12.5px; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--accent-soft); color: #145c38; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.shape-builder { display: grid; grid-template-columns: 1fr 150px; gap: 14px; align-items: start; }
.shape-builder .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shape-builder .fields label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); }
.shape-builder .fields .full { grid-column: 1 / -1; }
.preview { width: 100%; aspect-ratio: 1; background: #f6f7f2; border: 1px solid var(--line); border-radius: 8px; }
.preview polygon { fill: #ddd5c1; stroke: #4d473b; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.preview .start { fill: #1f7a4d; }
.preview text { font: 600 9px system-ui, sans-serif; fill: #6b4e33; }
#newDialog, #shapeDialog { width: min(560px, 94vw); }
#walkDialog { width: min(660px, 94vw); }
.walk { display: grid; grid-template-columns: 1fr 190px; gap: 14px; align-items: start; margin-top: 8px; }
.walk-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.walk-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 2px 4px; }
.walk-table td { padding: 2px 4px; }
.walk-table td:first-child { color: var(--muted); width: 22px; }
.walk-table button { padding: 2px 7px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { font-weight: 400; color: var(--muted); font-size: 11px; }
.mobilebar, .sheet-close { display: none; }

/* estimate tab */
.est-head { background: var(--accent-soft); border: 1px solid #bfe0cb; border-radius: 10px; padding: 12px 14px; }
.est-head .lbl { color: #185f3c; font-size: 12px; font-weight: 600; }
.est-range { font-size: 22px; font-weight: 750; letter-spacing: -.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.band { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: #fff; border: 1px solid #bfe0cb; font-size: 12px; font-weight: 600; color: #185f3c; }
.cta { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fbfcf9; }
.cta h4 { margin: 0 0 4px; font-size: 14px; }
.cta ul { margin: 6px 0 10px; padding-left: 18px; }
.cta li { margin: 2px 0; }
.cta .btnrow > * { flex: 1 1 auto; text-align: center; }
a.btn { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 10px; color: inherit; text-decoration: none; }
a.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.unpriced { color: var(--muted); font-size: 12.5px; margin: 4px 0; }

@media (max-width: 900px) {
  body { height: 100dvh; }
  .topbar { padding: 6px 8px; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
  .brand { min-width: 0; }
  .brand-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .project-name, .saved, .desk, #btnQuote { display: none !important; }
  .brand-text small { display: none; }
  .toolbar { gap: 4px; flex-wrap: nowrap; }
  .toolbar button { padding: 6px 9px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .palette {
    position: fixed; z-index: 20; top: 0; left: 0; bottom: 0; width: min(310px, 86vw);
    transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25);
  }
  body.show-palette .palette { transform: none; }
  .inspector {
    position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: 64dvh;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0;
    transform: translateY(105%); transition: transform .2s ease; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  }
  body.show-sheet .inspector { transform: none; }
  .sheet-close { display: block; flex: 0 0 46px !important; }
  .statusbar { display: none; }
  .mobilebar { display: flex; border-top: 1px solid var(--line); background: var(--panel); padding-bottom: env(safe-area-inset-bottom); }
  .mobilebar button { flex: 1; border: 0; border-radius: 0; padding: 11px 0; font-size: 13px; background: none; }
  .mobilebar button.active { color: var(--accent); font-weight: 650; }
  .shape-builder, .walk { grid-template-columns: minmax(0, 1fr); }
  .shape-builder .preview, .walk .preview { max-width: 180px; }
  .modebar { max-width: calc(100% - 20px); top: auto; bottom: 10px; }
  .pal-item { padding: 8px 6px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 8px 10px; }
  .card svg { height: 46px; }
  .card b { font-size: 13px; }
  .space { grid-template-columns: 1fr; gap: 6px; }
  .wiz-body h2 { font-size: 18px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr) 270px; }
  .brand span, .project-name { max-width: 150px; }
}
