/* ═══ Room visualizer ═══
   Stage first: the page opens on a finished room, the floor rail sits beside it
   on desktop and below it on a phone, and the quote box stays in reach.

   Tokens: this file is the ONE place the visualizer's colours, type sizes,
   radii and shadows are set. Rules below use the tokens only; a new value
   becomes a token first. Brand rules follow tools/theme.py (2026-10 theme):
   warm cream base, white cards, ink text, square cards and image frames,
   pills stay pills.

   Class prefixes: vz-* are behaviour hooks that src/visualizer/main.js finds
   or toggles (vz-fl, vz-demo, vz-drop, vz-controls…); vzx-* are layout and
   skin only. Restyle a vz-* element through a .vzx scope, never rename it. */

:root{
  /* Brand ink palette for this page (was an inline override in visualizer.html) */
  --navy:#121212; --navy-2:#121212; --navy-3:#343B44;
  --ink:#20242B; --ink-2:#343B44; --ink-3:#5A626C; --ink-4:#5A626C;
  --cream:#FFFFFF; --paper:#FFFFFF; --sand:#F0EBE2;
  --rule:#E5E0D8; --rule-2:#F7F5F0;
  --cargo:#121212; --cargo-2:#2A2A2A; --gold:#D8C7A8;

  /* Surfaces */
  --vz-surface:#F7F5F0;          /* warm cream base: title band, upload tile */
  --vz-surface-raised:#FBFAF7;   /* buy box */
  --vz-card:#FFFFFF;             /* rail, chips, inputs */
  --vz-hover:#F0EBE2;            /* hover wash on cream and white */
  --vz-notice:#FFF8EA;           /* inline notices */
  --vz-stage:#1B1B1B;            /* behind the room photo */
  --vz-on-stage:#CFC8BC;         /* text on the stage */
  --vz-on-dark:#FFFFFF;

  /* Lines */
  --vz-line:var(--rule);         /* dividers: decorative, no contrast floor */
  --vz-line-strong:#8A8276;      /* control borders: 3.8:1 on white (needs 3:1) */

  /* Text */
  --vz-text:var(--navy);
  --vz-text-2:var(--ink-2);
  --vz-muted:var(--ink-3);       /* 6.2:1 on white, 5.6:1 on cream */
  --vz-accent:#7A6A52;           /* bronze kicker: 4.8:1 on cream */
  --vz-accent-soft:#C9B893;      /* hover frame on room thumbnails */

  /* Type scale (type.css body is 17px; the tool's dense UI steps down) */
  --vz-t-xs:12px;  --vz-t-sm:13px;  --vz-t-md:15px;  --vz-t-lg:17px;
  --vz-t-h3:22px;  --vz-t-h1:clamp(24px,2.2vw,32px);

  /* Shape: cards and image frames are square (brand); controls are soft */
  --vz-r-frame:0;  --vz-r-control:8px;  --vz-r-pill:999px;

  /* Elevation */
  --vz-shadow-1:var(--shadow-sm);                 /* thumbnails */
  --vz-shadow-2:var(--shadow-md);                 /* the stage */
  --vz-shadow-float:0 4px 16px rgba(0,0,0,.18);   /* labels over a photo */
  --vz-shadow-up:0 -6px 18px rgba(42,42,42,.08);  /* pinned buy box */

  /* Layout */
  --vz-head:122px;     /* sticky site header, all-in (header.css) */
  --vz-touch:44px;     /* minimum touch target on coarse pointers */
  --vz-thumb-w:112px;  --vz-thumb-h:78px;
}

/* ── Title band ── */
.vzx-top{background:var(--vz-surface);border-bottom:1px solid var(--vz-line)}
.vzx-top-in{max-width:1480px;margin:0 auto;padding:14px 28px 12px;display:flex;gap:24px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.vzx-kick{margin:0 0 2px;font-size:var(--vz-t-xs);font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--vz-accent)}
.vzx-h{margin:0;font-family:var(--serif);font-weight:400;font-size:var(--vz-t-h1);line-height:1.1;color:var(--vz-text);text-wrap:balance}
.vzx-sub{margin:4px 0 0;font-size:var(--vz-t-md);line-height:1.55;color:var(--vz-muted);max-width:62ch}
.vzx-top-cta{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.vzx-upbtn{display:inline-flex;align-items:center;gap:9px}
.vzx-priv{font-size:var(--vz-t-xs);color:var(--vz-muted)}

/* ── Two columns: stage and rail ── */
.vzx{max-width:1480px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) 392px;align-items:start}
/* Grid children default to min-width:auto, which lets a row of tabs or a
   sideways floor strip widen the whole page on a phone. */
.vzx > *,.vzx-rail,.vzx-rail-head,.vzx-stage{min-width:0}
.vzx-stage{padding:14px 24px 28px 28px;display:flex;flex-direction:column;gap:10px}

/* ── Stage ── */
.vzx .vz-canvas-wrap{border-radius:var(--vz-r-frame);min-height:0;background:var(--vz-stage);box-shadow:var(--vz-shadow-2)}
.vzx-frame{position:relative;display:inline-block;line-height:0;max-width:100%}
.vzx-frame canvas{max-width:100%;max-height:max(340px,calc(100vh - var(--vz-head) - 260px));display:block;touch-action:none}
.vzx .vz-drop{background:var(--vz-stage);color:var(--vz-on-stage)}
.vzx .vz-drop b{font-family:var(--serif);font-weight:400;font-size:var(--vz-t-h3)}

/* Before/after slider: an invisible range input drives a visible handle */
.vzx-orig{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}
.vzx-cmp{position:absolute;top:0;bottom:0;left:50%;width:0;border-left:2px solid var(--vz-on-dark);box-shadow:0 0 0 1px rgba(0,0,0,.25);pointer-events:none;line-height:1}
.vzx-cmp::after{content:"";position:absolute;top:50%;left:-19px;width:36px;height:36px;margin-top:-18px;border-radius:50%;background:var(--vz-on-dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6 3 12l6 6M15 6l6 6-6 6' fill='none' stroke='%23121212' stroke-width='2'/%3E%3C/svg%3E") center/20px no-repeat;box-shadow:var(--vz-shadow-float)}
/* Keyboard focus lands on the hidden input: show it on the handle instead. */
.vzx-cmp.kbd::after{box-shadow:0 0 0 3px var(--vz-on-dark),0 0 0 6px var(--vz-text)}
.vzx-cmp span{position:absolute;top:12px;font-size:var(--vz-t-xs);font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--vz-on-dark);background:rgba(18,18,18,.65);padding:4px 8px;border-radius:var(--vz-r-pill);white-space:nowrap}
.vzx-cmp span:first-child{right:10px}
.vzx-cmp span:last-child{left:10px}
.vzx-cmp-range{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:ew-resize;touch-action:pan-y}
.vzx-orig[hidden],.vzx-cmp[hidden],.vzx-cmp-range[hidden]{display:none}

/* Zoom: cursor states on the room, and a small control strip bottom-centre */
.vzx-frame canvas.vz-zoom{cursor:zoom-in}
.vzx-frame canvas.vz-zoomed{cursor:crosshair}
.vzx-zoombtn{position:absolute;top:14px;right:14px;z-index:5;display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:0 14px;border:0;border-radius:var(--vz-r-pill);background:rgba(255,255,255,.96);color:var(--vz-text);font:inherit;font-size:var(--vz-t-sm);font-weight:700;line-height:1;box-shadow:var(--vz-shadow-float);cursor:pointer}
.vzx-zoombtn:hover{background:var(--vz-card)}
.vzx-zoombtn[aria-pressed=true]{background:var(--vz-text);color:var(--vz-on-dark)}
.vzx-zoomhud{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);z-index:5;display:flex;align-items:center;gap:6px;max-width:calc(100% - 24px);background:rgba(255,255,255,.96);color:var(--vz-text);border-radius:var(--vz-r-pill);padding:5px 6px;box-shadow:var(--vz-shadow-float);font-size:var(--vz-t-sm);line-height:1.2;white-space:nowrap}
.vzx-zoomhud[hidden]{display:none}
.vzx-zoomhud button{min-width:32px;min-height:32px;border:1px solid var(--vz-line-strong);background:var(--vz-card);color:var(--vz-text);border-radius:var(--vz-r-pill);font:inherit;font-weight:700;padding:0 10px;cursor:pointer}
.vzx-zoomhud button:hover:not([aria-disabled=true]){background:var(--vz-hover)}
.vzx-zoomhud button[aria-disabled=true]{opacity:.4;cursor:default}
.vzx-zoomhud #vzzoomlvl{min-width:34px;text-align:center;font-weight:700;font-variant-numeric:tabular-nums}
.vzx-zoomhint{color:var(--vz-muted);padding:0 6px;overflow:hidden;text-overflow:ellipsis}

/* Floor caption over the room, top left. It holds nothing clickable, so it
   lets the brush and corner handles underneath it through. */
.vzx-floortag{position:absolute;top:14px;left:14px;z-index:4;pointer-events:none;display:flex;align-items:center;gap:10px;background:rgba(255,255,255,.94);color:var(--vz-text);border-radius:var(--vz-r-frame);padding:8px 14px 8px 8px;box-shadow:var(--vz-shadow-float);max-width:calc(100% - 150px)}
.vzx-floortag .sw{width:38px;height:38px;border-radius:var(--vz-r-frame);background-size:cover;background-position:center;flex:none}
.vzx-floortag .nm{font-weight:700;font-size:var(--vz-t-md);line-height:1.2}
.vzx-floortag .cl{font-size:var(--vz-t-xs);color:var(--vz-muted);line-height:1.3}
.vzx-floortag .pr{margin-left:8px;font-weight:700;font-size:var(--vz-t-md);white-space:nowrap}
.vzx-floortag .pr small{display:block;font-size:var(--vz-t-xs);font-weight:500;color:var(--vz-muted);text-align:right}

/* ── Room strip ── */
.vzx-rooms{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:thin}
.vzx-rooms .vz-demo-rooms{display:flex;gap:10px;margin:0;flex-wrap:nowrap;justify-content:flex-start}
.vzx-rooms .vz-demo{width:var(--vz-thumb-w);flex:none;color:var(--vz-text-2);font-size:var(--vz-t-sm);font-weight:600;gap:6px}
.vzx-rooms .vz-demo img{width:var(--vz-thumb-w);height:var(--vz-thumb-h);border-radius:var(--vz-r-frame);border:2px solid transparent;box-shadow:var(--vz-shadow-1)}
.vzx-rooms .vz-demo:hover img,.vzx-rooms .vz-demo:focus-visible img{border-color:var(--vz-accent-soft)}
.vzx-rooms .vz-demo.on img{border-color:var(--vz-text)}
.vzx-rooms .vz-demo span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.vzx-mine{flex:none;width:var(--vz-thumb-w);height:var(--vz-thumb-h);border-radius:var(--vz-r-frame);border:2px dashed var(--vz-line-strong);background:var(--vz-surface);color:var(--vz-text);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;font:inherit;font-size:var(--vz-t-sm);font-weight:700;cursor:pointer}
.vzx-mine:hover{border-color:var(--vz-text);background:var(--vz-hover)}
.vzx-mine.on{border-style:solid;border-color:var(--vz-text)}

.vzx-note{margin:0;padding:10px 14px;border:1px solid var(--vz-line);border-radius:var(--vz-r-frame);background:var(--vz-notice);font-size:var(--vz-t-md);color:var(--vz-text-2)}
.vzx .vz-controls{border-radius:var(--vz-r-frame);gap:14px 18px}
.vzx .vz-ctl{font-size:var(--vz-t-sm)}
.vzx .vz-ctl input[type=range]{width:96px}
.vzx .vz-actions{margin-left:0}
.vzx .vz-tool{border-color:var(--vz-line-strong)}
.vzx .vz-tool[aria-pressed=true],.vzx .vz-tool.on{border-color:var(--vz-text)}

/* ── Rail ── */
.vzx-rail{position:sticky;top:var(--vz-head);align-self:start;height:calc(100vh - var(--vz-head));display:flex;flex-direction:column;border-left:1px solid var(--vz-line);background:var(--vz-card)}
.vzx-rail-head{padding:18px 18px 10px;border-bottom:1px solid var(--vz-line)}
.vzx-rail-h{margin:0 0 6px;font-family:var(--serif);font-weight:400;font-size:var(--vz-t-h3);color:var(--vz-text)}
/* Collection tabs, the way Evolux lays out its room scenes */
.vzx-tabs{display:flex;gap:0 12px;overflow-x:auto;margin-bottom:8px;border-bottom:1px solid var(--vz-hover);scrollbar-width:thin}
.vzx-tab{flex:none;min-width:32px;min-height:36px;background:none;border:0;padding:8px 2px;font:inherit;font-size:var(--vz-t-md);color:var(--vz-muted);cursor:pointer;position:relative;white-space:nowrap}
.vzx-tab:hover{color:var(--vz-text)}
.vzx-tab.on{color:var(--vz-text);font-weight:700}
.vzx-tab.on::after{content:"";position:absolute;left:50%;bottom:2px;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--vz-text)}
.vzx-filter{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.vzx-chips{display:flex;gap:6px}
.vzx-chip{min-height:36px;border:1px solid var(--vz-line-strong);background:var(--vz-card);border-radius:var(--vz-r-pill);padding:6px 12px;font:inherit;font-size:var(--vz-t-sm);font-weight:600;color:var(--vz-text-2);cursor:pointer}
.vzx-chip:hover{background:var(--vz-hover)}
.vzx-chip.on{background:var(--vz-text);border-color:var(--vz-text);color:var(--vz-on-dark)}
.vzx-search{flex:1 1 120px;min-width:0;min-height:36px;padding:8px 12px;border:1px solid var(--vz-line-strong);border-radius:var(--vz-r-pill);font:inherit;font-size:var(--vz-t-md);background:var(--vz-card)}

/* Floor swatches: square frames, name and price always visible */
.vzx .vz-floors{flex:1 1 auto;overflow-y:auto;padding:14px 18px;display:grid;grid-template-columns:repeat(3,1fr);gap:12px 10px;align-content:start}
.vzx .vz-fl{aspect-ratio:auto;border:0;border-radius:var(--vz-r-frame);overflow:visible;background:none}
.vzx .vz-fl .im{display:block;aspect-ratio:1;border-radius:var(--vz-r-frame);overflow:hidden;border:2px solid transparent;box-shadow:var(--vz-shadow-1)}
.vzx .vz-fl:hover .im{border-color:var(--vz-accent-soft)}
.vzx .vz-fl.on .im{border-color:var(--vz-text);box-shadow:0 0 0 2px var(--vz-card) inset}
.vzx .vz-fl img{width:100%;height:100%;object-fit:cover;display:block}
.vzx .vz-fl .nm{position:static;opacity:1;background:none;color:var(--vz-text);font-size:var(--vz-t-sm);font-weight:600;padding:6px 1px 0;line-height:1.25}
.vzx .vz-fl .mt{display:block;font-size:var(--vz-t-xs);color:var(--vz-muted);padding:1px 1px 0;line-height:1.3}

/* Buy box: always at the foot of the rail */
.vzx-buy{border-top:1px solid var(--vz-line);background:var(--vz-surface-raised);padding:14px 18px 16px;display:flex;flex-direction:column;gap:9px}
.vzx-buy-top{display:flex;align-items:center;gap:10px}
.vzx-buy-sw{width:44px;height:44px;border-radius:var(--vz-r-frame);background-size:cover;background-position:center;flex:none}
.vzx-buy-tx{display:flex;flex-direction:column;min-width:0}
.vzx-buy-tx b{font-size:var(--vz-t-md);color:var(--vz-text);line-height:1.25}
.vzx-buy-tx span{font-size:var(--vz-t-xs);color:var(--vz-muted);line-height:1.35}
.vzx-buy-pr{margin-left:auto;text-align:right;font-weight:700;font-size:var(--vz-t-lg);color:var(--vz-text);white-space:nowrap;font-variant-numeric:tabular-nums}
.vzx-buy-pr small{display:block;font-size:var(--vz-t-xs);font-weight:500;color:var(--vz-muted)}
.vzx-est{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:var(--vz-t-sm);font-weight:600;color:var(--vz-text-2)}
.vzx-est-in{display:flex;align-items:center;gap:6px;font-weight:500}
.vzx-est-in input{width:96px;min-height:36px;padding:7px 10px;border:1px solid var(--vz-line-strong);border-radius:var(--vz-r-control);font:inherit;font-size:var(--vz-t-md);background:var(--vz-card)}
.vzx-est-out{font-size:var(--vz-t-sm);line-height:1.45;color:var(--vz-muted);min-height:19px}
.vzx-est-out b{color:var(--vz-text)}
.vzx-quote,.vzx-sample{width:100%;justify-content:center;text-align:center}
.vzx-trust{margin:2px 0 0;font-size:var(--vz-t-xs);color:var(--vz-muted);text-align:center;line-height:1.4}

/* ── Short desktop screens: keep more floors in view ── */
@media (min-width:901px) and (max-height:940px){
  .vzx-trust{display:none}
  .vzx-buy{gap:7px;padding:12px 18px}
  .vzx-quote,.vzx-sample{padding-top:10px;padding-bottom:10px}
  .vzx-est-out{min-height:0}
}
@media (max-width:1100px){
  .vzx{grid-template-columns:minmax(0,1fr) 340px}
}

/* ── Phone and small tablet ──
   Order: room, room strip (and any active editor), floors with the buy box
   pinned, then the adjustment controls. Choosing a floor matters more than
   sliders. The stage dissolves into the grid so its children can be ordered. */
@media (max-width:900px){
  .vzx-top-in{padding:16px 16px 14px;align-items:flex-start}
  .vzx-top .vzx-h{font-size:28px!important}   /* beats the page's mobile h1 override */
  .vzx-top-cta{align-items:stretch;width:100%}
  .vzx-upbtn{justify-content:center}
  .vzx{grid-template-columns:1fr}
  .vzx-stage{display:contents}
  .vzx .vz-canvas-wrap{display:block;order:1;margin:12px 12px 0}
  /* With no room open the canvas is only ~244px tall, too short for the
     upload message: let the box grow to its content instead of clipping it. */
  .vzx .vz-canvas-wrap.vzx-empty{min-height:340px}   /* removed by main.js once a room loads */
  .vzx-frame{display:block;width:100%}
  .vzx-frame canvas{width:100%;height:auto;max-height:none}
  .vzx-floortag{top:8px;left:8px;padding:5px 10px 5px 5px;gap:8px}
  .vzx-floortag .sw{width:30px;height:30px}
  .vzx-floortag .nm{font-size:var(--vz-t-sm)}
  .vzx-floortag .cl{display:none}
  .vzx-zoombtn{top:8px;right:8px}
  .vzx-floortag{max-width:calc(100% - 72px)}
  .vzx-floortag .nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .vzx-floortag>div{min-width:0}
  .vzx-zoomhud{position:static;transform:none;margin:8px auto;width:max-content;max-width:calc(100% - 16px);box-shadow:none;border:1px solid var(--vz-line)}
  .vzx-zoombtn span{display:none}
  .vzx-rooms{order:2;margin:10px 12px 0}
  .vzx #vzquadhint,.vzx #vzmaskctls,.vzx-note{order:2;margin:10px 12px 0}
  :root{--vz-thumb-w:104px;--vz-thumb-h:74px}
  .vzx-rail{order:3;margin-top:12px;position:static;height:auto;border-left:0;border-top:1px solid var(--vz-line)}
  .vzx-rail-head{padding:14px 12px 8px}
  /* Floors scroll sideways in two rows, so the room stays on screen. */
  .vzx .vz-fl .nm,.vzx .vz-fl .mt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .vzx .vz-floors{grid-auto-flow:column;grid-template-rows:repeat(2,auto);grid-template-columns:none;grid-auto-columns:96px;overflow-x:auto;overflow-y:hidden;padding:12px}
  .vzx-buy{position:sticky;bottom:0;z-index:20;box-shadow:var(--vz-shadow-up);padding:10px 12px 12px;gap:7px}
  .vzx-trust{display:none}
  .vzx #vzctls{order:4;margin:12px}
}

/* ── Touch: every control at least 44px to hit ── */
@media (pointer:coarse){
  .vzx-tab{min-height:var(--vz-touch);min-width:var(--vz-touch);padding-left:6px;padding-right:6px}
  .vzx-chip,.vzx-search,.vzx-est-in input{min-height:var(--vz-touch)}
  .vzx .vz-actions .btn,.vzx .vz-tool{min-height:var(--vz-touch)}
  .vzx-zoomhud button,.vzx-zoombtn{min-width:var(--vz-touch);min-height:var(--vz-touch)}
  .vzx-zoomhint{display:none}
  .vzx .vz-ctl input[type=range],.vzx .vz-mask-bar input[type=range]{height:var(--vz-touch)}
}
