:root{font-family:Inter,"Noto Sans SC",system-ui,sans-serif;color:#202e29;background:#dfe9e2;--accent:#1e674d;--line:#dce5de;--sidebar:252px}*{box-sizing:border-box}body{margin:0;overflow:hidden}button{font:inherit;cursor:pointer;color:inherit}button:focus-visible{outline:2px solid #248762;outline-offset:2px}#stage{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:grab}#stage:active{cursor:grabbing}header,aside,.view,.toolbar,.hint,.title{position:fixed}header{top:0;left:0;right:0;height:68px;background:#f8faf7;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 25px}.brand{display:flex;align-items:center;gap:12px}.mark{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:#245b46;color:#f3fff6;font-size:21px}.brand strong{font-size:16px;letter-spacing:-.3px;display:block}.brand small,.kicker{font:600 10px/1.4 ui-monospace,monospace;letter-spacing:.16em;color:#557369}.demo{font-size:13px;padding:7px 11px;border:1px solid #d8e9dc;border-radius:20px;background:#eef6ef;color:#32664e}i{display:inline-block;width:7px;height:7px;background:#4c9c74;border-radius:50%;margin-right:5px}aside{left:0;top:68px;bottom:0;width:var(--sidebar);background:#f8faf7;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:26px 16px 16px}.side-top{padding:0 8px}h2{font-size:18px;margin:8px 0 18px}h2 span{font-size:12px;color:#5c7569;padding:2px 7px;background:#eaf1eb;border-radius:20px;margin-left:4px}#devices{overflow:auto;min-height:0}.row{width:100%;display:flex;align-items:center;text-align:left;gap:10px;padding:10px;border:1px solid transparent;background:transparent;border-radius:10px;margin-bottom:4px}.row:hover,.row.selected{background:#e8f2eb;border-color:#d1e5d7}.row strong{display:block;font-size:13px}.row small{display:block;font-size:11px;color:#5a7166;margin-top:3px}.mini{width:20px;height:30px;border:2px solid #293d36;border-radius:5px;flex:none;background:var(--swatch);box-shadow:inset 0 0 0 1px #ffffff66}.add{margin-top:12px;padding:10px;border:1px dashed #9eb9a9;border-radius:9px;background:#f4f8f3;color:#215d46;font-weight:650;font-size:14px}.add:hover{background:#e0efe4}.side-bottom{margin-top:auto;padding:15px 8px 0;color:#5a7166;font-size:12px}.title{left:calc(var(--sidebar) + 34px);top:102px;pointer-events:none}.title h1{font-size:clamp(26px,4vw,44px);margin:5px 0 6px;letter-spacing:-.06em}.title p{margin:0;color:#4e6a60;font-size:14px}.view{top:110px;right:25px}.view,.toolbar{display:flex;align-items:center;gap:4px;background:#f9fcf7;border:1px solid #ccdcd1;padding:4px;border-radius:10px;box-shadow:0 3px 13px #193c2a12}.view button,.toolbar button,.close{border:0;background:transparent;border-radius:6px;padding:7px 11px;font-size:13px}.view button.active,.view button:hover,.toolbar button:hover{background:#e4efe6;color:#1d6549}.toolbar{bottom:22px;left:calc(50% + var(--sidebar)/2);transform:translateX(-50%)}.toolbar span{width:46px;text-align:center;font:12px ui-monospace,monospace}.toolbar b{height:18px;border-right:1px solid var(--line)}.hint{bottom:30px;right:22px;font-size:11px;color:#536e63;pointer-events:none}.hint span{padding:0 3px}dialog{border:1px solid #cddfd1;border-radius:16px;padding:23px;width:min(390px,calc(100% - 28px));background:#f8faf7;color:inherit;box-shadow:0 20px 90px #152c2655}dialog::backdrop{background:#18322866}.close{position:absolute;right:12px;top:12px;font-size:20px}#error{position:fixed;left:calc(var(--sidebar) + 24px);top:48%;padding:14px;background:#fff;border-radius:8px}@media(max-width:1000px){.hint{display:none}}@media(max-width:650px){:root{--sidebar:0px}header{height:56px;padding:0 12px}aside{top:auto;left:8px;right:8px;bottom:62px;width:auto;height:60px;flex-direction:row;align-items:center;padding:5px;border:1px solid var(--line);border-radius:10px;gap:6px}.side-top,.side-bottom,.row small{display:none}#devices{display:flex;flex:1}.row{width:auto;flex:none;margin:0;padding:4px 6px}.row strong{font-size:11px}.mini{width:14px;height:22px}.add{margin:0;padding:6px;white-space:nowrap;font-size:11px}.title{left:14px;top:74px}.title p{font-size:12px}.view{top:148px;right:10px}.toolbar{bottom:12px}}
.header-actions{display:flex;align-items:center;gap:12px}.icon{display:inline-grid;place-items:center}.icon svg{display:block;width:20px;height:20px}#theme{background:transparent;border:1px solid var(--line);border-radius:8px;width:36px;height:36px}#theme .sun,[data-theme=dark] #theme .moon{display:none}[data-theme=dark] #theme .sun{display:block}.demo{cursor:pointer}.side-bottom{display:grid;justify-items:start;gap:8px}.version{font:12px ui-monospace,monospace}.side-bottom button{border:0;background:transparent;padding:3px 0;font-size:14px;color:inherit}.side-bottom button:hover{text-decoration:underline}
#backend{width:min(500px,calc(100% - 28px));max-height:calc(100% - 28px)}#backend-form{display:grid;gap:10px}#backend label,#backend details{font-size:14px}#backend input{font:inherit;width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:transparent;color:inherit}#backend-status,#catalog-status{margin:0;font-size:13px;color:var(--accent)}#backend-status:empty,#catalog-status:empty{display:none}.source-buttons{display:flex;justify-content:space-between;gap:8px}.source-buttons button{border:1px solid var(--line);border-radius:8px;padding:8px;background:transparent;font-size:13px}#connect{background:var(--accent);color:white}#backend details{margin-top:18px}#backend pre{overflow:auto;background:#53776313;padding:8px;border-radius:6px}#backend summary{cursor:pointer}
:root[data-theme=dark]{color-scheme:dark;color:#e4efe8;background:#17241e;--accent:#86caa9;--line:#34483e}
[data-theme=dark] :is(header,aside,.view,.toolbar,dialog,#error){background:#18251f;border-color:var(--line)}
[data-theme=dark] :is(.row.selected,.row:hover,.view button.active,.view button:hover,.toolbar button:hover,.add,.demo,h2 span){background:#293e33;border-color:#3d594a;color:#d3eada}
[data-theme=dark] :is(.kicker,.brand small,.side-bottom,.row small){color:#a1baac}
[data-theme=dark] #connect{color:#13251c}
@media(max-width:650px){.side-bottom{display:none}}
#workspace-status{margin:7px 0 0;color:var(--accent);font-size:13px}#workspace-status:empty{display:none}button:disabled{opacity:.55;cursor:default}
@media(max-width:650px){#workspace-status{position:absolute;bottom:100%;margin:0 0 6px;left:0;background:inherit;padding:6px;border-radius:6px}}
@media(max-width:650px){.side-bottom{display:grid;flex:none;padding:0 5px;gap:1px;border-left:1px solid var(--line)}.side-bottom button{font-size:11px}.version{font-size:10px}}
.brand{min-width:0}.brand>div{min-width:0}.brand small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:min(38vw,360px)}.header-actions{flex:none}
.side-bottom{justify-items:stretch;padding:12px 0 0}.version{display:flex;align-items:center;gap:7px;justify-self:start;padding:2px 8px;color:inherit;text-decoration:none}.version:hover{color:var(--accent)}.version svg{width:15px;height:15px}
.side-bottom #settings{display:flex;align-items:center;gap:9px;width:100%;padding:9px 8px;border:1px solid var(--line);border-radius:8px;text-decoration:none;text-align:left}.side-bottom #settings:hover{background:#54836920}.side-bottom #settings svg{width:17px;height:17px;flex:none}
#random-row{width:100%;margin:8px 0}#subtitle-form{display:grid;gap:8px}#subtitle-form label,#subtitle-status{font-size:14px}#subtitle-form>div{display:flex;gap:8px}#subtitle-form button{border:1px solid var(--line);background:transparent;border-radius:8px;padding:0 12px;white-space:nowrap}#subtitle-status{margin:0;color:var(--accent)}#subtitle-status:empty{display:none}#backend h3{font-size:15px;margin:20px 0 10px}
@media(max-width:650px){.view{top:70px}.side-bottom{padding:0 3px}.version{padding:0 1px;gap:3px}.version svg{width:11px;height:11px}.side-bottom #settings{padding:3px;gap:3px}.side-bottom #settings svg{width:13px;height:13px}}
#subtitle-form[hidden]{display:none}
.device-status{display:block;flex:0 0 8px;height:8px;border-radius:50%;margin-left:auto;background:#87948e}.device-status.online{background:#35a477;box-shadow:0 0 0 3px #35a47720}.device-status.offline{background:#c66d5d}.device-status.unknown{background:transparent;border:1px solid #87948e}
.canvas-credit{position:fixed;left:calc(var(--sidebar) + 28px);bottom:29px;color:#2e5144;text-decoration:none;font:12px ui-monospace,monospace}.canvas-credit:hover{text-decoration:underline}
.agent-launch,.agent-panel{position:fixed;right:24px}.agent-launch{bottom:22px;border:1px solid #2c7157;background:#215c46;color:#f4fff7;display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:12px;box-shadow:0 6px 18px #14292033}.agent-launch:hover{background:#2d7358}
.agent-panel{z-index:3;bottom:76px;width:min(376px,calc(100vw - 32px));height:min(440px,calc(100dvh - 100px));display:flex;flex-direction:column;border:1px solid var(--line);background:#f8faf7;border-radius:16px;overflow:hidden;box-shadow:0 16px 55px #132b2445}.agent-panel[hidden]{display:none}
.agent-heading{display:flex;justify-content:space-between;align-items:flex-start;padding:14px 16px;border-bottom:1px solid var(--line)}.agent-heading h2{margin:0 0 3px;font-size:16px}#agent-target{font-size:13px;color:#557369}#agent-close{background:transparent;border:0;font-size:23px;line-height:1}
.agent-history{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:9px}.agent-empty{margin:0;color:#557369;font-size:14px;line-height:1.5}.agent-message{font-size:14px;line-height:1.5;padding:8px 11px;border-radius:11px;background:#ebf1eb;max-width:88%;align-self:flex-start;white-space:pre-wrap;overflow-wrap:anywhere}.agent-message.user{align-self:flex-end;background:#d8ebdd}
.agent-suggestions{display:flex;gap:5px;flex-wrap:wrap;padding:0 12px 10px}.agent-suggestions button{background:transparent;border:1px solid var(--line);border-radius:20px;font-size:12px;padding:5px 8px}.agent-suggestions button:hover{background:#54836920}
#agent-form{display:flex;gap:8px;border-top:1px solid var(--line);padding:10px 12px}#agent-input{flex:1;min-width:0;border:1px solid var(--line);border-radius:8px;background:transparent;color:inherit;font:inherit;padding:8px}#agent-send{border:0;border-radius:8px;padding:0 12px;color:#f4fff7;background:#215c46}
[data-theme=dark] .agent-panel{background:#18251f}[data-theme=dark] .agent-message{background:#283c32}[data-theme=dark] .agent-message.user{background:#345440}[data-theme=dark] :is(#agent-target,.agent-empty,.canvas-credit){color:#abc8b8}
@media(max-width:650px){.canvas-credit{left:8px;bottom:133px;font-size:10px}.agent-launch{right:8px;bottom:12px;padding:7px 9px}.agent-launch span{display:none}.agent-panel{right:8px;bottom:132px;width:min(376px,calc(100vw - 16px));height:min(440px,calc(100dvh - 154px))}}
#drawer-toggle{display:none}#drawer-actions{display:contents}
@media(max-width:650px){
  #device-drawer{z-index:2;display:flex;flex-direction:column;align-items:stretch;gap:0;height:auto;max-height:min(68dvh,calc(100dvh - 134px));padding:0;box-shadow:0 6px 24px #14292022;overflow:hidden}
  #drawer-toggle{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:52px;padding:8px 13px;background:transparent;border:0;text-align:left}
  #drawer-toggle>span{display:grid;gap:2px;min-width:0}#drawer-toggle strong{font-size:14px}#drawer-count{margin-left:4px;font-size:12px;color:var(--accent)}#drawer-selected{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:#557369}#drawer-toggle svg{width:20px;height:20px;flex:none}.drawer-open #drawer-toggle svg{transform:rotate(180deg)}
  #device-drawer #devices,#device-drawer #drawer-actions{display:none}
  #device-drawer.drawer-open #devices{display:block;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:6px 9px;border-top:1px solid var(--line)}
  #device-drawer .row{width:100%;margin:0 0 3px;padding:7px 8px}#device-drawer .row strong{font-size:13px}#device-drawer .row small{display:block}
  #device-drawer.drawer-open #drawer-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;flex:none;padding:8px 10px;border-top:1px solid var(--line)}
  #device-drawer #drawer-actions .add{font-size:12px;padding:7px 9px}
  #device-drawer #drawer-actions .side-bottom{margin-left:auto;margin-top:0}
  #device-drawer #workspace-status{position:static;margin:0;padding:4px 12px}
  [data-theme=dark] #drawer-selected{color:#a1baac}
}
@media(max-width:650px){#device-drawer #devices .row>span:nth-child(2){min-width:0;overflow-wrap:anywhere}}

:root{--scroll-thumb:#88a799}
[data-theme=dark]{--scroll-thumb:#5c8471}
:is(#devices,.agent-history,dialog, #backend pre){scrollbar-width:thin;scrollbar-color:transparent transparent}
@media(hover:hover){
  :is(#devices,.agent-history,dialog,#backend pre):hover{scrollbar-color:var(--scroll-thumb) transparent}
}
:is(#devices,.agent-history,dialog,#backend pre):focus-visible{scrollbar-color:var(--scroll-thumb) transparent}

@media(max-width:650px){
  :root{--drawer-bottom:calc(8px + env(safe-area-inset-bottom,0px));--rail-bottom:calc(var(--drawer-bottom) + 64px)}
  #device-drawer{bottom:var(--drawer-bottom)}
  .toolbar{left:auto;right:8px;bottom:var(--rail-bottom);transform:none;flex-direction:column;gap:2px}
  .toolbar button{display:grid;place-items:center;width:34px;height:32px;padding:0}
  .toolbar span{width:auto;font-size:10px}
  .toolbar b{width:23px;height:1px;border:0;border-top:1px solid var(--line)}
  .agent-launch{right:8px;bottom:calc(var(--rail-bottom) + 137px);width:44px;height:40px;justify-content:center;padding:0}
  .agent-panel{bottom:var(--rail-bottom);height:min(440px,calc(100dvh - var(--rail-bottom) - 62px))}
  .canvas-credit{bottom:calc(var(--drawer-bottom) + 60px)}
  #device-drawer #drawer-actions .side-bottom{display:flex;align-items:center;gap:6px;padding-left:8px}
  #device-drawer #settings{width:32px;height:32px;justify-content:center;padding:0}
  #device-drawer #settings svg{width:16px;height:16px}
  #device-drawer #settings span{display:none}
}

.header-actions #settings{width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:8px;background:transparent}
.header-actions #settings:hover{background:#54836920}
.device-add-group{display:flex;gap:6px}
.device-add-group .add{flex:1;white-space:nowrap}
.agent-launch{background:#f8faf7;border-color:#b1c9bb;color:#214e3d}
.agent-launch:hover,.agent-launch[aria-expanded=true]{background:#e3eee6}
[data-theme=dark] .agent-launch{background:#233a30;border-color:#4e7966;color:#dff5e8}
[data-theme=dark] .agent-launch:hover,[data-theme=dark] .agent-launch[aria-expanded=true]{background:#345343}
@media(max-width:650px){.header-actions{gap:6px}#device-drawer #drawer-actions .side-bottom{border:0}}

.device-add-group{position:fixed;top:110px;left:calc(var(--sidebar) + 24px);display:inline-flex;border:1px solid var(--line);border-radius:9px;background:#f9fcf7;box-shadow:0 3px 13px #193c2a12}
[data-theme=dark] .device-add-group{background:#18251f}
.device-add-group button{width:42px;height:36px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--accent)}
.device-add-group button+button{border-left:1px solid var(--line);border-top-left-radius:0;border-bottom-left-radius:0}
.device-add-group button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}
.device-add-group button:hover:enabled{background:#54836922}
@media(max-width:650px){.device-add-group{top:72px;left:10px}}
