:root {
  color-scheme: light;
  --ink: #172131;
  --muted: #687486;
  --line: #e3e7ee;
  --panel: #ffffff;
  --canvas: #eaf0f5;
  --accent: #5568ec;
  --accent-dark: #3e50cd;
  --accent-soft: #eef0ff;
  --danger: #c64d55;
  --shadow: 0 7px 25px rgba(24, 37, 60, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #f4f6fa; color: var(--ink); }
body { font-size: 13px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, label:focus-within { outline: 2px solid #7c8af6; outline-offset: 2px; }
.topbar { height: 66px; display: flex; align-items: center; gap: 12px; padding: 0 23px; background: #172131; color: white; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 31px; height: 31px; padding: 4px; border-radius: 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #6574f2; transform: rotate(-3deg); flex: none; }
.brand-mark span { background: rgba(255,255,255,.94); border-radius: 2px; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .55; }
.brand-copy h1 { margin: 0; font-size: 17px; letter-spacing: -.4px; line-height: 1.2; font-weight: 750; }
.brand-copy h1 span { margin-left: 4px; color: #aeb7ff; font-size: 10px; letter-spacing: 1.2px; vertical-align: 3px; }
.brand-copy p { margin: 3px 0 0; font-size: 11px; color: #aeb9cb; }
.topbar-status { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #d4dce8; font-size: 11px; }
.status-dot { height: 7px; width: 7px; border-radius: 50%; background: #55d6a1; box-shadow: 0 0 0 4px rgba(85,214,161,.12); }
.workspace { height: calc(100dvh - 66px); min-height: 0; display: grid; grid-template-columns: 354px minmax(0, 1fr); }
.sidebar { background: #fff; overflow: auto; overscroll-behavior: contain; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #cfd5df transparent; }
.panel-section { padding: 18px 18px 19px; border-bottom: 1px solid #edf0f4; }
.intro-section { padding-top: 20px; padding-bottom: 16px; }
.section-kicker, .viewer-eyebrow { font-size: 9px; font-weight: 800; letter-spacing: 1.6px; color: #7c8798; }
.intro-section h2 { margin: 7px 0 7px; font-size: 19px; line-height: 1.2; letter-spacing: -.6px; }
.muted { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.muted.compact { margin-bottom: 12px; }
.section-heading { display: flex; gap: 9px; align-items: center; margin-bottom: 13px; }
.section-heading h3 { margin: 0; font-size: 13px; font-weight: 750; letter-spacing: -.15px; }
.step { display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; width: 22px; height: 22px; flex: none; background: var(--accent-soft); color: var(--accent-dark); font-size: 10px; font-weight: 800; }
.dimensions-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.dimensions-grid label { display: block; color: #586375; font-size: 10px; font-weight: 650; }
.dimensions-grid label span { color: #9ba4b1; font-size: 9px; margin-left: 2px; }
.dimensions-grid input { display: block; width: 100%; margin-top: 6px; height: 34px; border: 1px solid #dfe4ec; border-radius: 7px; padding: 0 8px; color: #212d40; background: #fbfcfe; font-size: 12px; font-weight: 650; }
.hint { margin: 9px 0 0; color: #8993a2; font-size: 10px; line-height: 1.55; }
.button { border: 0; border-radius: 7px; height: 34px; padding: 0 11px; font-size: 11px; font-weight: 700; transition: transform .13s, background .13s; }
.button:active { transform: translateY(1px); }
.button-secondary { background: #f0f2f7; color: #3d485b; border: 1px solid #e2e6ee; }
.button-secondary:hover { background: #e7eaf2; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-full { width: 100%; margin-top: 12px; }
.wall-list { display: grid; gap: 8px; }
.wall-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; align-items: center; }
.wall-select { width: 100%; border: 1px solid #e3e7ef; border-radius: 8px; min-width: 0; padding: 8px 9px; display: flex; align-items: center; gap: 9px; text-align: left; background: #fff; color: var(--ink); }
.wall-select:hover { border-color: #bbc4ff; background: #fbfbff; }
.wall-select.active { border-color: #8691fa; box-shadow: inset 0 0 0 1px rgba(85,104,236,.12); background: #f8f8ff; }
.wall-icon { width: 27px; height: 27px; flex: none; border-radius: 5px; border: 1px solid #cfd6df; background-color: #e9edf3; background-image: linear-gradient(135deg, transparent 47%, rgba(135,145,160,.24) 48%, rgba(135,145,160,.24) 51%, transparent 52%); }
.wall-east { background-color: #e4eaf0; }
.wall-south { background-color: #ece6df; }
.wall-west { background-color: #e5e8df; }
.wall-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wall-info strong { font-size: 11px; white-space: nowrap; }
.wall-info small { color: #919baa; font-size: 9px; }
.wall-arrow { color: #9aa4b3; font-size: 21px; margin-left: auto; }
.wall-select.active .wall-arrow { color: var(--accent); }
.wall-file { display: none; }
.file-button { display: inline-flex; align-items: center; justify-content: center; min-width: 77px; padding: 0 8px; height: 30px; border: 1px solid #e0e5ed; border-radius: 7px; background: #f9fafc; color: #475469; font-size: 9.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.file-button:hover { border-color: #aab4fa; color: var(--accent-dark); }
.wall-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 11px; }
.text-button { background: none; border: none; padding: 3px 0; color: var(--accent-dark); font-size: 10px; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.danger-text { color: var(--danger) !important; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.tool-button { min-height: 73px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 9px 10px; gap: 3px; border: 1px solid #e3e7ef; border-radius: 8px; background: #fff; color: #202c3e; }
.tool-button:hover { background: #fafaff; border-color: #c4cbfc; }
.tool-button.active { background: #f3f4ff; border-color: #8994fb; box-shadow: inset 0 0 0 1px rgba(85,104,236,.1); }
.tool-glyph { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 23px; color: var(--accent); font-size: 20px; font-weight: 600; }
.pipette-glyph { font-size: 17px; }
.paint-glyph { font-size: 17px; text-shadow: 0 1px 0 white; }
.tool-button strong { font-size: 10.5px; }
.tool-button small { color: #909aaa; font-size: 9px; }
.paint-controls { margin-top: 12px; padding: 11px; background: #f8f9fc; border: 1px solid #e9edf3; border-radius: 8px; }
.color-control { display: flex; align-items: center; justify-content: space-between; color: #5f6a7b; font-size: 10px; font-weight: 650; }
.color-control input { width: 33px; height: 25px; border: 1px solid #d9deea; border-radius: 6px; padding: 2px; background: #fff; }
.range-line { margin-top: 11px; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.range-line label { color: #687486; font-size: 10px; font-weight: 650; }
.range-line output { color: #364357; font-size: 10px; font-weight: 750; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 2px 0; }
.paint-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 8px; }
.paint-bottom-row .button { font-size: 9.5px; height: 30px; }
.sample-swatch { display: inline-block; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1px solid rgba(29,40,61,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); background: #e8e4dc; }
.upload-drop { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 62px; padding: 11px; border: 1px dashed #b8c1f7; border-radius: 9px; background: #f7f7ff; cursor: pointer; }
.upload-drop:hover { background: #f0f1ff; border-color: var(--accent); }
.upload-plus { width: 31px; height: 31px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #e6e8ff; color: var(--accent-dark); font-size: 23px; font-weight: 400; }
.upload-drop span:last-child { display: flex; flex-direction: column; gap: 4px; }
.upload-drop strong { font-size: 10.5px; }
.upload-drop small { color: #8a93a4; font-size: 9px; }
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.empty-state { padding: 13px 9px; margin-top: 9px; border-radius: 7px; color: #9099a8; background: #fafbfc; font-size: 10px; text-align: center; }
.furniture-list { display: grid; gap: 6px; margin-top: 9px; }
.furniture-card { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px; border: 1px solid #e5e9f0; border-radius: 8px; background: white; text-align: left; }
.furniture-card.selected { border-color: #8792fb; background: #f8f8ff; }
.furniture-thumb { display: flex; align-items: center; justify-content: center; overflow: hidden; width: 38px; height: 38px; border: 1px solid #e9ecf2; border-radius: 5px; background: repeating-conic-gradient(#f4f5f8 0% 25%, #fff 0% 50%) 50% / 8px 8px; }
.furniture-thumb img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.furniture-card-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.furniture-card-copy strong { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 205px; }
.furniture-card-copy small { color: #929bab; font-size: 9px; }
.selected-object-title { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 4px; }
.selected-object-title strong { font-size: 10.5px; max-width: 225px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; width: 26px; height: 26px; border-radius: 6px; font-size: 21px; }
.icon-button:hover { background: #fff0f1; }
.furniture-controls { margin-top: 10px; padding: 11px; border-radius: 8px; background: #f8f9fc; border: 1px solid #e9edf3; }
.hidden { display: none !important; }
.keyboard-hint { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 7px 8px; margin-top: 13px; align-items: baseline; }
.keyboard-hint span { padding: 3px 5px; color: #5564cb; background: #f0f1ff; border-radius: 4px; font-size: 9px; font-weight: 800; text-align: center; }
.keyboard-hint small { color: #8490a0; font-size: 9.5px; line-height: 1.4; }
.last-section { border-bottom: 0; }
.sidebar-footer { color: #a4adbb; font-size: 8px; letter-spacing: 1.3px; font-weight: 700; text-align: center; padding: 16px 8px 20px; }
.sidebar-footer span { color: #6e7cf1; padding: 0 3px; }
.viewer-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 15px 16px 12px; gap: 10px; background: #f1f4f8; }
.viewer-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 39px; padding: 0 3px; }
.viewer-toolbar > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.viewer-toolbar strong { font-size: 14px; letter-spacing: -.2px; }
.viewer-tools-right { display: flex; align-items: center; gap: 9px; }
.mini-pill { border: 1px solid #dce2ec; background: rgba(255,255,255,.72); padding: 6px 9px; color: #59677a; border-radius: 999px; font-size: 9px; font-weight: 700; }
.square-button { width: 31px; height: 31px; border-radius: 8px; border: 1px solid #dce2ec; background: white; color: #4e5a6d; font-size: 17px; }
.square-button:hover { border-color: #a7b0f5; color: var(--accent); }
.canvas-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 12px; background: radial-gradient(ellipse at 50% 35%, #f6f8fb 0%, #e6ebf2 65%, #dfe5ee 100%); border: 1px solid #dce2eb; box-shadow: var(--shadow); }
#roomCanvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; cursor: grab; }
#roomCanvas:active { cursor: grabbing; }
.canvas-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; color: #5c687b; font-size: 12px; background: #edf1f7; z-index: 5; transition: opacity .25s ease; }
.canvas-loading.done { opacity: 0; pointer-events: none; }
.loader-ring { width: 29px; height: 29px; border-radius: 50%; border: 3px solid #d5daea; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-tip { position: absolute; bottom: 15px; left: 15px; display: flex; align-items: center; gap: 9px; max-width: calc(100% - 30px); padding: 10px 12px; border-radius: 9px; color: #566174; background: rgba(255,255,255,.9); border: 1px solid rgba(210,218,229,.95); box-shadow: 0 3px 14px rgba(36,50,73,.08); font-size: 10px; line-height: 1.4; backdrop-filter: blur(10px); }
.tip-icon { font-size: 19px; color: var(--accent); }
.viewer-tip button { border: 0; background: none; color: #8d97a7; margin-left: 2px; font-size: 17px; padding: 0 2px; }
.color-toast { position: absolute; top: 15px; left: 15px; display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #dfe4ed; border-radius: 9px; background: rgba(255,255,255,.94); box-shadow: 0 4px 16px rgba(38,51,73,.08); }
.color-toast .sample-swatch { width: 26px; height: 26px; }
.color-toast span:last-child { display: flex; flex-direction: column; gap: 2px; }
.color-toast strong { color: #364255; font-size: 11px; }
.color-toast small { color: #8994a4; font-size: 9px; }
.view-crosshair { pointer-events: none; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; transform: translate(-50%,-50%); opacity: .2; }
.view-crosshair span { position: absolute; background: #43546b; border-radius: 1px; }
.view-crosshair span:first-child { width: 1px; height: 22px; left: 10px; }
.view-crosshair span:last-child { height: 1px; width: 22px; top: 10px; }
.camera-position { position: absolute; top: 15px; right: 15px; color: #748094; background: rgba(255,255,255,.74); border: 1px solid rgba(211,219,230,.8); border-radius: 6px; padding: 6px 8px; font-size: 9px; pointer-events: none; }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 23px; padding: 0 3px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: #828e9f; font-size: 9px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 4px; }
.wall-dot { background: #9ba7ba; }
.floor-dot { background: #9ea6b1; }
.item-dot { background: #7d89f4; }
.viewer-hint { color: #9aa4b2; font-size: 9px; text-align: right; }
.toast { position: fixed; bottom: 19px; left: 50%; transform: translate(-50%, 18px); z-index: 20; padding: 11px 15px; background: #1d293a; color: white; box-shadow: 0 6px 24px rgba(17,26,42,.2); border-radius: 9px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; font-size: 11px; max-width: min(90vw,520px); text-align: center; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.noscript-warning { position: fixed; inset: 20px; z-index: 99; background: white; padding: 30px; border: 2px solid #c44; }
@media (max-width: 930px) {
  .workspace { grid-template-columns: 315px minmax(0,1fr); }
  .panel-section { padding-left: 14px; padding-right: 14px; }
  .viewer-panel { padding: 12px; }
  .legend { max-width: 70%; }
}
@media (max-width: 720px) {
  html, body { overflow: auto; height: auto; min-height: 100%; }
  .topbar { height: 59px; padding: 0 14px; position: sticky; top: 0; z-index: 10; }
  .brand-copy h1 { font-size: 15px; }
  .brand-copy p { font-size: 10px; }
  .topbar-status { font-size: 10px; }
  .workspace { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 59px); }
  .viewer-panel { order: 0; height: min(54dvh, 470px); min-height: 320px; padding: 10px 10px 9px; gap: 6px; }
  .viewer-toolbar { min-height: 34px; }
  .viewer-toolbar strong { font-size: 12px; }
  .viewer-eyebrow { font-size: 8px; }
  .canvas-wrap { border-radius: 9px; }
  .viewer-tip { bottom: 9px; left: 9px; padding: 7px 9px; font-size: 9px; }
  .camera-position { top: 8px; right: 8px; font-size: 8px; }
  .viewer-footer { min-height: 16px; }
  .legend { font-size: 8px; max-width: 100%; gap: 4px; }
  .viewer-hint { display: none; }
  .sidebar { order: 1; overflow: visible; border-right: 0; }
  .panel-section { padding: 17px 16px; }
  .intro-section { padding-top: 18px; }
  .tool-button { min-height: 69px; }
  .sidebar-footer { padding-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
