/* Workspace V2: one token layer, loaded after the compatible V1 styles. */
:root{--em-bg:#0b1220;--em-surface:#151f30;--em-panel:#1b293d;--em-accent:#12b8a6;--em-text:#e7edf7;--em-border:#29384d;--em-muted:#9eafc7;--em-running:#30b77b;--em-stopped:#8996a8;--em-warning:#dba436;--em-error:#ec6570;--em-selected:#5798ed;--em-radius:8px;--em-header:44px;--em-sidebar:40px;--em-inspector-width:300px}
:root[data-em-theme=light]{--em-bg:#f5f7fb;--em-surface:#fff;--em-panel:#edf2f8;--em-accent:#087f72;--em-text:#172b4d;--em-border:#dce4ef;--em-muted:#5a6d86}
.em-v2 button,.em-v2 input,.em-v2 select{font-family:inherit}.em-v2 :focus-visible{outline:2px solid var(--em-selected);outline-offset:2px}
.em-v2 #em-toolbar{top:0;left:0;right:0;height:var(--em-header);padding:5px 10px;border-radius:0;box-shadow:0 1px 4px #0000000a;gap:6px;overflow:visible}.em-v2 #em-toolbar .em-brand{font-size:0;gap:0}.em-v2 #em-toolbar .em-mark{font-size:12px;width:36px;height:26px;line-height:26px;padding:0;border-radius:6px}.em-v2 #em-toolbar .em-labname{font-size:12px;max-width:24vw}.em-v2 #em-toolbar button,.em-v2 #em-toolbar a{height:28px;min-height:28px;padding:3px 9px;font-size:11px;line-height:20px;border-radius:6px}.em-v2 #em-toolbar #em-count{font-size:11px;white-space:nowrap}.em-v2 #em-toolbar .em-spacer{min-width:4px}.em-v2 #em-toolbar details{position:relative}.em-v2 summary{cursor:pointer;list-style:none;user-select:none}.em-v2 #em-toolbar summary{height:28px;line-height:26px;padding:0 10px;border:1px solid var(--em-border);border-radius:6px;font-size:12px}.em-v2 details> .em-v2-menu{position:absolute;top:34px;right:0;min-width:190px;background:var(--em-surface);border:1px solid var(--em-border);box-shadow:var(--em-shadow);border-radius:8px;padding:6px;display:flex;flex-direction:column;gap:4px;z-index:1100}.em-v2 .em-v2-menu a,.em-v2 .em-v2-menu button{text-align:left;width:100%}
.em-v2 #em-toolbar .em-close-lab{color:var(--em-error);font-size:18px;line-height:18px;padding:2px 8px;border-color:color-mix(in srgb,var(--em-error) 32%,var(--em-border));}
.em-v2 #lab-sidebar{top:var(--em-header);height:calc(100vh - var(--em-header));width:var(--em-sidebar);overflow:visible;transition:width .12s ease;z-index:1039}.em-v2.em-sidebar-expanded{--em-sidebar:176px}.em-v2.em-sidebar-expanded #lab-sidebar a{width:176px!important;text-align:left!important;white-space:nowrap;overflow:hidden;font-size:11px!important;padding-left:12px!important;display:flex;align-items:center;gap:12px}.em-v2 #lab-sidebar a i{flex:none}.em-v2 #lab-sidebar a:focus-visible{outline-offset:-3px}.em-v2 #lab-sidebar ul{width:100%}.em-v2 .em-inspector{top:calc(var(--em-header) + 8px);bottom:8px;right:8px;width:var(--em-inspector-width);border-radius:var(--em-radius);padding:16px;overflow:auto}.em-v2.em-console-open .em-inspector{right:calc(var(--em-console-width) + 16px)}
.em-v2-resizer{position:absolute;top:32px;bottom:0;left:-5px;width:9px;cursor:col-resize;z-index:4;touch-action:none;border:0;background:transparent}.em-v2-resizer:hover,.em-v2-resizer:focus-visible{background:var(--em-accent);opacity:.4}.em-v2.em-panel-resizing iframe{pointer-events:none}.em-v2.em-panel-resizing{user-select:none;cursor:col-resize}
.em-v2 .em-presets-dialog{width:min(980px,94vw);padding:20px;max-height:88vh}.em-v2 .em-presets-dialog h2{font-size:18px;margin:0 0 12px}.em-v2 .em-presets-dialog p{padding:0;margin:5px 0;font-size:11px;line-height:1.5}.em-v2 .em-presets-dialog .em-preset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}.em-v2 .em-preset-card{padding:12px;min-width:0;position:relative;box-shadow:none;border-radius:8px}.em-v2 .em-preset-card h3{background:transparent!important;padding:0 22px 0 0!important;color:var(--em-text)!important;font-size:13px!important;line-height:20px;margin:3px 0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.em-v2 .em-preset-card .em-kicker{font-size:9px;letter-spacing:.06em}.em-v2 .em-preset-availability{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--em-muted);max-width:100%;height:18px}.em-v2 .em-preset-card button{font-size:10px;min-height:25px;height:25px;padding:2px 8px;margin:6px 4px 0 0}.em-v2 .em-preset-unavailable{opacity:.65}.em-v2 .em-v2-pin{position:absolute;right:7px;top:7px;margin:0!important;border:0!important;background:transparent!important;font-size:15px!important;color:var(--em-accent)}.em-v2 .em-preset-grid[data-view=list]{grid-template-columns:1fr}.em-v2 .em-preset-grid[data-view=list] .em-preset-card{display:grid;grid-template-columns:110px minmax(160px,1fr) minmax(130px,1fr) auto auto auto;align-items:center;gap:8px;padding-right:35px}.em-v2 .em-preset-grid[data-view=list] .em-preset-card h3,.em-v2 .em-preset-grid[data-view=list] .em-preset-card p,.em-v2 .em-preset-grid[data-view=list] .em-preset-card button{margin:0}.em-v2-filters{display:flex;gap:8px;margin:12px 0;align-items:center;flex-wrap:wrap}.em-v2-filters input{flex:1;min-width:160px}.em-v2-filters input,.em-v2-filters select,.em-v2-filters button{font-size:11px;height:30px;min-height:30px;padding:4px 8px}.em-v2 .em-preset-from-node{margin-top:16px;border-top:1px solid var(--em-border);padding-top:12px}.em-v2 .em-preset-from-node label{display:inline-flex;align-items:center;gap:10px;font-size:11px}.em-v2 .em-preset-from-node select{font-size:11px;max-width:260px}.em-v2 .em-preset-from-node button{font-size:11px;min-height:30px}
.em-v2 .em-editor-preview{margin:12px 0;padding:16px;border:1px dashed var(--em-border);border-radius:8px;min-height:80px;display:flex;align-items:center;justify-content:center;background:var(--em-bg)}.em-v2 .em-editor-preview span{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;padding:10px}.em-v2 .em-validation-list{padding-left:20px}.em-v2 .em-validation-list li{margin:10px 0;font-size:12px}.em-v2 .em-lab-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}.em-v2 .em-lab-summary div{border:1px solid var(--em-border);border-radius:6px;padding:8px;font-size:11px}.em-v2 .em-lab-summary strong{display:block;font-size:20px}
@media(max-width:1250px){.em-v2 #em-count{display:none}.em-v2 #em-toolbar .em-labname{max-width:20vw}.em-v2 #em-toolbar .em-brand{display:none}.em-v2.em-console-open .em-inspector{width:260px}.em-v2 .em-preset-grid[data-view=list] .em-preset-card{display:block}}
@media(prefers-reduced-motion:reduce){.em-v2 #lab-sidebar{transition:none}}

.em-v2 .em-preset-card[hidden]{display:none!important}.em-v2 .em-presets-dialog>h2{background:transparent!important;color:var(--em-text)!important;padding:0!important}.em-v2 #lab-sidebar:not(:hover) a{overflow:hidden}.em-v2:not(.em-sidebar-expanded) #lab-sidebar a{width:40px!important;white-space:nowrap;overflow:hidden!important;font-size:0!important}.em-v2:not(.em-sidebar-expanded) #lab-sidebar a i{font-size:16px!important}.em-v2 #em-console-language{font-size:9px!important;font-weight:700;width:28px}

.em-v2 .em-presets-dialog{max-width:980px}.em-v2 .em-presets-dialog .em-preset-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}.em-v2 .em-preset-grid[data-view=list]{grid-template-columns:1fr}
.em-v2 #main-modal-edit{position:fixed;top:56px;right:10px;left:auto;bottom:auto;max-height:calc(100vh - 70px);overflow:auto;width:420px!important;background:var(--em-surface);border:1px solid var(--em-border);border-radius:8px;box-shadow:var(--em-shadow);z-index:1050;padding:16px}.em-v2 #main-modal-edit>.top-part{width:100%;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}.em-v2 #main-modal-edit>.top-part>label,.em-v2 #main-modal-edit .em-editor-preview{grid-column:1/-1}.em-v2 #main-modal-edit>.top-part>br{display:none}.em-v2 #main-modal-edit .form-group{margin:0;display:flex;flex-direction:column;gap:4px}.em-v2 #main-modal-edit label{font-size:11px;color:var(--em-text)}.em-v2 #main-modal-edit input,.em-v2 #main-modal-edit select{height:30px;font-size:12px;color:var(--em-text);background:var(--em-bg);border-color:var(--em-border)}.em-v2 #main-modal-edit .btn-part{display:flex;gap:8px;position:static;width:100%;padding:12px 0 0;margin:0}.em-v2 #main-modal-edit button{font-size:11px;min-height:28px;padding:3px 10px}


.em-v2 .em-text-extra{display:flex;flex-direction:column;gap:5px}.em-v2 .em-text-extra textarea{width:100%;background:var(--em-bg);color:var(--em-text);border:1px solid var(--em-border);border-radius:5px;padding:8px;font-size:12px}
/* Balanced Favorites / Recent cards: one stable column system for all views. */
.em-v2 .em-presets-dialog .em-preset-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.em-v2 .em-presets-dialog .em-preset-card{display:flex;flex-direction:column;gap:10px;min-height:158px;padding:14px;border-radius:8px;overflow:hidden}
.em-v2 .em-preset-head{display:flex;align-items:center;gap:10px;min-height:34px;min-width:0;padding-right:18px}.em-v2 .em-preset-device-icon{display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex:none;background:var(--em-panel);border:1px solid var(--em-border);border-radius:7px;font-size:9px;font-weight:700;color:var(--em-accent)}.em-v2 .em-preset-device-icon img{width:26px;height:26px;object-fit:contain}.em-v2 .em-preset-title{min-width:0;flex:1}.em-v2 .em-presets-dialog .em-preset-title h3{font-size:13px!important;font-weight:650;line-height:18px!important;text-transform:none;letter-spacing:0;margin:0!important;padding:0!important}.em-v2 .em-preset-title .em-kicker{font-size:9px;line-height:14px;letter-spacing:.01em;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--em-muted)}.em-v2 .em-preset-details{min-width:0}.em-v2 .em-presets-dialog .em-preset-details p{margin:0!important;padding:0!important;font-size:10.5px;line-height:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:17px}.em-v2 .em-preset-details .em-preset-availability{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--em-text)}.em-v2 .em-preset-specs{color:var(--em-muted)}.em-v2 .em-preset-actions{display:flex;gap:6px;align-items:center;margin-top:auto}.em-v2 .em-preset-actions button{margin:0!important;font-size:10.5px;line-height:18px;height:28px;min-height:28px;padding:4px 10px;border-radius:5px;white-space:nowrap}.em-v2 .em-preset-actions .em-preset-add{background:var(--em-accent);border-color:var(--em-accent);color:white}.em-v2 .em-v2-pin{right:9px;top:10px;width:21px;height:21px!important;min-height:21px!important;padding:0!important}.em-v2 .em-presets-empty{padding:10px 0!important}
.em-v2 .em-presets-dialog .em-preset-grid[data-view=list]{grid-template-columns:1fr}.em-v2 .em-presets-dialog .em-preset-grid[data-view=list] .em-preset-card{display:grid;grid-template-columns:minmax(180px,1.05fr) minmax(180px,1.4fr) auto;gap:18px;align-items:center;min-height:72px;padding:12px 36px 12px 14px}.em-v2 .em-preset-grid[data-view=list] .em-preset-head{padding-right:0}.em-v2 .em-preset-grid[data-view=list] .em-preset-actions{margin-top:0}.em-v2 .em-preset-grid[data-view=list] .em-v2-pin{top:24px}
@media(max-width:850px){.em-v2 .em-presets-dialog .em-preset-grid[data-view=list] .em-preset-card{grid-template-columns:1fr 1fr}.em-v2 .em-preset-grid[data-view=list] .em-preset-actions{grid-column:1/-1}}
/* Card actions share the right edge; titles have equal vertical breathing room. */
.em-v2 .em-preset-actions{justify-content:flex-end;width:100%}.em-v2 .em-preset-title{display:flex;flex-direction:column;justify-content:center;min-height:36px}.em-v2 .em-preset-head{min-height:36px}.em-v2 .em-presets-dialog .em-preset-title h3{padding-top:0!important;padding-bottom:0!important}.em-v2 .em-preset-grid[data-view=list] .em-preset-actions{justify-self:end;width:auto;align-self:center}.em-v2 .em-presets-dialog .em-preset-grid[data-view=list] .em-preset-card{padding-top:14px;padding-bottom:14px;min-height:76px}
.em-v2 .em-preset-icon-picker{display:flex;align-items:center;gap:10px;min-width:0;margin-top:5px}.em-v2 .em-preset-icon-preview{width:38px;height:38px;object-fit:contain;flex:none;border:1px solid var(--em-border);border-radius:6px;background:var(--em-panel);padding:5px}.em-v2 .em-preset-icon-picker>.bootstrap-select{width:calc(100% - 48px)!important;min-width:0}.em-v2 .em-preset-icon-picker .dropdown-toggle{width:100%;height:34px;min-height:34px;padding:5px 25px 5px 8px;font-size:11px;background:var(--em-bg);border-color:var(--em-border);color:var(--em-text)}.em-v2 .em-preset-icon-picker .filter-option{display:flex;align-items:center;gap:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.em-v2 .em-preset-icon-picker .filter-option img,.em-v2 .em-preset-icon-picker .dropdown-menu img{object-fit:contain;vertical-align:middle;flex:none}.em-v2 .em-preset-icon-picker .dropdown-menu{min-width:100%;max-width:100%;background:var(--em-surface);color:var(--em-text);border-color:var(--em-border)}.em-v2 .em-preset-icon-picker .dropdown-menu>li>a{display:flex;align-items:center;gap:8px;font-size:11px;color:var(--em-text);padding:5px 10px}.em-v2 .em-preset-icon-picker .dropdown-menu>li>a span.text{display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.em-v2 .em-preset-icon-picker .bs-searchbox input{font-size:11px;height:28px;background:var(--em-bg);color:var(--em-text);border-color:var(--em-border)}
/* Sidebar: restore native hover-to-expand, with a consistent compact rail. */
.em-v2.em-workspace #lab-sidebar{left:0;top:44px;width:40px!important;height:calc(100vh - 44px);padding-top:0!important;box-sizing:border-box;background:var(--em-surface)!important;border-right:1px solid var(--em-border);overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;transition:width .12s ease,box-shadow .12s ease}
.em-v2.em-workspace #lab-sidebar:hover,.em-v2.em-workspace #lab-sidebar:focus-within,.em-v2.em-workspace.em-sidebar-expanded #lab-sidebar{width:176px!important;box-shadow:8px 0 20px #00000010}
.em-v2.em-workspace #lab-sidebar ul{position:static;width:100%;padding:7px 0;margin:0;list-style:none;box-sizing:border-box}
.em-v2.em-workspace #lab-sidebar ul::before{content:'WORKSPACE';display:flex;align-items:center;opacity:0;width:calc(100% - 16px);height:30px;margin:0 8px 6px;padding:0 10px;box-sizing:border-box;border-left:3px solid var(--em-accent);border-radius:5px;background:color-mix(in srgb,var(--em-accent) 10%,var(--em-surface));font-size:11px;font-weight:750;letter-spacing:.1em;color:var(--em-accent)}
.em-v2.em-workspace #lab-sidebar:hover ul::before,.em-v2.em-workspace #lab-sidebar:focus-within ul::before,.em-v2.em-workspace.em-sidebar-expanded #lab-sidebar ul::before{display:flex;opacity:1}
.em-v2.em-workspace #lab-sidebar ul li{display:block;width:100%;padding:0;margin:0;list-style:none;box-sizing:border-box}
.em-v2.em-workspace #lab-sidebar ul li>a{position:relative;display:flex!important;align-items:center;gap:10px;box-sizing:border-box;width:calc(100% - 8px)!important;height:32px;min-height:32px;margin:2px 4px;padding:0 8px!important;border:0;border-radius:5px;color:var(--em-muted)!important;text-decoration:none;white-space:nowrap;overflow:hidden!important;font-size:12px!important;line-height:18px;text-align:left!important;transition:background-color .12s ease,color .12s ease}
.em-v2.em-workspace #lab-sidebar ul li>a>i{display:inline-flex;align-items:center;justify-content:center;flex:0 0 16px;width:16px;height:16px;margin:0;font-size:15px!important;line-height:16px;color:inherit!important}
.em-v2.em-workspace #lab-sidebar .em-sidebar-label{display:none;overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:500;line-height:18px}
.em-v2.em-workspace #lab-sidebar:hover .em-sidebar-label,.em-v2.em-workspace #lab-sidebar:focus-within .em-sidebar-label,.em-v2.em-workspace.em-sidebar-expanded #lab-sidebar .em-sidebar-label{display:block}
.em-v2.em-workspace #lab-sidebar ul li>a:hover,.em-v2.em-workspace #lab-sidebar ul li>a:focus-visible,.em-v2.em-workspace #lab-sidebar ul li>a.em-sidebar-active{background:var(--em-panel)!important;color:var(--em-accent)!important}
/* Keep native sidebar hover transparent in both themes; the active rail remains the selection cue. */
.em-v2.em-workspace #lab-sidebar li:hover,
.em-v2.em-workspace #lab-sidebar li:hover>a,
.em-v2.em-workspace #lab-sidebar a:hover,
.em-v2.em-workspace #lab-sidebar a:focus-visible{background:transparent!important;background-color:transparent!important;background-image:none!important;box-shadow:none!important;color:var(--em-accent)!important}
.em-v2.em-workspace #lab-sidebar li:hover>a::before,
.em-v2.em-workspace #lab-sidebar li:hover>a::after{background:transparent!important;box-shadow:none!important}
.em-v2.em-workspace #lab-sidebar a.em-sidebar-active::after{content:'';position:absolute;left:0;top:9px;width:2px;height:14px;border-radius:2px;background:var(--em-accent)}
.em-v2.em-workspace #lab-sidebar ul li.em-sidebar-section{border-top:1px solid var(--em-border);margin-top:7px;padding-top:7px}
.em-v2.em-workspace #lab-sidebar .plus-minus-slider{display:none!important}
/* Language control matches adjacent console actions; sizing behavior is unchanged. */
#em-console-header .em-console-tools #em-console-language{display:inline-flex;align-items:center;justify-content:center;flex:0 0 25px;width:25px;min-width:25px;height:27px;min-height:27px;margin:0;padding:0!important;border:0;border-radius:4px;background:transparent;color:var(--em-muted);font-family:inherit;font-size:9px!important;font-weight:600;line-height:27px;letter-spacing:.02em;vertical-align:middle}
#em-console-header .em-console-tools #em-console-language:hover{background:var(--em-panel);color:var(--em-accent)}
@media(prefers-reduced-motion:reduce){.em-v2.em-workspace #lab-sidebar,.em-v2.em-workspace #lab-sidebar a{transition:none}}
.em-login .em-login-intro h1{font-size:clamp(22px,2vw,30px);line-height:1.2;letter-spacing:-.025em;white-space:nowrap}
/* Add Text: reuse native fields and submit handler in a compact composer. */
.em-add-text-modal{width:min(800px,calc(100vw - 48px))!important}.em-v2 .em-add-text-modal .modal-header{padding:16px 20px}.em-v2 .em-add-text-modal .modal-title{font-size:16px;letter-spacing:0;text-transform:none}.em-v2 .em-add-text-modal .modal-body{padding:16px 20px}.em-v2 .em-add-text-editor{width:100%;float:none;padding:0;margin:0}.em-text-presets{display:flex;align-items:center;gap:7px;padding:0 0 14px}.em-text-presets>span{font-size:9px;letter-spacing:.07em;font-weight:650;color:var(--em-muted);margin-right:4px}.em-v2 .em-text-presets button{height:28px;min-height:28px;padding:3px 10px;font-size:11px;border-radius:5px}.em-v2 .em-text-presets button[aria-pressed=true]{border-color:var(--em-accent);color:var(--em-accent);background:var(--em-panel)}
.em-text-composer{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:18px}.em-v2 .em-text-composer .form-group{float:none;width:100%;margin:0;padding:0}.em-v2 .em-text-composer .form-group>label{display:block;float:none;width:100%;padding:0;margin:0 0 7px;font-size:11px;font-weight:600;text-align:left;color:var(--em-text)}.em-v2 .em-text-composer .form-group>div{float:none;width:100%;padding:0}.em-v2 .em-text-composer .main-text{width:100%;height:220px;min-height:180px;max-height:360px;padding:10px 12px;resize:vertical;line-height:1.5;font-size:13px;border-radius:6px;background:var(--em-bg);color:var(--em-text);border-color:var(--em-border)}.em-text-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.em-v2 .em-text-style-grid input,.em-v2 .em-text-style-grid select{height:32px;font-size:12px;padding:4px 8px;border-radius:5px;background:var(--em-bg);color:var(--em-text);border-color:var(--em-border)}.em-v2 .em-text-style-grid input[type=color]{padding:4px;cursor:pointer}.em-text-input-footer{display:flex;justify-content:space-between;gap:8px;margin-top:8px;font-size:10px;color:var(--em-muted)}.em-text-input-footer output{padding:0;color:inherit;font-size:10px;white-space:nowrap}.em-text-preview-area{margin-top:16px}.em-text-preview-area>.em-kicker{font-size:9px;color:var(--em-muted);font-weight:600;letter-spacing:.06em}.em-v2 .em-text-preview-area .em-editor-preview{margin:7px 0 0;min-height:92px;padding:10px;overflow:auto;background:var(--em-bg)}.em-v2 .em-text-preview-area .em-editor-preview>span{padding:8px;border-radius:3px;max-width:100%;text-align:center}
.em-text-composer-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;padding-top:16px;margin-top:16px;border-top:1px solid var(--em-border)}.em-text-composer-actions>span{margin-right:auto;color:var(--em-muted);font-size:10px}.em-v2 .em-text-composer-actions button{float:none;margin:0;height:30px;min-height:30px;padding:4px 13px;border-radius:5px;font-size:11px}.em-v2 .em-text-composer-actions [type=submit]{background:var(--em-accent);border-color:var(--em-accent);color:white}.em-v2 .em-text-composer-actions [type=submit]:disabled{opacity:.45;cursor:default}
@media(max-width:700px){.em-text-composer{grid-template-columns:1fr}.em-text-input-footer{flex-wrap:wrap}.em-text-composer-actions>span{display:none}.em-v2 .em-text-composer .main-text{height:150px}.em-text-presets{flex-wrap:wrap}}

#em-console-header .em-console-tools{align-items:center}

/* Animate native links only while both connected nodes are running. */
.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-packet,.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-response{pointer-events:none;filter:drop-shadow(0 1px 2px #172b4d55)}
.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-packet rect{fill:var(--em-accent);stroke:var(--em-surface);stroke-width:.8}
.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-packet path{fill:none;stroke:var(--em-surface);stroke-width:1;stroke-linecap:round;stroke-linejoin:round}
.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-response{opacity:.9}
.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-response rect{fill:#facc15;stroke:#854d0e;stroke-width:1}
.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-response path{fill:none;stroke:#854d0e;stroke-width:1;stroke-linecap:round;stroke-linejoin:round}
@media(prefers-reduced-motion:reduce){.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-packet,.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active g.em-link-response{display:none}}

/* Compact, grouped top-bar overflow menu. */
.em-v2 #em-toolbar details>.em-v2-menu{width:min(348px,calc(100vw - 16px));min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px;padding:10px}
.em-v2 .em-v2-menu-group{display:grid;align-content:start;gap:5px;min-width:0}
.em-v2 .em-v2-menu-group h3{display:block!important;margin:0 0 2px;padding:2px 4px!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;color:var(--em-accent)!important;font-size:9px;font-weight:750;letter-spacing:.1em;line-height:14px}
.em-v2 #em-toolbar .em-v2-menu-group>a,.em-v2 #em-toolbar .em-v2-menu-group>button{display:flex;justify-content:flex-start;align-items:center;width:100%;min-width:0;height:30px;min-height:30px;padding:4px 8px;font-size:10px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.em-v2 .em-v2-menu-group:last-child{grid-column:1/-1}
.em-v2 .em-v2-menu-group:nth-child(3){grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr))}.em-v2 .em-v2-menu-group:nth-child(3)>h3{grid-column:1/-1}

/* Consistent surface hierarchy and restrained, compositor-only UI motion. */
:root{--em-motion-fast:140ms;--em-motion-enter:180ms;--em-motion-ease:cubic-bezier(.2,.75,.25,1)}
.em-app button,.em-toolbar button,.em-toolbar summary,.em-dialog button,.em-console-dock button{transition:background-color var(--em-motion-fast) ease,border-color var(--em-motion-fast) ease,color var(--em-motion-fast) ease,box-shadow var(--em-motion-fast) ease}
.em-app button:active:not(:disabled),.em-toolbar button:active,.em-console-tools button:active{filter:brightness(.96)}
.em-app .em-card{box-shadow:0 2px 8px #142b4510;border-radius:12px}
.em-app .em-card:focus-within{border-color:var(--em-accent)}
.em-dialog{border-radius:12px;box-shadow:0 16px 56px #07172933}
.em-dialog::backdrop{background:#0b172966}
.em-v2 .em-inspector{box-shadow:0 6px 24px #142b4518}
.em-v2 #em-toolbar details:not([open])>.em-v2-menu{display:none}
.em-v2 #em-toolbar details[open]>summary{color:var(--em-accent);border-color:var(--em-accent);background:var(--em-panel)}
.em-v2 #em-toolbar details[open]>.em-v2-menu,.em-console-popover{animation:em-menu-enter var(--em-motion-fast) var(--em-motion-ease) both;transform-origin:top right}
.em-dialog[open],.em-inspector{animation:em-surface-enter var(--em-motion-enter) var(--em-motion-ease) both}
#em-console-dock{animation:em-console-enter var(--em-motion-enter) ease-out both}
#em-console-tabs{scrollbar-width:thin;scroll-behavior:smooth;overscroll-behavior:contain}
#em-console-tabs .em-session{transition:background-color var(--em-motion-fast) ease,border-color var(--em-motion-fast) ease;overflow:hidden}
#em-console-tabs .em-session:has([aria-selected=true]){border-color:var(--em-accent);box-shadow:inset 0 -2px var(--em-accent)}
#em-console-tabs .em-session-tab:focus-visible,.em-console-tools button:focus-visible{outline:2px solid var(--em-accent);outline-offset:-2px}
.em-console-dock .em-console-tools button{border-radius:4px}
.em-console-dock .em-console-tools button:hover{background:var(--em-panel);color:var(--em-accent)}
.em-workspace .modal.fade .modal-dialog{transition:transform var(--em-motion-enter) var(--em-motion-ease);transform:translateY(-8px)}
.em-workspace .modal.in .modal-dialog{transform:translateY(0)}
.em-workspace .modal.fade{transition:opacity var(--em-motion-fast) ease}
@keyframes em-menu-enter{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
@keyframes em-surface-enter{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@keyframes em-console-enter{from{opacity:0}to{opacity:1}}
/* Progressive enhancement: animate native dialog close without delaying cleanup. */
@supports (transition-behavior:allow-discrete){
 .em-dialog{animation:none;opacity:0;transform:translateY(5px);transition:opacity var(--em-motion-fast),transform var(--em-motion-fast),display var(--em-motion-fast) allow-discrete,overlay var(--em-motion-fast) allow-discrete}
 .em-dialog[open]{opacity:1;transform:translateY(0)}
 @starting-style{.em-dialog[open]{opacity:0;transform:translateY(5px)}}
}
@media(prefers-reduced-motion:reduce){.em-dialog,.em-inspector,#em-console-dock,.em-console-popover,.em-v2 #em-toolbar details>.em-v2-menu,.em-workspace .modal,.em-workspace .modal-dialog{animation:none!important;transition:none!important;transform:none!important}#em-console-tabs{scroll-behavior:auto}}
.em-app .em-main>div{animation:em-surface-enter var(--em-motion-enter) var(--em-motion-ease) both}
#lab-cards>.em-card{display:flex;flex-direction:column;min-width:0}
#lab-cards>.em-card h3{overflow-wrap:anywhere;line-height:1.35}
#lab-cards>.em-card footer{margin-top:auto;padding-top:16px}
@media(prefers-reduced-motion:reduce){.em-app .em-main>div{animation:none!important}}

/* Native shape creation: compact zone presets, fields and live preview. */
.em-workspace .em-shape-modal{width:min(820px,calc(100vw - 32px))!important}
.em-workspace .em-shape-modal .modal-header{padding:16px 20px}
.em-workspace .em-shape-modal .modal-title{font-size:17px;line-height:1.4;letter-spacing:0;text-transform:none;border:0;margin:0;padding:0}
.em-workspace .em-shape-modal .modal-body{padding:18px 20px}
.em-workspace .em-shape-composer{float:none;width:100%;padding:0;margin:0}
.em-shape-presets{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin-bottom:18px}
.em-shape-presets>span{font-size:9px;font-weight:700;letter-spacing:.08em;color:var(--em-muted);margin-right:4px}
.em-workspace .em-shape-presets button{display:inline-flex;align-items:center;gap:6px;font-size:11px;height:29px;min-height:29px;padding:4px 9px;border-radius:6px;background:var(--em-surface);color:var(--em-text);border:1px solid var(--em-border)}
.em-shape-presets button::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--shape-swatch)}
.em-workspace .em-shape-presets button[aria-pressed=true]{border-color:var(--shape-swatch);box-shadow:0 0 0 1px var(--shape-swatch)}
.em-shape-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,.9fr);gap:22px}
.em-shape-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px 12px;align-content:start}
.em-workspace .em-shape-fields .form-group{float:none;width:100%;margin:0;padding:0}
.em-workspace .em-shape-fields .form-group:has(.shape_name){grid-column:1/-1;grid-row:1}
.em-workspace .em-shape-fields label{display:block;float:none;width:100%;padding:0;margin:0 0 6px;font-size:11px;font-weight:600;color:var(--em-text);text-align:left}
.em-workspace .em-shape-fields .form-group>div{float:none;width:100%;padding:0}
.em-workspace .em-shape-fields .form-control{width:100%;height:34px;font-size:12px;line-height:20px;padding:5px 8px;border:1px solid var(--em-border);border-radius:6px}
.em-workspace .em-shape-fields input[type=color]{padding:5px;cursor:pointer}
.em-shape-preview-area>.em-kicker{font-size:9px;color:var(--em-muted)}
.em-workspace .em-shape-composer .em-editor-preview{display:flex;align-items:center;justify-content:center;margin:8px 0 10px;min-height:210px;padding:24px;background-color:var(--em-bg);background-image:radial-gradient(var(--em-border) .7px,transparent .7px);background-size:12px 12px;border:1px solid var(--em-border);border-radius:8px;overflow:hidden}
.em-shape-composer .em-editor-preview>span{display:flex;align-items:center;justify-content:center;min-height:92px;width:100%;padding:18px 12px;box-sizing:border-box;text-align:center;overflow-wrap:anywhere;color:#172b4d;font-size:12px;line-height:1.4}
.em-workspace .em-shape-preview-area p{font-size:10px;color:var(--em-muted);line-height:1.6;margin:0;padding:0;white-space:normal}
.em-shape-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;border-top:1px solid var(--em-border);margin-top:20px;padding-top:14px}
.em-shape-actions>span{margin-right:auto;font-size:10px;color:var(--em-muted)}
.em-workspace .em-shape-actions button{float:none;margin:0;height:32px;padding:5px 14px;font-size:12px;border-radius:6px}
.em-workspace .em-shape-actions [type=submit]{background:var(--em-accent);border-color:var(--em-accent);color:#fff}
@media(max-width:650px){.em-shape-layout{grid-template-columns:1fr}.em-workspace .em-shape-composer .em-editor-preview{min-height:130px}.em-shape-actions>span{display:none}}

/* Unified native Node / Network / Picture forms. */
.em-workspace .em-studio-modal{width:min(820px,calc(100vw - 32px))!important}
.em-workspace .em-studio-node{width:min(900px,calc(100vw - 32px))!important}
.em-workspace .em-studio-picture{width:min(680px,calc(100vw - 32px))!important}
.em-workspace .em-studio-modal .modal-header{padding:16px 20px}
.em-workspace .em-studio-modal .modal-title{font-size:17px;line-height:1.4;letter-spacing:0;text-transform:none;border:0;margin:0;padding:0}
.em-workspace .em-studio-modal .modal-body{padding:18px 20px;max-height:none;overflow:visible}
.em-workspace .em-studio-form{padding:0;margin:0;width:100%;float:none}
.em-workspace .em-studio-intro{margin:0 0 18px;padding:0;font-size:11px;line-height:1.6;color:var(--em-muted);white-space:normal}
.em-workspace .em-studio-form .form-group{display:flex;align-items:center;gap:16px;float:none;width:100%;margin:0 0 13px;padding:0}
.em-workspace .em-studio-form .form-group>label{float:none;flex:0 0 165px;width:165px;margin:0;padding:0;text-align:left;font-size:12px;font-weight:600;line-height:1.4;color:var(--em-text)}
.em-workspace .em-studio-form .form-group>div{float:none;flex:1;min-width:0;width:auto;margin:0;padding:0}
.em-workspace .em-studio-form input:not([type=hidden]):not([type=checkbox]):not([type=file]),.em-workspace .em-studio-form select,.em-workspace .em-studio-form .selectpicker-button{height:34px;min-height:34px;padding:5px 9px;font-size:12px;line-height:22px;border:1px solid var(--em-border);border-radius:6px;background:var(--em-bg);color:var(--em-text);width:100%;box-sizing:border-box}
.em-workspace .em-studio-form .bootstrap-select{width:100%!important;max-width:100%;margin:0}
.em-workspace .em-studio-form .bootstrap-select>.dropdown-toggle{display:flex;align-items:center;text-align:left;padding-right:28px}
.em-workspace .em-studio-form .bootstrap-select .filter-option{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.em-workspace .em-studio-form .bootstrap-select .dropdown-menu{font-size:12px;max-width:100%;min-width:100%}
.em-workspace .em-studio-form input[type=file]{width:100%;font-size:12px;color:var(--em-muted)}
.em-studio-form input[type=file]::file-selector-button{border:1px solid var(--em-border);border-radius:6px;padding:7px 10px;margin-right:10px;background:var(--em-panel);color:var(--em-text);cursor:pointer}
.em-workspace .em-studio-form .em-studio-actions{display:block;border-top:1px solid var(--em-border);padding-top:14px;margin:18px 0 0}
.em-workspace .em-studio-form .em-studio-actions>div{display:flex;justify-content:flex-end;gap:7px;margin:0;width:100%}
.em-workspace .em-studio-actions button{margin:0;float:none;height:32px;padding:5px 14px;font-size:12px;border-radius:6px}
.em-workspace .em-studio-actions [type=submit]{background:var(--em-accent);border-color:var(--em-accent);color:#fff}
.em-studio-hint{padding:10px 12px;margin-top:16px;background:var(--em-bg);border:1px solid var(--em-border);border-radius:7px;color:var(--em-muted);font-size:11px;line-height:1.6}
.em-picture-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:120px;padding:14px;border:1px dashed var(--em-border);border-radius:8px;background:var(--em-bg);color:var(--em-muted);font-size:11px;overflow-wrap:anywhere}
.em-picture-preview img{max-width:100%;max-height:200px;object-fit:contain}.em-picture-preview img[hidden]{display:none}
@media(max-width:650px){.em-workspace .em-studio-form .form-group{display:block}.em-workspace .em-studio-form .form-group>label{display:block;width:100%;margin-bottom:6px}.em-workspace .em-studio-modal .modal-body{padding:14px}}
.em-link-editor{width:min(640px,calc(100vw - 32px))}.em-link-editor h2{font-size:18px;margin:0 0 12px}.em-link-editor p{font-size:11px;line-height:1.6;padding:0;white-space:normal}
.em-link-ends{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:18px 0}.em-link-ends label{display:grid;gap:8px;min-width:0;font-size:12px}.em-link-ends select{width:100%;height:36px;padding:6px 8px;font-size:12px;border:1px solid var(--em-border);border-radius:6px;background:var(--em-bg);color:var(--em-text)}.em-link-actions{display:flex;justify-content:flex-end;border-top:1px solid var(--em-border);padding-top:14px}.em-link-actions button{font-size:12px}.em-link-result{color:var(--em-amber)}
@media(max-width:600px){.em-link-ends{grid-template-columns:1fr}}

/* Connection menu grows after Edit is inserted; do not retain native one-row cap. */
.em-workspace #context-menu.em-link-context{width:188px!important;min-width:188px!important;height:auto!important;max-height:none!important;overflow:visible!important}
.em-workspace #context-menu.em-link-context>.dropdown-menu{display:block;width:188px!important;min-width:188px!important;box-sizing:border-box;height:auto!important;max-height:none!important;overflow:visible!important;padding:4px!important;background:var(--em-surface)!important;border:1px solid var(--em-border);border-radius:8px;box-shadow:0 6px 20px #142b4522}
.em-workspace #context-menu.em-link-context .dropdown-header{padding:7px 9px!important;margin:0 0 3px!important;font-size:11px!important;line-height:16px!important;font-weight:650;background:var(--em-panel)!important;color:var(--em-muted)!important;border-radius:4px}
.em-workspace #context-menu.em-link-context li>a{display:flex!important;align-items:center;gap:8px;box-sizing:border-box;min-height:32px;padding:6px 9px!important;font-size:12px!important;line-height:20px!important;color:var(--em-text)!important;border-radius:4px;white-space:nowrap}
.em-workspace #context-menu.em-link-context li>a i{width:14px;text-align:center;font-size:12px!important;flex:none}
.em-workspace #context-menu.em-link-context li>a:hover,.em-workspace #context-menu.em-link-context li>a:focus{background:var(--em-panel)!important;color:var(--em-accent)!important}

/* Axis-aligned jsPlumb SVGs can be only 6px wide/high; packet lanes must not clip. */
.em-v2.em-workspace #lab-viewport svg.jtk-connector.em-flow-active{overflow:visible!important}
.em-app .em-delete-lab,.em-dialog .em-delete-lab{color:var(--em-red);background:var(--em-surface);border-color:var(--em-border)}
.em-app .em-delete-lab:hover,.em-dialog .em-delete-lab:hover{border-color:var(--em-red);color:var(--em-red)}
.em-delete-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
#delete-lab-form label{display:block;font-size:12px}#delete-lab-form input{display:block;width:100%;box-sizing:border-box}

/* Balanced node form and bounded template picker. */
.em-workspace .em-studio-node{width:min(740px,calc(100vw - 32px))!important}
.em-workspace .em-studio-node .modal-header{padding:14px 20px}
.em-workspace .em-studio-node .modal-body{padding:18px 20px 20px}
.em-workspace .em-studio-node .em-studio-intro{margin-bottom:16px;line-height:1.5}
.em-workspace .em-studio-node .form-group{gap:14px;margin-bottom:12px}
.em-workspace .em-studio-node .form-group>label{flex-basis:130px;width:130px}
.em-workspace .em-studio-node .bootstrap-select>.dropdown-menu{max-height:min(380px,52vh)!important;padding:6px 0;overflow:hidden!important;border:1px solid var(--em-border);border-radius:7px;box-shadow:var(--em-shadow)}
.em-workspace .em-studio-node .bootstrap-select .dropdown-menu.inner{max-height:min(316px,calc(52vh - 64px))!important;overflow-y:auto!important;overflow-x:hidden!important}
.em-workspace .em-studio-node .bootstrap-select .bs-searchbox{padding:4px 8px 8px}
.em-workspace .em-studio-node .bootstrap-select .dropdown-menu li>a{font-size:12px!important;line-height:20px!important;min-height:30px;padding:5px 12px!important;white-space:normal}
.em-workspace .em-studio-node .bootstrap-select .dropdown-menu li>a .em-template-missing{font-size:10px}
@media(max-width:650px){.em-workspace .em-studio-node .form-group>label{width:100%}.em-workspace .em-studio-node .modal-body{padding:14px}}

/* Let an open node picker participate in the form height. */
.em-workspace .em-studio-node .bootstrap-select.open>.dropdown-menu{position:relative!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;float:none!important;transform:none!important;margin:5px 0 0!important;width:100%!important}
.em-workspace .em-studio-node .bootstrap-select.open{height:auto!important}
.em-workspace .em-studio-node .form-group:has(.bootstrap-select.open){align-items:flex-start}
.em-workspace .em-studio-node .form-group:has(.bootstrap-select.open)>label{padding-top:8px}

/* The grid belongs to the screen, not the translated topology layer. */
.em-v2.em-workspace::before{content:"";position:fixed;inset:44px 0 0 40px;pointer-events:none;z-index:0;background-color:var(--em-bg);background-image:linear-gradient(color-mix(in srgb,var(--em-muted) 12%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--em-muted) 12%,transparent) 1px,transparent 1px);background-size:36px 36px}
:root[data-em-theme] .em-v2.em-workspace #lab-viewport{background:transparent!important;z-index:1}
.em-v2.em-workspace #body{background:transparent!important}

/* Centered viewport must not clip nodes at its translated origin. */
:root[data-em-theme] .em-v2.em-workspace #lab-viewport{overflow:visible!important}
#em-console-dock{animation:none!important}

/* Keep blank-canvas mouse selection available around a centered topology. */
.em-v2.em-workspace #lab-viewport::before{content:"";position:absolute;left:var(--em-hit-left,0px);top:var(--em-hit-top,0px);width:var(--em-hit-width,100%);height:var(--em-hit-height,100%);background:transparent;pointer-events:auto;z-index:-1}

/* Shared native context menu chrome. */
.em-v2.em-workspace #context-menu{width:204px!important;height:auto!important;overflow:visible!important;border:1px solid var(--em-border)!important;border-radius:9px!important;background:var(--em-surface)!important;box-shadow:var(--em-shadow)!important;padding:4px!important}
.em-v2.em-workspace #context-menu>.dropdown-menu{position:static!important;float:none!important;width:100%!important;min-width:0!important;height:auto!important;margin:0!important;padding:0!important;border:0!important;border-radius:6px!important;background:var(--em-surface)!important;box-shadow:none!important}
.em-v2.em-workspace #context-menu .dropdown-header{font-family:inherit!important;font-size:10px!important;font-weight:700!important;letter-spacing:.04em;line-height:18px!important;padding:7px 10px!important;margin:0 0 3px!important;border-radius:5px!important;background:var(--em-panel)!important;color:var(--em-accent)!important;text-shadow:none!important;white-space:normal}
.em-v2.em-workspace #context-menu li>a{display:flex!important;align-items:center;gap:9px;font-family:inherit!important;font-size:12px!important;font-weight:500!important;line-height:20px!important;min-height:32px!important;padding:6px 10px!important;border-radius:5px!important;color:var(--em-text)!important;background:transparent!important;white-space:normal!important;text-decoration:none!important}
.em-v2.em-workspace #context-menu li>a:hover,.em-v2.em-workspace #context-menu li>a:focus-visible{color:var(--em-accent)!important;background:var(--em-panel)!important;outline:none}
.em-v2.em-workspace #context-menu li>a>i{font-size:14px!important;width:16px!important;flex:0 0 16px;text-align:center;margin:0!important;color:var(--em-muted)!important}
.em-v2.em-workspace #context-menu .divider{height:1px!important;margin:5px 6px!important;background:var(--em-border)!important;border:0!important}

/* Native Configured Nodes modal, themed to match the Workspace shell. */
body.em-v2 .modal:has(.modal-title):has(.tbodyNodeList) .modal-dialog{width:min(1480px,calc(100vw - 32px));margin:24px auto}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-content{border:1px solid var(--em-border)!important;border-radius:8px!important;overflow:hidden;box-shadow:0 18px 54px rgba(20,43,69,.16)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-header{display:flex;align-items:center;min-height:58px;padding:14px 20px!important;background:var(--em-surface)!important;border-bottom:1px solid var(--em-border)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-title{margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:var(--em-text)!important;font:700 16px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif!important;letter-spacing:.02em;text-transform:none!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-header .close{order:2;margin-left:14px;color:var(--em-muted)!important;font-size:22px;opacity:.85}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-header .action-changeopacity{order:1;margin-left:auto;color:var(--em-muted)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body{padding:18px 20px!important;background:var(--em-surface)!important;overflow-x:auto}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body>.row:first-child{margin:0 0 12px}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body>.row:first-child [class*=col-]{padding:0}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body .dropdown-toggle{height:32px;padding:5px 10px;border:1px solid var(--em-border);border-radius:6px;background:var(--em-panel);color:var(--em-text);font-size:12px;box-shadow:none}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body>div:has(>.table){max-width:100%;overflow:auto;border:1px solid var(--em-border);border-radius:8px}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table{min-width:1100px;margin:0;border:0!important;border-collapse:separate;border-spacing:0;background:var(--em-surface);color:var(--em-text);font-size:12px}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>thead>tr>th{position:sticky;top:0;padding:10px 9px!important;border:0!important;border-bottom:1px solid var(--em-border)!important;background:var(--em-panel)!important;color:var(--em-muted)!important;font-size:10px;font-weight:700;letter-spacing:.035em;text-transform:uppercase;white-space:nowrap}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>tbody>tr>td{height:42px;padding:6px 9px!important;vertical-align:middle;border:0!important;border-bottom:1px solid var(--em-border)!important;color:var(--em-text);background:var(--em-surface)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>tbody>tr:last-child>td{border-bottom:0!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>tbody>tr:hover>td{background:var(--em-panel)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>tbody>tr.bg-info>td{background:color-mix(in srgb,var(--em-running) 12%,var(--em-surface))!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>tbody>tr.bg-warning>td{background:color-mix(in srgb,var(--em-warning) 14%,var(--em-surface))!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table input:not([type=checkbox]),body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table ui-select .ui-select-match{min-height:30px;padding:4px 8px;border:1px solid var(--em-border)!important;border-radius:5px;background:var(--em-bg)!important;color:var(--em-text)!important;font:500 12px/20px system-ui,-apple-system,"Segoe UI",sans-serif;box-shadow:none}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table ui-select{display:inline-block;min-width:76px;max-width:210px}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table ui-select .ui-select-match{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table .btn{min-width:28px;min-height:28px;padding:4px 7px;border:1px solid var(--em-border)!important;border-radius:5px;background:var(--em-panel)!important;color:var(--em-text)!important;box-shadow:none}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table .btn:hover{border-color:var(--em-accent)!important;color:var(--em-accent)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table .btn-danger{color:var(--em-error)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body>.row:last-child{margin:14px 0 0;color:var(--em-muted);font-size:11px}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body>.row:last-child .bg-info,body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body>.row:last-child .bg-warning{display:inline-block;padding:5px 8px;border:1px solid var(--em-border);border-radius:5px;background:var(--em-panel)!important;color:var(--em-muted)!important;font-weight:600}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-footer{padding:12px 20px!important;background:var(--em-surface)!important;border-top:1px solid var(--em-border)!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-footer .btn{min-height:32px;padding:5px 14px;border:1px solid var(--em-border);border-radius:6px;background:var(--em-panel);color:var(--em-text);font-size:12px}
@media(max-width:700px){body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-dialog{width:calc(100vw - 16px);margin:8px auto}body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-header,body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body{padding-left:12px!important;padding-right:12px!important}}

/* Match node/network list windows to the light Add Node/Add Network studio. */
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-title{text-transform:none!important;letter-spacing:0!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>thead>tr>th{background:#edf2f8!important;color:#5a6d86!important;border-bottom:1px solid #dce4ef!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .modal-body>div:has(>.table){border-color:#dce4ef!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) table.table{border-color:#dce4ef!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>tbody>tr>td{font-size:12px!important;font-weight:500!important}
body.em-v2 .modal:is(:has(.tbodyNodeList),:has(.tbodyNetList)) .table>tbody>tr>td:first-child{color:#5a6d86!important}

/* Native configured node/network dialogs are rendered as .modal-wide by EVE. */
body.em-v2 .modal.modal-wide .modal-dialog{width:min(1480px,calc(100vw - 32px));margin:24px auto}
body.em-v2 .modal.modal-wide .modal-content{overflow:hidden;border:1px solid #dce4ef!important;border-radius:8px!important;background:#fff!important;box-shadow:0 18px 54px rgba(20,43,69,.16)!important}
body.em-v2 .modal.modal-wide .modal-header{display:flex;align-items:center;min-height:58px;padding:14px 20px!important;border-bottom:1px solid #dce4ef!important;background:#edf2f8!important}
body.em-v2 .modal.modal-wide .modal-header .modal-title{margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:#172b4d!important;font:700 17px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif!important;letter-spacing:0!important;text-transform:none!important}
body.em-v2 .modal.modal-wide .modal-header .close{order:2;margin-left:14px;color:#5a6d86!important;font-size:22px;opacity:.85}
body.em-v2 .modal.modal-wide .modal-header .action-changeopacity{order:1;margin-left:auto;color:#8b9bb0!important}
body.em-v2 .modal.modal-wide .modal-body{padding:18px 20px!important;background:#fff!important}
body.em-v2 .modal.modal-wide .table-responsive{max-width:100%;overflow:auto;border:1px solid #dce4ef;border-radius:8px}
body.em-v2 .modal.modal-wide table.table{min-width:700px;margin:0;border:0!important;border-collapse:separate;border-spacing:0;background:#fff;color:#172b4d;font-size:12px}
body.em-v2 .modal.modal-wide .table>thead>tr>th{padding:10px 12px!important;border:0!important;border-bottom:1px solid #dce4ef!important;background:#edf2f8!important;color:#5a6d86!important;font-size:10px;font-weight:700;letter-spacing:.035em;text-transform:uppercase;white-space:nowrap}
body.em-v2 .modal.modal-wide .table>tbody>tr>td{height:42px;padding:8px 12px!important;vertical-align:middle;border:0!important;border-bottom:1px solid #e7edf5!important;background:#fff!important;color:#172b4d!important;font-size:12px;font-weight:500}
body.em-v2 .modal.modal-wide .table>tbody>tr:last-child>td{border-bottom:0!important}
body.em-v2 .modal.modal-wide .table>tbody>tr:hover>td{background:#f5f7fb!important}
body.em-v2 .modal.modal-wide .table a{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin-right:5px;border:1px solid #dce4ef;border-radius:6px;background:#edf2f8;color:#5a6d86!important;text-decoration:none}
body.em-v2 .modal.modal-wide .table a:hover{border-color:#087f72;background:#e6f4f1;color:#087f72!important}
body.em-v2 .modal.modal-wide .table a.action-networkdelete:hover,body.em-v2 .modal.modal-wide .table a.action-nodedelete:hover{border-color:#ec6570;background:#fff1f2;color:#ec6570!important}
body.em-v2 .modal.modal-wide .modal-footer{padding:12px 20px!important;border-top:1px solid #dce4ef!important;background:#fff!important}
body.em-v2 .modal.modal-wide .modal-footer .btn{min-height:32px;padding:5px 14px;border:1px solid #dce4ef;border-radius:6px;background:#edf2f8;color:#172b4d;font-size:12px}
@media(max-width:700px){body.em-v2 .modal.modal-wide .modal-dialog{width:calc(100vw - 16px);margin:8px auto}body.em-v2 .modal.modal-wide .modal-header,body.em-v2 .modal.modal-wide .modal-body{padding-left:12px!important;padding-right:12px!important}}

/* Polygon previews draw a true inset fill so the outline remains visible after clipping. */
.em-editor-preview span.em-preview-polygon{position:relative;background:var(--em-accent);border:0!important}
.em-editor-preview span.em-preview-polygon::before{content:'';position:absolute;inset:0;z-index:0;background:var(--em-preview-fill,#f0fdfa);clip-path:inherit;transform:scale(.985)}

.em-editor-preview span.em-preview-shape{width:min(150px,100%);max-width:100%;min-height:150px;flex:none;box-sizing:border-box}

.em-editor-preview span.em-preview-polygon .em-preview-label{position:relative;z-index:1;background:transparent!important;color:var(--em-text);text-align:center}
.em-editor-preview span.em-preview-polygon .em-preview-label{max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px!important}

/* Add Node: compact enterprise template browser, preserving the native EVE form/API. */
.em-workspace .em-node-library-modal{width:min(1500px,95vw)!important;max-width:1500px!important}
.em-workspace .em-node-library-modal .modal-content{height:min(90vh,900px);display:flex;flex-direction:column;overflow:hidden;border-radius:15px}
.em-workspace .em-node-library-modal .modal-header{min-height:76px;padding:13px 22px;display:flex;align-items:center;gap:14px;background:var(--em-surface)!important}
.em-workspace .em-node-library-modal .modal-title{font-size:19px;font-weight:700;line-height:1.25}
.em-workspace .em-node-library-modal .em-node-subtitle{margin:3px 0 0;color:var(--em-muted);font-size:12px;line-height:1.4}
.em-workspace .em-node-library-modal .modal-header .close{order:3;margin-left:auto;align-self:flex-start}
.em-workspace .em-node-library-modal .modal-body.em-node-modal-body{display:flex;flex:1;min-height:0;padding:0!important;overflow:hidden}
.em-workspace #form-node-add.em-studio-form{display:flex;flex:1;min-height:0;flex-direction:column;margin:0!important;padding:0!important}
.em-workspace #form-node-add .em-node-native-template{display:grid!important;grid-template-columns:minmax(95px,34%) minmax(0,1fr);gap:8px;align-items:center;margin:0;padding:7px 0;border-bottom:1px solid var(--em-border)}
.em-workspace #form-node-add .em-node-layout{display:grid;grid-template-columns:minmax(170px,19%) minmax(380px,49%) minmax(300px,32%);flex:1;min-height:0;overflow:hidden}
.em-workspace #form-node-add .em-node-categories{min-width:0;padding:17px 12px;border-right:1px solid var(--em-border);background:var(--em-surface);overflow-y:auto}
.em-workspace #form-node-add .em-node-category{display:flex;align-items:center;gap:9px;width:100%;min-height:40px;margin:0 0 3px;padding:7px 9px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--em-text);font-size:12px;text-align:left;justify-content:flex-start}
.em-workspace #form-node-add .em-node-category i{width:15px;color:var(--em-muted);text-align:center}
.em-workspace #form-node-add .em-node-category small{margin-left:auto;color:var(--em-muted);font-size:10px}
.em-workspace #form-node-add .em-node-category:hover{background:var(--em-panel)}
.em-workspace #form-node-add .em-node-category.is-active{background:#eff6ff;border-color:#bfdbfe;color:#2563eb}
.em-workspace #form-node-add .em-node-category.is-active i,.em-workspace #form-node-add .em-node-category.is-active small{color:#2563eb}
.em-workspace #form-node-add .em-node-native-template>label{width:auto;padding:0;margin:0;color:var(--em-text);font-size:11px;font-weight:600;text-align:left}
.em-workspace #form-node-add .em-node-native-template>.bootstrap-select{width:100%!important;min-width:0}
.em-workspace #form-node-add .em-node-native-template .dropdown-toggle{height:34px;min-height:34px;padding:5px 9px;font-size:12px}
:root[data-em-theme=dark] .em-workspace #form-node-add .em-node-category.is-active{background:#172b49;border-color:#284d79;color:#8abaff}
:root[data-em-theme=dark] .em-workspace #form-node-add .em-node-category.is-active i,:root[data-em-theme=dark] .em-workspace #form-node-add .em-node-category.is-active small{color:#8abaff}
.em-workspace #form-node-add .em-node-image-filter{display:flex;align-items:center;gap:7px;margin:14px 4px 0;padding-top:13px;border-top:1px solid var(--em-border);font-size:10px;font-weight:500;color:var(--em-muted)}
.em-workspace #form-node-add .em-node-image-filter input{margin:0;accent-color:#3b82f6}
.em-workspace #form-node-add .em-node-library{display:flex;min-width:0;min-height:0;flex-direction:column;padding:16px 14px;border-right:1px solid var(--em-border);overflow:hidden}
.em-workspace #form-node-add .em-node-tools{display:flex;gap:8px;margin-bottom:9px}
.em-workspace #form-node-add .em-node-search{display:flex;flex:1;min-width:0;height:37px;align-items:center;gap:8px;padding:0 10px;border:1px solid var(--em-border);border-radius:7px;background:var(--em-bg);color:var(--em-muted)}
.em-workspace #form-node-add .em-node-search>i{flex:none}
.em-workspace #form-node-add .em-node-search input{width:100%;height:34px;min-width:0;padding:5px 0;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;font-size:11px}
.em-workspace #form-node-add .em-node-search input:focus-visible{outline:none!important}
.em-workspace #form-node-add .em-node-clear{width:22px;min-width:22px;height:22px;min-height:22px;padding:0;border:0;border-radius:50%;background:var(--em-panel);color:var(--em-muted);font-size:16px;line-height:20px}
.em-workspace #form-node-add .em-node-vendor{width:124px;max-width:34%;height:37px;min-height:37px;padding:5px 8px;font-size:11px}
.em-workspace #form-node-add .em-node-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.em-workspace #form-node-add .em-node-row{display:grid;grid-template-columns:32px minmax(100px,1fr) minmax(70px,.48fr) 65px 100px 28px;align-items:center;gap:8px;min-height:58px;padding:6px 7px;border:1px solid transparent;border-bottom-color:var(--em-border);border-radius:6px;color:var(--em-text);cursor:pointer}
.em-workspace #form-node-add .em-node-row:hover{background:var(--em-panel)}
.em-workspace #form-node-add .em-node-row.is-selected{border-color:#60a5fa;background:#eff6ff}
:root[data-em-theme=dark] .em-workspace #form-node-add .em-node-row.is-selected{background:#172b49;border-color:#3b82f6}
.em-workspace #form-node-add .em-node-row-icon{display:grid;place-items:center;width:29px;height:29px;border:1px solid var(--em-border);border-radius:6px;background:var(--em-surface);color:var(--em-accent);font-size:14px}
.em-workspace #form-node-add .em-node-row-name{overflow:hidden;font-size:12px;font-weight:600;white-space:nowrap;text-overflow:ellipsis}
.em-workspace #form-node-add .em-node-row-vendor,.em-workspace #form-node-add .em-node-row-type{overflow:hidden;color:var(--em-muted);font-size:11px;white-space:nowrap;text-overflow:ellipsis}
.em-workspace #form-node-add .em-node-row-image{display:inline-flex;align-items:center;justify-self:start;gap:5px;padding:3px 6px;border-radius:10px;background:#dcfce7;color:#15803d;font-size:9px;white-space:nowrap}
.em-workspace #form-node-add .em-node-row-image i,.em-workspace #form-node-add .em-node-status:before{width:7px;height:7px;border-radius:50%;background:#16a34a;content:''}
.em-workspace #form-node-add .em-node-row-image.is-missing{background:var(--em-panel);color:var(--em-muted)}
.em-workspace #form-node-add .em-node-row-image.is-missing i{background:#94a3b8}
.em-workspace #form-node-add .em-node-favorite{width:25px;min-width:25px;height:25px;min-height:25px;padding:0;border:0;background:transparent;color:#a7b3c3;font-size:17px}
.em-workspace #form-node-add .em-node-favorite.is-favorite{color:#e9a400}
.em-workspace #form-node-add .em-node-empty{padding:20px;color:var(--em-muted);font-size:11px;text-align:center}
.em-workspace #form-node-add .em-node-config{display:flex;min-width:0;min-height:0;flex-direction:column;overflow:auto;background:var(--em-surface)}
.em-workspace #form-node-add .em-node-selected{position:sticky;top:0;z-index:2;display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:76px;padding:13px 15px;border-bottom:1px solid var(--em-border);background:var(--em-surface)}
.em-workspace #form-node-add .em-node-config-icon{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--em-border);border-radius:8px;background:var(--em-panel);color:var(--em-accent);font-size:17px}
.em-workspace #form-node-add .em-node-selected strong,.em-workspace #form-node-add .em-node-selected div span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.em-workspace #form-node-add .em-node-selected strong{font-size:14px}
.em-workspace #form-node-add .em-node-selected div span{margin-top:2px;color:var(--em-muted);font-size:10px}
.em-workspace #form-node-add .em-node-status{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border-radius:12px;background:#dcfce7;color:#15803d;font-size:9px;white-space:nowrap}
.em-workspace #form-node-add .em-node-status:empty{display:none}
.em-workspace #form-node-add .em-node-status.is-missing{background:var(--em-panel);color:var(--em-muted)}
.em-workspace #form-node-add .em-node-status.is-missing:before{background:#94a3b8}
.em-workspace #form-node-add .em-node-fields{flex:1;min-height:0;padding:7px 14px 0;overflow:auto}
.em-workspace #form-node-add #form-node-data{display:block;min-height:0}
.em-workspace #form-node-add #form-node-data .form-group{display:grid;grid-template-columns:minmax(95px,34%) minmax(0,1fr);gap:8px;align-items:center;margin:0;padding:7px 0;border-bottom:1px solid var(--em-border)}
.em-workspace #form-node-add #form-node-data .form-group>label{width:auto;padding:0;margin:0;color:var(--em-text);font-size:11px;font-weight:600;text-align:left}
.em-workspace #form-node-add #form-node-data .form-group>div{width:100%;min-width:0;padding:0}
.em-workspace #form-node-add #form-node-data input.form-control,.em-workspace #form-node-add #form-node-data .dropdown-toggle{height:34px;min-height:34px;padding:5px 9px;font-size:12px}
.em-workspace #form-node-add #form-node-buttons.em-node-footer{position:sticky;bottom:0;z-index:2;display:flex;justify-content:flex-end;gap:8px;margin:0;padding:11px 14px;border-top:1px solid var(--em-border);background:var(--em-surface)}
.em-workspace #form-node-add #form-node-buttons button{min-height:34px;padding:6px 14px;border-radius:6px;font-size:11px}
.em-workspace #form-node-add #form-node-buttons button[type=submit]{border-color:#3b82f6;background:#3b82f6;color:#fff}
@media(max-width:1050px){.em-workspace .em-node-library-modal{width:96vw!important}.em-workspace #form-node-add .em-node-layout{grid-template-columns:155px minmax(320px,1fr) minmax(280px,.9fr)}.em-workspace #form-node-add .em-node-row{grid-template-columns:28px minmax(100px,1fr) 82px 26px}.em-workspace #form-node-add .em-node-row-vendor,.em-workspace #form-node-add .em-node-row-type{display:none}}
@media(max-width:760px){.em-workspace .em-node-library-modal{width:98vw!important}.em-workspace .em-node-library-modal .modal-content{height:94vh}.em-workspace #form-node-add .em-node-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(190px,1fr) minmax(230px,1fr);overflow:auto}.em-workspace #form-node-add .em-node-categories{display:flex;flex-wrap:wrap;gap:4px;padding:8px;border-right:0;border-bottom:1px solid var(--em-border);overflow:visible}.em-workspace #form-node-add .em-node-category{width:auto;min-height:30px;margin:0;padding:5px 7px}.em-workspace #form-node-add .em-node-category small,.em-workspace #form-node-add .em-node-category i{display:none}.em-workspace #form-node-add .em-node-image-filter{width:100%;margin:3px 0 0;padding:5px 2px 0}.em-workspace #form-node-add .em-node-library{min-height:220px;padding:8px;border-right:0;border-bottom:1px solid var(--em-border)}.em-workspace #form-node-add .em-node-config{min-height:220px}.em-workspace #form-node-add .em-node-row{grid-template-columns:28px minmax(90px,1fr) 90px 25px}.em-workspace #form-node-add .em-node-row-vendor,.em-workspace #form-node-add .em-node-row-type{display:none}}


.em-workspace #form-node-add .em-node-selected{display:flex;align-items:center;gap:10px;flex-wrap:nowrap}.em-workspace #form-node-add .em-node-selected>div{flex:1;min-width:0}.em-workspace #form-node-add .em-node-selected-favorite{flex:0 0 28px;background:transparent;border:0;color:var(--em-muted);font-size:19px;padding:2px}.em-workspace #form-node-add .em-node-selected-favorite.is-favorite{color:#eab308}

/* Compact Add Node spacing requested after live review. */
.em-workspace .em-node-library-modal{width:min(1280px,94vw)!important;max-width:1280px!important}
.em-workspace .em-node-library-modal .modal-content{height:min(82vh,760px);border-radius:12px}
.em-workspace .em-node-library-modal .modal-header{min-height:62px;padding:10px 18px}
.em-workspace .em-node-library-modal .modal-title{font-size:18px}
.em-workspace #form-node-add .em-node-layout{grid-template-columns:165px minmax(300px,1fr) minmax(330px,36%)}
.em-workspace #form-node-add .em-node-categories{padding:10px 8px}
.em-workspace #form-node-add .em-node-category{min-height:32px;margin-bottom:2px;padding:5px 7px;font-size:11px;gap:7px}
.em-workspace #form-node-add .em-node-library{padding:10px;gap:8px}
.em-workspace #form-node-add .em-node-tools{gap:6px;padding-bottom:8px}
.em-workspace #form-node-add .em-node-search{min-height:32px;height:32px;padding:4px 8px}
.em-workspace #form-node-add .em-node-search input{font-size:11px}
.em-workspace #form-node-add .em-node-vendor{min-height:32px;height:32px;padding:4px 6px;font-size:10px;max-width:110px}
.em-workspace #form-node-add .em-node-row{min-height:42px;height:42px;padding:5px 7px;gap:7px;border-radius:4px;grid-template-columns:26px minmax(90px,1fr) 60px 58px 68px 22px}
.em-workspace #form-node-add .em-node-row-icon{width:26px;height:26px;border-radius:5px;font-size:13px}
.em-workspace #form-node-add .em-node-row-name{font-size:11px}
.em-workspace #form-node-add .em-node-row-vendor,.em-workspace #form-node-add .em-node-row-type{font-size:9px}
.em-workspace #form-node-add .em-node-row-image{padding:3px 5px;font-size:8px}
.em-workspace #form-node-add .em-node-selected{padding:10px 12px;min-height:58px}
.em-workspace #form-node-add .em-node-config-icon{width:30px;height:30px;font-size:14px}
.em-workspace #form-node-add .em-node-selected strong{font-size:12px}
.em-workspace #form-node-add .em-node-fields{padding:3px 12px 0}
.em-workspace #form-node-add #form-node-data .form-group{padding:5px 0;gap:6px}
.em-workspace #form-node-add #form-node-data input.form-control,.em-workspace #form-node-add #form-node-data .dropdown-toggle{height:30px;min-height:30px;padding:4px 7px;font-size:11px}
.em-workspace #form-node-add .em-node-native-template{padding:5px 0}
.em-workspace #form-node-add #form-node-buttons.em-node-footer{padding:8px 12px}
.em-workspace #form-node-add .em-node-list,.em-workspace #form-node-add .em-node-fields,.em-workspace #form-node-add .em-node-categories{scrollbar-width:thin;scrollbar-color:#b6c3d2 transparent}
.em-workspace #form-node-add ::-webkit-scrollbar{width:5px;height:5px}
.em-workspace #form-node-add ::-webkit-scrollbar-thumb{background:#b6c3d2;border-radius:5px}
@media(max-width:1100px){.em-workspace #form-node-add .em-node-layout{grid-template-columns:145px minmax(250px,1fr) minmax(280px,36%)}.em-workspace #form-node-add .em-node-row{grid-template-columns:26px minmax(90px,1fr) 68px 22px}.em-workspace #form-node-add .em-node-row-vendor,.em-workspace #form-node-add .em-node-row-type{display:none}}
@media(max-width:760px){.em-workspace .em-node-library-modal .modal-content{height:92vh}.em-workspace #form-node-add .em-node-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(160px,1fr) minmax(210px,1fr)}}

/* Extra compact size from user review. */
.em-workspace .em-node-library-modal{width:min(1100px,91vw)!important;max-width:1100px!important}
.em-workspace .em-node-library-modal .modal-content{height:min(74vh,640px);border-radius:10px}
.em-workspace .em-node-library-modal .modal-header{min-height:52px;padding:8px 14px}
.em-workspace .em-node-library-modal .modal-title{font-size:16px}
.em-workspace .em-node-library-modal .em-node-subtitle{font-size:10px;margin-top:2px}
.em-workspace #form-node-add .em-node-layout{grid-template-columns:145px minmax(280px,1fr) minmax(310px,35%)}
.em-workspace #form-node-add .em-node-category{min-height:28px;padding:4px 6px;font-size:10px}
.em-workspace #form-node-add .em-node-row{min-height:34px;height:34px;padding:3px 5px;gap:5px;grid-template-columns:22px minmax(85px,1fr) 58px 64px 20px}
.em-workspace #form-node-add .em-node-row-type{display:none}
.em-workspace #form-node-add .em-node-row-icon{width:22px;height:22px;font-size:12px}
.em-workspace #form-node-add .em-node-row-name{font-size:10px}
.em-workspace #form-node-add .em-node-selected{min-height:48px;padding:7px 10px}
.em-workspace #form-node-add #form-node-data .form-group{padding:4px 0;grid-template-columns:minmax(85px,34%) minmax(0,1fr)}
.em-workspace #form-node-add #form-node-data input.form-control,.em-workspace #form-node-add #form-node-data .dropdown-toggle{height:28px;min-height:28px;font-size:10px}
.em-workspace #form-node-add #form-node-data>div:not(.form-group):has(>label){float:none;width:100%;padding:4px 0!important}
.em-workspace #form-node-add #form-node-data>div:not(.form-group)>label{height:auto!important;margin:0!important;font-size:10px}
.em-workspace #form-node-add #form-node-data .form-group:has(>input[type=checkbox]){display:block;padding:2px 0 5px}
.em-workspace #form-node-add #form-node-data input[type=checkbox].form-control{width:15px!important;height:15px!important;min-height:15px;padding:0}
.em-workspace #form-node-add #form-node-data .form-group:has(>input.hidden):not(:has(label)){display:none}
.em-workspace #form-node-add #form-node-buttons>.form-group{display:flex;justify-content:flex-end;gap:6px;width:100%;margin:0;padding:0}
@media(max-width:1000px){.em-workspace #form-node-add .em-node-row{grid-template-columns:22px minmax(85px,1fr) 64px 20px}.em-workspace #form-node-add .em-node-row-vendor{display:none}}
@media(max-width:760px){.em-workspace .em-node-library-modal .modal-content{height:92vh}.em-workspace #form-node-add .em-node-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(160px,1fr) minmax(210px,1fr)}}

/* Narrow Add Node modal after user review. */
.em-workspace .em-node-library-modal{width:min(960px,90vw)!important;max-width:960px!important}
.em-workspace #form-node-add .em-node-layout{grid-template-columns:132px minmax(250px,1fr) minmax(300px,34%)}
.em-workspace #form-node-add .em-node-row{grid-template-columns:22px minmax(85px,1fr) 64px 20px}
.em-workspace #form-node-add .em-node-row-vendor{display:none}
.em-workspace #form-node-add .em-node-tools{flex-wrap:wrap}
.em-workspace #form-node-add .em-node-vendor{max-width:100px}
@media(max-width:760px){.em-workspace #form-node-add .em-node-layout{grid-template-columns:1fr;grid-template-rows:auto minmax(160px,1fr) minmax(210px,1fr)}}

/* Tighten template metadata and keep the native Template dropdown inside its panel. */
.em-workspace #form-node-add .em-node-row{display:flex;align-items:center;gap:7px}
.em-workspace #form-node-add .em-node-row-icon{flex:0 0 22px}
.em-workspace #form-node-add .em-node-row-name{flex:0 1 auto;min-width:0;max-width:calc(100% - 126px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.em-workspace #form-node-add .em-node-row-image{flex:0 0 auto;margin-left:0}
.em-workspace #form-node-add .em-node-favorite{flex:0 0 20px;margin-left:auto}
.em-workspace #form-node-add .em-node-native-template{position:relative;z-index:4}
.em-workspace #form-node-add .em-node-native-template .bootstrap-select{width:100%!important;min-width:0}
.em-workspace #form-node-add .em-node-native-template .bootstrap-select.open>.dropdown-menu{position:absolute!important;top:100%!important;bottom:auto!important;left:0!important;right:0!important;transform:none!important;width:100%!important;max-height:220px!important;overflow:auto!important;margin:2px 0 0!important;z-index:20!important}
.em-workspace #form-node-add .em-node-native-template .bootstrap-select.open>.dropdown-menu>.inner{max-height:190px!important;overflow-y:auto!important}
.em-workspace #form-node-add .em-node-native-template .bootstrap-select .dropdown-menu li>a{min-height:30px;padding:6px 9px;font-size:11px}

/* Balance the center library and configuration panel. */
.em-workspace #form-node-add .em-node-layout{grid-template-columns:132px minmax(0,1.15fr) minmax(320px,1fr)}
.em-workspace #form-node-add .em-node-library{padding:9px 8px}
.em-workspace #form-node-add .em-node-tools{gap:5px;padding-bottom:6px}
.em-workspace #form-node-add .em-node-search{min-height:30px;height:30px;padding:3px 7px}
.em-workspace #form-node-add .em-node-search input{font-size:10px}
.em-workspace #form-node-add .em-node-vendor{min-height:30px;height:30px;max-width:88px;padding:3px 5px;font-size:9px}
.em-workspace #form-node-add .em-node-native-template{grid-template-columns:minmax(0,1fr)!important;padding:5px 8px}
.em-workspace #form-node-add .em-node-native-template>label{display:none!important}
.em-workspace #form-node-add .em-node-native-template .bootstrap-select .dropdown-toggle{width:100%;height:30px;min-height:30px;padding:4px 8px;font-size:10px}
@media(max-width:900px){.em-workspace #form-node-add .em-node-layout{grid-template-columns:120px minmax(0,1fr) minmax(280px,38%)}}

/* Slightly narrower center column; align availability badge with the row actions. */
.em-workspace #form-node-add .em-node-layout{grid-template-columns:132px minmax(0,1.05fr) minmax(320px,1fr)}
.em-workspace #form-node-add .em-node-row-image{margin-left:auto}
.em-workspace #form-node-add .em-node-favorite{margin-left:8px}

/* Restore readable typography across the compact Add Node dialog. */
.em-workspace .em-node-library-modal .modal-title{font-size:18px;line-height:1.3}
.em-workspace .em-node-library-modal .em-node-subtitle{font-size:12px}
.em-workspace #form-node-add .em-node-category{font-size:12px;min-height:32px}
.em-workspace #form-node-add .em-node-category small{font-size:10px}
.em-workspace #form-node-add .em-node-image-filter{font-size:11px;line-height:1.35}
.em-workspace #form-node-add .em-node-search input{font-size:12px}
.em-workspace #form-node-add .em-node-vendor{font-size:11px}
.em-workspace #form-node-add .em-node-row{height:38px;min-height:38px;gap:8px}

/* Keep the Add Node title and helper line on one clean left-aligned axis. */
.em-workspace .em-node-library-modal .modal-header{justify-content:flex-start;align-items:flex-start;position:relative;padding:10px 18px 9px;min-height:66px}
.em-workspace .em-node-library-modal .em-node-heading{display:flex;flex:1;min-width:0;flex-direction:row;align-items:center;justify-content:flex-start;gap:22px;margin:0;text-align:left}
.em-workspace .em-node-library-modal .modal-title,.em-workspace .em-node-library-modal .em-node-subtitle{align-self:center;margin:0!important;text-align:left}
.em-workspace .em-node-library-modal .modal-title{position:relative;top:2px;white-space:nowrap}
.em-workspace .em-node-library-modal .em-node-subtitle{line-height:1.35;padding:0!important}
.em-workspace .em-node-library-modal .modal-header .close{position:absolute;top:10px;right:14px;margin:0}
.em-workspace #form-node-add .em-node-row-name{font-size:12px;line-height:1.35}
.em-workspace #form-node-add .em-node-row-image{font-size:10px;padding:4px 7px}
.em-workspace #form-node-add .em-node-selected strong{font-size:14px}
.em-workspace #form-node-add .em-node-selected div span{font-size:11px}
.em-workspace #form-node-add .em-node-status{font-size:10px}
.em-workspace #form-node-add #form-node-data .form-group>label{font-size:12px}
.em-workspace #form-node-add #form-node-data input.form-control,.em-workspace #form-node-add #form-node-data .dropdown-toggle{font-size:12px;height:32px;min-height:32px}

/* Center the compact heading vertically so its top and bottom breathing room match. */
.em-workspace .em-node-library-modal .modal-header{align-items:center;padding:14px 18px;min-height:76px}
.em-workspace .em-node-library-modal .modal-title{top:0}
.em-workspace .em-node-library-modal .em-node-heading{align-self:center}
.em-workspace #form-node-add .em-node-row-icon svg{display:block;width:16px;height:16px}
.em-workspace #form-node-add .em-node-native-template .dropdown-toggle{font-size:12px;height:32px;min-height:32px}
.em-workspace #form-node-add .em-node-native-template .bootstrap-select .dropdown-menu li>a{font-size:12px;min-height:34px;padding:7px 10px}
.em-workspace #form-node-add #form-node-buttons button{font-size:12px;min-height:34px}

/* Fill the remaining panel height when the template dropdown is open. */
.em-workspace #form-node-add .em-node-native-template .bootstrap-select.open>.dropdown-menu{height:min(320px,calc(74vh - 200px))!important;max-height:none!important;min-height:160px!important;overflow:hidden!important}
.em-workspace #form-node-add .em-node-native-template .bootstrap-select.open>.dropdown-menu>.inner{height:100%!important;max-height:none!important;overflow-y:auto!important}

/* Keep Lab Library card actions aligned consistently across cards. */
#lab-cards>.em-card footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:8px}
#lab-cards>.em-card footer>button{box-sizing:border-box;width:100%;min-width:0;min-height:38px;padding:7px 8px;white-space:nowrap;line-height:1.2}
@media(max-width:420px){#lab-cards>.em-card footer{grid-template-columns:1fr}}

/* Give the Guacamole terminal enough horizontal room to keep its glyphs readable. */
.em-workspace:not(.em-console-expanded){--em-console-width:min(55vw,760px)}
@media(max-width:760px){.em-workspace:not(.em-console-expanded){--em-console-width:min(78vw,620px)}}
