.te-dialog {
 position:fixed; inset:0; width:100%; height:100dvh; max-width:none; max-height:none;
 margin:0; padding:0; border:0; border-radius:0; color:var(--text);
 background:var(--surface-1); overflow:hidden; box-shadow:none;
}
.te-dialog[open] { display:grid; grid-template-rows:auto auto minmax(0,1fr); }
.te-dialog::backdrop { background:var(--surface-1); }
.te-header,.te-toolbar,.te-tabbar {
 position:relative; z-index:5; display:flex; align-items:center; justify-content:space-between;
 gap:12px; padding:12px 20px; border-bottom:1px solid var(--border);
 background:var(--surface-solid);
}
.te-tabbar { padding-block:5px; }
.te-tabs { display:flex; gap:6px; }
.te-tabbar .button { min-height:35px; padding:5px 12px; font-size:13px; }
.te-tabs .button { border-color:transparent; white-space:nowrap; }
.te-tabs [aria-selected=true] { color:var(--accent); border-color:var(--accent); background:var(--accent-soft); }
.te-tabbar .button svg { width:16px; height:16px; }
.te-map-panel { display:grid; grid-template-rows:auto auto minmax(0,1fr); min-height:0; }
.te-map-panel[hidden],.te-groups-panel[hidden] { display:none; }
.te-heading,.te-finish,.te-tools,.te-modes,.te-zoom,.te-edge-actions {
 display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
.te-heading h1 { margin:0; font-size:21px; letter-spacing:-.025em; }
.te-heading>span { padding-left:12px; margin-left:4px; border-left:1px solid var(--border); color:var(--text-secondary); font-size:13px; }
.te-finish .button { min-height:38px; }
.te-dialog .te-dirty { color:var(--text-secondary); font-size:12px; margin-right:6px; }
.te-toolbar { padding-block:8px; }
.te-toolbar .button { min-height:34px; padding:6px 11px; font-size:12px; }
.te-instruction {
 display:flex; align-items:center; gap:10px; min-height:42px; padding:7px 20px;
 color:var(--text); background:var(--accent-soft); border-bottom:1px solid var(--accent);
 font-size:13px; line-height:1.45;
}
.te-instruction strong { white-space:nowrap; }
.te-step-dot { flex:0 0 9px; width:9px; height:9px; background:var(--accent); border-radius:50%; }
.te-dialog[data-mode=connect] .te-step-dot,.te-dialog[data-mode=disconnect] .te-step-dot,.te-dialog[data-mode=wifi] .te-step-dot {
 animation:te-step-pulse 1.5s ease-out 3;
}
@keyframes te-step-pulse { from { box-shadow:0 0 0 0 var(--accent); } to { box-shadow:0 0 0 8px transparent; } }
@media(prefers-reduced-motion:reduce) { .te-step-dot { animation:none!important; } }
.te-modes { gap:3px; padding:3px; border:1px solid var(--border); border-radius:10px; }
.te-modes .button { border-color:transparent; }
.te-modes .button[aria-pressed=true] {
 color:var(--accent); background:var(--accent-soft); border-color:var(--accent);
}
.te-zoom { flex-wrap:nowrap; gap:5px; }
.te-scale { min-width:37px; text-align:center; color:var(--text-secondary); font-size:12px; }
.te-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,310px); min-height:0; }
.te-view {
 position:relative; overflow:clip; min-width:0; min-height:0; overscroll-behavior:contain;
 background-color:var(--surface-1);
 background-image:radial-gradient(color-mix(in srgb,var(--text-secondary) 37%,transparent) .7px, transparent .7px);
 background-size:20px 20px; touch-action:none; cursor:grab;
}
.te-stage { position:absolute; inset:0 auto auto 0; width:1px; height:1px; transform-origin:0 0; }
.te-lines,.te-port-labels,.te-nodes { position:absolute; inset:0; pointer-events:none; }
.te-lines { width:100%; height:100%; overflow:visible; }
.te-lines path { fill:none; }
.te-connection { stroke:var(--success); stroke-width:2.5; }
.te-connection.legacy { stroke:var(--text-secondary); stroke-dasharray:6 4; }
.te-connection.draft,.te-connection.selected { stroke:var(--accent); stroke-width:3; }
.te-group-path { stroke:var(--accent); stroke-width:2; }
.te-connection.wireless,.te-group-path.wireless { stroke:var(--cyan); stroke-dasharray:6 5; }
.te-provider-path { stroke:var(--cyan); stroke-width:2; }
.te-provider-path.draft,.te-provider-path.selected { stroke:var(--accent); stroke-width:3; }
.te-hit { stroke:transparent; stroke-width:15; pointer-events:stroke; cursor:pointer; }
.te-edge-label {
 position:absolute; transform:translate(-50%,-50%); min-height:26px; z-index:2; display:flex; gap:5px;
 align-items:center; padding:3px 8px; border:1px solid var(--success); border-radius:20px;
 color:var(--text); background:var(--surface-solid); font:inherit; font-size:11px; white-space:nowrap;
 pointer-events:auto; cursor:pointer;
}
.te-edge-label.legacy { border-color:var(--text-secondary); border-style:dashed; }
.te-edge-label.wireless { border-color:var(--cyan); border-style:dashed; }
.te-edge-label.provider { border-color:var(--cyan); }
.te-edge-label.draft,.te-edge-label.selected { border-color:var(--accent); }
.te-dialog[data-mode=disconnect] .te-edge-label { border-color:var(--warning); }
.te-dialog[data-mode=disconnect] .te-edge-label:hover { box-shadow:0 0 0 3px color-mix(in srgb,var(--warning) 30%,transparent); }
.te-edge-label.selected { box-shadow:0 0 0 3px var(--accent-soft); }
.te-edge-label small { max-width:84px; color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; }
.te-node {
 position:absolute; display:flex; align-items:center; text-align:left; gap:12px; z-index:3;
 width:240px; height:82px; padding:12px 14px; border-radius:12px; border:1px solid var(--border);
 background:var(--surface-solid); color:var(--text); font:inherit;
 pointer-events:auto; user-select:none; touch-action:none; cursor:grab;
}
.te-node>svg,.te-node>.tp-mini-switch { flex-shrink:0; width:32px; height:32px; color:var(--accent); }
.te-node>.tp-mini-switch { width:42px; height:auto; }
.te-node>span:not(.tp-mini-switch) { display:grid; gap:4px; min-width:0; }
.te-node strong,.te-node small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.te-node strong { font-size:15px; font-weight:650; }
.te-node small { font-size:11px; color:var(--text-secondary); }
.te-node.te-provider { border-style:dashed; cursor:default; pointer-events:none; }
.te-node.te-provider.ready { pointer-events:auto; }
.te-dialog[data-mode=connect] button.te-node,.te-dialog[data-mode=wifi] button.te-node { cursor:crosshair; }
.te-node.te-client-group { cursor:pointer; border-style:dashed; border-color:var(--accent); }
.te-dialog[data-mode=move] .te-node.te-client-group { cursor:grab; }
.te-node.ready { border-color:color-mix(in srgb,var(--accent) 65%,var(--border)); }
.te-node.ready:hover,.te-node.chosen { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.te-node.dim { opacity:.58; }
.te-end-dot { width:9px; height:9px; border-radius:100%; background:var(--accent); margin-left:auto; }
.te-guide { position:absolute; z-index:4; pointer-events:none; border-color:var(--accent); border-style:dashed; }
.te-guide-x { top:-20000px; height:40000px; border-width:0 0 0 1px; }
.te-guide-y { left:-20000px; width:40000px; border-width:1px 0 0; }
.te-side { display:grid; grid-template-rows:auto minmax(0,1fr); min-height:0; border-left:1px solid var(--border); background:var(--surface-solid); }
.te-visibility { display:flex; flex-wrap:wrap; align-items:center; gap:9px 13px; padding:9px 15px; border-bottom:1px solid var(--border); font-size:12px; color:var(--text-secondary); }
.te-visibility label { display:flex; align-items:center; gap:4px; cursor:pointer; }
.te-inspector {
 position:relative; overflow:auto; padding:18px; min-height:0;
 background:var(--surface-solid);
}
.te-inspector h2 { margin:0 0 12px; font-size:17px; }
.te-inspector p,.te-inspector label { margin:0 0 12px; color:var(--text-secondary); font-size:13px; line-height:1.5; }
.te-inspector .te-first { color:var(--accent); }
.te-inspector .button { font-size:12px; min-height:34px; }
.te-device-name { display:block; margin:0 0 8px; font-size:15px; }
.te-ports { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin:0 0 12px; }
.te-port {
 display:flex; align-items:center; gap:6px; min-width:0; min-height:44px; padding:5px;
 border:1px solid var(--border); border-radius:7px; background:var(--surface-1);
 color:var(--text); font:inherit; font-size:11px; text-align:left; cursor:pointer;
}
.te-port:hover:not(:disabled),.te-port:focus-visible { border-color:var(--accent); }
.te-port.replaceable:not(:disabled) { border-color:color-mix(in srgb,var(--warning) 65%,var(--border)); }
.te-port.replaceable:not(:disabled) small { color:var(--warning); }
.te-port:disabled { color:var(--text-secondary); opacity:.65; cursor:default; }
.te-port b { min-width:23px; text-align:center; }
.te-port span,.te-port small { display:block; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.te-port small { margin-top:2px; color:var(--text-secondary); font-size:10px; }
.te-ends { padding-left:21px; margin:0 0 12px; font-size:13px; overflow-wrap:anywhere; }
.te-ends li { padding:5px 0; }
.te-name { display:block; margin:5px 0 8px; width:100%; min-height:38px; padding:7px 10px; border:1px solid var(--border); border-radius:9px; color:var(--text); background:var(--surface-1); font:inherit; }
.te-name:focus-visible { outline:2px solid var(--accent-soft); border-color:var(--accent); }
.te-edge-actions { margin-top:12px; }
.te-client-list { list-style:none; padding:0; margin:8px 0; }
.te-client-list li { display:grid; gap:3px; padding:6px 0; border-bottom:1px solid var(--border); }
.te-client-list li[hidden] { display:none; }
.te-client-list .button { justify-self:start; text-align:left; }
.te-client-list small { color:var(--text-secondary); }
.te-member-links { display:flex; flex-wrap:wrap; gap:5px; }
.te-member-links:empty { display:none; }
.te-inspector input[data-te-search] { width:100%; }
.te-inspector .te-danger { color:var(--danger); border-color:color-mix(in srgb,var(--danger) 30%,var(--border)); }
.te-alert {
 position:absolute; z-index:9; bottom:14px; left:18px; max-width:min(490px,calc(100vw - 36px));
 margin:0; padding:12px; border:1px solid var(--danger); border-radius:8px; background:var(--surface-solid);
}
.tp-map-tools>[data-action=tp-edit-map] { margin-left:auto; }
.te-node.te-custom-group { border-style:solid; background:color-mix(in srgb,var(--surface-solid) 94%,var(--accent)); }
.te-groups-panel { min-height:0; overflow:auto; overscroll-behavior:contain; }
.te-groups-workspace { max-width:1240px; margin:auto; padding:28px clamp(12px,3vw,36px) 38px; }
.te-groups-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px 24px; margin:0 0 20px; }
.te-groups-heading h2 { margin:0 0 6px; font-size:23px; }
.te-groups-heading p,.te-group-column p { margin:0; color:var(--text-secondary); font-size:13px; line-height:1.55; }
.te-groups-heading .button { white-space:nowrap; min-height:38px; }
.te-groups-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.12fr); gap:16px; align-items:start; }
.te-group-column { min-width:0; border:1px solid var(--border); border-radius:14px; background:var(--surface-solid); }
.te-group-column>header,.te-group-column>footer,.te-group-form,.te-group-close,.te-group-delete { padding:15px 16px; }
.te-group-column h3 { margin:0; font-size:16px; }
.te-roster>header { display:grid; gap:10px; }
.te-roster .tp-client-search-field { width:100%; margin:0; }
.te-group-list { margin:0; padding:0 16px; list-style:none; max-height:min(48vh,490px); overflow:auto; overscroll-behavior:contain; }
.te-group-device { display:flex; align-items:center; gap:10px; min-width:0; padding:9px 0; border-top:1px solid var(--border); }
.te-group-device[hidden] { display:none; }
.te-group-device[draggable=true] { cursor:grab; }
.te-group-device[draggable=true]:active { cursor:grabbing; }
.te-group-device>svg,.te-group-device>.tp-mini-switch { flex:0 0 23px; width:23px; color:var(--accent); pointer-events:none; }
.te-group-device>span:not(.tp-mini-switch) { flex:1; min-width:0; }
.te-group-device strong,.te-group-device small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.te-group-device strong { font-size:13px; }
.te-group-device small { margin-top:2px; font-size:11px; color:var(--text-secondary); }
.te-group-device small:empty { display:none; }
.te-group-device .te-group-origin { color:var(--accent); }
.te-group-device .button,.te-group-column footer .button,.te-group-detail-head .button { min-height:32px; padding:4px 9px; font-size:12px; }
.te-group-device .button svg,.te-group-column .button svg { width:16px; height:16px; }
.te-group-empty-result { padding:0 16px 15px; }
.te-group-options { display:flex; gap:6px; padding:12px 16px; overflow:auto; }
.te-group-options:empty { display:none; }
.te-group-options .button { flex-shrink:0; max-width:min(240px,85%); min-height:33px; gap:6px; padding:4px 9px; font-size:12px; }
.te-group-options .button span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.te-group-options .button small { opacity:.8; }
.te-group-options .button[aria-pressed=true] { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.te-group-detail { margin:0 12px; padding:10px 4px 4px; border:1px solid var(--border); border-radius:11px; }
.te-group-detail-head { display:flex; align-items:center; gap:11px; min-width:0; padding:0 10px 10px; }
.te-group-detail-head>div:nth-child(2) { flex:1; min-width:0; overflow-wrap:anywhere; }
.te-group-mark { display:grid; flex:0 0 40px; place-items:center; height:40px; border-radius:10px; color:var(--accent); background:var(--accent-soft); }
.te-group-mark svg { width:23px; height:23px; }
.te-group-drop-hint { margin:0 10px 7px; padding:12px; border:1px dashed var(--border); border-radius:8px; color:var(--text-secondary); font-size:12px; }
.te-group-detail.te-drop-active,.te-group-options .te-drop-active { border-color:var(--accent); background:var(--accent-soft); box-shadow:inset 0 0 0 1px var(--accent); }
.te-group-detail.te-drop-active .te-group-drop-hint { border-color:var(--accent); color:var(--text); }
.te-group-column footer { display:flex; justify-content:flex-end; }
.te-group-column .te-danger { color:var(--danger); }
.te-group-delete { display:flex; flex-wrap:wrap; gap:7px; }
.te-group-delete p { flex-basis:100%; }
.te-group-empty { display:grid; justify-items:center; gap:9px; padding:35px 16px; text-align:center; }
.te-group-empty svg { width:33px; height:33px; color:var(--accent); }
.te-group-form { display:grid; gap:12px; }
.te-group-form>label { display:grid; gap:5px; font-size:13px; }
.te-group-form input[name=name] { width:100%; padding:8px 10px; min-height:38px; color:var(--text); background:var(--surface-1); border:1px solid var(--border); border-radius:8px; font:inherit; }
.te-group-form fieldset { min-width:0; padding:0; margin:0; border:0; }
.te-group-form legend { padding:0 0 6px; font-size:13px; }
.te-group-icon-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(78px,1fr)); gap:6px; }
.te-group-icon-option { position:relative; cursor:pointer; }
.te-group-icon-option input { position:absolute; width:1px; height:1px; opacity:0; }
.te-group-icon-option span { display:grid; justify-items:center; gap:4px; padding:8px 2px; border:1px solid var(--border); border-radius:8px; }
.te-group-icon-option svg { width:22px; height:22px; }
.te-group-icon-option small { font-size:11px; }
.te-group-icon-option input:checked+span { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.te-group-icon-option input:focus-visible+span { outline:2px solid var(--accent); outline-offset:1px; }
.te-group-form .te-edge-actions { margin:0; }
@media(max-width:900px) {
 .te-toolbar { align-items:flex-start; flex-wrap:wrap; }
 .te-body { grid-template-columns:minmax(0,1fr) minmax(216px,246px); }
 .te-inspector { padding:12px; }
}
@media(max-width:640px) {
 .te-header,.te-toolbar,.te-tabbar { padding-inline:9px; }
 .te-instruction { padding-inline:10px; align-items:flex-start; font-size:12px; }
 .te-instruction strong { white-space:normal; min-width:72px; }
 .te-step-dot { margin-top:4px; }
 .te-heading { gap:4px; }
 .te-heading h1 { font-size:16px; }
 .te-heading>span { padding-left:6px; font-size:11px; }
 .te-finish { flex:0 0 auto; flex-wrap:nowrap; }
 .te-header .button { padding-inline:8px; font-size:12px; }
 .te-dialog .te-dirty { display:none; }
 .te-body { grid-template-columns:1fr; grid-template-rows:minmax(155px,1.6fr) minmax(0,1fr); }
 .te-side { border-left:0; border-top:1px solid var(--border); }
 .te-ports { grid-template-columns:repeat(auto-fit,minmax(105px,1fr)); }
 .te-tabs { gap:2px; }
 .te-tabbar { gap:4px; }
 .te-tabbar .button { padding-inline:6px; font-size:11px; }
 .te-groups-workspace { padding-top:15px; }
 .te-groups-heading { flex-wrap:wrap; }
 .te-groups-heading h2 { font-size:19px; }
 .te-groups-columns { grid-template-columns:1fr; gap:12px; }
 .te-group-main { grid-row:1; }
 .te-group-list { max-height:32vh; }
}
