:root {
  --accent: #e8732a; --accent-ink: #fff; --dark: #16202b;
  --bg: rgba(255, 255, 255, 0.94); --ink: #18202a; --muted: #5d6874; --line: #dfe3e8; --soft: #f2f4f7;
  --r: 14px; --shadow: 0 10px 30px rgba(10, 20, 30, 0.18);
  --sheetW: 392px; --sumW: 300px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfd9e2; color: var(--ink); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
#viewport { position: fixed; inset: 0; touch-action: none; }
#viewport canvas { display: block; width: 100%; height: 100%; outline: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* loader */
.loader { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: linear-gradient(#dfe8ef, #c4d1db); z-index: 50; transition: opacity .4s; }
body.ready .loader { opacity: 0; pointer-events: none; }
.spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(0,0,0,.12); border-top-color: var(--accent); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* top bar */
.top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; z-index: 10; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 10px; background: var(--dark); color: #fff; padding: 9px 14px; border-radius: 12px; box-shadow: var(--shadow); }
.brand b { letter-spacing: .08em; font-size: 15px; }
.brand b::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: 8px; border-radius: 2px; transform: rotate(45deg) translateY(-1px); }
.brand span { font-size: 12px; opacity: .75; }
.topacts { display: flex; gap: 8px; align-items: center; }
.langs { display: flex; background: var(--bg); border-radius: 12px; padding: 3px; box-shadow: var(--shadow); }
.langs button { border: 0; background: none; padding: 8px 11px; border-radius: 9px; font-weight: 600; font-size: 13px; min-width: 40px; cursor: pointer; }
.langs button.on { background: var(--dark); color: #fff; }
.icon { border: 0; background: var(--bg); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; }

.dimchip { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: rgba(22, 32, 43, .82); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; z-index: 9; white-space: nowrap; backdrop-filter: blur(6px); }

/* view buttons */
.viewbar { position: fixed; right: calc(var(--sumW) + 26px); top: 70px; display: flex; flex-direction: column; gap: 6px; z-index: 9; }
.viewbar button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; font-size: 12px; }
.viewbar button.on { background: var(--dark); color: #fff; }
.viewbar button.ar { width: auto; padding: 0 10px; display: flex; gap: 6px; align-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* options sheet */
.sheet { position: fixed; left: 14px; top: 70px; bottom: 14px; width: var(--sheetW); background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 8; backdrop-filter: blur(10px); overflow: hidden; }
.grip { display: none; }
.steps { display: flex; gap: 4px; padding: 10px 10px 6px; overflow-x: auto; scrollbar-width: none; flex: none; border-bottom: 1px solid var(--line); }
.steps::-webkit-scrollbar { display: none; }
.steps button { flex: none; border: 0; background: var(--soft); padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.steps button i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.steps button.on { background: var(--dark); color: #fff; }
.steps button.on i { background: var(--accent); color: #fff; }
.pane { flex: 1; overflow-y: auto; padding: 14px 16px 20px; overscroll-behavior: contain; }
.pane h3 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pane h3:first-child { margin-top: 2px; }
.sheetfoot { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex: none; }
.sheetfoot button { flex: 1; }

/* controls */
button.primary, button.strong, button.ghost, .chip { min-height: 46px; border-radius: 12px; padding: 0 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.primary { background: var(--accent); color: var(--accent-ink); border: 0; }
button.strong { background: var(--dark); color: #fff; border: 0; }
button.ghost { background: #fff; border: 1px solid var(--line); }
button.big { min-height: 52px; font-size: 16px; }
button:disabled { opacity: .45; cursor: default; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.card { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
.card b { font-size: 15px; }
.card small { color: var(--muted); font-size: 12px; }
.card.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.card svg { width: 44px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; margin-bottom: 2px; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; min-height: 42px; border-radius: 9px; font-weight: 600; cursor: pointer; font-size: 14px; }
.seg button.on { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; }
.field > label { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
.field > label output { color: var(--accent); font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 22px; font-weight: 600; cursor: pointer; flex: none; }
.stepper input[type=range] { flex: 1; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: var(--line); accent-color: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.3); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; }
.hint { font-size: 12px; color: var(--muted); margin-top: -6px; }
.warn { background: #fff4e5; border: 1px solid #ffd59a; color: #7a4a00; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.sw { border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.sw span { width: 46px; height: 46px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); display: block; }
.sw.on span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.sw.on { color: var(--ink); font-weight: 700; }
.colgroup { margin: 6px 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }

.items { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.item.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.item .ih { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item .ih b { font-size: 14px; }
.item .del { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 18px; }
.item select, .addrow select, .form input, .form select, .form textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.item .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.addrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 8px 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle .tx { display: flex; flex-direction: column; }
.toggle .tx small { color: var(--muted); }
.toggle input { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { left: 23px; }
.incl { display: flex; flex-wrap: wrap; gap: 6px; }
.incl span { background: #e9f6ee; color: #1f6b3a; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form .full { grid-column: 1 / -1; }
.form label { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.form textarea { min-height: 80px; resize: vertical; }
.form .consent { flex-direction: row; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink); font-size: 12px; line-height: 1.4; }
.form .consent input { width: 22px; height: 22px; min-height: 0; flex: none; margin-top: 1px; accent-color: var(--accent); }
.form .err { border-color: #e0483e !important; background: #fff6f5; }

/* summary */
.summary { position: fixed; right: 14px; top: 70px; width: var(--sumW); max-height: calc(100% - 84px); overflow-y: auto; background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; z-index: 8; backdrop-filter: blur(10px); }
.summary h2 { margin: 0 0 8px; font-size: 16px; }
.sumtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.sumtable td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sumtable td:first-child { color: var(--muted); padding-right: 8px; }
.sumtable td:last-child { text-align: right; font-weight: 600; }
.sumacts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.price { margin-top: 12px; padding: 10px 12px; background: var(--soft); border-radius: 12px; }
.price b { font-size: 22px; display: block; }
.mbar { display: none; }

dialog { border: 0; border-radius: 16px; padding: 20px; max-width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(10, 20, 30, .45); }
dialog h2 { margin: 0 0 10px; }
dialog input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.row { display: flex; gap: 8px; margin-top: 14px; }
.row.end { justify-content: flex-end; }
.qr { display: grid; place-items: center; margin: 12px 0; }
.qr canvas { width: 200px; height: 200px; image-rendering: pixelated; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--dark); color: #fff; padding: 10px 16px; border-radius: 12px; opacity: 0; transition: all .25s; z-index: 60; pointer-events: none; font-size: 14px; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.xroverlay { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 24px; color: #fff; text-shadow: 0 1px 4px #000; }
.xroverlay button { min-height: 46px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; font-weight: 700; }

/* ---------- phones / narrow ---------- */
@media (max-width: 820px) {
  .summary { display: none; }
  .top { padding: max(8px, env(safe-area-inset-top)) 10px 8px; }
  .brand { padding: 8px 11px; }
  .brand span { display: none; }
  .langs button { padding: 7px 8px; min-width: 34px; }
  .dimchip { top: 60px; left: 10px; transform: none; font-size: 12px; padding: 6px 11px; }
  .viewbar { right: 10px; top: 62px; }
  .viewbar { top: 100px; gap: 5px; }
  .viewbar button { width: 40px; height: 40px; border-radius: 11px; }
  .viewbar button.ar span { display: none; }
  .viewbar button.ar { width: 42px; padding: 0; justify-content: center; }
  .sheet { --peek: 46vh; left: 0; right: 0; top: auto; bottom: 0; width: auto; height: var(--sheetH, 46vh); max-height: calc(100% - 60px); border-radius: 18px 18px 0 0; transition: height .25s ease; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .sheet.dragging { transition: none; }
  .grip { display: flex; justify-content: center; padding: 8px 0 2px; cursor: grab; touch-action: none; flex: none; }
  .grip span { width: 44px; height: 5px; border-radius: 3px; background: #c3c9d0; }
  .steps { padding: 4px 10px 8px; }
  .sheetfoot { display: none; }
  .mbar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); z-index: 12; }
  .mbar button { flex: 1; min-height: 48px; }
  .mbar .strong { flex: 0 0 auto; }
  body { --peek: 46vh; }
}
.xroverlay[hidden] { display: none; }
.row.wrap { flex-wrap: wrap; }
.row .ghost { flex: 1; }

/* 10-30: quick size picks on the first step (Maße) */
.quick{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px}
.quick button{border:1px solid var(--line,#d8dbe0);background:#fff;border-radius:10px;padding:8px 11px;font:inherit;font-weight:600;font-size:13px;cursor:pointer}
.quick button.on{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 25%,transparent)}
/* ?embed=1 — inside the seller's site: no own brand chip and language switch */
.embed .top .brand,.embed #langs{display:none}
/* 10-30: panels appear only when the app is ready — no layout shift (CLS) while it starts */
body:not(.ready) .sheet, body:not(.ready) .summary, body:not(.ready) .mbar, body:not(.ready) .tools, body:not(.ready) .dimchip { visibility: hidden; }

/* 10-30 stage 1: option cards, ground swatches, info boxes, live price, reservation */
.cards.opt .card { min-height: 0; padding: 9px 10px; }
.cards.opt .card svg { width: 40px; height: 28px; }
.cards.opt .card small { line-height: 1.3; }
.gsw { display: block; width: 100%; height: 30px; border-radius: 8px; margin-bottom: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.g-lawn { background: radial-gradient(circle at 30% 40%, #6f8f45 0 18%, transparent 19%), repeating-linear-gradient(100deg, #4c6430 0 2px, #5b7838 2px 4px); }
.g-gravel { background: radial-gradient(circle at 20% 30%, #b9b5ad 0 3px, transparent 4px) 0 0/9px 9px, radial-gradient(circle at 60% 70%, #8d8981 0 3px, transparent 4px) 0 0/11px 11px, #7d7a74; }
.g-pavers { background: linear-gradient(90deg, #5d5b57 2px, transparent 2px) 0 0/22px 11px, linear-gradient(#5d5b57 2px, transparent 2px) 0 0/22px 11px, #8f8c86; }
.g-concrete { background: radial-gradient(circle at 70% 30%, #b5b1aa, transparent 50%), #9d9a94; }
.g-grassgrid { background: radial-gradient(circle, #5f8a3a 0 4px, #3d3424 5px 6px, transparent 7px) 0 0/14px 14px, radial-gradient(circle, #5f8a3a 0 4px, #3d3424 5px 6px, transparent 7px) 7px 7px/14px 14px, #a19d95; }
.info { display: flex; flex-direction: column; gap: 2px; background: var(--soft); border-radius: 10px; padding: 9px 11px; margin: 10px 0; font-size: 13px; }
.info span { color: var(--muted); font-size: 12px; }
.note { font-size: 12px; color: #7a4a00; background: #fff7e8; border-radius: 10px; padding: 8px 10px; }
button.full { width: 100%; margin-top: 6px; }
.warn .fix { display: block; margin-top: 6px; border: 0; background: #7a4a00; color: #fff; border-radius: 8px; padding: 7px 10px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.toggle.mini { padding: 8px 0 4px; border-bottom: 0; }
.toggle.mini .tx b { font-size: 13.5px; }
.toggle.mini .tx small { font-size: 12px; }
.field.inl { margin: 4px 0 6px; }
.field.inl .seg button { min-height: 36px; }
.price .prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price .prow .seg { padding: 2px; border-radius: 9px; background: #fff; }
.price .prow .seg button { min-height: 28px; padding: 0 9px; font-size: 12px; }
.price .prow .seg button.on { background: var(--dark); color: #fff; }
.price b { margin: 2px 0; }
.price small { display: block; font-size: 11.5px; line-height: 1.35; }
.price .demo { margin-top: 4px; color: #8a5a00; font-weight: 600; }
button.reserve { border-color: var(--accent); color: var(--ink); }
.tol { margin: 6px 0 0; }
.mprice { display: none; }
@media (max-width: 820px) {
  .mbar .mprice:not([hidden]) { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; flex: 0 0 auto; min-height: 48px; padding: 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); cursor: pointer; line-height: 1.1; }
  .mprice b { font-size: 16px; font-variant-numeric: tabular-nums; }
  .mprice small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
  .mbar #mInquiry { font-size: 14px; padding: 0 10px; }
}
/* 10-30 phone polish: the view buttons stay above the bottom sheet (AR no longer covers the steps strip) */
@media (max-width: 820px) {
  .viewbar { top: auto; bottom: calc(var(--peek, 46vh) + 28px); max-height: calc(100% - var(--peek, 46vh) - 140px); flex-wrap: wrap-reverse; align-content: flex-end; }
  .mprice b, .mprice small { display: block; }
}
.hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;opacity:0}
/* with a real logo the decorative diamond is not needed */
.brand:has(img.logo) b::before { display: none; }
.brand:has(img.logo) { display: flex; align-items: center; }
/* 10-31: carports on 4 sides — 2 × 2 side picker (small plan per side) + one compact box per carport */
.cp4{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0 0 12px}
.cp4 button{display:flex;align-items:center;gap:8px;border:1px solid var(--line,#d8dbe0);background:#fff;border-radius:12px;padding:6px 10px;min-height:46px;font:inherit;font-weight:600;font-size:14px;cursor:pointer;text-align:left}
.cp4 svg{width:40px;height:29px;flex:none;fill:none;stroke:#8a939c;stroke-width:1.5}
.cp4 svg .hl{fill:#eef0f2;stroke-dasharray:2 2}
.cp4 button.on{border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 25%,transparent)}
.cp4 button.on svg .hl{fill:color-mix(in srgb,var(--accent) 35%,#fff);stroke:var(--accent);stroke-dasharray:none}
.cpbox{border-left:3px solid var(--accent,#d8463f);padding:2px 0 2px 12px;margin:0 0 14px}
.cpbox>b{display:block;margin:0 0 4px;font-size:14px}
.cpbox .field{margin-bottom:6px}
.cpbox .quick{margin:0 0 6px}
.cpbox .hint{margin:0 0 4px}

/* 10-31: every step visible at once — no hidden steps in a scrolling strip */
.steps { overflow: visible; justify-content: space-between; align-items: center; gap: 2px; position: relative; flex-wrap: nowrap; }
.steps::before { content: ""; position: absolute; left: 22px; right: 22px; top: 50%; height: 2px; background: var(--line); z-index: 0; }
.steps button { position: relative; z-index: 1; padding: 6px; border-radius: 999px; flex: 0 0 auto; min-width: 34px; justify-content: center; background: var(--bg); }
.steps button .lbl { display: none; }
.steps button.on { padding: 6px 12px 6px 6px; }
.steps button.on .lbl { display: inline; }
.steps button i { width: 24px; height: 24px; font-size: 12px; border: 2px solid var(--line); background: #fff; }
.steps button.done i { background: var(--dark); border-color: var(--dark); color: #fff; }
.steps button:hover:not(.on) i { border-color: var(--accent); color: var(--accent); }
.steps button.on i { border-color: var(--accent); }
.stepsinfo { padding: 2px 14px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.stepsinfo b { color: var(--ink, #1b1d1f); }
.steps { border-bottom: 0; }
