.mobile-dock,.mobile-sheet-close{display:none}
@media(max-width:700px){
:root{--mobile-dock-height:calc(64px + env(safe-area-inset-bottom))}body{padding-bottom:var(--mobile-dock-height);height:100dvh;box-sizing:border-box}button,input,select,textarea{font-size:16px}button,summary,a{touch-action:manipulation}button{min-height:44px}.mobile-dock{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:160;min-height:64px;padding:6px 6px calc(6px + env(safe-area-inset-bottom));background:#17263d;gap:3px;box-shadow:0 -5px 24px #17263d1a}.mobile-dock button,.mobile-dock a{display:grid;place-items:center;flex:1;min-width:0;margin:0;padding:8px 3px;color:#cbd7e8;background:transparent;border:0;border-radius:10px;font:600 11px system-ui;text-decoration:none;min-height:48px}.mobile-dock [aria-pressed=true]{background:#344d73;color:white}.mobile-dock [data-install]{color:#a6c7ff;flex:.9}.mobile-sheet-close{position:fixed;z-index:155;bottom:calc(var(--mobile-dock-height) + 8px);right:12px;background:#17263d;color:white;border:0;border-radius:24px;padding:9px 18px;box-shadow:0 4px 16px #17263d26}
body[data-mobile-panel]:not([data-mobile-panel=""])>.mobile-sheet-close,body:has(.ui-tool-window:not([hidden]))>.mobile-sheet-close{display:block}.app-header{min-height:54px;padding:8px 12px;gap:8px;flex-wrap:wrap}.app-header .brand{font-size:17px}.app-header .studio-nav{display:none}.app-header #project-name{order:0;flex:1;width:70px;min-width:50px;padding:7px;font-size:13px;margin:0}.app-header #new{display:none}.app-header #save,.app-header .file-actions{order:0}.app-header #save{font-size:12px;padding:6px 10px}.file-actions summary{font-size:12px;padding:11px 10px}.toolbar{padding:6px 12px;min-height:54px;gap:6px;flex-wrap:nowrap}.toolbar #examples,.toolbar .history-actions,.toolbar .pane-toggles,.toolbar #save-status,.toolbar .debug-tools,.toolbar .grow{display:none}.toolbar #run{flex:0;margin-left:auto;padding:9px 13px;font-size:12px}.mode-switch{flex-shrink:0}.mode-switch button{font-size:12px;padding:6px 10px}body>main,body.hide-library main,body.hide-inspector main,body.hide-library.hide-inspector main{display:block;flex:1;min-height:0;overflow:hidden}.workspace{height:100%;min-height:0}.scope-bar{height:52px;padding:5px 10px}.scope-bar #main-graph,.scope-bar #scope,.canvas-tools #show-guide,.canvas-tools #compile{display:none}.canvas-tools{width:100%;justify-content:space-between}.canvas-tools #fit-graph{font-size:12px}.canvas-tools button{min-width:44px}.workflow-bar{display:none}#viewport{top:52px}.canvas-help{bottom:10px;left:10px;right:10px;font-size:11px}.canvas-guide{left:12px;transform:none;top:65px;width:calc(100% - 24px);max-width:none;max-height:calc(100% - 85px);overflow:auto;padding:18px}.canvas-guide h2{font-size:23px}.guide-steps{display:none}
body main>aside:first-child,body main>.inspector,body>.execution{display:none!important;position:fixed;z-index:130;left:0;right:0;bottom:var(--mobile-dock-height);height:65dvh;max-height:65dvh;width:100%;padding:20px 16px 68px;border:0;border-radius:22px 22px 0 0;background:white;box-shadow:0 -14px 45px #17263d25;overflow:auto;box-sizing:border-box}body[data-mobile-panel=library] main>aside:first-child,body[data-mobile-panel=inspector] main>.inspector,body[data-mobile-panel=result]>.execution{display:block!important}.library-section>summary{display:none}.library-section>h2,.library-section>.hint{display:block}#catalog{max-height:none;overflow:visible}#catalog-search,#catalog-category{width:100%;font-size:16px}#catalog button{font-size:14px;touch-action:none}.structure-contract{display:block;width:100%;text-align:left;padding:12px}.library-section>.panel-label,.inspector .panel-label,.execution strong .result-dot{display:none}.execution #output{font-size:24px}.execution strong{font-size:14px}.mobile-dragging main>aside:first-child,.mobile-dragging .ui-tool-window{transform:translateY(85dvh);pointer-events:none}.text-mode main{height:100%;overflow:auto}#text-panel{min-height:100%;padding:14px}#text-source{font-size:14px;min-height:45dvh}.code-heading h2{font-size:17px}
.ui-header{min-height:48px;padding:0 12px}.ui-header nav{gap:12px;font-size:11px}.ui-header .brand{font-size:16px}.ui-title{height:44px;min-height:44px;flex-direction:row;align-items:center;padding:2px 12px}.ui-title h1{font-size:14px}.ui-title #new-ui{font-size:11px;padding:7px 10px;min-height:36px}body:has(#ui-design-stage) main{height:calc(100dvh - var(--mobile-dock-height));display:flex}.design-toolbar{display:none;padding:10px;position:fixed;z-index:140;bottom:var(--mobile-dock-height);left:0;right:0;background:white;border-radius:20px 20px 0 0;box-shadow:0 -8px 30px #17263d25;max-height:55dvh;overflow:auto}.design-toolbar button{font-size:14px;padding:12px}.design-toolbar h2{display:none}body[data-mobile-panel=tools] .design-toolbar{display:flex;flex-wrap:wrap;padding-bottom:70px}#ui-design-canvas{padding:16px;min-height:0}.ui-tool-window{left:0!important;top:auto!important;bottom:var(--mobile-dock-height);width:100%!important;max-width:none!important;height:60dvh;max-height:70dvh;border:0;border-radius:22px 22px 0 0;resize:none;z-index:145!important;box-shadow:0 -12px 40px #17263d28}.ui-window-handle{padding:10px 16px;font-size:15px}.ui-window-body{padding-bottom:62px}.ui-window-body #ui-palette{display:grid;grid-template-columns:1fr 1fr;padding:16px;gap:10px}.ui-window-body #ui-palette button{font-size:15px;padding:14px;min-height:60px}.ui-window-body #ui-design-properties label{font-size:14px;grid-template-columns:1fr 140px}.ui-window-body #ui-design-properties input{font-size:16px}.ui-tool-window .ui-window-handle button{min-width:44px}.design-widget{touch-action:none}body>#error{bottom:calc(var(--mobile-dock-height) + 10px)}
body:has(#project-list){overflow:auto;height:auto;min-height:100dvh}body:has(#project-list)>header{padding:12px;min-height:56px;height:auto}body:has(#project-list) header>a:not(.brand){display:none}body:has(#project-list) main{padding:24px 16px 32px;overflow:visible}body:has(#project-list) h1{font-size:32px;letter-spacing:-.04em}.create-project{padding:20px}.create-project button{display:block;width:100%;margin:10px 0;font-size:15px;min-height:48px}.create-project input{font-size:16px;padding:12px}#project-list p{padding:16px}#project-list button{min-height:44px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
.pwa-notice{position:fixed;z-index:400;bottom:85px;left:12px;right:12px;max-width:560px;margin:auto;padding:16px;display:flex;gap:12px;align-items:center;background:#17263d;color:white;border-radius:14px;box-shadow:0 8px 30px #17263d33;font:14px/1.5 system-ui}.pwa-notice[hidden]{display:none}.pwa-notice button{background:#fff;color:#17263d;border:0;border-radius:8px;padding:10px;min-height:44px;cursor:pointer}

.ui-drag-ghost{position:fixed;z-index:500;pointer-events:none;padding:10px 16px;background:#4167e8;color:white;border-radius:8px;box-shadow:0 4px 20px #17223530;font:13px system-ui}
@media(max-width:700px){body:has(#viewport),body:has(#ui-design-stage){overflow:hidden;width:100%;max-width:100vw}.toolbar .mode-switch{width:auto;flex:0 1 auto}.toolbar #run{width:auto;flex:0 0 auto}.toolbar{width:100%;overflow:hidden}.mobile-dock{width:100%;box-sizing:border-box}.mobile-dock button{letter-spacing:-.02em}.mobile-dock [data-install]{font-size:10px}.app-header{width:100%;box-sizing:border-box}.toolbar .mode-switch button{padding-left:10px;padding-right:10px}}
@media(max-width:700px){body main>aside:first-child,body main>.inspector,body>.execution,.ui-window-body{scroll-padding-bottom:85px;scroll-padding-top:16px}.toolbar .mode-switch button{white-space:nowrap;font-size:11px;padding:6px 9px}.toolbar #run{font-size:12px;padding:9px 12px}.mobile-dock button{font-size:10px}}
@media(max-width:700px){.canvas-tools #show-guide{display:block;font-size:10px;padding:6px;min-width:44px}.canvas-tools #zoom{display:none}.scope-bar .history-actions{display:flex;gap:0}.scope-bar .history-actions button{font-size:0;padding:6px;min-width:36px}.scope-bar .history-actions button::before{content:'↶';font-size:22px}.scope-bar .history-actions button:last-child::before{content:'↷'}.canvas-tools{gap:1px}.canvas-tools #fit-graph{font-size:11px;padding:6px}}
@media(max-width:700px){.canvas-tools{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));margin-left:0;gap:4px;min-width:0}.canvas-tools .history-actions{display:contents}.scope-bar .canvas-tools button{min-width:0!important;padding:4px;font-size:10px}.scope-bar .canvas-tools .history-actions button{font-size:0}.canvas-tools #fit-graph{font-size:10px}}

.drag-ready{outline:3px solid #4167e8;outline-offset:2px}

.pwa-notice{flex-wrap:wrap}.pwa-notice>span{flex:1 0 100%;min-width:0;overflow-wrap:anywhere}.pwa-notice>a{color:#c5d6ff;text-decoration:underline;min-height:44px;display:flex;align-items:center}
