/* AUHAUS Design Studio — inside a sandboxed iframe on the AUHAUS site.
   The served CSP is `font-src 'self'`, so there are no web fonts here: the
   stack below is the closest system approximation of the site's Manrope/Inter
   pairing. Loading Google Fonts would silently fail. */
:root{
  --ink:#12151A; --ink-2:#1C2128; --bone:#F4F1EC; --line:#E3DDD3;
  --brass:#B8873B; --brass-lt:#D4A85C; --muted:#5A6068;
}
*{box-sizing:border-box}
/* MUST come before anything that sets `display`. Every state in this app is
   toggled with the `hidden` attribute, and the UA's `[hidden]{display:none}` is
   a plain rule that ANY later `display` declaration beats — so `.go` and
   `#preview` were showing an empty preview box and a live "Create my concept"
   button before the visitor had chosen a file. */
[hidden]{display:none !important}
html,body{margin:0;background:#fff;color:var(--ink);
  font-family:'Segoe UI',-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif}
.wrap{max-width:760px;margin:0 auto;padding:26px 20px 34px}
section{text-align:center}

/* ── drop zone ─────────────────────────────────────────────────────────── */
.drop{display:flex;flex-direction:column;align-items:center;gap:8px;cursor:pointer;
  border:2px dashed var(--line);border-radius:14px;padding:34px 22px;color:var(--ink);
  background:var(--bone);transition:border-color .15s ease,background .15s ease}
.drop:hover{border-color:var(--brass);background:#fff}
.drop svg{color:var(--brass)}
.drop span{font-weight:700;font-size:16px}
.drop small{color:var(--muted);font-size:12.5px}

#preview{max-width:100%;max-height:260px;border-radius:12px;margin:18px auto 0;display:block;
  border:1px solid var(--line)}

/* ── the two pickers ───────────────────────────────────────────────────── */
.choices{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin:24px 0 4px;text-align:left}
.lbl{display:block;font-weight:700;font-size:13px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:9px}
.opts{display:flex;flex-wrap:wrap;gap:7px}
.opt{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:999px;
  padding:8px 15px;font-size:13.5px;font-weight:600;cursor:pointer;font-family:inherit;
  transition:all .15s ease}
.opt:hover{border-color:var(--brass);color:var(--brass)}
.opt[aria-checked="true"]{background:var(--ink);border-color:var(--ink);color:#fff}

/* ── buttons ───────────────────────────────────────────────────────────── */
.go{display:inline-block;background:var(--brass);color:#fff;border:0;border-radius:8px;
  padding:14px 32px;font-size:16px;font-weight:700;cursor:pointer;margin-top:22px;
  font-family:inherit;text-decoration:none;transition:transform .15s ease,box-shadow .15s ease}
.go:hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(184,135,59,.34)}
.ghost{background:transparent;border:1px solid var(--line);color:var(--ink);border-radius:8px;
  padding:13px 28px;font-size:15px;font-weight:700;cursor:pointer;margin-top:22px;font-family:inherit}
.ghost:hover{border-color:var(--ink)}
.actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}

/* ── states ────────────────────────────────────────────────────────────── */
.msg{margin:16px auto 0;max-width:520px;color:#8A3A2A;background:#FCF0EC;border:1px solid #F3D6CC;
  border-radius:10px;padding:12px 16px;font-size:14.5px;line-height:1.55}
.spin{width:38px;height:38px;margin:26px auto 16px;border-radius:50%;
  border:3px solid var(--line);border-top-color:var(--brass);animation:sp 1s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}

/* ── the % progress pie (estimated against measured render times) ──────── */
.pie{width:72px;height:72px;margin:22px auto 16px;position:relative}
.pie svg{width:100%;height:100%;transform:rotate(-90deg)}
.pie circle{fill:none;stroke-width:5}
.pie .pie-bg{stroke:var(--line)}
.pie .pie-fg{stroke:var(--brass);stroke-linecap:round;
  transition:stroke-dashoffset .25s linear}
.pie .pie-num{position:absolute;inset:0;display:flex;align-items:center;
  justify-content:center;font-weight:800;font-size:15px;color:var(--ink);
  font-variant-numeric:tabular-nums}
#progress p{font-weight:700;font-size:16px;margin:0 0 4px}
#progress small{color:var(--muted);font-size:13px}

#resultImg{max-width:100%;border-radius:14px;display:block;margin:0 auto;
  box-shadow:0 18px 44px rgba(10,12,16,.22)}

/* ── the measured plan views ───────────────────────────────────────────── */
.hint{font-size:13px;line-height:1.6;color:var(--muted);margin:10px 0 0}
.tabs{display:flex;gap:8px;justify-content:center;margin:0 0 14px}
.tab{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:999px;
  padding:9px 22px;font-size:14px;font-weight:700;cursor:pointer;font-family:inherit;
  transition:all .15s ease}
.tab[aria-selected="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.viewport{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;
  position:relative;aspect-ratio:900/560}
.viewport svg{display:block;width:100%;height:100%}
#canvas3d{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
#canvas3d:active{cursor:grabbing}
.drag-hint{position:absolute;right:12px;bottom:10px;font-size:11.5px;color:var(--muted);
  background:rgba(255,255,255,.85);border-radius:6px;padding:3px 9px;pointer-events:none}

/* ── the 3D camera bar (orbit / walk-through) ──────────────────────────── */
.v3d-bar{position:absolute;left:10px;top:10px;display:flex;gap:10px;align-items:center}
.v3d-bar .prop-toggle{background:rgba(255,255,255,.92)}
.v3d-nav{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,.92);
  border:1px solid var(--line);border-radius:999px;padding:2px 6px}
.v3d-nav button{border:0;background:transparent;color:var(--ink);cursor:pointer;
  font-size:12px;padding:4px 7px;font-family:inherit}
.v3d-nav button:hover{color:var(--brass)}
.v3d-nav span{font-size:12px;font-weight:700;max-width:150px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap}
.readout{margin:16px 0 0}
#planStats{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.stat{font-size:13.5px;color:var(--ink);background:var(--bone);border-radius:999px;
  padding:7px 14px}
.scale-note{font-size:12.5px;color:var(--muted);margin:10px 0 0}

/* ── the assumptions panel ─────────────────────────────────────────────── */
.assume{text-align:left;background:#FBF6EA;border:1px solid #E8D9B8;border-left:3px solid var(--brass);
  border-radius:0 10px 10px 0;padding:15px 18px;margin:0 0 16px;font-size:13.5px;line-height:1.6}
.assume strong{color:var(--ink);display:block;margin-bottom:6px}
.assume ul{margin:0 0 12px;padding-left:20px;color:var(--muted)}
.assume li{margin:3px 0}
.assume-fix{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.assume-fix label{font-weight:600;color:var(--ink);font-size:13px}
.assume-fix input{width:90px;border:1px solid var(--line);border-radius:7px;padding:8px 10px;
  font-size:14px;font-family:inherit}
.assume-fix span{color:var(--muted);font-size:13px}
.ghost.small{margin-top:0;padding:8px 16px;font-size:13px}
.assume-foot{margin:10px 0 0;color:var(--muted);font-size:12.5px}

/* ── the download gate ─────────────────────────────────────────────────── */
.gate-title{font-size:22px;margin:6px 0 4px}
.gate-sub{color:var(--muted);font-size:14.5px;line-height:1.6;max-width:460px;margin:0 auto 18px}
.gate-form{max-width:400px;margin:0 auto;text-align:left}
.gate-form input{width:100%;border:1px solid var(--line);border-radius:8px;padding:12px 13px;
  font-size:15px;font-family:inherit;margin:0 0 10px;box-sizing:border-box}
.gate-form input:focus{outline:none;border-color:var(--brass);box-shadow:0 0 0 3px rgba(184,135,59,.16)}
.gate-row{display:flex;gap:10px}
.gate-row input{flex:1}
.gate-form .go{display:block;width:100%;margin-top:8px}
.gate-form .ghost{display:block;width:100%;margin-top:10px}
.gate-fine{color:var(--muted);font-size:12px;line-height:1.5;margin:12px 0 0;text-align:center}

/* ── the cabinet proposal ──────────────────────────────────────────────── */
.prop-pickers{text-align:left;border:1px solid var(--line);border-radius:14px;padding:18px;margin:0 0 6px}
.prop-pickers .choice{margin:0 0 16px}
.prop-pickers .go{margin-top:4px}
.style-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px}
.style-card{border:2px solid var(--line);border-radius:10px;overflow:hidden;cursor:pointer;
  background:#fff;padding:0;font-family:inherit;text-align:center;transition:border-color .15s ease}
.style-card img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.style-card span{display:block;font-size:12px;font-weight:700;padding:7px 4px;color:var(--ink)}
.style-card[aria-checked="true"]{border-color:var(--brass);box-shadow:0 0 0 2px rgba(184,135,59,.25)}
#propImg{max-width:100%;border-radius:14px;display:block;margin:0 auto;
  box-shadow:0 18px 44px rgba(10,12,16,.22)}

/* ── the proposal room grid ────────────────────────────────────────────────
   One card per measured room. The card body keeps a fixed 4:3 stage so the
   grid doesn't jump as renders land; the pie sits centre-stage while a room
   is rendering and the note strip carries per-card status. */
.prop-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(225px,1fr));
  gap:14px;margin:14px 0 0;text-align:left}
.prop-grid > .hint{grid-column:1/-1;text-align:center}
.prop-card{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff}
.prop-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:9px 12px;border-bottom:1px solid var(--line);background:var(--bone)}
.prop-card-name{font-weight:700;font-size:13.5px}
.prop-card-name small{color:var(--muted);font-weight:600;font-size:11.5px;margin-left:4px}
.prop-toggle{display:flex;border:1px solid var(--line);border-radius:999px;overflow:hidden;
  flex:none}
.prop-toggle button{border:0;background:#fff;color:var(--ink);font-family:inherit;
  font-weight:700;font-size:11.5px;padding:5px 11px;cursor:pointer}
.prop-toggle button[aria-checked="true"]{background:var(--ink);color:#fff}
.prop-card-body{position:relative;aspect-ratio:4/3;display:flex;align-items:center;
  justify-content:center;background:var(--bone)}
.prop-card-body img{width:100%;height:100%;object-fit:cover;display:block;cursor:zoom-in}
.prop-card-pie{width:56px;height:56px;margin:0}
.prop-card-note{position:absolute;left:10px;right:10px;bottom:8px;margin:0;font-size:11.5px;
  line-height:1.45;color:var(--muted);background:rgba(255,255,255,.92);border-radius:7px;
  padding:6px 9px;text-align:center}
#propResult{margin-top:18px}
.disclaimer{max-width:560px;margin:18px auto 0;font-size:13px;line-height:1.65;color:var(--muted);
  background:var(--bone);border-left:3px solid var(--brass);border-radius:0 8px 8px 0;
  padding:13px 16px;text-align:left}
.disclaimer strong{color:var(--ink);display:block;margin-bottom:3px}
.remaining{color:var(--muted);font-size:12.5px;margin:14px 0 0}

@media(max-width:560px){
  .choices{grid-template-columns:1fr;gap:18px}
  .wrap{padding:18px 14px 26px}
}
@media(prefers-reduced-motion:reduce){
  .spin{animation-duration:3s}
  .go:hover{transform:none}
}
