.home-workspace{display:block;max-width:1600px;margin:auto;min-width:0;letter-spacing:0}
.home-workspace section{min-width:0}
.home-workspace h2{font-size:15px;margin:0;line-height:1.35}
.home-workspace section>header{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.home-workspace section>header>span{color:var(--muted);font-size:12px}
.home-rooms,.home-toolbar-actions{display:flex;align-items:center;gap:6px}
.home-rooms button,.home-toolbar-actions button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:32px;min-height:32px;padding:6px;border:1px solid var(--line);border-radius:4px;background:var(--surface);font-size:12px;white-space:nowrap}
.home-rooms button[aria-current=true],.home-toolbar-actions button[aria-pressed=true]{border-color:var(--module-accent);color:var(--module-accent)}
.home-workspace svg{width:18px;height:18px;flex:0 0 18px}
/* The walk caption is a small overlay inside the map, shown only while it has text. */
.home-communication{position:absolute;left:8px;bottom:8px;z-index:3;max-width:calc(100% - 16px);margin:0;padding:4px 8px;border-radius:4px;background:#24302fd9;color:#f5f7f9;font-size:12px;line-height:1.35;overflow-wrap:anywhere;pointer-events:none}
.home-communication:empty{display:none}
.home-empty{color:var(--muted);font-size:13px;margin:10px 0}
/* Source failures remain announced; room terminals expose their visible status without shrinking the office. */
.home-source-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.home-dialog{width:min(560px,100%);max-height:calc(100dvh - 32px);overflow:auto;background:var(--surface);border:1px solid var(--line-strong);border-radius:8px;box-shadow:0 16px 60px #0007}
.home-dialog>header,.home-dialog>footer,.home-dialog>form>footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;border-bottom:1px solid var(--line)}
.home-dialog h2{margin:0;font-size:17px;overflow-wrap:anywhere;min-width:0}
.home-dialog>header button{min-width:32px;min-height:32px;flex-shrink:0}
.home-dialog-body{padding:4px 16px 16px;overflow-wrap:anywhere}
.home-dialog dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;font-size:13px}
.home-dialog dt{margin:0;color:var(--muted)}
.home-dialog dd{margin:0;overflow-wrap:anywhere}
.home-dialog>footer,.home-dialog>form>footer{border-bottom:0;border-top:1px solid var(--line);justify-content:flex-end;flex-wrap:wrap}
.home-dialog [data-slot-form] .field{display:grid;gap:6px;min-width:0}
.home-dialog [data-slot-form] select{width:100%;min-width:0;height:36px;padding:6px 10px;border:1px solid var(--line-strong);border-radius:4px;background:var(--surface-2);color:var(--text);font:inherit}
.home-dialog .team-command{display:inline-flex;align-items:center;gap:8px;min-height:36px;text-decoration:none;max-width:100%;font-size:13px;white-space:normal;overflow-wrap:anywhere}
.home-dialog .chat-icon{flex:0 0 18px;width:18px;height:18px}
.home-work-summary{padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}
.home-work-summary>header,.home-work-progress>span{display:flex;align-items:center;justify-content:space-between;gap:12px}
.home-work-summary h3{font-size:14px;margin:0}
.home-work-summary>header>span{color:var(--muted);text-align:right;overflow-wrap:anywhere}
.home-dialog .home-work-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}
.home-work-counts dt{font-size:11px}
.home-work-counts dd{font-size:16px;margin-top:4px;font-variant-numeric:tabular-nums}
.home-work-status{margin:8px 0;color:var(--muted);font-size:12px}
.home-work-summary>a{display:flex;align-items:flex-start;gap:8px;min-height:28px;color:var(--text);text-decoration:none;overflow-wrap:anywhere}
.home-work-summary>a:hover{text-decoration:underline}
.home-work-points{margin:8px 0;padding-left:18px;font-size:12px}
.home-work-points li{margin-bottom:4px}
.home-work-progress{display:grid;gap:6px;margin:12px 0 4px;font-size:12px}
.home-work-progress progress{width:100%;height:6px;accent-color:var(--accent);border:0;border-radius:2px;overflow:hidden}
.home-work-progress progress::-webkit-progress-bar{background:var(--line)}
.home-work-progress progress::-webkit-progress-value{background:var(--accent)}
.home-detail-workers,.home-detail-tasks{padding:0;list-style:none}
.home-detail-workers button{display:flex;align-items:center;gap:8px;min-height:32px;border:0;background:transparent;text-align:left;overflow-wrap:anywhere;width:100%}
.home-detail-tasks li{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line)}
.home-detail-tasks li>span{font-size:12px;color:var(--muted);flex-shrink:0}
.home-goal{white-space:pre-wrap}
.home-office{--cols:56;--rows:22;--room-cols:19}
.home-stage{position:relative;min-width:0}
.home-map{position:relative;width:min(100%,calc(max(112px,var(--home-h,100dvh - 300px)) * var(--cols) / var(--rows)));aspect-ratio:var(--cols)/var(--rows);margin-inline:auto;overflow:hidden;isolation:isolate;background:#3a3a50;color:#24302f;border-radius:4px}
.home-map[data-layout=swipe]{width:min(100%,calc(max(112px,var(--home-h,100dvh - 300px)) * var(--room-cols) / var(--rows)));aspect-ratio:var(--room-cols)/var(--rows);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:thin;touch-action:pan-x}
.home-world{position:absolute;inset:0}
.home-map[data-layout=swipe] .home-world{position:relative;inset:auto;width:calc(100% * var(--cols) / var(--room-cols));height:100%}
/* Editing keeps the viewing scale. Wide: the stage keeps the three-room box, the room sits on the right at the same
   size and the assets take the rest. Narrower: the panel sits beside the room when it fits, otherwise both share one view. */
.home-office[data-editing=true] .home-map{margin:0;overflow:hidden;scroll-snap-type:none;touch-action:none}
.home-office[data-editing=true] .home-world{position:relative;inset:auto;width:calc(100% * var(--cols) / var(--room-cols));height:100%}
.home-office[data-mode=side] .home-stage{display:flex;gap:12px;align-items:stretch;margin-inline:auto}
.home-office[data-mode=side][data-layout=wide] .home-stage{width:min(100%,calc(max(112px,var(--home-h,100dvh - 300px)) * var(--cols) / var(--rows)));aspect-ratio:var(--cols)/var(--rows)}
.home-office[data-mode=side][data-layout=wide] .home-map{flex:0 0 auto;width:calc(100% * var(--room-cols) / var(--cols));height:100%;aspect-ratio:auto}
.home-office[data-mode=side][data-layout=swipe] .home-stage{height:max(112px,var(--home-h,100dvh - 300px))}
.home-office[data-mode=side][data-layout=swipe] .home-map{flex:0 0 auto;width:calc(max(112px,var(--home-h,100dvh - 300px)) * var(--room-cols) / var(--rows));height:100%;aspect-ratio:auto}
.home-office[data-mode=side] .home-editor{flex:1 1 0;min-width:0;min-height:0}
.home-office[data-mode=single] .home-stage{width:min(100%,calc(max(112px,var(--home-h,100dvh - 300px)) * var(--room-cols) / var(--rows)));aspect-ratio:var(--room-cols)/var(--rows);margin-inline:auto}
.home-office[data-mode=single] .home-map{width:100%;height:100%;aspect-ratio:auto}
.home-office[data-mode=single] .home-editor{position:absolute;inset:0;z-index:4}
.home-office[data-mode=single][data-view=room] .home-editor{display:none}
.home-world canvas{display:block;position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.home-snaps{position:absolute;inset:0;pointer-events:none}
.home-snap{position:absolute;width:1px;height:1px;scroll-snap-align:start}
.home-map-controls{position:absolute;inset:0}
.home-wall-clock{position:absolute;transform:translate(-50%,-50%);width:112px;min-height:40px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:3px 6px;background:#152622;color:#b9f3cc;border:3px solid #665c4a;border-radius:2px;box-shadow:0 2px 0 #242323;cursor:pointer;font:600 16px/1.1 Consolas,monospace;font-variant-numeric:tabular-nums;z-index:1}
.home-wall-clock small{font:11px/1.15 Consolas,monospace;color:#b6cbbb}
.home-wall-clock:hover{background:#1c332b}.home-wall-clock:focus-visible{outline:2px solid #ffd76a;outline-offset:2px}
.home-wall-clock[data-stale=true]{color:#d8c79c}.home-office[data-editing=true] .home-wall-clock{display:none}
.clock-dialog .clock-date,.clock-countdown{font:24px/1.4 Consolas,monospace;font-variant-numeric:tabular-nums}
.clock-dialog .clock-date{margin-bottom:0}.clock-display-option{display:grid;gap:8px;margin:20px 0}
.clock-dialog select,.clock-dialog input{min-height:36px;max-width:100%;background:var(--surface-2);color:var(--text);border:1px solid var(--line-strong);border-radius:4px;padding:6px 8px;font:inherit}
.clock-duration,.clock-actions{display:flex;gap:8px;flex-wrap:wrap}.clock-duration label{display:grid;gap:6px;flex:1;min-width:90px}.clock-duration input{width:100%;box-sizing:border-box}
.clock-countdown{display:block;margin:12px 0 0}.clock-actions{margin-top:12px}.clock-actions button{min-height:36px}
.clock-dialog .muted{font-size:12px;color:var(--muted)}.clock-dialog [data-clock-notice]{font-size:13px}
.home-system{width:calc(100% / var(--cols));height:calc(200% / var(--rows));transform:translate(-50%,-100%);padding:0;border:0;background:transparent;cursor:pointer}
.home-system:focus-visible,.home-system:hover{outline:2px solid var(--accent);outline-offset:2px;border-radius:2px}
.system-dialog nav{display:flex;gap:4px;flex-wrap:wrap;padding:12px 16px}
.system-dialog nav button{padding:6px 8px;background:var(--surface-2);border:1px solid var(--line);border-radius:4px;color:var(--text)}
.system-dialog nav button[aria-selected=true]{border-color:var(--accent)}
.system-dialog form{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 0;border-block:1px solid var(--line)}
.system-dialog form label{display:flex;align-items:center;gap:6px;font-size:13px}
.system-dialog input[type=number]{width:80px;padding:6px;background:var(--surface-2);border:1px solid var(--line);color:var(--text)}
.system-checks{list-style:none;padding:0;font-size:13px}
.system-checks li{padding:8px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.system-checks li b{display:block}.system-checks li small{color:var(--muted)}
.system-dialog summary{cursor:pointer;padding:8px 0}.system-dialog code{font-size:11px;overflow-wrap:anywhere}
.home-map[data-editing=true] .home-map-controls,.home-map[data-compact=true] .home-map-controls{display:none}
.home-map-control{position:absolute;min-width:24px;min-height:24px;padding:2px;display:flex;align-items:center;justify-content:center;gap:4px;border:1px solid transparent;background:transparent;border-radius:3px;color:#24302f}
.home-map-control:hover{background:#ffffff38;border-color:#ffffffb0}
.home-map-control:focus-visible{outline:2px solid #ffd76a;outline-offset:1px;background:#ffffff40;z-index:2}
.home-room{font-size:11px;line-height:1;max-width:calc(600% / var(--cols));transform:translateY(-100%);color:#24302f;background:#f5f7f9;border-color:#9aaab4;padding:2px 5px;box-shadow:0 1px 0 #2f3a4155;justify-content:flex-start;white-space:nowrap}
.home-room b{overflow:hidden;text-overflow:ellipsis}
.home-room svg{width:14px;height:14px;flex-basis:14px}
.home-room[data-zone=home]{background:#dbbe82;border-color:#a98b4c}
.home-room[data-zone=team]{background:#e99aa6;border-color:#bf6f7d}
.home-room[data-zone=chat]{background:#91c7a2;border-color:#629d76}
.home-room[data-zone=work]{background:#92b9e8;border-color:#6590c4}
.home-room[data-zone=system]{background:#ededed;border-color:#9aa6ae}
.home-room[data-zone=project]{background:#79c9b5;border-color:#4f9f8b}
.home-room[data-zone=external]{max-width:calc(350% / var(--cols));background:#b9a6e3;border-color:#8a76c0}
.home-environment{max-width:calc(700% / var(--cols));font-size:11px;line-height:1;white-space:nowrap;background:#ededed;border-color:#9aa6ae;padding:2px 5px;transform:translateY(-100%);justify-content:flex-start}
.home-environment b{overflow:hidden;text-overflow:ellipsis}
.home-lab-setup{position:absolute;display:flex;align-items:center;gap:4px;min-height:24px;border:1px dashed #6d7783;border-radius:3px;color:#24302f;background:#edededd8;text-decoration:none;z-index:1}
.home-lab-setup svg{width:14px;height:14px;flex-basis:14px}
.home-lab-setup:hover,.home-lab-setup:focus-visible{border-style:solid;border-color:#24302f;background:#fff}
.home-map[data-editing=true] .home-lab-setup,.home-map[data-compact=true] .home-lab-setup{display:none}
.home-room:hover,.home-room:focus-visible{border-color:#24302f}
.home-room-label{font-size:11px;line-height:1;gap:4px;padding:2px 6px;background:#f5f7f9e8;border-color:#3a3a50;color:#24302f;white-space:nowrap}
.home-room-label button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding:0;border:1px solid #9aaab4;border-radius:3px;background:#fff;color:#24302f}
.home-room-label svg{width:14px;height:14px;flex-basis:14px}
.home-add{width:calc(100% / var(--cols));height:calc(100% / var(--rows));transform:translate(-50%,-100%)}
.home-add:hover,.home-add:focus-visible{border-color:#2c7a60;border-style:dashed}
.home-add .home-sprite-fallback{font-size:18px;font-weight:700;line-height:1;color:#2c7a60}
.home-room-next{width:24px;height:24px;transform:translate(-50%,-50%);background:#f5f7f9d8;border-color:#9aaab4}
.home-worker{width:calc(100% / var(--cols));height:calc(200% / var(--rows));transform:translate(-50%,-100%);flex-direction:column;justify-content:flex-end}
.home-sprite-fallback{display:none;align-self:center;justify-self:center}
.home-map[data-asset-state=fallback] .home-sprite-fallback{display:inline-flex}
.home-map[data-asset-state=fallback] .home-worker{justify-content:center}
.home-asset-fallback{display:none;position:absolute;bottom:4px;left:8px;font-size:11px;background:#fff;color:#344047;padding:3px;z-index:3}
.home-map[data-asset-state=fallback] .home-asset-fallback{display:block}
.home-edit-layer{position:absolute;inset:0;touch-action:none;cursor:crosshair}
.home-edit-layer:focus-visible{outline:2px solid #ffd76a;outline-offset:-2px}
.home-selection{position:absolute;border:2px solid #ffd76a;box-shadow:0 0 0 1px #3a3a50,inset 0 0 0 1px #3a3a50;border-radius:2px;pointer-events:none}
.home-toolbar-divider{width:1px;align-self:stretch;margin:4px 3px;background:var(--line)}
.home-toolbar-actions .primary:not(:disabled){border-color:var(--module-accent);color:var(--module-accent)}
.home-toolbar-actions button:disabled{opacity:.45;cursor:default}
.home-editor{display:flex;flex-direction:column;gap:10px;padding:10px;border:1px solid var(--line);border-radius:6px;background:var(--surface);overflow:hidden}
.home-palette-tabs{display:flex;flex-wrap:wrap;gap:4px;flex:0 0 auto}
.home-palette-tabs button{min-height:30px;padding:4px 10px;border:1px solid var(--line);border-radius:14px;background:transparent;font-size:12px;white-space:nowrap}
.home-palette-tabs [aria-selected=true]{border-color:var(--module-accent);color:var(--module-accent)}
.home-office[data-mode=single] .home-palette-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;padding-bottom:2px}
/* Tiles are square and fit the category's largest sprite at the map scale (--tile is set from JS through CSSOM). */
.home-palette{--tile:96px;display:grid;grid-template-columns:repeat(auto-fill,var(--tile));grid-auto-rows:var(--tile);gap:6px;flex:1 1 auto;min-height:0;overflow:auto;align-content:start;padding:2px}
.home-palette-item,.home-look-swatch{display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:4px;background:#2b2c3a}
.home-palette-item{touch-action:pan-y;cursor:grab}
.home-office[data-mode=single] .home-palette-item{touch-action:manipulation;cursor:pointer}
.home-palette-item:hover,.home-look-swatch:hover{border-color:#9aaab4}
.home-palette-item[aria-pressed=true],.home-look-swatch[aria-pressed=true]{border-color:#ffd76a;box-shadow:inset 0 0 0 1px #ffd76a}
.home-palette-item:focus-visible,.home-look-swatch:focus-visible{outline:2px solid #ffd76a;outline-offset:1px}
.home-palette-thumb-host{display:grid;place-items:center}
.home-palette-thumb{display:block}
.home-palette-pod{display:flex}
.home-looks{display:grid;gap:14px;flex:1 1 auto;min-height:0;overflow:auto;align-content:start;padding:2px}
.home-look{display:block;margin:0;padding:0;border:0;min-width:0}
.home-look legend{padding:0;margin-bottom:6px;font-size:12px;color:var(--muted)}
.home-look>div{display:flex;flex-wrap:wrap;gap:6px}
.home-look-swatch{padding:5px}
.home-edit-views{display:none}
.home-office[data-mode=single] .home-edit-views{display:flex;gap:4px;width:min(100%,calc(max(112px,var(--home-h,100dvh - 300px)) * var(--room-cols) / var(--rows)));margin:0 auto 8px}
.home-edit-views button{flex:1 1 0;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;border:1px solid var(--line);border-radius:4px;background:var(--surface);font-size:12px}
.home-edit-views [aria-selected=true]{border-color:var(--module-accent);color:var(--module-accent)}
.home-editor-statusbar{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;min-height:40px;padding:12px 0;border-bottom:1px solid var(--line);font-size:12px}
.home-editor-room{color:var(--module-accent);font-weight:600}
.home-editor-status{margin:0;color:var(--text);overflow-wrap:anywhere}
.home-editor-selection{color:var(--muted);overflow-wrap:anywhere}
.home-editor-tip{display:none;color:var(--muted)}
.home-office[data-mode=single] .home-editor-status:empty+.home-editor-tip{display:inline}
.home-editor-disarm{display:inline-flex;align-items:center;justify-content:center;align-self:center;min-width:28px;min-height:28px;padding:4px;border:1px solid var(--line);border-radius:4px;background:var(--surface)}
.home-editor-disarm svg{width:14px;height:14px;flex-basis:14px}
.home-edit-layer[data-hover=sprite],.home-edit-layer[data-hover=slot]{cursor:grab}
.home-edit-layer[data-hover=fixed]{cursor:not-allowed}
.home-edit-layer[data-hover=dragging]{cursor:grabbing}
/* The preview shows where and how large a sprite lands; refused spots are dimmed and outlined in red. */
.home-preview{position:absolute;display:grid;place-items:center;pointer-events:none;outline:1px dashed #ffd76a;opacity:.9}
.home-preview[hidden]{display:none}
.home-preview[data-valid=false]{outline-color:#ff6b6b;opacity:.5;filter:grayscale(1)}
.home-drag-ghost{position:fixed;z-index:50;pointer-events:none;transform:translate(-50%,-50%);opacity:.85}
.home-drag-ghost[hidden]{display:none}
@media(max-width:900px){.home-rooms span{display:none}}
@media(max-width:440px){.home-rooms,.home-toolbar-actions{gap:3px}.home-dialog dl{gap:8px;font-size:12px}.home-toolbar-divider{margin-inline:1px}}
.home-rooms svg,.home-toolbar-actions svg{width:18px;height:18px;flex:0 0 18px}

.home-studio{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.home-theme{min-height:30px;max-width:190px;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--text);padding:0 8px;font-size:12px}
.home-studio-end{margin-left:auto}
.home-icon-button,.home-icon-badge{display:inline-grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--muted)}
.home-icon-button:hover{color:var(--text);border-color:#9aaab4}
.home-icon-badge{border-style:dashed}
.home-glyph,.home-icon-button svg,.home-icon-badge svg,.home-palette-tabs svg,.home-swatch svg{width:15px;height:15px;flex:0 0 15px}
.home-providers{display:inline-flex;gap:4px}
.home-swatch{display:inline-flex;align-items:center;gap:4px;height:30px;padding:0 3px 0 6px;border:1px solid var(--line);border-radius:4px;color:var(--muted);font-size:11px;font-weight:650}
.home-swatch input[type=color]{width:22px;height:22px;padding:0;border:0;border-radius:3px;background:transparent;cursor:pointer}
.home-swatch[data-state=none]{border-style:dashed}
.home-palette-tabs button{display:inline-flex;align-items:center;gap:5px}
.home-inspector{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px;border:1px solid var(--line);border-radius:6px;background:#2b2c3a;flex:0 0 auto}
.home-inspector-name{max-width:170px;margin-right:2px;overflow:hidden;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}
.home-inspector-actions{display:inline-flex;gap:4px;margin-left:auto}
.home-patterns{display:flex;flex-wrap:wrap;gap:4px;width:100%}
.home-patterns .home-look-swatch{width:38px;height:38px;padding:2px}
.home-patterns canvas{width:32px;height:32px}
.home-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(68px,1fr));gap:6px;flex:1 1 auto;min-height:0;overflow:auto;align-content:start;padding:2px}
.home-tile{position:relative;aspect-ratio:1}
.home-tile-body{display:grid;place-items:center;width:100%;height:100%;padding:4px;border:1px solid var(--line);border-radius:6px;background:#2b2c3a}
.home-tile-body:hover{border-color:#9aaab4}
.home-tile-body canvas{width:100%;height:100%;object-fit:contain}
.home-tile[data-checked=true] .home-tile-body{border-color:var(--module-accent);box-shadow:inset 0 0 0 1px var(--module-accent)}
.home-tile-check{position:absolute;top:3px;right:3px;display:grid;place-items:center;width:18px;height:18px;padding:0;border:1px solid #ffffff55;border-radius:50%;background:#1d1e28cc;color:transparent}
.home-tile-check svg{width:11px;height:11px}
.home-tile:hover .home-tile-check,.home-tile-check:focus-visible{border-color:#ffffffaa}
.home-tile[data-checked=true] .home-tile-check{border-color:var(--module-accent);background:var(--module-accent);color:#1d1e28}
.home-tile-play{position:absolute;left:3px;bottom:3px;display:grid;place-items:center;width:24px;height:24px;padding:0;border:1px solid #ffffff40;border-radius:50%;background:#1d1e28cc;color:#e9e4da;opacity:.72}
.home-tile-play svg{width:12px;height:12px}
.home-tile:hover .home-tile-play,.home-tile-play:focus-visible{opacity:1;border-color:#ffffffaa}
.home-tile-play[aria-pressed=true]{opacity:1;border-color:var(--module-accent);color:var(--module-accent)}
