  /* konfigx.ch palette: dark navy + cyan, Space Grotesk / IBM Plex Mono. Single (dark) theme like the site. */
  :root {
    color-scheme: dark;
    --bg:#060f1c; --bg2:#0a1830; --card:#0b1a31; --ink:#f0f6fc; --muted:#9fb3c8; --faint:#5d7491;
    --line:rgba(255,255,255,.08); --line-strong:rgba(159,179,200,.28);
    --accent:#22d3ee; --accent-soft:rgba(34,211,238,.09); --accent-ink:#04202a;
    --danger:#ff7a85; --danger-bg:rgba(255,122,133,.13); --warn-bg:rgba(251,191,36,.13); --warn:#fcd34d;
    --focus:#67e8f9; --shadow:0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    --mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
    --r:14px; --gap:16px;
  }
  * { box-sizing:border-box; }
  html,body { height:100%; }
  body { margin:0; font:15px/1.45 'Space Grotesk',system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--ink); }
  button { font:inherit; color:inherit; }
  :focus-visible { outline:2px solid var(--focus); outline-offset:2px; }

  /* ---- layout: viewer | configuration column (scrolls) with a pinned summary ---- */
  .app { display:grid; grid-template-columns: minmax(0,1fr) clamp(440px, 38vw, 580px); height:100vh; }
  .viewer { position:relative; background:var(--bg2); min-height:0; }
  .viewer iframe { position:absolute; inset:0; width:100%; height:100%; border:0; background:var(--bg2); }
  /* Covers the iframe until the app has hidden DynaMaker's own toolbar (it is visible for a moment after load). */
  .loading { position:absolute; inset:0; z-index:1; display:grid; place-items:center; background:var(--bg2); color:var(--muted);
    font-family:var(--mono); font-size:13px; letter-spacing:.04em; transition:opacity .25s; }
  .loading.done { opacity:0; pointer-events:none; }
  .loading::before { content:""; width:22px; height:22px; margin-bottom:38px; border:2px solid var(--line-strong); border-top-color:var(--accent);
    border-radius:50%; animation:spin .8s linear infinite; position:absolute; }
  .loading span { margin-top:44px; }
  @keyframes spin { to { transform:rotate(360deg); } }
  /* Floating toolbar at the top of the 3D view (replaces DynaMaker's own icon bar, which the app hides in the embed). */
  .viewbar { position:absolute; top:14px; left:50%; transform:translateX(-50%); width:max-content; z-index:1; display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:2px;
    padding:4px; max-width:calc(100% - 20px); border:1px solid var(--line-strong); border-radius:999px; background:rgba(10,24,48,.82); box-shadow:var(--shadow); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }
  .viewbar button { display:inline-flex; align-items:center; justify-content:center; gap:7px; height:36px; min-width:36px; padding:0; border:0; border-radius:999px; background:transparent; color:var(--ink); cursor:pointer; }
  .viewbar button svg { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
  .viewbar button.tg { padding:0 14px 0 11px; font-size:14px; font-weight:500; }
  .viewbar button:hover { background:rgba(255,255,255,.09); }
  .viewbar button[aria-pressed=true] { background:var(--accent-soft); color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
  .viewbar .slat { stroke-width:3; stroke-linecap:butt; transform-box:fill-box; transform-origin:center; transition:transform .35s ease; }
  .viewbar #louvreBtn[aria-pressed=true] .slat { transform:rotate(-68deg); }
  .viewbar .vsep { width:1px; height:20px; margin:0 5px; background:var(--line-strong); }
  #status { position:absolute; left:16px; bottom:16px; right:16px; padding:10px 14px; border-radius:10px; background:var(--warn-bg); color:var(--warn); display:none; z-index:2; }
  #status.error { background:var(--danger-bg); color:var(--danger); }

  .config { display:flex; flex-direction:column; min-height:0; background:var(--bg); border-left:1px solid var(--line); }
  .head { padding:20px 24px 12px; position:relative; z-index:1; box-shadow:0 1px 0 var(--line); }
  .head h1 { font-size:22px; margin:0 0 2px; letter-spacing:-.01em; }
  .head p { margin:0; color:var(--muted); }
  .scroll { flex:1; overflow-y:auto; padding:6px 12px 24px; display:flex; flex-direction:column; gap:var(--gap); scroll-behavior:smooth; }

  /* ---- step cards ---- */
  .card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); padding:18px 18px 20px; }
  .card > header { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
  .step { flex:none; width:26px; height:26px; border-radius:50%; background:var(--accent); color:var(--accent-ink); font-size:13px; font-weight:700; display:grid; place-items:center; }
  .card h2 { margin:0; font-size:17px; font-weight:650; }
  .card .aside { margin-left:auto; color:var(--muted); font-size:12.5px; text-align:right; }
  .group > h3, .sub .lbl, .minmax, .chip, .card .aside { font-family:var(--mono); }
  .hint { color:var(--muted); font-size:12.5px; margin:10px 0 0; }
  .chip { display:inline-block; margin-top:10px; padding:4px 10px; border-radius:999px; background:var(--accent-soft); color:var(--accent); font-size:12.5px; font-weight:600; }

  /* ---- dimensions ---- */
  .dim { margin-bottom:16px; }
  .dim:last-of-type { margin-bottom:4px; }
  .dim .row { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
  .dim label { font-weight:600; }
  .num { display:flex; align-items:center; gap:6px; color:var(--muted); }
  .num input { width:88px; padding:6px 8px; border:1px solid var(--line-strong); border-radius:8px; background:transparent; color:var(--ink); font:inherit; text-align:right; }
  input[type=range] { -webkit-appearance:none; appearance:none; width:100%; height:6px; border-radius:99px; outline-offset:6px;
    background:linear-gradient(to right, var(--accent) var(--pct,50%), var(--line-strong) var(--pct,50%)); }
  input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:22px; height:22px; border-radius:50%; background:var(--card); border:3px solid var(--accent); cursor:grab; box-shadow:0 1px 3px rgba(0,0,0,.25); }
  input[type=range]::-moz-range-thumb { width:16px; height:16px; border-radius:50%; background:var(--card); border:3px solid var(--accent); cursor:grab; }
  .minmax { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; margin-top:4px; }

  /* ---- option tiles: 4 in a row, 2x2 when narrow (container query) ---- */
  .opts { container-type:inline-size; }
  .grid4 { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:8px; }
  /* ---- embedded in konfigx.ch: <body class="in-site"> sits below the site's 58px app bar ---- */
  .in-site { --bar:58px; }
  .in-site .app { height:calc(100vh - var(--bar)); height:calc(100dvh - var(--bar)); }
  @container (max-width: 380px) { .grid4 { grid-template-columns:repeat(2, minmax(0,1fr)); } }
  .grid2 { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
  .grid3 { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; }
  .tile { position:relative; display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 4px 9px; text-align:center;
    background:transparent; border:1.5px solid var(--line-strong); border-radius:12px; cursor:pointer; min-height:92px; }
  .tile:hover { border-color:var(--muted); }
  .tile[aria-pressed=true] { border-color:var(--accent); background:var(--accent-soft); box-shadow:0 0 0 1px var(--accent) inset; }
  .tile[aria-pressed=true]::after { content:"✓"; position:absolute; top:5px; right:7px; font-size:12px; font-weight:700; color:var(--accent); }
  .tile svg { width:48px; height:36px; color:var(--muted); }
  .tile[aria-pressed=true] svg { color:var(--accent); }
  .tile .t { font-size:12.5px; font-weight:600; line-height:1.2; overflow-wrap:break-word; hyphens:auto; max-width:100%; }
  .tile .p { font-size:11.5px; color:var(--muted); line-height:1.2; }
  .tile.wide { align-items:flex-start; text-align:left; padding:12px 14px; min-height:0; }
  .swatchbox { width:48px; height:36px; border-radius:8px; border:1px solid var(--line-strong); }

  /* ---- colour swatches ---- */
  .swatch { width:40px; height:40px; flex:none; }
  .dot { flex:none; }
  .colorTile { min-height:0; padding:12px 6px 10px; }

  /* ---- side panels: groups -> cards (accordion) ---- */
  .group { margin-top:18px; }
  .group:first-of-type { margin-top:0; }
  .group > h3 { margin:0 0 8px; font-size:11.5px; letter-spacing:.09em; text-transform:uppercase; color:var(--muted); font-weight:700; display:flex; align-items:center; gap:10px; }
  .group > h3::after { content:""; flex:1; height:1px; background:var(--line); }
  .pcard { border:1px solid var(--line-strong); border-radius:12px; background:var(--card); margin-bottom:10px; overflow:hidden; }
  .pcard:last-child { margin-bottom:0; }
  .pcard.open { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
  .phead { width:100%; display:flex; align-items:center; gap:12px; padding:10px 12px; background:transparent; border:0; cursor:pointer; text-align:left; }
  .phead:hover { background:var(--accent-soft); }
  .plan { flex:none; width:44px; height:44px; color:var(--muted); }
  .phead .names { flex:1; min-width:0; }
  .phead .pt { font-weight:650; }
  .phead .ps { color:var(--muted); font-size:12.5px; }
  .phead .pp { font-weight:600; font-size:13px; white-space:nowrap; }
  .phead .chev { color:var(--muted); transition:transform .15s; }
  .pcard.open .chev { transform:rotate(180deg); }
  .pbody { display:none; padding:4px 10px 14px; border-top:1px solid var(--line); background:linear-gradient(var(--accent-soft), transparent 40px); }
  .pcard.open .pbody { display:block; }
  .sub { margin-top:14px; }
  .sub .lbl { font-size:12px; font-weight:700; color:var(--muted); margin-bottom:6px; letter-spacing:.02em; }
  .seg { display:flex; gap:6px; flex-wrap:wrap; }
  .seg button { display:flex; align-items:center; gap:8px; padding:7px 12px; border:1.5px solid var(--line-strong); border-radius:999px; background:transparent; cursor:pointer; font-size:13px; }
  .seg button:hover { border-color:var(--muted); }
  .seg button[aria-pressed=true] { border-color:var(--accent); background:var(--accent-soft); font-weight:600; }
  .dot { width:16px; height:16px; flex:none; }
  .linkbtn { margin-top:14px; background:transparent; border:0; padding:0; color:var(--accent); font-weight:600; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }

  /* ---- accessories ---- */
  .acc { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
  .acc:first-of-type { border-top:0; padding-top:0; }
  .acc .n { font-weight:600; }
  .acc .pr { color:var(--muted); font-size:12.5px; }
  .switch { position:relative; flex:none; width:46px; height:26px; border-radius:99px; border:0; background:var(--line-strong); cursor:pointer; transition:background .15s; }
  .switch::after { content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:transform .15s; }
  .switch[aria-checked=true] { background:var(--accent); }
  .switch[aria-checked=true]::after { transform:translateX(20px); }

  /* ---- pinned summary ---- */
  .summary { background:var(--card); border-top:1px solid var(--line-strong); box-shadow:0 -6px 20px rgba(20,30,25,.08); padding:12px 20px 16px; }
  .breakdown { display:none; max-height:34vh; overflow:auto; margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid var(--line); }
  .summary.open .breakdown { display:block; }
  .breakdown .row { display:flex; justify-content:space-between; gap:12px; padding:3px 0; font-size:13.5px; }
  .breakdown .note { color:var(--muted); font-size:12px; margin-top:6px; }
  .sumrow { display:flex; align-items:center; gap:12px; }
  .total { flex:1; }
  .pricebtn { display:inline-flex; align-items:center; gap:8px; margin-left:-8px; padding:4px 8px; border:0; border-radius:10px; background:transparent; cursor:pointer; }
  .pricebtn:hover { background:var(--accent-soft); }
  .pricebtn .chev { width:20px; height:20px; flex:none; fill:none; stroke:var(--accent); stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; transition:transform .2s; }
  .summary.open .pricebtn .chev { transform:rotate(180deg); }
  #copyLink { display:inline-flex; align-items:center; justify-content:center; gap:8px; }
  #copyLink .ic { width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  #copyLink .ic-ok, #copyLink.copied .ic-link { display:none; }
  #copyLink.copied .ic-ok { display:block; }
  #copyLink.copied { color:var(--accent); border-color:var(--accent); }
  .sumrow .primary { white-space:nowrap; }
  .total .v { font-size:24px; font-weight:750; letter-spacing:-.01em; white-space:nowrap; }
  .btn { border:1.5px solid var(--line-strong); background:transparent; border-radius:10px; padding:10px 14px; cursor:pointer; }
  .btn:hover { border-color:var(--muted); }
  .primary { background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:700; padding:12px 18px; }
  .primary:hover { filter:brightness(1.08); border-color:var(--accent); }

  /* ---- offer dialog ---- */
  dialog { border:1px solid var(--line-strong); border-radius:var(--r); background:var(--card); color:var(--ink); padding:0; width:min(480px, calc(100vw - 32px)); box-shadow:0 20px 60px rgba(0,0,0,.5); }
  dialog::backdrop { background:rgba(3,8,16,.7); }
  .dlg { padding:22px 22px 20px; display:flex; flex-direction:column; gap:12px; }
  .dlg h2 { margin:0; font-size:19px; }
  .dlg p { margin:0; color:var(--muted); font-size:13.5px; }
  .dlg label { display:flex; flex-direction:column; gap:4px; font-size:12px; font-family:var(--mono); color:var(--muted); letter-spacing:.03em; }
  .dlg input, .dlg textarea { font:15px/1.4 'Space Grotesk',system-ui,sans-serif; color:var(--ink); background:transparent; border:1px solid var(--line-strong); border-radius:8px; padding:9px 10px; }
  .dlg textarea { resize:vertical; min-height:64px; }
  .dlg .two { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .dlg .actions { display:flex; gap:10px; justify-content:flex-end; margin-top:4px; }
  #offerStatus { min-height:20px; font-size:13px; color:var(--muted); }
  #offerStatus.error { color:var(--danger); }
  .dlg .demo { padding:9px 12px; border-radius:8px; background:var(--warn-bg); color:var(--warn); font-size:13px; }
  .dlg .note { font-size:12.5px; }
  .dlg input[aria-invalid=true], .dlg textarea[aria-invalid=true] { border-color:var(--danger); box-shadow:0 0 0 1px var(--danger); }
  .ferr { color:var(--danger); font:13px/1.35 'Space Grotesk',system-ui,sans-serif; letter-spacing:0; }
  .ferr:empty { display:none; }
  @media (max-width: 480px) { .dlg .two { grid-template-columns:1fr; } }

  /* ---- small screens: viewer on top, panel below, summary pinned to the bottom ---- */
  @media (max-width: 900px) {
    html,body { height:auto; }
    .app { display:block; height:auto; }
    .viewer { position:sticky; top:0; height:46vh; z-index:3; }
    .in-site .app { height:auto; }
    .in-site .viewer { top:var(--bar); }
    .config { border-left:0; }
    .scroll { overflow:visible; padding-bottom:110px; }
    .summary { position:fixed; left:0; right:0; bottom:0; z-index:5; padding:10px 16px 14px; }
    .sumrow { flex-wrap:wrap; }
    .total { flex:1 1 100%; display:flex; align-items:baseline; justify-content:space-between; }
    .total .v { font-size:22px; }
    .sumrow .btn { flex:none; }
    .sumrow .primary { flex:1; white-space:nowrap; }
    .viewbar { top:8px; }
    .viewbar button { height:34px; min-width:34px; }
    .viewbar button.tg { padding:0 10px 0 8px; font-size:13px; }
    @media (max-width: 480px) { .viewbar button.tg { padding:0; } .viewbar button.tg span { display:none; } }   /* phones: icons only, one row */
    .card { padding:16px 14px 18px; }
  }

  /* ==== laptops (901–1600 px wide): same layout as the big screen, just denser. Wider screens are untouched. ==== */
  @media (min-width: 901px) and (max-width: 1600px) {
    .app { grid-template-columns: minmax(0,1fr) clamp(380px, 31vw, 480px); }
    .head { padding:14px 20px 10px; }
    .head h1 { font-size:19px; }
    .head p { font-size:13.5px; }
    .scroll { padding:6px 10px 18px; gap:12px; }
    .card { padding:14px 14px 16px; }
    .card > header { margin-bottom:10px; }
    .card h2 { font-size:16px; }
    .dim { margin-bottom:12px; }
    .tile { min-height:80px; }
    .summary { padding:10px 16px 12px; }
    .total .v { font-size:21px; }
    .btn { padding:9px 12px; }
    #copyLink { width:42px; height:42px; padding:0; flex:none; }
    #copyLink .lbl { display:none; }
    .primary { padding:11px 16px; }
    .viewbar button.tg { font-size:13px; }
  }

  /* ==== phones (≤ 640 px): compact controls, one-line price bar. Tablets (641–900 px) keep the stacked layout above. ==== */
  @media (max-width: 640px) {
    .in-site { --bar:50px; }
    .viewer { height:40vh; }
    /* view toolbar: smaller icon-only pill */
    .viewbar { top:6px; padding:3px; }
    .viewbar button, .viewbar button.tg { height:30px; min-width:30px; padding:0; }
    .viewbar button svg { width:17px; height:17px; }
    .viewbar button.tg span { display:none; }
    .viewbar .vsep { height:16px; margin:0 3px; }
    /* title */
    .head { padding:12px 16px 8px; }
    .head h1 { font-size:18px; }
    .head p { font-size:13px; }
    /* step cards */
    .scroll { padding:4px 10px 86px; gap:10px; }
    .card { padding:12px 12px 14px; border-radius:12px; }
    .card > header { margin-bottom:10px; gap:8px; }
    .step { width:22px; height:22px; font-size:12px; }
    .card h2 { font-size:15px; }
    .card .aside { font-size:11px; }
    .hint, .chip { font-size:12px; }
    .dim { margin-bottom:10px; }
    .dim .row { margin-bottom:4px; }
    .num input { width:74px; padding:4px 6px; }
    .tile { min-height:68px; padding:8px 4px 7px; gap:4px; }
    .tile svg { width:38px; height:28px; }
    .tile .t { font-size:12px; }
    .tile .p { font-size:11px; }
    .colorTile { padding:8px 4px 7px; }
    .swatch { width:30px; height:30px; }
    .phead { padding:8px 10px; gap:10px; }
    .plan { width:36px; height:36px; }
    .acc { padding:9px 0; }
    /* price bar: one line — price | copy-link icon | quote */
    .summary { padding:8px 12px calc(8px + env(safe-area-inset-bottom)); }
    .sumrow { flex-wrap:nowrap; gap:8px; }
    .total { flex:1 1 auto; display:block; min-width:0; }
    .total .v { font-size:18px; }
    #copyLink { flex:none; width:42px; height:42px; padding:0; }
    #copyLink .lbl { display:none; }
    .sumrow .primary { flex:none; padding:11px 14px; font-size:14px; }
  }
