/* Dedicated touch layout; desktop Studio remains independent. */
html,body{height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
button,select{min-height:44px;height:auto;touch-action:manipulation}button:focus-visible{outline:3px solid #42a6c9;outline-offset:2px}
header{height:74px;min-height:74px;flex-wrap:nowrap;padding:8px 16px;gap:12px}.brand{flex-shrink:0}.brand small{display:block;font-size:9px;letter-spacing:1.3px}.brand strong{font-size:16px}.brand-logo{min-width:44px}.creator-links{flex:1;width:auto;order:0;justify-content:center;font-size:12px}.connection{flex-shrink:0}.header-actions{margin-left:auto}.header-actions button{white-space:nowrap}.primary{background:#236e87!important}
#connect-usb{display:flex;align-items:center;gap:7px;white-space:nowrap;width:auto!important;min-width:125px}.usb-dot{display:inline-block;flex-shrink:0;width:9px;height:9px;border-radius:50%;background:#ce5260}.usb-connected .usb-dot{background:#23ae78}.usb-busy .usb-dot{background:#d79b25}
.toolbar{height:58px;min-height:58px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;gap:8px;flex-wrap:nowrap}.toolbar .group{flex-shrink:0}.toolbar button{white-space:nowrap}.toolbar select{max-width:190px;height:44px}.toolbar .spacer{min-width:0}
#surface{min-height:0;position:relative;flex:1}.workspace-panel{min-width:0}.workspace-tag{display:none}#blocks{touch-action:none}.blocklyToolboxCategory{min-height:49px!important;display:flex;align-items:center}.blocklyToolboxCategoryLabel{font-size:12px!important}.blocklyToolbox{scrollbar-width:thin}.workspace-tools{bottom:18px;right:75px;border-radius:14px;box-shadow:0 3px 18px #17364e18;max-width:none;flex-wrap:nowrap}.workspace-tools button{min-width:42px;padding:0 9px}.workspace-tools #clear{display:none}
#code-panel{position:relative;inset:auto;flex:0 0 40%;width:40%;min-width:290px;z-index:8}#code-panel[hidden]{display:none}#code{font-size:15px;line-height:1.6}.code-heading{flex-wrap:wrap;gap:5px}.code-heading select{max-width:170px}footer{height:44px;min-height:44px;padding:0 12px;gap:7px;font-size:12px}footer button{min-height:38px;white-space:nowrap}#upload-target{padding-right:7px}#log-panel{height:150px;max-height:28dvh}
dialog{width:min(650px,calc(100vw - 24px));max-height:85dvh;padding:22px;overflow:auto}dialog button{min-height:44px}dialog input{font-size:16px}dialog .row{flex-wrap:wrap}.mobile-cards{display:grid;gap:12px}.mobile-card{padding:16px;border:1px solid #d9e4eb;border-radius:14px;background:#f4f8fb}.mobile-card h3{margin:0 0 8px;font-size:16px}.mobile-card p{line-height:1.7;margin:8px 0;color:#566f80}.mobile-card button{margin:4px 8px 0 0}.mobile-card a{color:#276581}.mobile-kicker{color:#6a8494;font-size:12px;letter-spacing:1px}.mobile-card progress{width:100%;height:12px}#mobile-hint{font-size:12px;color:#61768a}.operation-notice{max-height:25dvh;overflow:auto}.mobile-offline{color:#7d6528}
.workspace-panel{isolation:isolate;overflow:hidden}#code-panel{z-index:40}.workspace-tools{z-index:30!important}.connection [hidden]{display:none!important}
#palette-toggle{position:sticky;left:0;z-index:4;box-shadow:5px 0 9px #f3f7fa}
.palette-hidden .blocklyToolbox,.palette-hidden .blocklyToolboxFlyout{display:none!important}
.usb-selected .usb-dot{background:#d79b25}
@media(max-width:699px){.workspace-panel:not(.palette-hidden) .workspace-tag{display:block;position:absolute;inset:auto 12px 78px;z-index:31;padding:10px;border-radius:10px;background:#e8f1f8;color:#294f69;text-align:center;pointer-events:none}}
@media(max-width:700px){footer{display:grid;grid-template-columns:1fr auto;grid-template-rows:24px 22px;height:58px;min-height:58px;align-content:center}footer #upload-target{grid-area:1/1;width:auto}footer #logs{grid-area:1/2;min-height:26px;height:26px}footer #status{grid-area:2/1/3/3;max-width:100%}footer .dot{display:none}}
@media(orientation:portrait){#code-panel{position:absolute;inset:0;width:100%;min-width:0;background:white}}
html[data-theme=dark] .mobile-card{background:#203149;border-color:#35465e}html[data-theme=dark] .mobile-card p{color:#b7ccde}
@media(max-width:1100px){header{padding:7px 10px;gap:8px}.creator-links{display:none}.header-actions{gap:6px}.header-actions button{padding:0 10px}.toolbar{padding:0 10px}.workspace-tools{right:65px}.brand strong{font-size:14px}}
@media(max-width:700px){header{height:112px;min-height:112px;display:grid;grid-template-columns:1fr auto;grid-template-rows:48px 44px;gap:4px 8px}.brand{grid-column:1;grid-row:1}.connection{grid-column:2;grid-row:1}.header-actions{grid-column:1/-1;grid-row:2;display:flex;width:100%;justify-content:space-between}.header-actions button{flex:1;font-size:12px}.brand small{display:block}.toolbar{height:54px;min-height:54px}.toolbar .group{padding-right:6px}.toolbar .group button{padding:0 10px}#code-panel{position:absolute;inset:0;flex:none;width:100%;min-width:0;background:white;box-shadow:none}.workspace-tools{bottom:12px;right:12px}.workspace-tools #fit{max-width:70px}.workspace-tools button{min-width:40px}footer{height:60px;min-height:60px;flex-wrap:wrap;align-content:center;gap:2px 6px}#upload-target{width:calc(100% - 90px);border:none;font-size:11px}footer #logs{order:2;margin-left:auto}footer #status{order:3;max-width:calc(100% - 14px);font-size:11px}footer .dot{order:3}footer .spacer{display:none}dialog{padding:16px;border-radius:18px}.blocklyToolboxCategory{min-height:47px!important}.blocklyToolboxCategoryLabel{font-size:11px!important}.operation-notice{padding:10px!important}}
@media(max-height:540px) and (orientation:landscape){header{height:54px;min-height:54px}.brand-logo{display:none}.toolbar{height:50px;min-height:50px}.workspace-tools{bottom:7px}footer{height:36px;min-height:36px}.creator-links{display:none}#log-panel{height:95px}}
