/*
 * Kitchen configurator — the stylesheet.
 *
 * Room studio's design language, carried over: dark glass panels, a dock of
 * section buttons at the bottom centre, a control panel on the right that
 * becomes a bottom sheet on a phone, icon buttons and a quality select at
 * the top right, a loading screen with a real progress bar and a veil for
 * discrete changes. Every target is 44 px or more; the safe-area insets are
 * honoured. Everything the room had that a kitchen has not (the seat grid,
 * the display readout, the transport) is gone, and the kitchen's own pieces
 * (the unit strip, the floating and dimension labels, the floor disc, the
 * image swatches) are at the end.
 */

:root {
  color-scheme: dark;
  --ink: #eef1ec;
  --muted: #a8b4ac;
  --panel: #17231ef2;
  --line: #ffffff19;
  --accent: #c2daab;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  background: #0e1712;
  color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }

/* ---------------------------------------------------------------- controls */

button, input, select { font: inherit; }
button, select { color: inherit; background: #ffffff08; border: 1px solid var(--line); border-radius: 12px; }
button { cursor: pointer; min-height: 44px; padding: 10px 14px; touch-action: manipulation; transition: background .18s, color .18s, border-color .18s; }
button:hover { background: #ffffff16; }
button:disabled { opacity: .38; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [role=option]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button[aria-pressed=true] { background: var(--accent); color: #203124; border-color: transparent; }
svg { width: 21px; height: 21px; flex-shrink: 0; }

/* ---------------------------------------------------------------- the stage */

#stage { position: absolute; inset: 0; }
#stage canvas { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
#stage > canvas { position: absolute; inset: 0; z-index: 1; }
.top-actions, .dock, .control-panel, .walk-stick, .look-hint { z-index: 3; }
#loading { z-index: 5; }
#veil { position: absolute; inset: 0; background: #0b1210; opacity: 0; pointer-events: none; transition: opacity 150ms ease; z-index: 2; }

/* ---------------------------------------------------------------- top right */

.top-actions {
  position: absolute;
  top: max(26px, env(safe-area-inset-top));
  right: max(26px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  align-items: center;
}
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; flex-shrink: 0; background: #15201bdd; backdrop-filter: blur(15px); }
.icon-button[aria-pressed=true] { background: var(--accent); color: #203124; }
.status {
  font-size: 11px;
  background: #15201be6;
  backdrop-filter: blur(15px);
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 30px;
  max-width: 230px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-toast { min-height: 40px; display: flex; align-items: center; }

.quality-select {
  width: auto;
  min-height: 40px;
  padding: 8px 30px 8px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  background: #15201be6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef1ec' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center/12px;
  backdrop-filter: blur(15px);
  border: 1px solid var(--line);
  border-radius: 30px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.quality-select:hover { background-color: #1f2e26e6; }

/* ---------------------------------------------------------------- the dock */

.dock {
  position: absolute;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 7px;
  background: var(--panel);
  border: 1px solid #ffffff25;
  border-radius: 20px;
  box-shadow: 0 12px 40px #0005;
  backdrop-filter: blur(22px);
}
.dock button { display: flex; align-items: center; gap: 9px; border-color: transparent; background: transparent; padding: 11px 17px; font-size: 12px; font-weight: 500; border-radius: 13px; }
.dock button[aria-expanded=true] { background: #e6eedf; color: #203124; }

/* ---------------------------------------------------------------- the panel */

.control-panel {
  position: absolute;
  right: 26px;
  top: 88px;
  width: clamp(310px, 24vw, 380px);
  max-height: calc(100% - 114px - var(--safe-bottom));
  background: var(--panel);
  border: 1px solid #ffffff25;
  border-radius: 22px;
  box-shadow: 0 14px 55px #0004;
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-heading { padding: 23px 21px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { font-size: 20px; letter-spacing: -.5px; font-weight: 500; margin: 0; }
.panel-heading p { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.panel-heading .icon-button { border: none; background: #ffffff08; width: 36px; height: 36px; min-height: 44px; min-width: 44px; }
.panel-scroll { padding: 0 21px 22px; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b8c6bd45 transparent; touch-action: pan-y; }
.panel-grip { display: none; }

.help { font-size: 11px; line-height: 1.6; color: var(--muted); margin: 14px 0; }
.segments { display: flex; background: #0002; border: 1px solid var(--line); border-radius: 13px; padding: 4px; gap: 3px; }
.segments button { flex: 1; border: 0; background: none; font-size: 12px; padding: 9px 6px; border-radius: 9px; }
.segments button[aria-pressed=true] { background: #e6eedf; color: #203124; }
.wide { width: 100%; margin-top: 14px; }

details { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 5px; }
summary { cursor: pointer; font-size: 11px; color: #c1cfc5; padding: 14px 0; min-height: 44px; touch-action: manipulation; }
.details-content { padding: 0 0 7px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; font-size: 12px; cursor: pointer; }
input[type=checkbox] { appearance: none; width: 34px; height: 21px; border: 1px solid #ffffff28; border-radius: 20px; background: #26312b; position: relative; flex-shrink: 0; cursor: pointer; }
input[type=checkbox]:before { content: ''; position: absolute; left: 3px; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: #bcc5bf; transition: transform .15s; }
input[type=checkbox]:checked { background: #bcd6a8; }
input[type=checkbox]:checked:before { transform: translateX(13px); background: #24472b; }
input[type=checkbox]:disabled { opacity: .38; cursor: default; }

.range-label { display: flex; justify-content: space-between; font-size: 12px; margin: 23px 0 4px; color: #d8e2d9; }
.range-label output { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; height: 36px; margin: 0; accent-color: #c6dfb3; cursor: pointer; touch-action: pan-y; }
input[type=range]::-webkit-slider-thumb { width: 21px; height: 21px; }
input[type=range]:disabled { opacity: .38; cursor: default; }
select { width: 100%; min-height: 44px; padding: 10px 12px; background: #26362d; }
select:disabled { opacity: .5; cursor: default; }

.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-grid button { display: flex; align-items: center; gap: 11px; font-size: 11px; min-height: 52px; }
.preset-orb { width: 23px; height: 23px; border-radius: 50%; background: linear-gradient(145deg, #f0e2b8, #bbcdda); box-shadow: inset 0 0 0 1px #ffffff2a; flex-shrink: 0; }
.preset-orb.soft { background: linear-gradient(145deg, #e9edf2, #aab4bb); }
.preset-orb.evening { background: linear-gradient(145deg, #e0a262, #3f4550); }
/* The two plan shapes on the layout buttons. */
.shape { width: 22px; height: 22px; flex-shrink: 0; border: 2px solid currentColor; border-radius: 3px; opacity: .8; }
.shape-straight { border-width: 0 0 4px; border-radius: 0; height: 16px; }
.shape-l { border-width: 0 0 4px 4px; border-radius: 0; }

.color-heading { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin: 10px 0 6px; }
.color-heading:not(:first-child) { margin-top: 23px; }
input[type=color] { width: 44px; height: 44px; background: none; padding: 9px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 7px; }
.swatches button { position: relative; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0; border-color: transparent; background: none; }
.swatches button:before { content: ''; display: block; width: 27px; height: 27px; background: var(--swatch); background-size: cover; background-position: center; border-radius: 50%; border: 1px solid #ffffff44; }
.swatches button:hover:before { box-shadow: 0 0 0 2px #17231e, 0 0 0 4px #ffffff45; }
.swatches button[aria-pressed=true] { background: none; border-color: transparent; }
.swatches button[aria-pressed=true]:before { box-shadow: 0 0 0 2px #17231e, 0 0 0 4px var(--accent); }
.swatches button:focus-visible { outline: none; }
.swatches button:focus-visible:before { outline: 2px solid var(--ink); outline-offset: 5px; }
/* An image swatch: the thumbnail from the manifest fills the disc. */
.swatches button[style*="url("]:before { border-color: #ffffff66; }

.actions { display: flex; gap: 8px; margin-top: 16px; }
.actions button, .actions select { flex: 1; font-size: 11px; min-width: 0; }

/* ---------------------------------------------------------------- walking */

.walk-stick { position: absolute; left: 28px; bottom: calc(110px + var(--safe-bottom)); width: 132px; height: 132px; touch-action: none; user-select: none; -webkit-user-select: none; }
.stick-base { position: relative; width: 100%; height: 100%; border-radius: 50%; background: #17231eb8; border: 1px solid #ffffff2e; backdrop-filter: blur(12px); box-shadow: 0 10px 30px #0005; display: grid; place-items: center; cursor: grab; transition: background .18s, border-color .18s; }
.walk-stick.active .stick-base { background: #1d2c25d9; border-color: #c2daab80; cursor: grabbing; }
.stick-knob { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #dcecd0, #a9c497 70%); box-shadow: 0 4px 12px #0006, inset 0 0 0 1px #ffffff40; pointer-events: none; transition: transform .06s linear; }
.walk-stick.active .stick-knob { transition: none; }
.stick-mark { position: absolute; width: 0; height: 0; border: 5px solid transparent; opacity: .55; pointer-events: none; }
.stick-mark.n { top: 9px; left: calc(50% - 5px); border-bottom-color: #e6eedf; border-top: 0; }
.stick-mark.s { bottom: 9px; left: calc(50% - 5px); border-top-color: #e6eedf; border-bottom: 0; }
.stick-mark.w { left: 9px; top: calc(50% - 5px); border-right-color: #e6eedf; border-left: 0; }
.stick-mark.e { right: 9px; top: calc(50% - 5px); border-left-color: #e6eedf; border-right: 0; }
.look-hint { position: absolute; bottom: calc(139px + var(--safe-bottom)); right: 32px; font-size: 11px; color: #eef4e9; pointer-events: none; text-shadow: 0 1px 8px #000; }
.panel-open .look-hint { right: calc(clamp(310px, 24vw, 380px) + 50px); }

/* ---------------------------------------------------------------- loading and progress */

#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: #17231e; }
#loading p { font-size: 18px; letter-spacing: -.3px; margin: 22px 0 7px; }
#loading small { font-size: 11px; color: #9bad9f; }
#loading progress { width: min(260px, 65vw); margin: 14px 0 12px; }
progress { appearance: none; border: 0; height: 3px; border-radius: 4px; background: #ffffff10; overflow: hidden; }
progress::-webkit-progress-bar { background: #ffffff10; }
progress::-webkit-progress-value { background: #76bfc4; border-radius: 4px; }
progress::-moz-progress-bar { background: #76bfc4; }
progress:indeterminate { background: linear-gradient(90deg, #ffffff0b 20%, #76bfc4 50%, #ffffff0b 80%); background-size: 220% 100%; animation: progress-slide 1.8s ease-in-out infinite; }
.inline-progress { padding: 14px 0 3px; font-size: 10px; color: #c9dddb; }
.inline-progress progress { width: 100%; display: block; margin: 8px 0; }
.inline-progress small { font-size: 9px; color: var(--muted); }
.error { position: absolute; top: 35%; left: 10%; right: 10%; padding: 24px; text-align: center; background: #223d2d; z-index: 20; border-radius: 16px; }
@keyframes progress-slide { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* ---------------------------------------------------------------- the kitchen's own pieces */

/* The unit strip: one tile per unit in the run, scrolling sideways, the selected one in the accent. */
.unit-strip { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #b8c6bd45 transparent; padding: 12px 2px 8px; margin: 0 -2px; scroll-snap-type: x proximity; }
.unit-strip [role=option] { flex: 0 0 64px; width: 64px; min-height: 56px; padding: 7px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 10px; scroll-snap-align: center; }
.unit-strip [role=option] strong { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.unit-strip [role=option] span { font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: var(--muted); }
.unit-strip [role=option][aria-selected=true] { background: var(--accent); color: #203124; border-color: transparent; }
.unit-strip [role=option][aria-selected=true] span { color: #34483a; }
.strip-empty { font-size: 11px; color: var(--muted); margin: 8px 2px; }

/* Labels over the kitchen: positioned by main.js each render, never interactive. */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.floating-label, .dim-label { position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; background: #15201be6; backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 20px; padding: 6px 11px; font-size: 11px; color: var(--ink); will-change: transform; }
.floating-label { font-weight: 500; }
.dim-label { font-size: 10px; color: #d8e2d9; font-variant-numeric: tabular-nums; }

/* The ring that marks where a click on the floor walks to. */
.floor-disc { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 2px solid var(--accent); border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 4px #c2daab33; z-index: 2; transition: opacity .3s; }

/* Poster mode: the kitchen alone. */
body[data-poster] .top-actions, body[data-poster] .dock, body[data-poster] #controls, body[data-poster] #labels, body[data-poster] .walk-stick, body[data-poster] .look-hint, body[data-poster] .floor-disc { display: none !important; }

/* ---------------------------------------------------------------- responsive */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 1180px) {
  .control-panel { max-height: calc(100% - 204px - var(--safe-bottom)); }
}

@media (max-width: 1000px) {
  .dock button { padding: 11px 14px; }
  .control-panel { width: 290px; right: 18px; }
  .top-actions { right: 18px; }
  .panel-heading { padding: 20px 18px 16px; }
  .panel-scroll { padding: 0 18px 20px; }
}

@media (max-width: 700px) {
  .top-actions { top: calc(15px + env(safe-area-inset-top)); right: 14px; left: 14px; gap: 6px; justify-content: flex-end; }
  .top-actions .icon-button { width: 44px; height: 44px; }
  /* Announcements drop under the row, so they never push the buttons off the screen. */
  .status-toast { position: absolute; top: 52px; right: 0; max-width: calc(100vw - 28px); }
  .dock { bottom: calc(12px + var(--safe-bottom)); width: calc(100% - 28px); max-width: 400px; padding: 5px; gap: 2px; border-radius: 18px; }
  .dock button { flex: 1; flex-direction: column; gap: 3px; padding: 8px 3px; font-size: 9px; min-height: 55px; }
  .dock svg { width: 20px; height: 20px; }
  .control-panel { top: auto; left: 10px; right: 10px; width: auto; bottom: calc(91px + var(--safe-bottom)); max-height: min(54dvh, 460px); border-radius: 21px; }
  /* The grip is a 44 px target that overlaps the heading's top padding, so the sheet stays as short as before. */
  .panel-grip { display: flex; min-height: 44px; height: 44px; margin-bottom: -22px; position: relative; z-index: 1; flex-shrink: 0; align-items: flex-start; justify-content: center; background: transparent; border: 0; padding: 9px 0 0; }
  .panel-grip span { height: 3px; width: 33px; background: #a9bbb355; border-radius: 4px; }
  .panel-heading { padding: 0 18px 13px; flex-shrink: 0; }
  .panel-heading h2 { font-size: 19px; }
  .panel-heading p { font-size: 10px; margin-top: 2px; }
  .panel-scroll { padding: 0 18px 17px; }
  .help { font-size: 11px; margin: 12px 0; }
  details { margin-top: 15px; }
  .range-label { margin-top: 16px; }
  .swatches { gap: 6px; }
  .quality-select { min-height: 44px; padding: 8px 28px 8px 12px; }
  .walk-stick { left: 16px; bottom: calc(96px + var(--safe-bottom)); width: 124px; height: 124px; }
  .look-hint { right: 16px; bottom: calc(133px + var(--safe-bottom)); background: #17231e80; padding: 8px 11px; border-radius: 18px; }
  .panel-open .walk-stick, .panel-open .look-hint { visibility: hidden; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .top-actions { top: 10px; right: 14px; }
  .dock { left: 16px; bottom: 12px; transform: none; width: auto; }
  .dock button { padding: 9px 12px; }
  .control-panel { top: 65px; right: 14px; left: auto; width: 290px; bottom: auto; max-height: calc(100% - 77px); }
  .panel-grip { display: none; }
  .panel-heading { padding: 14px 16px; }
  .panel-scroll { padding: 0 16px 16px; }
  .walk-stick { bottom: 88px; width: 116px; height: 116px; }
  .look-hint { right: 320px; bottom: 110px; }
  .panel-open .walk-stick { visibility: visible; }
}

/* Compact drawing tools and camera recovery. */
:root { --panel: #18231ff5; --accent: #d2dfb7; --line: #ffffff20; }
.brand-eyebrow { display:block;font-size:9px;letter-spacing:2px;color:var(--muted);font-weight:600; }
.scene-tools { position:absolute;z-index:3;top:max(26px,env(safe-area-inset-top));left:28px;display:flex;gap:4px;align-items:center;padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:15px;backdrop-filter:blur(20px);box-shadow:0 5px 24px #0002; }
.scene-tools button { display:flex;align-items:center;gap:8px;font-size:11px;padding:8px 12px;border:0;background:transparent; }
.scene-tools button:hover { background:#ffffff12; }
.scene-tools [data-open-drawings] { color:var(--accent); }
.scene-tools svg { width:17px;height:17px; }
.scene-mode { padding:0 12px;font-size:11px;color:var(--muted);border-right:1px solid var(--line); }
#resetView { border-left:1px solid var(--line);border-radius:0 10px 10px 0; }
.top-actions { padding:5px;border:1px solid var(--line);border-radius:17px;background:#17231ed9;backdrop-filter:blur(20px);box-shadow:0 5px 24px #0002; }
.top-actions .icon-button,.quality-select { background-color:transparent;border-color:transparent;border-radius:11px;min-height:44px; }
.status-toast { position:absolute;top:64px;right:0;max-width:min(360px,calc(100vw - 30px));min-height:44px; }
.control-panel { top:100px;border-radius:20px;box-shadow:0 20px 65px #0005;max-height:calc(100% - 212px - var(--safe-bottom)); }
.panel-heading { border-bottom:1px solid var(--line);margin-bottom:17px; }
.panel-heading h2 { font-weight:550; }
.panel-scroll { scrollbar-gutter:stable; }
.handoff-button { text-align:left;margin:8px 0 20px;padding:15px 16px;background:#d2dfb715;border-color:#d2dfb73a;color:var(--accent);font-weight:500; }
.handoff-button span { display:block;font-size:10px;color:var(--muted);font-weight:400;margin-top:5px; }
.dock { border-radius:18px; }
.dock button:hover:not([aria-expanded=true]) { background:#ffffff0d; }
body:not([data-ready=settled]) .scene-tools { visibility:hidden; }
body[data-poster] .scene-tools { display:none!important; }

/* The drawing workspace uses paper colours and vector sheets that also print cleanly. */
.drawing-dialog { width:min(1400px,calc(100vw - 48px));height:calc(100dvh - 48px);max-width:none;max-height:none;padding:0;border:1px solid #ffffff35;border-radius:24px;background:#f0f2eb;color:#243a2c;box-shadow:0 30px 100px #0007;overflow:hidden;color-scheme:light; }
.drawing-dialog[open] { display:flex;flex-direction:column; }
.drawing-dialog::backdrop { background:#09120fc9;backdrop-filter:blur(8px); }
.drawing-header { display:flex;justify-content:space-between;align-items:center;gap:20px;padding:22px 28px 17px;background:#19271f;color:#f0f3ec;flex-shrink:0; }
.drawing-header h1 { margin:4px 0 3px;font-size:24px;letter-spacing:-.65px;font-weight:500; }
.drawing-header p { margin:0;font-size:11px;color:#bcc9b5; }
.drawing-header .icon-button { background:#ffffff0d;border-color:#ffffff22; }
.drawing-toolbar { display:flex;justify-content:space-between;align-items:end;gap:18px;padding:16px 28px;border-bottom:1px solid #d7dfd0;flex-shrink:0; }
.drawing-toolbar label { display:flex;flex-direction:column;gap:4px;color:#65725e;font-size:10px;letter-spacing:.3px; }
.drawing-toolbar input { width:260px;max-width:100%;height:44px;padding:10px 12px;border:1px solid #bdcbb3;background:#fff;border-radius:9px;font-size:13px;color:#253a2c; }
.drawing-export-actions { display:flex;gap:8px;flex-wrap:wrap; }
.drawing-dialog button { border:1px solid #c9d4be;border-radius:9px;font-size:11px;background:#fff; }
.drawing-dialog button:hover { background:#e2ead8; }
.drawing-dialog .primary-button { background:#294831;border-color:#294831;color:#fff; }
.drawing-dialog .primary-button:hover { background:#3b6042; }
.drawing-dialog button:focus-visible,.drawing-dialog input:focus-visible,.drawing-dialog [tabindex]:focus-visible { outline:2px solid #557b41;outline-offset:2px; }
.drawing-tabs { display:flex;gap:5px;padding:14px 28px 0;overflow-x:auto;flex-shrink:0; }
.drawing-tabs button { white-space:nowrap;border-color:transparent;background:transparent;padding:9px 16px; }
.drawing-tabs button[aria-pressed=true] { background:#dce6ce;color:#29402a;border-color:#c4d3b4; }
.drawing-sheet-heading { padding:14px 28px 10px;display:flex;justify-content:space-between;align-items:center;gap:14px;flex-shrink:0; }
.drawing-sheet-heading h2 { margin:0;font-size:12px;font-weight:500; }
.drawing-sheet-heading button { min-height:36px;padding:6px 12px; }
.drawing-canvas { flex:1;min-height:0;overflow:auto;margin:0 28px;background:white;border:1px solid #d8dfd1;box-shadow:0 3px 16px #243c2710;border-radius:4px;overscroll-behavior:contain; }
.drawing-canvas>svg { display:block;width:100%;height:100%;min-height:280px; }
.drawing-canvas.document-view { background:#e4e8df;padding:20px; }
.drawing-canvas .manufacturer-report { max-width:1120px;margin:auto;box-shadow:0 3px 12px #263d2814; }
.drawing-footer { display:flex;justify-content:space-between;gap:10px;padding:13px 28px 17px;color:#607155;font-size:10px;flex-shrink:0; }
#drawingFeedback { color:#315f30; }
#printReport { display:none; }
@media(max-width:1000px) { .scene-tools { top:26px;left:18px; }.scene-mode { display:none; }.drawing-toolbar input { width:210px; } }
@media(max-width:700px) {
 .scene-tools { top:calc(9px + env(safe-area-inset-top));left:14px;right:auto;padding:2px;gap:0;border-radius:12px; }
 .scene-tools button { font-size:10px;padding:7px 9px; }.scene-tools svg { width:15px;height:15px; }#resetView { width:44px;justify-content:center; }#resetView span { display:none; }
 .top-actions { top:calc(68px + env(safe-area-inset-top));padding:4px;gap:2px;justify-content:space-between; }
 .top-actions .icon-button { width:44px; }.quality-select { padding-left:8px;padding-right:24px; }
 .status-toast { top:60px; }
 .control-panel { top:auto;max-height:min(54dvh,460px); }.panel-heading { margin-bottom:14px;padding-bottom:15px; }
 .drawing-dialog { width:100vw;height:100dvh;margin:0;border:0;border-radius:0; }
 .drawing-header { padding:18px 16px 14px; }.drawing-header h1 { font-size:20px; }.drawing-header .brand-eyebrow { font-size:8px;letter-spacing:1.5px; }
 .drawing-header p { font-size:10px; }.drawing-toolbar { padding:12px 16px;gap:10px;align-items:stretch;flex-direction:column; }.drawing-toolbar label { flex-direction:row;align-items:center;gap:12px; }.drawing-toolbar input { flex:1;width:auto;min-width:0; }
 .drawing-export-actions { gap:6px; }.drawing-export-actions button { flex:1;font-size:10px;padding:8px 6px; }
 .drawing-tabs { padding:10px 12px 0;gap:2px; }.drawing-tabs button { padding:9px 11px; }
 .drawing-sheet-heading { padding:10px 16px; }.drawing-sheet-heading h2 { font-size:11px; }.drawing-sheet-heading button { min-height:44px;font-size:10px; }
 .drawing-canvas { margin:0 12px; }.drawing-canvas.document-view { padding:0; }.drawing-canvas>svg { min-width:560px;min-height:360px; }
 .drawing-footer { padding:10px 16px max(13px,env(safe-area-inset-bottom));font-size:9px;flex-direction:column;gap:3px; }
}
@media(max-width:360px) {
 .scene-tools button { padding:7px; }
 .top-actions { display:grid;grid-template-columns:minmax(0,1fr) repeat(3,44px); }
 .top-actions .quality-select { width:100%;min-width:0;max-width:none; }
 .top-actions .icon-button { width:44px; }
 .top-actions .status-toast { top:60px; }
}
@media(max-height:520px) and (orientation:landscape) { .scene-tools { top:10px;left:14px;right:auto; }.scene-tools span { display:none; }.control-panel { top:78px;max-height:calc(100% - 88px); }.drawing-header { padding:10px 18px; }.drawing-toolbar { padding:8px 18px; }.drawing-tabs { padding-top:5px; } }
@media print {
 html,body { height:auto!important;overflow:visible!important;background:#fff; }
 body > :not(#drawingDialog) { display:none!important; }
 #drawingDialog { display:block!important;position:static!important;width:100%!important;height:auto!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;overflow:visible!important;box-shadow:none!important;background:#fff!important; }
 #drawingDialog::backdrop { display:none; }
 #drawingDialog > :not(#printReport) { display:none!important; }
 #printReport { display:block; }
}
.drawing-view-actions,#drawingZoom { display:flex;gap:6px; }
.drawing-canvas.drawing-zoomed>svg { max-width:none;min-height:100%; }
@media(max-width:700px) { .drawing-sheet-heading { flex-wrap:wrap;gap:8px; }.drawing-sheet-heading h2 { flex-basis:100%; }.drawing-view-actions { justify-content:space-between;width:100%; }.drawing-canvas>svg { min-width:0;min-height:250px; }.drawing-canvas.drawing-zoomed>svg { min-width:560px; } }
.drawing-sheet-heading button { min-width:44px; }
@media print { :root { color-scheme:light!important; } html { background:white!important; } }

/* A selected cabinet keeps only its immediate actions in the walkthrough. */
.cabinet-interaction { position:absolute;z-index:4;bottom:calc(114px + var(--safe-bottom));left:50%;transform:translateX(-50%);width:min(410px,calc(100% - 32px));padding:12px;border:1px solid #c2daab40;border-radius:18px;background:#17231ef2;box-shadow:0 8px 32px #0004;backdrop-filter:blur(20px); }
.interaction-heading { display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 2px 9px;font-size:11px; }
.interaction-heading strong { font-weight:500; }
.interaction-heading output { color:var(--accent);font-size:10px;font-variant-numeric:tabular-nums; }
.cabinet-quick-actions { display:flex;gap:6px; }
.cabinet-quick-actions button { flex:1;min-width:0;min-height:44px;padding:8px 10px;font-size:12px;border-radius:10px; }
.cabinet-quick-actions #dismissCabinet { flex:0 0 44px;padding:0;background:transparent;border-color:transparent;font-size:22px;color:var(--muted); }
#openCabinet { color:#203124;background:var(--accent);border-color:transparent; }
#cabinetDetailsToggle[aria-expanded=true] { border-color:var(--accent);color:var(--accent); }
.cabinet-details { position:absolute;bottom:calc(100% + 8px);left:0;right:0;padding:14px;background:#17231ef7;border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 32px #0004;max-height:min(380px,calc(100dvh - 290px));overflow-y:auto;overscroll-behavior:contain; }
.cabinet-details .segments { margin:0 0 6px; }
.cabinet-details .segments button { min-height:44px; }
.cabinet-scrub { display:flex;align-items:center;gap:10px;font-size:11px; }
.cabinet-scrub input { flex:1;min-width:0;margin:0;min-height:44px; }
.cabinet-scrub output { min-width:32px;text-align:right; }
.clearance-note { margin:0 0 10px;color:var(--accent);font-size:10px;line-height:1.5; }
.fitting-field { display:grid;grid-template-columns:70px minmax(0,1fr);align-items:center;gap:8px;margin:6px 0; }
.fitting-field label { font-size:11px;color:var(--muted); }
.fitting-field select { width:100%;min-width:0;font-size:11px;min-height:44px; }
.cabinet-details .help { font-size:10px;margin:8px 0 0;line-height:1.5; }
.panel-open .cabinet-interaction,body[data-xr] .cabinet-interaction,body[data-poster] .cabinet-interaction { display:none!important; }
body[data-cabinet] .look-hint { visibility:hidden; }
@media(max-width:700px) {
 .cabinet-interaction { bottom:calc(232px + var(--safe-bottom));width:calc(100% - 24px);padding:10px; }
 .cabinet-details { padding:12px;max-height:calc(100dvh - 445px); }
 .cabinet-quick-actions button { font-size:11px;padding:8px; }
 .fitting-field { grid-template-columns:60px minmax(0,1fr); }
}
@media(max-height:520px) and (orientation:landscape) {
 .cabinet-interaction { bottom:18px;left:18px;transform:none;width:300px; }
 .cabinet-details { max-height:calc(100dvh - 175px); }
 body[data-cabinet] .walk-stick { visibility:hidden; }
}
.first-person-badge { display:inline-flex;align-items:center;gap:9px;color:var(--accent);font-size:12px;margin:4px 0 12px; }
.first-person-badge:before { content:'';width:7px;height:7px;border-radius:50%;background:var(--accent); }
.xr-entry { margin-top:14px;background:#c2daab17;color:var(--accent);border-color:#c2daab50;font-weight:600; }
#xrHelp { line-height:1.6; }
body[data-xr] .scene-tools,body[data-xr] .top-actions,body[data-xr] .dock,body[data-xr] .control-panel,body[data-xr] .walk-stick,body[data-xr] .look-hint,body[data-xr] #labels,body[data-xr] #floorDisc { visibility:hidden!important;pointer-events:none; }
@media(max-width:700px) { .look-hint { max-width:min(240px,calc(100% - 164px));text-align:right; } }

#closeAllCabinets { margin:12px 0 20px; }

.sink-shortcut { display:flex;flex-direction:column;align-items:flex-start;gap:3px;width:100%;margin:0 0 18px;padding:12px 14px;text-align:left;color:var(--accent); }
.sink-shortcut span { font-size:10px;color:var(--muted); }
.sink-fittings { border-top:1px solid var(--line);margin-top:14px;padding-top:12px; }
.sink-fittings h3 { font-size:13px;font-weight:500;margin:0; }
.sink-fittings .help { margin-bottom:10px; }
.sink-fittings .toggle { font-size:11px;margin:10px 0 0; }

.renderer-settings{margin-top:20px;padding-top:16px;border-top:1px solid var(--line,rgba(255,255,255,.14))}.renderer-settings>label{display:block;margin-bottom:8px;font-weight:600}.renderer-settings>select{width:100%;min-height:42px}.renderer-settings .help{margin:8px 0 0;line-height:1.5}
