:root{font-family:"Avenir Next",Avenir,"Segoe UI",sans-serif;color:#254353;background:#edf3f7;font-size:16px;--blue:#235e79;--ink:#254353;--muted:#657f8c;--line:#d7e3ea;--paper:#fff}*{box-sizing:border-box}body{margin:0;height:100dvh;min-height:520px}button,input{font:inherit}button{cursor:pointer;color:inherit;border:0}button:disabled{opacity:.42;cursor:not-allowed}svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icons{display:none}.app-shell{height:100%;max-width:760px;margin:auto;display:flex;flex-direction:column;background:#f7fafc}.topbar{height:64px;flex-shrink:0;padding:8px 22px;display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--line)}.device-heading,.top-actions{display:flex;align-items:center;gap:12px}h1{font-size:1.1rem;font-weight:650;margin:0}h2{font-size:1.2rem;font-weight:650;margin:0 0 12px}.badge{font-size:.75rem;background:#e0eaf0;padding:4px 8px;border-radius:6px;color:#5d7887}.icon-button{background:transparent;width:44px;height:44px;display:grid;place-items:center;border-radius:10px}.icon-button:hover{background:#e6eff4}.top-actions{gap:0}main{flex:1;display:flex;min-height:0;position:relative}.dashboard{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}.map-panel{flex:1;min-height:170px;display:flex;flex-direction:column;background:#edf3f7}.map-head{padding:13px 24px 0;display:flex;justify-content:space-between;color:var(--muted);font-size:.8rem;gap:10px}.map-stage{position:relative;flex:1;min-height:0;display:grid;grid-template:minmax(0,1fr)/minmax(0,1fr);place-items:center;padding:8px 22px;overflow:hidden}.map-stage>svg{height:100%;width:100%;max-height:100%;overflow:visible;stroke:none}.map-stage>p{font-size:.9rem;text-align:center;max-width:34ch;line-height:1.6;margin:20px;color:var(--muted)}.room-shape{fill:#cfdfe9;transition:fill .14s}.room[data-color="1"] .room-shape{fill:#d9e4dc}.room[data-color="2"] .room-shape{fill:#e5e5d8}.room[data-color="3"] .room-shape{fill:#dadfed}.room[data-color="4"] .room-shape{fill:#d8e6e8}.room[data-color="5"] .room-shape{fill:#e6dfe7}.room{cursor:pointer;outline:none}.room[aria-disabled="true"]{cursor:default}.room[aria-pressed="true"] .room-shape{fill:#6595b0}.room[aria-pressed="true"] text{fill:#fff}.room:focus-visible .room-shape{stroke:#235e79;stroke-width:2}.room text{fill:#476575;font-family:inherit;font-weight:550;text-anchor:middle;dominant-baseline:central;pointer-events:none}.room .room-selected{fill:white;stroke:#235e79;stroke-width:1.3;pointer-events:none}.floor-shape{fill:#dce6ec}.cartoon .house-shadow{fill:#254353;opacity:.13;pointer-events:none}.cartoon .room-shape{stroke:#2f5266;stroke-width:var(--edge);stroke-linejoin:round;paint-order:fill}.cartoon .room[data-color="0"] .room-shape{fill:#cfe3ef}.cartoon .room[data-color="1"] .room-shape{fill:#d6ead9}.cartoon .room[data-color="2"] .room-shape{fill:#f3e7c9}.cartoon .room[data-color="3"] .room-shape{fill:#dcdcf2}.cartoon .room[data-color="4"] .room-shape{fill:#cfe9e6}.cartoon .room[data-color="5"] .room-shape{fill:#f1dcdf}.cartoon .room[aria-pressed="true"] .room-shape{fill:#4f86a6}.cartoon .room text{font-weight:650;fill:#2f5266;paint-order:stroke;stroke:#ffffffb3;stroke-width:calc(var(--edge)*1.4);stroke-linejoin:round}.cartoon .room[aria-pressed="true"] text{fill:#fff;stroke:#2f5266}.wall-shape{fill:#91aabd}.robot-marker{fill:#fff;stroke:#235e79;stroke-width:1.6;pointer-events:none}.robot-core{fill:#aac7d7;stroke:none}.dock-marker{fill:#86a2b3;stroke:none}.selection-bar{padding:6px 24px 14px;min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:12px}.selection-bar>div{min-width:0;display:flex;flex-direction:column;gap:3px}.selection-bar strong{font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.selection-bar span{font-size:.75rem;color:var(--muted)}.clear-button{background:transparent;color:var(--blue);font-size:.8rem;font-weight:600;min-height:44px;padding:8px;white-space:nowrap}.control-panel{padding:0 24px max(20px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:white;flex-shrink:0}.status-strip{height:52px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:.875rem}.status{display:flex;align-items:center;gap:7px;min-width:0}.status span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.status i{width:7px;height:7px;border-radius:50%;background:#4b8b77;flex-shrink:0}.battery{display:flex;align-items:center;gap:7px;white-space:nowrap}.battery svg{width:22px;height:22px}.active-task{display:flex;justify-content:space-between;gap:12px;font-size:.75rem;color:var(--muted);padding-bottom:9px}.active-task>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}fieldset{border:0;padding:0;margin:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}.mode-option{position:relative;min-width:0}.mode-option input{position:absolute;opacity:0;width:1px;height:1px}.mode-tile{height:68px;display:flex;align-items:center;gap:11px;padding:12px 14px;background:#f5f8fa;border:1px solid #e0e8ee;border-radius:11px;cursor:pointer}.mode-tile>svg{color:#648294;width:22px;height:22px}.mode-tile>span{flex:1;min-width:0}.mode-tile strong{display:block;font-size:.9rem;font-weight:600;line-height:1.3}.mode-tile small{display:block;font-size:.75rem;color:var(--muted);margin-top:3px}.mode-tile .check{position:absolute;right:8px;top:8px;width:12px;height:12px;display:none;color:var(--blue)}.mode-option input:checked+.mode-tile{background:#e9f2f8;border:1.5px solid #608fa9;padding:11.5px 13.5px}.mode-option input:checked+.mode-tile>svg{color:var(--blue)}.mode-option input:checked+.mode-tile .check{display:block}.mode-option input:disabled+.mode-tile{opacity:.6;cursor:not-allowed}.mode-option input:focus-visible+.mode-tile{outline:3px solid #bd8f36;outline-offset:2px}.command-bar{display:grid;grid-template-columns:minmax(0,1fr) 64px 64px;gap:10px;margin-top:16px}.primary,.secondary{border-radius:10px;min-height:48px;font-weight:600;padding:12px 18px}.primary{background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;gap:10px;font-size:.95rem}.primary svg{width:20px;height:20px}.secondary{background:#edf3f7;border:1px solid var(--line)}.utility{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:10px;background:#f1f6f9;min-height:54px}.utility span{font-size:.65rem}.utility svg{width:22px;height:22px}.permission-note{margin:10px 0 0;font-size:.8rem;color:var(--muted)}button:focus-visible,summary:focus-visible,input:focus-visible{outline:3px solid #bd8f36;outline-offset:3px}.sr-only{position:absolute;width:1px;height:1px;clip:rect(0,0,0,0);overflow:hidden;white-space:nowrap}dialog{color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:18px;width:calc(100% - 32px);max-width:420px;padding:26px;max-height:85dvh;overflow:auto}dialog::backdrop{background:#193b5266}dialog p{line-height:1.55;margin:10px 0}.muted{font-size:.8rem;color:var(--muted);line-height:1.55}.dialog-buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}#confirm-target{font-size:1.1rem;font-weight:600}#confirm-mode{font-size:.95rem}.sheet-top{display:flex;justify-content:space-between;align-items:center}.sheet-top h2{margin:0}.menu-dialog details{border-top:1px solid var(--line);padding:16px 0}.menu-dialog summary{cursor:pointer;font-weight:600;min-height:28px}.menu-dialog #logout{width:100%}.details-stats{display:flex;gap:24px;margin:22px 0 10px;font-size:.8rem;color:var(--muted)}.details-stats strong{color:var(--ink);font-size:1.1rem;margin-right:6px}.stop-button{width:100%;background:#f8eeeb;color:#935344;font-size:.9rem;font-weight:600;border-radius:9px;min-height:46px;margin:14px 0 20px}.history-item{display:flex;justify-content:space-between;gap:15px;border-top:1px solid #eaf0f4;padding:12px 0;font-size:.8rem}.history-item p{margin:2px 0}#devices{padding-left:18px;font-size:.8rem;overflow-wrap:anywhere}#devices li{margin:15px 0}.login{margin:auto;width:100%;max-width:380px;padding:28px}.login label{display:block;font-size:.875rem;margin:18px 0 8px}.login input{width:100%;padding:13px 14px;border:1px solid #bacdd9;border-radius:9px}.login .primary{width:100%;margin-top:24px}#error{position:absolute;bottom:12px;left:12px;right:12px;max-height:30dvh;overflow:auto;z-index:5;background:#fff1ed;border:1px solid #e9c7bb;color:#8c4430;border-radius:10px;padding:14px 18px;font-size:.85rem;line-height:1.5;box-shadow:0 8px 20px #29435412}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);max-width:calc(100% - 30px);background:#254353;color:white;padding:13px 20px;z-index:20;border-radius:10px;font-size:.85rem;text-align:center;line-height:1.5}[hidden]{display:none!important}@media(min-width:800px){.app-shell{margin:20px auto;height:calc(100% - 40px);border:1px solid var(--line);border-radius:20px;overflow:hidden}.map-stage{padding:10px 60px}.control-panel{padding-left:30px;padding-right:30px}fieldset{gap:12px}.mode-tile{height:72px}.topbar{padding-left:30px;padding-right:20px}}@media(max-width:430px){.topbar{height:54px;padding:4px 14px}.device-heading{gap:9px}.top-actions .icon-button{width:40px;height:44px}h1{font-size:1rem}.map-head{padding:10px 18px 0;font-size:.75rem}.map-stage{padding:6px 14px}.selection-bar{padding:4px 18px 10px;min-height:53px}.control-panel{padding:0 16px max(12px,env(safe-area-inset-bottom))}.status-strip{height:44px}.mode-tile{height:74px;gap:8px;padding:9px 10px}.mode-option input:checked+.mode-tile{padding:8.5px 9.5px}.mode-tile strong{font-size:.875rem}.mode-tile small{font-size:.7rem}.mode-tile>svg{width:20px;height:20px}.mode-tile .check{width:13px;height:13px}fieldset{gap:8px}.command-bar{margin-top:12px;grid-template-columns:minmax(0,1fr) 57px 57px;gap:8px}.primary{padding:12px;font-size:.875rem}}@media(max-height:670px){.status-strip{height:38px}.command-bar{margin-top:10px}.selection-bar{padding-bottom:6px;min-height:46px}.map-head{padding-top:6px}.control-panel{padding-bottom:max(8px,env(safe-area-inset-bottom))}.active-task{padding-bottom:4px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

@media(max-width:360px){.mode-tile>svg:first-child{display:none}}
