/* ============================================================
   AI-ASSISTED BATHROOM PLANNER — page-specific styles
   Reuses brand tokens, header/footer, .btn, .container, .eyebrow
   from styles.css. Loaded only on planner.html.
   ============================================================ */

/* ---------- planner hero ---------- */
.planner-hero {
  position: relative;
  padding: clamp(120px, 16vh, 180px) 0 clamp(40px, 6vw, 70px);
  background: radial-gradient(120% 120% at 80% 0%, #1a1416 0%, var(--ink) 55%);
  overflow: hidden;
}
.planner-hero .container { position: relative; z-index: 1; }
.planner-hero h1 {
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(2.3rem, 5.6vw, 4.2rem); line-height: 1; letter-spacing: -.02em;
  max-width: 16ch; margin-bottom: 1.1rem;
}
.planner-hero h1 .accent { color: var(--red); }
.planner-hero p { color: var(--muted); max-width: 58ch; font-size: clamp(1rem, 1.2vw, 1.15rem); line-height: 1.7; }
.planner-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6rem; }
.planner-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--muted); padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.02);
}
.planner-badge svg { width: 15px; height: 15px; stroke: var(--red); fill: none; stroke-width: 1.8; }

/* ---------- wizard shell ---------- */
.wizard { padding-block: clamp(28px, 5vw, 56px); }
.wizard-inner {
  display: grid; grid-template-columns: 1fr; gap: clamp(22px, 3vw, 40px);
  align-items: start;
}
@media (min-width: 940px) { .wizard-inner { grid-template-columns: 1.15fr .85fr; } }
/* collapsible live plan — toggled by the "Live plan" button to free space for the editor + items */
.wizard-inner.preview-collapsed { grid-template-columns: 1fr; }
.wizard-inner.preview-collapsed .preview-rail { display: none; }
.live-toggle { display: inline-flex; align-items: center; gap: 7px; background: linear-gradient(180deg, #1b1b1e, #161618); border: 1px solid var(--line); color: var(--cream); border-radius: 9px; padding: 9px 13px; font-family: var(--sans); font-weight: 600; font-size: .82rem; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); transition: border-color .18s, color .18s; }
.live-toggle:hover { border-color: var(--red); color: var(--red); }
.live-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.live-toggle.on { border-color: var(--red); color: var(--red); }

/* progress rail */
.wizard-progress { display: flex; gap: 6px; margin-bottom: clamp(20px, 3vw, 32px); }
.wizard-progress .pip {
  flex: 1; height: 4px; border-radius: 999px; background: var(--line);
  position: relative; overflow: hidden;
}
.wizard-progress .pip::after {
  content: ""; position: absolute; inset: 0; width: 0;
  background: linear-gradient(90deg, var(--red), var(--red-bright));
  transition: width .5s var(--ease-out);
}
.wizard-progress .pip.done::after { width: 100%; }
.wizard-progress .pip.active::after { width: 60%; }

.step-count { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: .7rem; }

/* steps */
.wsteps { position: relative; }
.wstep { display: none; animation: stepIn .5s var(--ease-out) both; }
.wstep.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.wstep h2 {
  font-family: var(--serif); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.1; margin-bottom: .4rem;
}
.wstep .step-sub { color: var(--muted); margin-bottom: 1.5rem; max-width: 52ch; }

/* fields */
.field-grid { display: grid; gap: 16px; }
.field-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .field-grid.cols-2, .field-grid.cols-3 { grid-template-columns: 1fr; } }
.field label { display: block; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.field input[type="number"], .field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select {
  width: 100%; padding: 14px 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--cream);
  font-family: var(--sans); font-size: 1rem; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224,27,34,.15);
}
.field .hint { font-size: .8rem; color: var(--muted-2); margin-top: 6px; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9aa0' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }

/* selectable option cards (style, budget, priority, shape) */
.opt-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.opt-card {
  position: relative; text-align: left; cursor: pointer;
  padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  color: var(--cream); font-family: var(--sans);
  transition: border-color .2s, transform .2s, background .2s;
}
.opt-card:hover { border-color: #3a3a40; transform: translateY(-2px); }
.opt-card.selected { border-color: var(--red); background: rgba(224,27,34,.07); box-shadow: 0 0 0 1px var(--red) inset; }
.opt-card .oc-title { font-weight: 700; font-size: 1rem; margin-bottom: 3px; }
.opt-card .oc-desc { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.opt-card .oc-swatch { height: 42px; border-radius: 8px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,.06); }
.opt-card .oc-check { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: .2s; }
.opt-card.selected .oc-check { background: var(--red); border-color: var(--red); }
.opt-card .oc-check svg { width: 11px; height: 11px; stroke: #fff; fill: none; stroke-width: 2.4; opacity: 0; }
.opt-card.selected .oc-check svg { opacity: 1; }

/* style swatches (CSS only — no external assets, no AI-purple) */
.sw-modern  { background: linear-gradient(135deg, #d8d4cd, #b7b2a9); }
.sw-dark    { background: linear-gradient(135deg, #2b2b30, #0c0c0e); }
.sw-stone   { background: linear-gradient(135deg, #b9a48c, #7c6b58); }
.sw-classic { background: linear-gradient(135deg, #eceae6, #cfc9bf); }
.sw-budget  { background: linear-gradient(135deg, #c9c9cf, #9a9aa0); }

/* wall picker (existing layout) */
.wall-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wall-row:last-child { border-bottom: 0; }
.wall-row .wl { font-weight: 600; }
.wall-row .wl small { display: block; color: var(--muted-2); font-weight: 400; font-size: .78rem; }

/* photo dropzone (UI only in V1) */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 16px; padding: clamp(26px, 5vw, 48px);
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
  background: rgba(255,255,255,.015);
}
.dropzone.drag { border-color: var(--red); background: rgba(224,27,34,.06); }
.dropzone svg { width: 38px; height: 38px; stroke: var(--red); fill: none; stroke-width: 1.5; margin-bottom: 12px; }
.dropzone .dz-title { font-weight: 700; margin-bottom: 4px; }
.dropzone .dz-sub { color: var(--muted); font-size: .86rem; }
.dz-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.dz-thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.dz-thumb { position: relative; }
.dz-thumb img { display: block; }
.dz-rm { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: #15151a; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.dz-rm:hover { background: var(--red); border-color: var(--red); }

/* wizard nav buttons */
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: clamp(24px, 4vw, 38px); }
.btn-ghost-sm { background: none; border: 1px solid var(--line); color: var(--cream); padding: 13px 24px; border-radius: 6px; font-family: var(--sans); font-weight: 700; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: border-color .2s, color .2s; }
.btn-ghost-sm:hover { border-color: var(--red); color: var(--red); }
.btn-ghost-sm[disabled] { opacity: .35; pointer-events: none; }

/* ---------- sticky live preview (plan) ---------- */
.preview-rail { position: sticky; top: 100px; }
.preview-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.preview-card h3 { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.plan-stage { width: 100%; aspect-ratio: 4 / 3; background: #0c0c0e; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.plan-stage svg { width: 100%; height: 100%; display: block; }
/* "Step 2" 3D-concept handoff card on the results page (optional, fun next step → concept.html) */
.concept-cta { display: flex; align-items: center; gap: clamp(18px, 3vw, 36px); position: relative; overflow: hidden; background: linear-gradient(120deg, var(--ink-2) 0%, #211517 100%); border-color: rgba(224, 27, 34, .28); }
.concept-cta::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }
.concept-cta .cc-main { flex: 1 1 auto; min-width: 0; }
.concept-cta h3 { margin: 6px 0 8px; }
.concept-cta p { color: var(--muted); margin: 0 0 18px; max-width: 60ch; }
.concept-cta .cc-btn { display: inline-flex; align-items: center; gap: 8px; }
.concept-cta .cc-art { flex: 0 0 auto; width: clamp(78px, 12vw, 116px); opacity: .95; }
.concept-cta .cc-art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 18px rgba(224, 27, 34, .25)); }
@media (max-width: 620px) { .concept-cta { flex-direction: column-reverse; align-items: flex-start; text-align: left; } .concept-cta .cc-art { width: 64px; } }
/* results preview = a light "paper" card showing the exact clean export (matches the downloaded PDF) */
.export-paper { background: #fff; border-radius: 10px; padding: clamp(12px, 2.4vw, 22px); box-shadow: 0 14px 38px rgba(0, 0, 0, .34); border: 1px solid rgba(0, 0, 0, .06); }
.export-paper svg { display: block; width: 100%; height: auto; max-height: 64vh; }
@media (max-width: 560px) { .export-paper svg { max-height: 70vh; } }

/* ---------- results ---------- */
.results { padding-block: clamp(30px, 6vw, 72px); display: none; }
.results.active { display: block; animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* cards cascade in for a bit of life */
.results.active .result-card { animation: cardIn .5s var(--ease-out) both; }
.results.active .result-card:nth-child(1) { animation-delay: .05s; }
.results.active .result-card:nth-child(2) { animation-delay: .12s; }
.results.active .result-card:nth-child(3) { animation-delay: .19s; }
.results.active .result-card:nth-child(4) { animation-delay: .26s; }
.results.active .result-card:nth-child(5) { animation-delay: .33s; }
.results.active .result-card:nth-child(6) { animation-delay: .40s; }
.results.active .result-card:nth-child(7) { animation-delay: .47s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.results-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .results-grid { grid-template-columns: 1fr 1fr; } }
.result-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3vw, 30px); }
.result-card.span-2 { grid-column: 1 / -1; }
.result-card h3 { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; margin-bottom: 6px; }
.result-card .rc-eyebrow { color: var(--red); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; margin-bottom: 10px; }
.result-card p { color: var(--muted); line-height: 1.65; }

.est-range { font-family: var(--serif); font-weight: 700; font-size: clamp(2rem, 4vw, 3rem); color: var(--cream); line-height: 1; margin: 4px 0 8px; }
.est-range .to { color: var(--muted-2); }

/* budget split bars */
.split-row { margin-bottom: 12px; }
.split-row .sr-top { display: flex; justify-content: space-between; font-size: .86rem; margin-bottom: 5px; }
.split-row .sr-top .sr-val { color: var(--muted); }
.split-bar { height: 8px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.split-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--red-deep), var(--red)); transition: width .8s var(--ease-out); }

/* product basket */
.basket { display: grid; gap: 12px; }
.basket-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.basket-item .bi-cat { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); font-weight: 600; }
.basket-item .bi-name { font-weight: 700; margin: 2px 0; }
.basket-item .bi-supplier { font-size: .8rem; color: var(--muted-2); }
.basket-item .bi-price { font-weight: 700; white-space: nowrap; }
.basket-item .bi-price small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted-2); text-align: right; }

/* ---------- interactive layout editor (desktop) ---------- */
/* fittings palette = a horizontal TOP bar (add objects); scrolls sideways if it overflows */
.editor-toolbar { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 8px; margin-bottom: 12px; overflow-x: auto; overflow-y: hidden; padding: 9px 10px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.editor-toolbar::-webkit-scrollbar { height: 7px; }
.editor-toolbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }
.pal-cat { display: none; }   /* category labels hidden in the flat top bar */
.pal-grid { display: inline-flex; gap: 8px; flex-shrink: 0; }
.pal-grid button { flex: 0 0 auto; scroll-snap-align: start; }
.editor-toolbar button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 74px; background: linear-gradient(180deg, #1b1b1e, #161618); border: 1px solid var(--line); color: var(--cream); border-radius: 10px; padding: 10px 10px 8px; font-family: var(--sans); font-weight: 600; font-size: .7rem; letter-spacing: .03em; cursor: pointer; transition: border-color .18s, color .18s, transform .18s, box-shadow .18s; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 2px 6px -4px rgba(0,0,0,.6); }
.editor-toolbar button:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 18px -10px rgba(224,27,34,.5); }
.editor-toolbar button:active { transform: translateY(0); box-shadow: none; }
.pal-ico { width: 30px; height: 30px; opacity: .85; pointer-events: none; }
.editor-toolbar button:hover .pal-ico { opacity: 1; }
.editor-toolbar button span { pointer-events: none; }
/* editor bar: draw-shape toggle + detected-shape label + fullscreen */
.editor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ed-barbtn { display: inline-flex; align-items: center; gap: 7px; background: linear-gradient(180deg, #1b1b1e, #161618); border: 1px solid var(--line); color: var(--cream); border-radius: 9px; padding: 9px 13px; font-family: var(--sans); font-weight: 600; font-size: .82rem; cursor: pointer; transition: border-color .18s, color .18s, box-shadow .18s, transform .18s; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 2px 6px -4px rgba(0,0,0,.6); }
.ed-barbtn:hover { border-color: var(--red); color: var(--red); }
.ed-barbtn:active { transform: translateY(1px); box-shadow: none; }
.ed-barbtn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.ed-barbtn:disabled:hover { border-color: var(--line); color: var(--cream); }
.ed-barbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ed-fsbtn.on { border-color: var(--red); color: var(--red); }
.ed-shape { font-size: .8rem; font-weight: 700; color: var(--red-bright); letter-spacing: .02em; padding: 4px 11px; border: 1px solid rgba(224, 27, 34, .3); border-radius: 999px; background: rgba(224, 27, 34, .06); }
.ed-nook { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--cream); }
.ed-nook[hidden] { display: none; }   /* author display: rule otherwise defeats the UA [hidden] rule, so the nook fields would show on every shape */
.ed-nookin { width: 52px; background: var(--ink, #0a0a0b); border: 1px solid var(--line); border-radius: 7px; color: var(--cream); font-family: var(--sans); font-size: .82rem; padding: 7px 8px; text-align: center; }
.ed-nookin:focus { outline: none; border-color: var(--red); }
.ed-bar-spacer { flex: 1 1 auto; }
/* fullscreen (immersive) editor */
html.ed-fs-lock, html.ed-fs-lock body { overflow: hidden; }
.editor-desktoponly.ed-fullscreen { position: fixed; inset: 0; z-index: 4000; margin: 0; background: var(--ink, #0a0a0b); padding: 14px clamp(12px, 3vw, 24px) calc(16px + env(safe-area-inset-bottom)); overflow: auto; -webkit-overflow-scrolling: touch; }
html.ed-fs-lock #edProps { z-index: 4100; }   /* mobile bottom-sheet stays above the fullscreen layer */
/* canvas is full-width; the properties panel stacks below it as the bottom bar */
.editor-main { display: block; }
/* min-width:0 lets the horizontal palette bar be BOUNDED by the column (and scroll) instead of stretching the editor wider than the viewport */
.wizard-main, .editor-desktoponly, .editor-main, .editor-toolbar { min-width: 0; max-width: 100%; }
.editor-stage { position: relative; width: 100%; margin-inline: auto; background: #121214; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: none;
  background-image: none; }   /* grid is now always SVG-drawn + clipped to the floor (room mode AND the custom-draw canvas), so it stays to-scale and never leaks into the wall band */
.ed-dims { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ed-guides { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; overflow: visible; }
.ed-glayer { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.ed-cursor { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8; overflow: visible; }
.ed-gnum { position: absolute; transform: translate(-50%, -50%); width: 58px; text-align: center; pointer-events: auto;
  background: #0c0c0e; color: #fff; border: 1px solid var(--red); border-radius: 6px; padding: 3px 4px;
  font-family: var(--sans); font-weight: 700; font-size: .72rem; cursor: text; touch-action: manipulation; }
.ed-gnum:hover { border-color: var(--red-bright); }
.ed-gnum:focus { outline: none; border-color: var(--red-bright); box-shadow: 0 0 0 2px rgba(224,27,34,.35); }
.ed-wnum { border-color: #5a5a63; }
.ed-wnum:hover, .ed-wnum:focus { border-color: var(--red); }
/* custom-shape drawing */
.editor-drawbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 12px; background: rgba(224,27,34,.07); border: 1px solid var(--red); border-radius: 8px; }
.editor-drawbar[hidden] { display: none; }
.editor-drawbar .db-label { font-size: .8rem; font-weight: 600; color: var(--cream); margin-right: 6px; flex: 1 1 auto; min-width: 200px; }
.editor-drawbar button { background: linear-gradient(180deg, #1b1b1e, #161618); border: 1px solid var(--line); color: var(--cream); border-radius: 7px; padding: 8px 12px; font-family: var(--sans); font-weight: 600; font-size: .8rem; cursor: pointer; transition: border-color .18s, color .18s; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.editor-drawbar button:hover { border-color: var(--red); color: var(--red); }
.editor-drawbar .db-toggle[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.editor-drawbar .db-toggle[aria-pressed="true"]:hover { color: #fff; filter: brightness(1.08); }
.editor-drawbar .db-toggle[aria-pressed="false"] { opacity: .72; }
.editor-stage.drawing { cursor: crosshair; }
.ed-drawhint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(8,8,9,.82); color: var(--cream); font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 6px; pointer-events: none; z-index: 8; white-space: nowrap; max-width: 92%; text-align: center; }
.ed-item { position: absolute; box-sizing: border-box; border-radius: 3px; cursor: grab; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.025); border: 1px solid transparent; user-select: none; touch-action: none; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.ed-item:hover { border-color: rgba(244,241,236,.28); }
.ed-item:active { cursor: grabbing; }
.ed-item.sel { z-index: 5; border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 0 5px rgba(224,27,34,.16); background: rgba(224,27,34,.05); }
.ed-item.door, .ed-item.window { background: none; border: none; overflow: visible; }
/* electrical plan: floor fittings shown faded as a reference (non-interactive), doors/windows shown full but locked */
.ed-item.ed-ghost { opacity: .26; pointer-events: none; background: none; border-color: transparent; filter: saturate(.4); }
.ed-item.ed-ghost:hover { border-color: transparent; }
.ed-item.ed-ghost .ed-lab, .ed-item.ed-ghost .ed-st, .ed-item.ed-ghost .ed-bolt { display: none; }
.ed-item.ed-locked { pointer-events: none; cursor: default; }
.ed-item.ed-locked:hover { border-color: transparent; }
.ed-glyph { position: absolute; left: 50%; top: 50%; pointer-events: none; overflow: visible; }
.ed-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 9px; padding: 24px; pointer-events: none; }
.ed-empty-ico { width: 46px; height: 46px; fill: none; stroke: var(--red); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.ed-empty .ee-title { font-family: var(--serif, Fraunces), Georgia, serif; font-size: 1.05rem; font-weight: 600; color: var(--cream); }
.ed-empty .ee-sub { font-size: .82rem; color: var(--muted-2); max-width: 280px; line-height: 1.5; }
.ed-lab { position: relative; z-index: 2; font-size: .58rem; font-weight: 700; letter-spacing: .03em; color: var(--cream); text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.7); pointer-events: none; white-space: nowrap; }
.ed-item.door .ed-lab, .ed-item.window .ed-lab { display: none; }
.ed-bolt { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); z-index: 3; width: 17px; height: 17px; border-radius: 50%; background: rgba(12,12,14,.95); border: 1px solid #ffd65a; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ed-bolt svg { width: 11px; height: 11px; fill: #ffd65a; }
/* Floor / Electrical plan switcher (admin Advanced Planner only) */
.plan-type-seg { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; background: var(--ink-2, #16161a); border: 1px solid var(--line); border-radius: 12px; }
.plan-type-seg .pts-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--muted-2, #9a958c); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.plan-type-seg .pts-btn svg { width: 16px; height: 16px; }
.plan-type-seg .pts-btn:hover { color: var(--cream); }
.plan-type-seg .pts-btn.active { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 6px 16px -8px rgba(224,27,34,.6); }
@media (max-width: 560px) { .plan-type-seg { display: flex; width: 100%; } .plan-type-seg .pts-btn { flex: 1; justify-content: center; padding: 11px 8px; } }
/* properties = a compact BOTTOM bar below the canvas; controls flow horizontally + wrap */
.editor-props { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 12px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px 14px; }
.editor-props[hidden] { display: none; }
.editor-props .ep-head { flex: 1 0 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 0; }
.editor-props .ep-title { font-weight: 700; }
.ep-grab { display: none; }
.ep-done { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--line); color: var(--cream); border-radius: 999px; padding: 6px 13px; font-family: var(--sans); font-weight: 600; font-size: .76rem; cursor: pointer; transition: border-color .18s, color .18s; }
.ep-done:hover { border-color: var(--red); color: var(--red); }
.editor-props label { display: inline-flex; flex-direction: column; gap: 5px; margin: 0; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.editor-props input { width: 94px; margin: 0; padding: 9px 11px; border-radius: 8px; background: var(--ink-2); border: 1px solid var(--line); color: var(--cream); font-family: var(--sans); font-size: .95rem; }
.editor-props input:focus { outline: none; border-color: var(--red); }
.ep-actions { display: flex; gap: 8px; margin-top: 2px; }
.ep-actions button { flex: 1; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: linear-gradient(180deg, #1b1b1e, #161618); color: var(--cream); font-family: var(--sans); font-weight: 600; font-size: .8rem; cursor: pointer; transition: border-color .18s, color .18s, box-shadow .18s; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.ep-actions button:active { box-shadow: none; }
#epRotate:hover { border-color: var(--red); color: var(--red); }
.ep-delete { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 8px; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(224,27,34,.3); background: rgba(224,27,34,.05); color: var(--cream); font-family: var(--sans); font-weight: 600; font-size: .8rem; cursor: pointer; transition: border-color .18s, background .18s, color .18s; }
.ep-delete svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ep-delete:hover { border-color: var(--red-bright); background: rgba(224,27,34,.14); color: var(--red-bright); }
.ep-hint { font-size: .76rem; color: var(--muted-2); margin-top: 10px; line-height: 1.5; }
.ed-foot { font-size: .8rem; color: var(--muted-2); margin-top: 12px; }

/* desktop-only gate */
.editor-mobilenote { display: none; text-align: center; padding: clamp(28px, 6vw, 48px); border: 1px dashed var(--line); border-radius: 16px; background: rgba(255,255,255,.015); }
.editor-mobilenote svg { width: 42px; height: 42px; stroke: var(--red); fill: none; stroke-width: 1.5; margin-bottom: 12px; }
.editor-mobilenote .dz-title { font-weight: 700; margin-bottom: 6px; font-size: 1.05rem; }
.editor-mobilenote p { color: var(--muted); font-size: .9rem; line-height: 1.6; max-width: 44ch; margin: 0 auto; }
.editor-mobilenote.flash { animation: noteFlash .45s ease 3; }

/* bottom-bar overrides: lay the edit controls out horizontally so the panel stays a short BAR (not a tall stack) */
.editor-props .ep-actions { margin: 0; }
.editor-props .ep-delete { width: auto; margin: 0; }
.editor-props .ep-seglab { margin: 0; align-self: flex-end; }
.editor-props .ep-note { flex: 1 1 200px; margin: 0; }
.editor-props .ep-note textarea { min-height: 38px; }
.editor-props .ep-presets { margin: 0; }
.editor-props .ep-hint { display: none; }

/* ===== MOBILE: keep the bars touch-friendly; canvas stays full-width between them ===== */
@media (max-width: 720px) {
  .editor-toolbar button { padding: 9px 11px; }   /* bigger tap targets in the top bar */
  .editor-drawbar { position: sticky; top: 8px; z-index: 9; }
  .editor-drawbar .db-label { min-width: 0; font-size: .76rem; }
  .editor-drawbar button { flex: 1 1 auto; padding: 11px 10px; }
  .wizard-main, .editor-desktoponly, .editor-main, .editor-toolbar { min-width: 0; max-width: 100%; }
  .editor-stage { border-radius: 14px; }
  .ed-empty { font-size: .85rem; padding: 18px; }
  .ed-gnum { font-size: 16px; width: 62px; padding: 5px 4px; }
  .editor-props { padding: 11px 12px; }
  .editor-props input { font-size: 16px; }   /* 16px stops iOS zoom-on-focus */
  .editor-props .ep-title { font-size: 1rem; }
}
@keyframes edSheetUp { from { transform: translateY(102%); } to { transform: translateY(0); } }
@keyframes noteFlash { 0%, 100% { border-color: var(--line); } 50% { border-color: var(--red-bright); background: rgba(224,27,34,.16); box-shadow: 0 0 0 3px rgba(224,27,34,.28); } }

/* "why this layout" list */
.result-list { list-style: none; display: grid; gap: 11px; }
.result-list li { position: relative; padding-left: 24px; color: var(--muted); line-height: 1.6; }
.result-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; background: var(--red); border-radius: 2px; transform: rotate(45deg); }

/* disclaimers */
.disclaimer { font-size: .8rem; color: var(--muted-2); line-height: 1.6; border-left: 2px solid var(--red-deep); padding-left: 14px; margin-top: 14px; }

/* lead capture in results */
.lead-fields { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin: 16px 0; }
@media (max-width: 560px) { .lead-fields { grid-template-columns: 1fr; } }
.form-note { margin-top: 12px; font-size: .9rem; }
.form-note.ok { color: #46c47c; }
.form-note.err { color: var(--red-bright); }

/* ===== AI concept generator card ===== */
.concept-card { border-color: rgba(224,27,34,.35); box-shadow: 0 0 0 1px rgba(224,27,34,.12) inset; }
.concept-intro { margin-bottom: 18px; }
.concept-fields { display: grid; gap: 18px; margin-bottom: 18px; }
.field input[type="url"] {
  width: 100%; padding: 13px 14px; border-radius: 8px; background: var(--ink-2);
  border: 1px solid var(--line); color: var(--cream); font-family: var(--sans); font-size: .95rem;
}
.field input[type="url"]:focus { outline: none; border-color: var(--red); }
.field input[type="file"] { width: 100%; color: var(--muted); font-family: var(--sans); font-size: .88rem; }
.field input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 9px 14px; border-radius: 8px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--cream);
  font-family: var(--sans); font-weight: 600; font-size: .82rem; transition: border-color .2s, color .2s;
}
.field input[type="file"]::file-selector-button:hover { border-color: var(--red); color: var(--red); }
.field-note { font-size: .8rem; color: var(--muted); line-height: 1.55; margin-top: 8px; }
.field label .req { color: var(--red-bright); margin-left: 2px; }
.cg-style-prev { margin-top: 10px; }
.cg-style-prev img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

/* optional fitting close-up references */
.cg-fixtures .opt { color: var(--muted); font-weight: 400; font-size: .82em; }
.cg-fx-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
.cg-fx { display: flex; flex-direction: column; gap: 7px; }
.cg-fx-label { font-size: .82rem; font-weight: 600; color: var(--cream); }
.cg-fx-input { font-size: .82rem; }
.cg-fx-prev { margin-top: 2px; }
.cg-fx-prev img { display: block; width: 100%; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
@media (max-width: 520px) { .cg-fx-grid { grid-template-columns: 1fr; } }

/* requested-changes chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 9px 15px; border-radius: 999px; background: var(--ink-2);
  border: 1px solid var(--line); color: var(--cream); font-family: var(--sans);
  font-weight: 600; font-size: .85rem; transition: border-color .18s, background .18s, color .18s;
}
.chip:hover span { border-color: var(--red); }
.chip input:checked + span { background: rgba(224,27,34,.12); border-color: var(--red); color: var(--cream); }
.chip input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

.concept-privacy { font-size: .8rem; color: var(--muted-2); line-height: 1.55; margin-top: 14px; }

/* button states */
#btnGenerate[disabled] { opacity: .55; cursor: progress; }
.btn-outline {
  background: none; border: 1px solid var(--line); color: var(--cream); padding: 14px 26px;
  border-radius: 8px; font-family: var(--sans); font-weight: 700; font-size: .8rem;
  letter-spacing: .04em; cursor: pointer; transition: border-color .2s, color .2s; text-decoration: none; display: inline-block;
}
.btn-outline:hover { border-color: var(--red); color: var(--red); }

/* generated result */
.concept-result { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; animation: cgFade .5s var(--ease-out) both; }
@keyframes cgFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.concept-image-wrap { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--ink); }
.concept-image-wrap img { display: block; width: 100%; height: auto; }
.concept-after { margin-top: 18px; }
.concept-after-msg { color: var(--cream); font-weight: 600; margin-bottom: 14px; }
.concept-ctas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* fixture icons pop in when added */
.ed-item.ed-pop { animation: edPop .34s cubic-bezier(.2,.85,.3,1.25) both; }
@keyframes edPop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: none; } }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wstep, .results.active { animation: none !important; }
  .results.active .result-card, .ed-item.ed-pop { animation: none !important; }
  .editor-toolbar button:hover, .ed-barbtn:active { transform: none !important; }
  .wizard-progress .pip::after, .split-bar > i { transition: none !important; }
  .concept-result { animation: none !important; }
}

/* ===== planner upgrade: area chip · warnings · clash tint · zoom · preset chips ===== */
.ed-areachip{position:absolute;right:10px;bottom:10px;pointer-events:none;z-index:3;
  text-align:right;color:rgba(244,241,236,.92);font-weight:700;font-size:clamp(.72rem,1.5vw,.9rem);
  letter-spacing:.02em;line-height:1.2;padding:7px 11px;border-radius:8px;
  background:rgba(18,18,20,.74);border:1px solid var(--line);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);}
.ed-areachip span{display:block;font-weight:500;font-size:.68em;color:rgba(244,241,236,.55);margin-top:1px;}
/* door swing controls (segmented) */
.ep-doorctl{margin:2px 0 10px;}
.ep-seglab{font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:9px 0 5px;}
.ep-seg{display:flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;}
.ep-seg button{flex:1;padding:7px 8px;border:0;border-left:1px solid var(--line);background:var(--panel);color:var(--cream);font:inherit;font-size:.76rem;font-weight:600;cursor:pointer;transition:background .15s,color .15s;}
.ep-seg button:first-child{border-left:0;}
.ep-seg button:hover{color:var(--red);}
.ep-seg button.on{background:var(--red);color:#fff;}
/* per-item status (Keep/Remove/Move/New) + notes + on-canvas badge */
.ep-status button[data-v="new"].on{background:#2f76c9;}
.ep-status button[data-v="keep"].on{background:#2f9e5b;}
.ep-status button[data-v="move"].on{background:#d39a2a;}
.ep-status button[data-v="remove"].on{background:var(--red);}
.ep-note{display:block;font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600;margin:10px 0 0;}
.ep-note textarea{display:block;width:100%;margin-top:5px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--cream);font-family:var(--sans);font-size:.85rem;padding:8px 9px;resize:vertical;min-height:46px;text-transform:none;letter-spacing:0;font-weight:400;}
.ep-note textarea:focus{outline:none;border-color:var(--red);}
.ed-st{position:absolute;top:-7px;right:-4px;z-index:3;font-size:.5rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#fff;padding:1px 5px;border-radius:999px;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,.6);white-space:nowrap;}
.ed-st.new{background:#2f76c9;} .ed-st.keep{background:#2f9e5b;} .ed-st.move{background:#d39a2a;} .ed-st.remove{background:var(--red);}
.ed-item.st-remove{opacity:.72;} .ed-item.st-remove .ed-glyph{filter:saturate(.35);}
.ed-warns{display:flex;flex-direction:column;gap:5px;margin:0 0 10px;padding:10px 14px;border-radius:10px;
  background:rgba(255,176,32,.08);border:1px solid rgba(255,176,32,.28);font-size:.84rem;color:#ffc24d;line-height:1.45;}
.ed-warns[hidden]{display:none;}
.ed-warns b{color:#ffd27a;font-weight:700;}
.ed-warns em{color:#8a8a90;font-style:normal;font-size:.74rem;}
.ed-item.clash{outline:2px solid rgba(255,42,48,.85);outline-offset:-2px;background:rgba(224,27,34,.16);}
.ed-item{touch-action:none;}
.ed-zoomgrp{display:inline-flex;gap:4px;}
.ed-zoombtn{min-width:34px;font-size:1.05rem;font-weight:700;padding:6px 10px;}
.editor-stage-wrap,.editor-main{overflow:auto;}
.ep-presets{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 10px;}
.ep-presets button{padding:6px 10px;border-radius:8px;border:1px solid var(--line,#2a2a2e);background:var(--panel,#161618);
  color:var(--cream,#f4f1ec);font:inherit;font-size:.78rem;cursor:pointer;}
.ep-presets button.on{border-color:var(--red,#e01b22);background:rgba(224,27,34,.14);}
.ep-presets button:hover{border-color:var(--red,#e01b22);}
