:root {
  --header:58px;
  --hud-edge:16px;
  --hud-bottom:38px;
  --hud-surface:#171717;
  --hud-border:#3e3e3e;
  --hud-hover:#2d2d2d;
  --hud-radius:7px;
  --hud-muted:#b8b8b8;
  --build-bar-bottom:89px;
}
.hud-icon {
  display:inline-block;width:15px;height:15px;flex-shrink:0;vertical-align:-3px;
  fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;
}
button .hud-icon {margin-right:6px}
.app-header {padding-inline:var(--hud-edge);grid-template-columns:auto minmax(0,1fr) auto;gap:22px;background:#101010}
.app-header h1 {font-size:15px;letter-spacing:.015em;line-height:1.2}
.view-navigation {justify-content:start;gap:8px;min-width:0}
.segmented {padding:2px;gap:2px;border-radius:var(--hud-radius);background:#1a1a1a;border-color:#373737}
.segmented button,.view-navigation>button {min-height:34px;border-radius:5px;white-space:nowrap}
.segmented button {font-size:12px;padding-inline:11px}
.segmented button.active {box-shadow:none}
.edit-label-short {display:none}
#edit-layout,#done-editing {font-weight:650;padding-inline:11px}
.panel-tabs {gap:2px}
.panel-tabs>button,.panel-tabs #help {min-height:36px;padding:6px 9px;border-radius:5px;color:#d2d2d2;font-size:12px}
.panel-tabs #help {width:auto;min-width:0;margin-left:0;border:1px solid transparent}
.panel-tabs>button:hover,.panel-tabs #help:hover {color:#fff;background:var(--hud-hover)}
.panel-tabs>button.active {background:#2a2a2a;border-color:#454545;color:#fff}
#note-count {display:none}
.workspace {isolation:isolate}
.viewport canvas:focus-visible {outline-offset:-2px}
.view-bar,.time-bar,.section-controls,.tools,.walk-hud,.walk-pad,.mode-banner,#measure-result,#selection,.table-dock,.storefront-study {
  border:1px solid var(--hud-border);background:var(--hud-surface);border-radius:var(--hud-radius);
  box-shadow:0 2px 10px #0003;
}
.view-bar,.time-bar {top:var(--hud-edge)}
.view-bar {right:var(--hud-edge);gap:2px;padding:3px;align-items:center;z-index:5}
.surface-button,.tools button {border:0;border-radius:5px;background:transparent;box-shadow:none;min-height:36px;padding:6px 10px;font-size:12px}
.surface-button:hover,.tools button:hover {background:var(--hud-hover)}
.surface-button[aria-pressed=true],.tools button.active {background:#eee;color:#161616}
.movement-control {position:relative;display:flex;flex:none}
#movement-toggle {
  position:relative;isolation:isolate;display:grid;place-items:center;
  width:36px;height:36px;padding:0;border:0;border-radius:50%;
  background:transparent;color:#eee;
}
#movement-toggle::before {
  content:"";position:absolute;inset:2px;z-index:-1;
  border:1px solid #575757;border-radius:50%;background:#252525;
}
#movement-toggle:hover::before {background:var(--hud-hover);border-color:#888}
#movement-toggle[aria-expanded=true] {color:#161616}
#movement-toggle[aria-expanded=true]::before {background:#eee;border-color:#eee}
#movement-toggle .hud-icon {width:20px;height:20px;margin:0}
#movement-menu {
  display:grid;gap:2px;position:absolute;top:calc(100% + 6px);right:0;
  min-width:128px;padding:4px;border:1px solid var(--hud-border);border-radius:var(--hud-radius);
  background:var(--hud-surface);box-shadow:0 5px 18px #0005;
}
#movement-menu .surface-button {display:flex;align-items:center;justify-content:space-between;text-align:left}
#movement-menu .surface-button[aria-pressed=true]::after {
  content:"";width:5px;height:8px;margin-right:2px;
  border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-1px) rotate(45deg);
}
.tools {left:var(--hud-edge);bottom:var(--hud-bottom);gap:2px;padding:3px}
.view-footer {height:24px;gap:14px;padding-inline:var(--hud-edge);background:#141414;border-top:1px solid #343434;color:var(--hud-muted);font-size:11px;line-height:1.3;text-shadow:none}
#model-status {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.view-units,#navigation-hint:empty {display:none}
.map-credits a {text-decoration:none}
.map-credits a:hover {text-decoration:underline}
.entrance-marker {border-radius:5px;font-weight:600;min-height:34px}

/* Time, facade and section studies share the same narrow dock. */
.study-stack {position:absolute;left:var(--hud-edge);top:var(--hud-edge);display:grid;align-content:start;gap:6px;width:166px;max-height:calc(100% - 88px);overflow:auto;z-index:4;scrollbar-width:thin}
.study-stack:has(#interior-study:not([hidden])) {width:202px}
.study-stack .time-bar,.study-stack .section-controls {position:static;width:100%}
.study-stack #roof-resident-status {display:block;padding:6px 0 1px;color:#c5c5c5;font-size:11px;line-height:1.35}
.study-stack #roof-resident-status[hidden] {display:none}
.study-stack :focus-visible {outline-offset:-2px}
.walking .study-stack {top:auto;bottom:var(--hud-bottom);max-height:calc(100% - 130px)}
.storefront-study,#site-clock,.study-stack .section-controls {padding:7px 9px}
.storefront-study label[for] {margin:0 0 4px;color:#ddd;line-height:1.3}
.interior-choice {display:flex;align-items:stretch;gap:4px}
.interior-choice select {flex:1;width:0;min-width:0}
.interior-choice button {flex:none;padding-inline:9px}
#interior-scheme-dialog {width:min(88vw,350px)}
#interior-scheme-dialog h2 {margin:0 0 16px}
#interior-scheme-dialog input {width:100%;font-size:16px}
.interior-dialog-actions {display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.interior-dialog-actions button {min-height:44px}
#interior-scheme-error {font-size:13px;color:#ddd}
#storefront-concept {min-height:34px;padding:5px 6px;font-size:12px}
#storefront-save-status:not([hidden]) {display:block;margin-top:5px;color:var(--hud-muted);font-size:11px;line-height:1.35}
.clock-row,.clock-speed {display:flex;align-items:center}
.clock-row {justify-content:space-between;gap:5px}
#site-time {font:600 16px/1.2 ui-monospace,monospace;font-variant-numeric:tabular-nums}
.clock-speed {gap:1px}
.clock-speed button {display:grid;place-items:center;width:28px;min-height:28px;padding:1px;border:0;border-radius:4px;background:transparent;color:#ddd;font-size:12px}
.clock-speed button:hover,#clock-details summary:hover {background:var(--hud-hover)}
.clock-speed button[aria-pressed=true] {background:#eee;color:#161616}
#time-slider {display:block;width:100%;height:19px;margin:2px 0;padding:0;accent-color:#ddd;cursor:pointer}
#clock-details summary {width:fit-content;padding-inline:2px;color:var(--hud-muted);cursor:pointer;font-size:11px;line-height:20px}
#sun-date {display:block;width:100%;margin:3px 0}

/* First-person controls sit opposite the view actions. */
.walk-hud {top:var(--hud-edge);left:var(--hud-edge);right:auto;padding:7px 8px;font-size:11px}
.walk-hud>span {padding:0 3px;color:#dedede}
.walk-hud>div {gap:3px;margin-top:4px}
.walk-hud button {border-radius:4px;font-size:11px;min-height:31px;padding:4px 7px;color:#e9e9e9}
.walk-hud button:hover {background:var(--hud-hover);text-decoration:none;color:#fff}
.walk-hud small {display:none}
.walk-pad {right:var(--hud-edge);bottom:var(--hud-bottom)}
.walk-pad button {border-radius:5px;background:#2a2a2a}
.walking #selection {bottom:var(--hud-bottom);left:auto;right:var(--hud-edge)}
.elevator-prompt {
  position:absolute;z-index:5;transform:translate(-50%,-100%);white-space:nowrap;padding:8px 12px;
  background:#f1f1f1;color:#101010;font-weight:650;border:1px solid #fff;box-shadow:0 2px 10px #0006;
}
.elevator-prompt:hover,.elevator-prompt:active {transform:translate(-50%,-100%);background:#d8d8d8;color:#101010}

/* Furniture actions remain in the scene and details stay in the inspector. */
.table-dock {right:var(--hud-edge);bottom:var(--hud-bottom);max-width:calc(100% - 2 * var(--hud-edge));padding:4px;display:flex;align-items:center;z-index:5}
.table-dock-actions {width:100%;flex-wrap:nowrap;gap:3px}
.table-dock-actions>:is(button,.layout-sign-in),.table-shortcuts>button {flex:none;min-height:35px;white-space:nowrap;border-radius:5px;font-weight:550;font-size:12px;padding:6px 9px}
body.layout-editing .table-dock {left:var(--hud-edge)}
#scene-add-table {background:#efefef;color:#101010;padding-inline:12px}
#scene-add-table[aria-expanded=true] {background:#d4d4d4}
#snap-placement[aria-pressed=true] {border-color:#5b5b5b;color:#f5f5f5;background:#333}
#scene-save-design,#scene-sign-in {margin-left:auto}
.layout-sign-in {display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 12px;border:1px solid transparent;border-radius:5px;line-height:1.3;text-decoration:none;white-space:nowrap}
.design-actions .layout-sign-in {flex:1;order:1;padding-inline:7px}
#removed-source-tables {display:grid;gap:4px;margin-top:8px}
#removed-source-tables button {text-align:left;border:1px solid var(--hud-border)}
#scene-design-status:empty {display:none}
#scene-design-status {font-size:11px;line-height:1.25;color:var(--hud-muted);max-width:170px}
.table-help,.table-shortcuts {position:absolute;bottom:calc(100% + 7px);left:0;max-width:100%;background:var(--hud-surface);border:1px solid var(--hud-border);border-radius:var(--hud-radius);padding:6px 9px;margin:0;color:var(--hud-muted)}
.table-shortcuts {gap:3px;padding:4px}
.table-shortcuts strong {max-width:162px;color:#eee}
.table-shortcuts button {min-height:31px;font-size:11px;padding:5px 7px;background:#262626}
.table-shortcuts button:hover {background:#3a3a3a}
.table-dock:has(.table-shortcuts:not([hidden])) .table-help,
body:is(.catalog-open,.placing-furniture) :is(.table-help,.table-shortcuts),
body.layout-editing :is(.tools,#layer-shell),body:not(.layout-editing) :is(#snap-placement,#redo-table) {display:none}
#furniture-picker {position:absolute;z-index:5;left:var(--hud-edge);right:var(--hud-edge);bottom:var(--build-bar-bottom);border-radius:var(--hud-radius)}
#furniture-picker :is(#furniture-search,#close-catalog,#catalog-prev,#catalog-next,#furniture-categories button,#furniture-catalog button) {border-radius:5px}
#furniture-picker .catalog-meta>span:not(#furniture-count) {display:none}
#furniture-count {margin-right:0}
body.placing-furniture .mode-banner {position:absolute;top:auto;bottom:var(--build-bar-bottom);left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 2 * var(--hud-edge));z-index:6;display:flex;align-items:center;gap:8px;padding:6px 8px 6px 12px}
body:not(.placing-furniture) .mode-banner {left:auto;right:var(--hud-edge);top:calc(var(--hud-edge) + 50px);max-width:min(320px,calc(100% - 2 * var(--hud-edge)));z-index:6}
.mode-banner button {margin-left:3px}
#confirm-placement {text-decoration:none;font-weight:650}
.panel-header {background:#171717}
.controls-guide kbd {color:#eee;font:11px ui-monospace,monospace;white-space:nowrap}
#help-dialog {max-height:calc(100dvh - 28px);overflow:auto}

@media(max-width:940px){
  .app-header {gap:12px}
  .panel-tabs>button,.panel-tabs #help {padding-inline:7px}
  .segmented button {padding-inline:8px}
  #scene-design-status {max-width:115px}
}
@media(max-width:800px){
  :root {--header:94px;--hud-edge:10px;--build-bar-bottom:90px}
  .app-header {grid-template-columns:minmax(0,1fr) auto;grid-template-rows:44px 49px;gap:0 5px}
  .app-header h1 {font-size:13px}
  .panel-tabs {grid-row:1;grid-column:2}
  .view-navigation {justify-self:stretch;justify-content:center;align-self:center;gap:6px}
  .view-navigation>button,.segmented button {min-height:40px}
  .table-dock-actions>:is(button,.layout-sign-in) {padding:5px 7px;min-height:36px}
  #scene-add-table {padding-inline:8px}
  #scene-design-status {max-width:88px;font-size:10px}
  body.layers-open .table-dock {display:none}
  .walk-hud {top:var(--hud-edge)}
}
@media(max-width:640px){
  .view-bar {left:var(--hud-edge);justify-content:flex-end;flex-wrap:wrap}
  .view-bar .surface-button {min-height:39px;padding:6px 7px}
  .view-bar :is(#plan-view,#fit) {width:37px;padding-inline:0}
  .view-bar .hud-icon {margin:0}
  .view-bar .view-label,.edit-label,.view-navigation>button .hud-icon,.table-dock-actions>button .hud-icon {display:none}
  .edit-label-short {display:inline}
  #inside-bar:not([hidden]) {flex-wrap:wrap;justify-content:flex-end}
  .study-stack {top:calc(var(--hud-edge) + 50px);max-height:calc(100% - 138px);width:155px}
  .walk-hud {top:calc(var(--hud-edge) + 50px);max-width:calc(100% - 2 * var(--hud-edge))}
  .walking .study-stack {max-height:calc(100% - 168px)}
  body.layout-editing .table-dock-actions {flex-wrap:wrap}
  body.layout-editing #scene-design-status {font-size:10px;max-width:80px}
  .table-shortcuts strong {max-width:110px}
  .table-dock-actions>:is(button,.layout-sign-in),.table-shortcuts>button {font-size:11px}
  body:not(.layout-editing) .workspace:has(#table-dock:not([hidden])) .tools {bottom:88px}
  .controls-guide {grid-template-columns:65px 1fr;gap:11px}
}
@media(max-width:410px){
  .app-header h1 {font-size:12px}
  .panel-tabs>button,.panel-tabs #help {padding-inline:6px;font-size:11px}
  .segmented button {padding-inline:7px;font-size:11px}
  #edit-layout,#done-editing {padding-inline:8px}
  .view-bar .surface-button {font-size:11px}
  .view-footer {font-size:10px;gap:6px}
}
@media(max-height:500px) and (orientation:landscape){
  :root {--header:44px;--hud-edge:8px;--build-bar-bottom:58px}
  .app-header {display:flex;justify-content:space-between;gap:7px}
  .panel-tabs {margin-left:auto}
  .view-navigation>button,.segmented button {min-height:34px}
  .table-dock {bottom:6px}
  .layout-editing .view-footer {display:none}
  .study-stack {max-height:calc(100% - 65px)}
}
@media(pointer:coarse){
  .walk-hud>span {display:none}
  .walk-hud>div {margin-top:0}
  .walk-hud button,.panel-tabs>button,.panel-tabs #help {min-height:42px}
  .walking #selection {bottom:calc(var(--hud-bottom) + 136px)}
}

.phone-only {display:none!important}

@media(max-width:640px), (orientation:landscape) and (max-height:500px){
  :root {
    --phone-header:52px;
    --header:calc(var(--phone-header) + env(safe-area-inset-top, 0px));
    --hud-edge:8px;
    --hud-bottom:calc(30px + env(safe-area-inset-bottom, 0px));
    --build-bar-bottom:calc(var(--hud-bottom) + 58px);
    --phone-left:max(var(--hud-edge),env(safe-area-inset-left, 0px));
    --phone-right:max(var(--hud-edge),env(safe-area-inset-right, 0px));
  }
  .app-header {
    display:grid;grid-template-columns:auto minmax(0,1fr) auto;
    grid-template-rows:1fr;gap:4px;height:var(--header);
    padding:env(safe-area-inset-top, 0px) var(--phone-right) 0 var(--phone-left);
    background:#101010;
  }
  .app-header h1 {font-size:12px;letter-spacing:.065em}
  .brand-detail {
    position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
    clip-path:inset(50%);white-space:nowrap;
  }
  .view-navigation {
    grid-row:1;grid-column:2;justify-content:flex-end;align-self:center;gap:3px;
  }
  .phone-trigger.phone-only {
    display:inline-flex!important;align-items:center;justify-content:center;gap:4px;
    min-width:44px;min-height:44px;padding:4px 8px;border-radius:5px;font-size:12px;line-height:1.2;
  }
  .phone-trigger[aria-expanded=true] {background:#eee;color:#101010}
  #phone-scene {white-space:nowrap}
  #phone-scene .hud-icon {display:inline-block;width:13px;height:13px;margin:0}
  #phone-tools {grid-column:3;grid-row:1;color:#e4e4e4}
  #phone-tools[aria-expanded=true] {color:#141414}
  .view-navigation>button:is(#edit-layout,#done-editing) {min-width:44px;min-height:44px;padding:6px 8px}
  .edit-label,.desktop-dock-label,.desktop-guide,.study-stack,.panel-tabs,.view-navigation .segmented {display:none}
  .edit-label-short {display:inline}

  .view-navigation .segmented,.panel-tabs {
    position:absolute;top:calc(100% + 6px);right:var(--phone-right);width:min(280px,calc(100vw - 16px));
    max-height:calc(100dvh - var(--header) - var(--hud-bottom) - 6px);
    overflow:auto;overscroll-behavior:contain;padding:5px;gap:3px;
    border:1px solid var(--hud-border);border-radius:var(--hud-radius);
    background:var(--hud-surface);box-shadow:0 5px 18px #0005;
  }
  body[data-phone-menu=scene] .view-navigation .segmented,
  body[data-phone-menu=tools] .panel-tabs {display:grid;grid-template-columns:1fr 1fr;align-items:stretch}
  .view-navigation .segmented>button,.panel-tabs>button,.panel-tabs #help {
    width:100%;min-height:44px;padding:7px 10px;text-align:left;font-size:13px;
  }
  #phone-tool-slot.phone-only {display:block!important;grid-column:1 / -1}
  #phone-tool-slot .tools {
    position:static;display:grid;grid-template-columns:1fr 1fr;gap:3px;
    padding:4px 0 0;margin-top:3px;border:0;border-top:1px solid var(--hud-border);border-radius:0;box-shadow:none;
  }
  #phone-tool-slot .tools button {min-height:44px;padding:7px 10px;text-align:left;font-size:13px}
  body:is(.walking,.layout-editing) #phone-tool-slot .tools {display:none}

  .view-bar {
    top:var(--hud-edge);left:auto;right:var(--phone-right);gap:0;
    padding:1px;flex-wrap:nowrap;
  }
  .view-bar .surface-button,.view-bar #phone-view {min-height:44px;padding:7px 10px;font-size:12px}
  .view-bar :is(#plan-view,#fit) {width:auto}
  .view-bar #phone-view {min-width:44px;white-space:nowrap}
  #movement-toggle {width:44px;height:44px}
  #movement-toggle::before {inset:6px}
  .view-bar:has(> .surface-button:not([hidden])) #phone-view {
    border-left:1px solid var(--hud-border);border-top-left-radius:0;border-bottom-left-radius:0;
  }
  body:not([data-phone-menu=view]) #phone-view-options {display:none!important}
  body[data-phone-menu=view] #phone-view-options.phone-only {
    display:grid!important;position:absolute;inset:calc(100% + 6px) 0 auto auto;
    width:max-content;min-width:138px;max-width:calc(100vw - 2 * var(--hud-edge));
    max-height:calc(100dvh - var(--header) - 68px);overflow:auto;overscroll-behavior:contain;
    background:var(--hud-surface);border:1px solid var(--hud-border);border-radius:var(--hud-radius);
    box-shadow:0 5px 18px #0005;padding:4px;gap:2px;
  }
  #phone-view-options>.surface-button {text-align:left;font-size:13px}
  #phone-view-options .view-label {display:inline}
  #phone-view-options .hud-icon {margin:0 6px 0 0}
  .view-bar:has(#inside-bar[hidden]) #phone-view-options :is(#layer-shell,#tea-loft-view) {display:none}
  .view-bar:not(:has(#phone-view-options>.surface-button:not([hidden],#layer-shell,#tea-loft-view))):has(#inside-bar[hidden]) #phone-view {display:none!important}
  .view-bar:not(:has(> .surface-button:not([hidden]),#inside-bar:not([hidden]),#phone-view-options>.surface-button:not([hidden],#layer-shell,#tea-loft-view))) {
    border:0;padding:0;background:none;box-shadow:none;
  }

  #phone-study.phone-only {
    position:absolute;z-index:5;left:var(--phone-left);top:var(--hud-edge);
    background:var(--hud-surface);border:1px solid var(--hud-border);box-shadow:0 2px 10px #0003;
  }
  #phone-study[aria-expanded=true] {background:#eee;color:#141414}
  .phone-section-label,.phone-facade-label,.phone-interior-label {display:none}
  .workspace:not(:has(#interior-study:not([hidden]))):has(#section-controls:not([hidden])) .phone-section-label,
  .workspace:not(:has(:is(#interior-study,#section-controls):not([hidden]))):has(#storefront-study:not([hidden])) .phone-facade-label {display:inline}
  .workspace:has(:is(#section-controls,#storefront-study):not([hidden])) .phone-daylight-label {display:none}
  .workspace:has(#interior-study:not([hidden])) :is(.phone-daylight-label,.phone-section-label,.phone-facade-label) {display:none}
  .workspace:has(#interior-study:not([hidden])) .phone-interior-label {display:inline}
  body[data-phone-menu=study] .study-stack,
  body[data-phone-menu=study].walking .study-stack {
    display:grid;top:calc(var(--hud-edge) + 50px);bottom:auto;left:var(--phone-left);
    width:min(224px,calc(100% - var(--phone-left) - var(--phone-right)));
    max-height:calc(100% - 80px);overscroll-behavior:contain;gap:0;z-index:6;
    border:1px solid var(--hud-border);border-radius:var(--hud-radius);
    background:var(--hud-surface);box-shadow:0 5px 18px #0005;
  }
  .study-stack :is(.time-bar,.section-controls,.storefront-study) {border:0;border-radius:0;box-shadow:none;padding:6px 10px 8px}
  .study-stack :is(.section-controls,.storefront-study) {border-top:1px solid var(--hud-border)}
  .study-stack .clock-speed button {width:44px;min-height:44px}
  .study-stack :is(#time-slider,#section-height) {height:32px}
  #clock-details summary {padding:11px 6px;min-height:44px;line-height:20px}
  .study-stack :is(#sun-date,#storefront-concept) {font-size:16px;min-height:44px}
  .study-stack .interior-choice :is(select,button) {min-height:44px}
  .study-stack .interior-choice select {font-size:16px}
  .study-stack:has(#interior-study:not([hidden])) {
    width:min(232px,calc(100% - var(--phone-left) - var(--phone-right)));
  }
  .study-stack .adaptive-walls {min-height:44px;font-size:13px}
  .study-stack .adaptive-walls input {width:19px;height:19px}

  .view-footer {
    height:calc(22px + env(safe-area-inset-bottom, 0px));gap:6px;
    padding:0 var(--phone-right) env(safe-area-inset-bottom, 0px) var(--phone-left);
    font-size:10px;text-shadow:none;
  }
  .map-credits {font-size:9px;gap:6px}
  .controls-guide.phone-only {display:grid!important;font-size:13px}
  #help-dialog {width:min(400px,calc(100% - 24px));padding:17px}
  #help-dialog .dialog-close {min-width:44px;min-height:44px}
  body:not(.placing-furniture) .mode-banner {
    top:calc(var(--hud-edge) + 53px);left:var(--phone-left);right:auto;max-width:calc(100% - var(--phone-left) - var(--phone-right));
  }
  .mode-banner button {min-height:44px}
  #measure-result,#selection,.tea-cutaway #selection {
    bottom:var(--hud-bottom);left:var(--phone-left);max-width:calc(100% - var(--phone-left) - var(--phone-right));
  }
  #selection>button {min-height:44px}
  #inspector:not([hidden]) {
    position:absolute;inset:auto var(--phone-right) var(--hud-bottom) var(--phone-left);width:auto;
    max-height:64%;height:min(490px,64%);min-height:0;overflow:hidden;
    border:1px solid var(--hud-border);border-radius:10px;
    box-shadow:0 5px 25px #0007;
  }
  body.layers-open .workspace {height:100%}
  body.layers-open .view-footer,.layout-editing .view-footer {display:flex}
  #inspector .panel {padding:12px 14px 16px}
  #inspector .panel-header {height:51px;padding:0 8px 0 14px}
  #close-panel {width:44px;min-height:44px}
  #inspector input:not([type=checkbox]),#inspector select,#inspector textarea {font-size:16px}

  .walk-hud {
    top:calc(var(--hud-edge) + 52px);right:var(--phone-right);left:auto;padding:1px;z-index:4;
  }
  .walk-hud>span,#mouse-look {display:none}
  .walk-hud>div {margin:0;gap:1px}
  .walk-hud button {min-height:44px;min-width:44px;padding:5px 7px;font-size:12px}
  .walk-pad:not([hidden]) {
    display:grid;position:absolute;left:var(--phone-left);right:var(--phone-right);bottom:var(--hud-bottom);
    grid-template-columns:auto minmax(0,1fr);justify-items:start;align-items:end;
    padding:0;border:0;background:transparent;box-shadow:none;pointer-events:none;z-index:4;
  }
  .walk-pad button {
    min-height:44px;width:44px;margin:0;padding:5px;border:1px solid #555;
    background:#171717e8;pointer-events:auto;font-size:17px;
  }
  .walk-pad :is([data-walk],.walk-direction-row) {display:none}
  #walk-stick.phone-only {
    display:grid!important;position:relative;place-items:center;grid-row:1;grid-column:1;
    width:clamp(92px,26vw,112px);aspect-ratio:1;border-radius:50%;
    border:1px solid #e4e4e48c;background:#111a;box-shadow:0 2px 10px #0004;
    pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;
  }
  #walk-stick::before {
    content:'';position:absolute;inset:18%;border:1px solid #fff3;border-radius:50%;pointer-events:none;
  }
  #walk-stick.engaged {background:#111c;cursor:grabbing}
  .walk-stick-thumb {
    width:38%;aspect-ratio:1;border-radius:50%;background:#e4e4e4d9;
    border:1px solid #fff9;box-shadow:0 2px 8px #0005;pointer-events:none;transition:transform .12s ease-out;
  }
  #walk-stick.engaged .walk-stick-thumb {transition:none}
  .walk-pad #walk-jump,.walk-pad #fly-vertical {grid-row:1;grid-column:2;justify-self:end}
  .walk-pad #walk-jump {width:auto;min-width:60px;padding-inline:10px;font-size:13px}
  #fly-vertical {display:grid}
  #fly-vertical button {text-align:left;width:auto;min-width:83px;padding-inline:8px;font-size:13px}
  #fly-vertical .phone-only {display:inline!important}
  .walking #selection {
    bottom:calc(var(--hud-bottom) + 98px);right:var(--phone-right);left:auto;
  }
  .elevator-prompt {min-height:44px}
  .entrance-marker {min-height:44px}

  .table-dock,body.layout-editing .table-dock {
    bottom:var(--hud-bottom);left:var(--phone-left);right:var(--phone-right);max-width:none;
  }
  .table-dock-actions,body.layout-editing .table-dock-actions {gap:2px;flex-wrap:nowrap}
  .table-dock-actions>:is(button,.layout-sign-in),.table-shortcuts>button {
    min-width:44px;min-height:44px;padding:5px 7px;font-size:12px;
  }
  .table-dock-actions>:is(#undo-table,#redo-table) .hud-icon {
    display:inline-block;width:16px;height:16px;margin:0;vertical-align:middle;
  }
  .table-dock-actions>:not(#undo-table,#redo-table) .hud-icon {display:none}
  #scene-add-table {padding-inline:8px}
  #scene-design-status:not(:empty),body.layout-editing #scene-design-status:not(:empty) {
    position:absolute;right:0;bottom:100%;width:max-content;max-width:min(230px,100%);padding:4px 7px;
    border-radius:4px;background:var(--hud-surface);font-size:11px;
  }
  body.catalog-open #scene-design-status {display:none}
  .table-help {display:none}
  .table-shortcuts {flex-wrap:wrap;gap:2px;padding:3px}
  .table-shortcuts strong {flex-basis:100%;max-width:none;font-size:12px}
  #furniture-picker {left:var(--phone-left);right:var(--phone-right);max-height:calc(100% - 110px)}
  body.placing-furniture .mode-banner {
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:min(325px,calc(100% - var(--phone-left) - var(--phone-right)));
    top:auto;bottom:var(--build-bar-bottom);padding:4px;gap:3px;
  }
  body.placing-furniture .mode-banner .mode-message {grid-column:1 / -1;padding:4px 6px;font-size:12px}
  body.placing-furniture .mode-banner button {margin:0;border-radius:5px;font-size:12px}
  body.placing-furniture #rotate-placement.phone-only {display:block!important;background:#282828}
}


body.layout-editing .table-dock {display:flex;flex-wrap:wrap;gap:4px}
.edit-floor {display:flex;align-items:center;gap:3px;width:100%;font-size:12px}
.edit-floor span {padding:0 8px 0 4px;color:var(--hud-muted)}
.edit-floor button {min-height:32px;padding:5px 12px;border-radius:5px}
.edit-floor button[aria-pressed=true] {background:#ececec;color:#171717}
body.layout-editing #furniture-picker,
body.placing-furniture .mode-banner {bottom:calc(var(--build-bar-bottom) + 36px)}

@media (max-width:640px), (orientation:landscape) and (max-height:500px) {
 .edit-floor button {min-height:44px}
 body.layout-editing #furniture-picker,body.placing-furniture .mode-banner {bottom:calc(var(--build-bar-bottom) + 48px)}
 body.layout-editing #furniture-picker {max-height:calc(100% - 158px)}
}

body.layout-editing #tea-loft-view {display:none!important}


.app-header {grid-template-columns:auto minmax(0,1fr) auto auto}
#language-toggle {white-space:nowrap;min-width:42px;height:34px;padding:3px 7px;border:1px solid var(--hud-border);border-radius:5px;font-size:12px}
#language-toggle:hover {background:var(--hud-hover)}
@media (min-width:641px) and (max-width:800px) and (min-height:501px) {
 .app-header {grid-template-columns:minmax(0,1fr) auto auto}
 #language-toggle {grid-column:3;grid-row:1}
 .view-navigation {grid-column:1 / -1}
}
@media (max-width:640px), (orientation:landscape) and (max-height:500px) {
 .app-header {grid-template-columns:auto minmax(0,1fr) auto auto}
 #language-toggle {grid-column:4;grid-row:1;min-width:38px;height:44px;padding-inline:4px}
}
