/* Canvas-first layout preferences are screen UI only, never export geometry. */
@media screen {
  body.ef-layout-ready{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}
  body.ef-layout-ready .app-layout{flex:1 1 0;min-height:0;height:auto!important;width:100%;overflow:hidden}
  body.ef-layout-ready .editor-panel{min-width:0;min-height:0;height:100%}
  .ef-layout-bar{display:grid;grid-template-columns:minmax(102px,1fr) auto;align-items:center;gap:12px;flex:none;width:100%;min-width:0;min-height:54px;padding:5px 12px;background:#fff;border-top:1px solid var(--border);border-bottom:1px solid var(--border);z-index:15;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  .ef-layout-identity{min-width:0;overflow:hidden}.ef-layout-brand{display:flex;flex-direction:column;justify-content:center;min-width:0;min-height:44px;text-decoration:none;overflow:hidden;color:var(--ink);line-height:1.2}.ef-layout-wordmark{display:block;font-size:17px;font-weight:750;letter-spacing:-.6px;white-space:nowrap}.ef-layout-title{display:block;min-width:0;max-width:100%;font-size:11px;font-weight:500;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}
  .ef-layout-tools{display:flex;align-items:stretch;gap:6px;min-width:0}.ef-layout-action-label{min-width:0;overflow-wrap:anywhere}
  .ef-layout-action{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;padding:6px 12px;border:1px solid var(--border);border-radius:8px;background:#f7f9f3;color:#34482c;font-size:12px;line-height:1.3;touch-action:manipulation}
  .ef-layout-action svg{flex:none;width:18px;height:18px}
  .ef-layout-action:hover,.ef-layout-action[aria-expanded="true"]{background:#e9f4d9;border-color:#a3bd7e}
  .ef-layout-action:focus-visible,.ef-layout-close:focus-visible,.ef-layout-option:has(input:focus-visible){outline:2px solid var(--green,#628634);outline-offset:2px}
  #ef-layout-focus-tools{display:none}
  #ef-layout-focus-tools .ef-layout-brand{padding-inline:10px}
  #ef-layout-restore{display:none}
  .ef-layout-backdrop{position:fixed;inset:0;z-index:44;background:#16231966;touch-action:none}
  .ef-layout-menu{position:fixed;top:8px;right:8px;bottom:8px;z-index:52;width:min(480px,calc(100vw - 16px));overflow:auto;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 12px 60px #14201744;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  .ef-layout-drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:56px;padding:6px 12px;border-bottom:1px solid var(--border);background:#fff;position:sticky;top:0;z-index:5;font-size:14px}
  .ef-layout-close{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;font-size:26px;border-radius:8px;background:#eef3e6}
  .ef-layout-section{border-bottom:1px solid var(--border)}
  .ef-layout-section>summary{min-height:48px;padding:13px 16px;font-size:13px;font-weight:600;cursor:pointer;touch-action:manipulation}
  .ef-layout-section>summary:focus-visible{outline:2px solid var(--green,#628634);outline-offset:-3px}
  .ef-layout-section-content{padding:0 12px 14px}
  .ef-layout-menu .projectbar{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:12px;height:auto!important;min-height:0;padding:6px 0;border:0;background:transparent}
  .ef-layout-menu .project-identity{gap:8px}.ef-layout-menu .project-icon{display:none}.ef-layout-menu .project-version{display:none}
  .ef-layout-menu .project-title{max-width:100%;width:100%;font-size:15px;min-height:44px}.ef-layout-menu .project-identity>div{min-width:0;flex:1}
  .ef-layout-menu .project-actions{flex-wrap:wrap;width:100%;gap:7px}.ef-layout-menu .project-actions .btn{min-height:44px;height:auto;white-space:normal;font-size:12px;padding:9px 11px}
  .ef-layout-menu .project-actions .export-wrap{margin-left:auto}.ef-layout-menu .dropdown{max-width:calc(100vw - 52px);top:50px}
  .ef-layout-menu .topbar{display:flex;flex-direction:column;align-items:stretch;height:auto;gap:12px;padding:7px 0;border:0;background:transparent}
  .ef-layout-menu .topbar>.brand{display:none}.ef-layout-menu .topbar>.top-divider,.ef-layout-menu .workspace-label{display:none}
  .ef-layout-menu .top-right{margin:0;justify-content:flex-start;gap:8px;flex-wrap:wrap;font-size:11px}
  .ef-layout-menu .top-right .icon-btn,.ef-layout-menu #theme-toggle,.ef-layout-menu #language-toggle{min-width:44px;min-height:44px;margin:0}
  .ef-layout-menu #save-status{max-width:180px}.ef-layout-menu .avatar{display:none}
  .ef-layout-menu .sb-eventflow-navigation{height:auto;display:flex;flex-wrap:wrap;padding:0;border:0;background:transparent;gap:0;font-size:12px}
  .ef-layout-menu .sb-eventflow-navigation .sb-eventflow-updates{margin-left:0}
  .ef-layout-menu .editor-tabs{height:auto;min-height:44px;flex-direction:column;align-items:stretch;gap:8px;padding:0;border:0;background:transparent}
  .ef-layout-menu .view-tabs{max-width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .ef-layout-menu .view-tab{min-height:44px;padding:7px;justify-content:flex-start;border:1px solid var(--border);border-radius:7px;font-size:12px;line-height:1.4;white-space:normal}
  .ef-layout-menu .view-tab.active{background:#e9f4d9}.ef-layout-menu .validation-btn{min-height:44px;font-size:11px;justify-content:flex-start}
  .ef-layout-menu .validation-btn svg{width:18px;height:18px}
  .ef-layout-options{padding:14px 16px}.ef-layout-full-button{display:block;width:100%;min-height:44px;padding:9px 12px;border:1px solid var(--border);border-radius:8px;background:#edf4e3;font-size:12px;text-align:left;margin-bottom:8px}
  .ef-layout-full-button:disabled{display:none}.ef-layout-option{display:flex;align-items:center;gap:10px;min-height:44px;font-size:12px;cursor:pointer}.ef-layout-option input{width:20px;height:20px;accent-color:#719747}
  body.ef-layout-ready:not(.ef-layout-compact) .app-layout{grid-template-columns:var(--ef-library-width,258px) minmax(0,1fr) var(--ef-details-width,270px)}
  body.ef-layout-ready:not(.ef-layout-compact) .app-layout>.library-panel{grid-column:1;grid-row:1}
  body.ef-layout-ready:not(.ef-layout-compact) .app-layout>.editor-panel{grid-column:2;grid-row:1}
  body.ef-layout-ready:not(.ef-layout-compact) .app-layout>.inspector-panel{grid-column:3;grid-row:1}
  body.ef-layout-ready.ef-layout-hide-library{--ef-library-width:0px}body.ef-layout-ready.ef-layout-hide-details{--ef-details-width:0px}
  body.ef-layout-ready:not(.ef-layout-compact).ef-layout-hide-library .library-panel,body.ef-layout-ready:not(.ef-layout-compact).ef-layout-hide-details .inspector-panel{display:none}
  body.ef-layout-ready:not(.ef-layout-compact) .inspector-panel>.ef-layout-drawer-heading{display:none}
  body.ef-layout-compact .app-layout{display:block!important;grid-template-columns:minmax(0,1fr)!important;border-top:0}
  body.ef-layout-compact #mobile-tools,body.ef-layout-compact #library-backdrop{display:none!important}
  body.ef-layout-compact .library-panel,body.ef-layout-compact .inspector-panel{display:none;position:fixed;top:0;bottom:0;left:0;right:auto;width:min(370px,calc(100vw - 20px));max-width:100%;height:100dvh;max-height:100dvh;min-height:0;z-index:50;border:1px solid var(--border);border-radius:0;box-shadow:10px 0 45px #17271933;background:#fff;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom)}
  body.ef-layout-compact.library-open .library-panel{display:flex}
  body.ef-layout-compact .inspector-panel{left:auto;right:0;overflow-y:auto}
  body.ef-layout-compact .inspector-panel.mobile-open{display:flex;flex-direction:column}
  body.ef-layout-compact .library-panel .panel-heading{padding:10px 14px;min-height:64px;background:#fff;flex:none}
  body.ef-layout-compact .library-panel .panel-heading>div:first-child{flex:1}.ef-layout-compact .library-panel .panel-heading h2{font-size:16px}
  body.ef-layout-compact .library-close{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;font-size:25px;background:#eef3e6;border-radius:8px}
  body.ef-layout-compact .library-panel .search-field{min-height:44px;flex:none;margin-inline:14px}
  body.ef-layout-compact .library-panel .search-field input{font-size:16px;min-height:28px}
  body.ef-layout-compact .library-panel .category-filters{display:flex;flex-wrap:nowrap;overflow-x:auto;flex:none;padding:10px 14px;gap:7px}
  body.ef-layout-compact .library-panel .category-chip{flex:none;min-height:40px;font-size:11px;padding:8px 11px}
  body.ef-layout-compact .library-panel .library-toolbar{flex:none;min-height:44px;padding:0 14px;font-size:11px}
  body.ef-layout-compact .library-panel .library-toolbar select{min-height:40px;font-size:14px;width:135px}
  body.ef-layout-compact .library-panel .device-list{flex:1 1 0;min-height:0;overflow:auto;padding:0 10px 10px}
  body.ef-layout-compact .library-panel .library-device{min-height:78px;gap:12px;padding:10px 8px;margin-bottom:6px;border:1px solid var(--border);border-radius:7px}
  body.ef-layout-compact .library-panel .device-thumb{display:flex;width:58px;height:48px;flex:none}.ef-layout-compact .library-panel .device-thumb .device-art{width:56px;height:46px}
  body.ef-layout-compact .library-panel .device-model{font-size:12px}.ef-layout-compact .library-panel .device-brand{font-size:10px}
  body.ef-layout-compact .library-panel .add-device{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;opacity:1;font-size:24px;background:#edf4e3}
  body.ef-layout-compact .custom-device-btn{min-height:52px;flex:none;font-size:12px;margin:8px 14px;padding:8px 12px}.ef-layout-compact .custom-device-btn small{font-size:10px}
  body.ef-layout-compact .library-footer{display:none}
  body.ef-layout-compact .inspector-panel #inspector{flex:1 0 auto}.ef-layout-compact .inspector-heading{position:static;min-height:52px;padding:10px 16px}
  body.ef-layout-compact .inspector-heading h2{font-size:13px}.ef-layout-compact .inspector-heading [data-action="close-inspector"]{display:none!important}
  body.ef-layout-compact .inspector-panel .field>span,.ef-layout-compact .inspector-panel .section-label,.ef-layout-compact .inspector-panel .spec-row,.ef-layout-compact .inspector-panel .port-spec{font-size:12px}
  body.ef-layout-compact .inspector-panel .field input,.ef-layout-compact .inspector-panel .field select,.ef-layout-compact .inspector-panel .field textarea{min-height:44px;font-size:16px}
  body.ef-layout-compact .inspector-panel .btn,.ef-layout-compact .inspector-panel .cable-choice{min-height:44px;font-size:12px}
  body.ef-layout-compact:not(.ef-layout-show-legend) .canvas-legend,body.ef-layout-compact:not(.ef-layout-show-controls) .canvas-bottom,body.ef-layout-compact:not(.ef-layout-show-status) .editor-footer{display:none!important}
  body.ef-layout-compact .canvas-topline{display:none}.ef-layout-compact .canvas-wrap{min-height:0}
  body.ef-layout-compact .canvas-bottom{bottom:max(10px,env(safe-area-inset-bottom));left:12px;right:12px;justify-content:flex-end}
  body.ef-layout-compact .canvas-controls{min-height:46px;height:auto;max-width:100%;flex-wrap:wrap;gap:1px;padding:1px;border-radius:9px;-webkit-text-size-adjust:100%;text-size-adjust:100%}.ef-layout-compact .canvas-controls button{width:44px;min-width:44px;height:44px;font-size:19px}
  body.ef-layout-compact .canvas-controls button svg{width:17px;height:17px}.ef-layout-compact .canvas-controls #zoom-value{font-size:11px;min-width:36px}
  body.ef-layout-compact .canvas-help{display:none}
  body.ef-layout-compact .node-toolbar button,body.ef-layout-compact .edge-toolbar button{min-width:44px;min-height:44px}
  body.ef-layout-focus .ef-layout-bar,body.ef-layout-focus .canvas-bottom,body.ef-layout-focus .canvas-legend,body.ef-layout-focus .editor-footer,body.ef-layout-focus .node-toolbar,body.ef-layout-focus .edge-toolbar{display:none!important}
  body.ef-layout-focus #ef-layout-focus-tools{display:flex;align-items:center;gap:4px;position:fixed;left:12px;top:max(10px,env(safe-area-inset-top));max-width:calc(100% - 24px);padding:2px;z-index:20;border:1px solid var(--border);border-radius:9px;box-shadow:0 3px 14px #15241222;background:#fff;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body.ef-layout-focus #ef-layout-restore{display:inline-flex;min-width:44px;min-height:44px;background:transparent;border-color:transparent}
  body.ef-layout-focus .connection-status{top:64px}
  html[data-theme="dark"] .ef-layout-bar,html[data-theme="dark"] .ef-layout-menu,html[data-theme="dark"] .ef-layout-drawer-heading,html[data-theme="dark"] body.ef-layout-compact .library-panel,html[data-theme="dark"] body.ef-layout-compact .library-panel .panel-heading,html[data-theme="dark"] body.ef-layout-compact .inspector-panel{background:#1b261e;color:#dfebd7}
  html[data-theme="dark"] .ef-layout-action,html[data-theme="dark"] .ef-layout-close,html[data-theme="dark"] .ef-layout-full-button{background:#273621;color:#dcebd0;border-color:#465a38}
  html[data-theme="dark"] .ef-layout-action[aria-expanded="true"],html[data-theme="dark"] .ef-layout-menu .view-tab.active{background:#3a502b}
  html[data-theme="dark"] #ef-layout-focus-tools{background:#273621;color:#dcebd0}html[data-theme="dark"] .ef-layout-brand{color:#dfebd7}
  @media(max-width:1100px){
    .ef-layout-bar{grid-template-columns:minmax(102px,1fr) minmax(0,3fr);gap:8px;padding:5px 8px}
    .ef-layout-tools{display:grid;grid-template-columns:repeat(5,minmax(44px,1fr));gap:4px;width:100%}
    .ef-layout-tools .ef-layout-action{flex-direction:column;gap:2px;min-width:44px;min-height:44px;padding:3px 2px;font-size:clamp(10px,1.5vw,12px);line-height:1.1}
    .ef-layout-tools .ef-layout-action svg{width:17px;height:17px}
    .ef-layout-compact .control-separator{margin-inline:1px}
  }
  @media(max-width:360px){.ef-layout-bar{grid-template-columns:minmax(0,1fr);gap:2px;padding-block:2px}.ef-layout-identity .ef-layout-brand{flex-direction:row;justify-content:flex-start;align-items:center;gap:10px}.ef-layout-title{margin:0}}

}
@media print{#ef-layout-focus-tools,.ef-layout-bar,.ef-layout-menu,.ef-layout-backdrop,#ef-layout-restore,.ef-layout-drawer-heading{display:none!important}}
