/* V7.5.0 — Blurting Studio dedicated mobile/touch experience.
   Intentionally scoped to data-studio-device="mobile" so desktop is untouched. */
html[data-studio-device="mobile"]{--mobile-safe-bottom:max(10px,env(safe-area-inset-bottom));--mobile-nav-h:76px;--mobile-gutter:10px;scroll-padding-bottom:calc(var(--mobile-nav-h) + 20px)}
html[data-studio-device="mobile"],html[data-studio-device="mobile"] body{width:100%;max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;overscroll-behavior-y:none}
html[data-studio-device="mobile"] body{padding-bottom:calc(var(--mobile-nav-h) + var(--mobile-safe-bottom) + 12px);background:linear-gradient(180deg,#f7fbff 0,#eef5fb 100%)}
html[data-studio-device="mobile"] button,html[data-studio-device="mobile"] a,html[data-studio-device="mobile"] summary,html[data-studio-device="mobile"] label,html[data-studio-device="mobile"] input,html[data-studio-device="mobile"] select,html[data-studio-device="mobile"] textarea{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
html[data-studio-device="mobile"] button:hover:before,html[data-studio-device="mobile"] .primary-link:hover:before,html[data-studio-device="mobile"] .download-button:hover:before{transform:translateX(-180%) rotate(15deg)!important}
html[data-studio-device="mobile"] button:hover,html[data-studio-device="mobile"] .primary:hover,html[data-studio-device="mobile"] .secondary:hover,html[data-studio-device="mobile"] .project:hover,html[data-studio-device="mobile"] .dropzone:hover{transform:none!important}
html[data-studio-device="mobile"] button,html[data-studio-device="mobile"] .primary-link,html[data-studio-device="mobile"] .download-button{min-height:46px}
html[data-studio-device="mobile"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),html[data-studio-device="mobile"] select,html[data-studio-device="mobile"] textarea{min-height:48px;font-size:16px!important;border-radius:14px}
html[data-studio-device="mobile"] textarea{line-height:1.55}

/* Compact mobile header */
html[data-studio-device="mobile"] .topbar{position:sticky;top:0;z-index:4200;padding-top:env(safe-area-inset-top);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
html[data-studio-device="mobile"] .topbar-inner{width:calc(100% - 18px);height:62px;min-height:62px;padding:6px 0;gap:8px}
html[data-studio-device="mobile"] .brand{gap:7px;min-width:0;flex:1}
html[data-studio-device="mobile"] .brand-logo-shell,html[data-studio-device="mobile"] .brand-logo-link:hover .brand-logo-shell,html[data-studio-device="mobile"] .brand-logo-link:focus-visible .brand-logo-shell{width:44px!important;height:44px!important;border-radius:13px!important;box-shadow:0 5px 15px rgba(30,80,124,.08)!important}
html[data-studio-device="mobile"] .brand-logo-shell .brand-mark{width:42px;height:42px;flex-basis:42px}
html[data-studio-device="mobile"] .brand-logo-shell .brand-mark img{width:33px!important;height:37px!important}
html[data-studio-device="mobile"] .brand-full,html[data-studio-device="mobile"] .brand-writing-hand{display:none!important}
html[data-studio-device="mobile"] .brand h1{display:block!important;max-width:42vw;font-size:13px!important;line-height:1.15;white-space:normal!important}
html[data-studio-device="mobile"] .topbar-actions{gap:5px;flex:0 0 auto}
html[data-studio-device="mobile"] .health{display:none!important}
html[data-studio-device="mobile"] .language-switch{padding:2px;border-radius:11px}
html[data-studio-device="mobile"] .lang-btn{min-width:34px;min-height:36px;padding:6px 7px;font-size:10px}
html[data-studio-device="mobile"] .topbar-icon,html[data-studio-device="mobile"] .profile-button{width:38px;height:38px;min-height:38px;border-radius:12px;padding:8px}
html[data-studio-device="mobile"] .profile-popover{position:fixed!important;top:calc(env(safe-area-inset-top) + 62px)!important;right:10px!important;left:10px!important;width:auto!important;max-width:none!important}

/* Touch-first section dock. Existing tab semantics are reused. */
html[data-studio-device="mobile"] .studio-section-tabs{position:fixed!important;z-index:4300!important;left:8px!important;right:8px!important;bottom:calc(6px + env(safe-area-inset-bottom))!important;top:auto!important;width:auto!important;max-width:none!important;margin:0!important;transform:none!important;padding:7px!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;gap:5px!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;scrollbar-width:none;border:1px solid rgba(194,211,228,.92)!important;border-radius:22px!important;background:rgba(250,253,255,.96)!important;box-shadow:0 18px 50px rgba(23,59,96,.24)!important;backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}
html[data-studio-device="mobile"] .studio-section-tabs[hidden]{display:none!important}
html[data-studio-device="mobile"] .studio-section-tabs::-webkit-scrollbar{display:none}
html[data-studio-device="mobile"] .studio-section-tabs button{scroll-snap-align:center;flex:0 0 84px!important;min-width:84px!important;height:58px!important;min-height:58px!important;padding:6px 5px!important;border-radius:15px!important;display:grid!important;grid-template-rows:22px 1fr;place-items:center;gap:2px;font-size:9.5px!important;line-height:1.08;text-align:center;white-space:normal!important;color:#61768c!important;background:transparent!important;border:1px solid transparent!important;box-shadow:none!important}
html[data-studio-device="mobile"] .studio-section-tabs button:before{content:attr(data-mobile-icon)!important;position:static!important;width:auto!important;height:auto!important;background:none!important;transform:none!important;font-size:18px;line-height:1;opacity:1}
html[data-studio-device="mobile"] .studio-section-tabs button.active{color:#0a78c9!important;background:linear-gradient(180deg,#fff,#eef8ff)!important;border-color:#cce6f7!important;box-shadow:0 6px 15px rgba(29,110,170,.12)!important}

/* Main mobile canvas */
html[data-studio-device="mobile"] .page,html[data-studio-device="mobile"] .themes-page,html[data-studio-device="mobile"] .rush-studio-page{width:calc(100% - 16px)!important;margin:10px auto 18px!important;gap:12px!important}
html[data-studio-device="mobile"] .panel,html[data-studio-device="mobile"] .rush-studio-hero,html[data-studio-device="mobile"] .rush-studio-config,html[data-studio-device="mobile"] .rush-studio-preview{border-radius:20px!important}
html[data-studio-device="mobile"] .upload-panel,html[data-studio-device="mobile"] .list-panel,html[data-studio-device="mobile"] .classroom-hero-panel,html[data-studio-device="mobile"] .class-library-panel{padding:16px!important}
html[data-studio-device="mobile"] .section-title{display:flex;flex-direction:column;align-items:stretch;gap:11px;margin-bottom:16px}
html[data-studio-device="mobile"] .section-title h2{font-size:22px;line-height:1.18}
html[data-studio-device="mobile"] .section-title>button{width:100%}
html[data-studio-device="mobile"] .privacy{display:none!important}
html[data-studio-device="mobile"] .source-card{padding:15px;border-radius:17px}
html[data-studio-device="mobile"] .source-heading{align-items:flex-start}
html[data-studio-device="mobile"] .share-import-fields{grid-template-columns:1fr!important;gap:10px}
html[data-studio-device="mobile"] .share-import-button{width:100%;min-height:50px}
html[data-studio-device="mobile"] .drop-grid{grid-template-columns:1fr!important;gap:10px}
html[data-studio-device="mobile"] .dropzone{min-height:138px;padding:18px 14px;border-radius:17px}
html[data-studio-device="mobile"] .dropzone .drop-instruction{font-size:12px;line-height:1.4}
html[data-studio-device="mobile"] .form-actions{display:grid!important;grid-template-columns:1fr;gap:10px;align-items:stretch}
html[data-studio-device="mobile"] .form-actions>*{width:100%!important;min-width:0!important}
html[data-studio-device="mobile"] .advanced-settings summary{min-height:46px;display:flex;align-items:center}
html[data-studio-device="mobile"] .project{display:grid!important;grid-template-columns:1fr;gap:13px;padding:15px!important;border-radius:17px}
html[data-studio-device="mobile"] .project h3{font-size:15px}
html[data-studio-device="mobile"] .project-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;width:100%;justify-content:stretch!important}
html[data-studio-device="mobile"] .project-actions button,html[data-studio-device="mobile"] .project-actions a{min-height:44px;display:flex;align-items:center;justify-content:center;text-align:center;padding:8px;font-size:10.5px}

/* Customize / settings become bottom sheets on touch devices. */
html[data-studio-device="mobile"] .studio-tools-row{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:7px;margin:14px -2px 4px;padding:2px 2px 8px;scroll-snap-type:x proximity;scrollbar-width:none}
html[data-studio-device="mobile"] .studio-tools-row::-webkit-scrollbar{display:none}
html[data-studio-device="mobile"] .studio-tool{flex:0 0 auto;scroll-snap-align:start}
html[data-studio-device="mobile"] .studio-tool>summary{min-height:46px;padding:0 14px;border-radius:14px;transform:none!important}
html[data-studio-device="mobile"] .studio-tool-panel,html[data-studio-device="mobile"] .studio-tool-panel.customize-panel.studio-tool-panel--portal{position:fixed!important;z-index:5200!important;left:8px!important;right:8px!important;bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom) + 8px)!important;top:auto!important;width:auto!important;max-width:none!important;max-height:min(72dvh,760px)!important;padding:16px!important;border-radius:24px 24px 18px 18px!important;overflow:auto!important;overscroll-behavior:contain;box-shadow:0 -18px 55px rgba(24,52,87,.24)!important}
html[data-studio-device="mobile"] .mode-config-grid,html[data-studio-device="mobile"] .mode-node-config,html[data-studio-device="mobile"] .mode-config-row,html[data-studio-device="mobile"] .default-language-setting{grid-template-columns:1fr!important}
html[data-studio-device="mobile"] .mode-config-top,html[data-studio-device="mobile"] .mode-timer-summary,html[data-studio-device="mobile"] .default-language-setting{align-items:flex-start!important;flex-direction:column!important}
html[data-studio-device="mobile"] .timer-chip-list,html[data-studio-device="mobile"] .node-policy-options{gap:8px}
html[data-studio-device="mobile"] .timer-option span,html[data-studio-device="mobile"] .node-policy-option{min-height:40px;padding:8px 11px}

/* Classes */
html[data-studio-device="mobile"] .classroom-hero-panel{grid-template-columns:1fr!important;gap:16px}
html[data-studio-device="mobile"] .classroom-hero-copy h2{font-size:25px!important}
html[data-studio-device="mobile"] .classroom-feature-row{display:flex;overflow-x:auto;flex-wrap:nowrap!important;gap:7px;padding-bottom:3px;scrollbar-width:none}
html[data-studio-device="mobile"] .classroom-feature-row span{flex:0 0 auto;white-space:nowrap}
html[data-studio-device="mobile"] .class-create-card{padding:15px!important;border-radius:18px!important}
html[data-studio-device="mobile"] .teacher-control-grid{grid-template-columns:1fr!important}
html[data-studio-device="mobile"] .class-list{grid-template-columns:1fr!important}

/* Theme Editor: horizontal theme picker + single-column editor. */
html[data-studio-device="mobile"] .theme-editor-hero{padding:17px!important;align-items:flex-start!important;flex-direction:column!important;gap:14px!important}
html[data-studio-device="mobile"] .theme-editor-hero h2{font-size:26px!important}
html[data-studio-device="mobile"] .theme-editor-hero-actions{display:grid!important;grid-template-columns:1fr 1fr;width:100%;gap:8px}
html[data-studio-device="mobile"] .theme-editor-shell{display:block!important;min-height:0!important;overflow:visible!important}
html[data-studio-device="mobile"] .theme-library-pane{padding:14px!important;border-right:0!important;border-bottom:1px solid #e2eaf3;overflow:hidden}
html[data-studio-device="mobile"] .theme-library-head{align-items:center}
html[data-studio-device="mobile"] .theme-list{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(220px,76vw);grid-template-columns:none!important;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;padding:2px 2px 10px;gap:9px;scrollbar-width:none}
html[data-studio-device="mobile"] .theme-list::-webkit-scrollbar{display:none}
html[data-studio-device="mobile"] .theme-card{scroll-snap-align:start;padding:12px;border-radius:17px}
html[data-studio-device="mobile"] .theme-editor-pane{padding:14px!important}
html[data-studio-device="mobile"] .theme-form-head{flex-direction:column!important;gap:13px}
html[data-studio-device="mobile"] .theme-form-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:7px}
html[data-studio-device="mobile"] .theme-editor-grid,html[data-studio-device="mobile"] .theme-colour-grid,html[data-studio-device="mobile"] .theme-brand-grid,html[data-studio-device="mobile"] .theme-cover-grid,html[data-studio-device="mobile"] .theme-sound-grid{grid-template-columns:1fr!important}
html[data-studio-device="mobile"] .theme-config-card{padding:14px!important;border-radius:18px!important}
html[data-studio-device="mobile"] .theme-upload-row{display:grid!important;grid-template-columns:1fr;gap:8px}
html[data-studio-device="mobile"] .theme-upload-row input[type=file]{max-width:100%!important;width:100%}

/* Notes: map first, editor second, each comfortable for touch. */
html[data-studio-device="mobile"] .notes-toolbar,html[data-studio-device="mobile"] .notes-link-row{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}
html[data-studio-device="mobile"] .notes-toolbar>*{min-width:0!important;width:100%!important}
html[data-studio-device="mobile"] .notes-workspace{grid-template-columns:1fr!important;gap:12px!important}
html[data-studio-device="mobile"] .notes-map-card,html[data-studio-device="mobile"] .notes-editor-card{border-radius:20px!important;min-width:0}
html[data-studio-device="mobile"] .notes-map-head{align-items:flex-start!important;flex-direction:column!important;gap:10px!important}
html[data-studio-device="mobile"] .notes-map-stage{height:min(54dvh,520px)!important;min-height:330px}
html[data-studio-device="mobile"] .notes-map-viewport,html[data-studio-device="mobile"] .node-activity-viewport{touch-action:none}
html[data-studio-device="mobile"] .notes-editor-actions,html[data-studio-device="mobile"] .notes-node-entries-head{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}

/* Rush Studio */
html[data-studio-device="mobile"] .rush-studio-hero{padding:17px!important;align-items:flex-start!important}
html[data-studio-device="mobile"] .rush-studio-hero h2{font-size:27px!important}
html[data-studio-device="mobile"] .rush-studio-mark{display:none!important}
html[data-studio-device="mobile"] .rush-studio-shell{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
html[data-studio-device="mobile"] .rush-studio-config,html[data-studio-device="mobile"] .rush-studio-preview{padding:16px!important}
html[data-studio-device="mobile"] .rush-option-grid,html[data-studio-device="mobile"] .rush-language-config,html[data-studio-device="mobile"] .rush-publication-logo-grid{grid-template-columns:1fr!important}
html[data-studio-device="mobile"] .rush-publication-logo-head,html[data-studio-device="mobile"] .rush-studio-section-head{align-items:flex-start!important;flex-direction:column!important}
html[data-studio-device="mobile"] .rush-logo-clear{width:100%}
html[data-studio-device="mobile"] .rush-logo-preview{align-items:flex-start!important;flex-direction:column!important}
html[data-studio-device="mobile"] .rush-logo-preview-frame{width:100%!important;min-height:86px}
html[data-studio-device="mobile"] .rush-studio-actions{display:grid!important;grid-template-columns:1fr!important;gap:8px}
html[data-studio-device="mobile"] .rush-studio-actions button{width:100%}
html[data-studio-device="mobile"] .rush-studio-preview{display:grid!important;grid-template-columns:1fr!important;margin-top:0!important}
html[data-studio-device="mobile"] .rush-preview-screen{grid-row:auto!important;min-height:240px!important;padding:18px!important}
html[data-studio-device="mobile"] .rush-student-entry{display:grid!important;grid-template-columns:1fr!important;align-items:start!important;gap:5px!important}
html[data-studio-device="mobile"] .rush-student-entry code{overflow-wrap:anywhere}

/* Maintenance */
html[data-studio-device="mobile"] .maintenance-hero,html[data-studio-device="mobile"] .maintenance-storage-head,html[data-studio-device="mobile"] .maintenance-toolbar{align-items:flex-start!important;flex-direction:column!important;padding:17px!important}
html[data-studio-device="mobile"] .maintenance-hero-actions,html[data-studio-device="mobile"] .maintenance-storage-actions{display:grid!important;grid-template-columns:1fr!important;width:100%;gap:8px}
html[data-studio-device="mobile"] .maintenance-summary,html[data-studio-device="mobile"] .maintenance-storage-summary,html[data-studio-device="mobile"] .maintenance-asset-list{grid-template-columns:1fr!important}
html[data-studio-device="mobile"] .maintenance-library,html[data-studio-device="mobile"] .maintenance-storage{padding:16px!important}
html[data-studio-device="mobile"] .maintenance-filter{width:100%;overflow-x:auto;scrollbar-width:none}
html[data-studio-device="mobile"] .maintenance-filter button{flex:0 0 auto;min-height:42px}

/* Dialogs become usable full-width mobile surfaces. */
html[data-studio-device="mobile"] dialog:not(.draft-preview-dialog){width:calc(100vw - 12px)!important;max-width:none!important;max-height:calc(var(--studio-visual-height,100dvh) - 18px)!important;margin:auto!important;border-radius:22px!important;padding:16px!important;overscroll-behavior:contain}
html[data-studio-device="mobile"] .review-dialog,html[data-studio-device="mobile"] .published-dialog,html[data-studio-device="mobile"] .project-theme-dialog,html[data-studio-device="mobile"] .theme-preview-dialog,html[data-studio-device="mobile"] .scorm-export-dialog{height:auto!important;overflow:auto!important}
html[data-studio-device="mobile"] .review-grid,html[data-studio-device="mobile"] .issue-grid,html[data-studio-device="mobile"] .metric-grid,html[data-studio-device="mobile"] .branch-inputs,html[data-studio-device="mobile"] .scorm-threshold-grid,html[data-studio-device="mobile"] .scorm-mode-grid{grid-template-columns:1fr!important}
html[data-studio-device="mobile"] .image-stage,html[data-studio-device="mobile"] .preview-card iframe{height:48dvh!important;min-height:300px}
html[data-studio-device="mobile"] .copy-row{display:grid!important;grid-template-columns:1fr!important}
html[data-studio-device="mobile"] .copy-row button,html[data-studio-device="mobile"] .download-button{width:100%}
html[data-studio-device="mobile"] .confirm-actions,html[data-studio-device="mobile"] .dialog-actions{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
html[data-studio-device="mobile"] .close{position:sticky!important;float:right;top:4px;right:4px;width:42px;height:42px;min-height:42px}

/* Workspace gate */
html[data-studio-device="mobile"] .workspace-gate{padding:calc(env(safe-area-inset-top) + 10px) 10px calc(env(safe-area-inset-bottom) + 10px)!important;align-items:center!important;overflow:auto}
html[data-studio-device="mobile"] .workspace-card{width:100%!important;max-width:520px!important;padding:22px 18px!important;border-radius:24px!important}
html[data-studio-device="mobile"] .workspace-form{gap:11px}
html[data-studio-device="mobile"] .workspace-enter{min-height:52px}

/* Very narrow phones */
@media(max-width:390px){
 html[data-studio-device="mobile"] .brand h1{display:none!important}
 html[data-studio-device="mobile"] .studio-section-tabs button{flex-basis:78px!important;min-width:78px!important}
 html[data-studio-device="mobile"] .project-actions,html[data-studio-device="mobile"] .theme-form-actions{grid-template-columns:1fr!important}
 html[data-studio-device="mobile"] .section-title h2{font-size:20px}
}
/* Landscape phones: preserve vertical working area. */
@media(orientation:landscape) and (max-height:560px){
 html[data-studio-device="mobile"]{--mobile-nav-h:64px}
 html[data-studio-device="mobile"] .topbar-inner{height:52px;min-height:52px}
 html[data-studio-device="mobile"] .studio-section-tabs button{height:48px!important;min-height:48px!important;grid-template-rows:18px 1fr}
 html[data-studio-device="mobile"] .studio-section-tabs button:before{font-size:15px}
 html[data-studio-device="mobile"] .studio-tool-panel,html[data-studio-device="mobile"] .studio-tool-panel.customize-panel.studio-tool-panel--portal{max-height:68dvh!important}
}


/* V7.11.0 — committee-reviewed mobile Studio scroll and interaction stabilization. */
html[data-studio-device="mobile"]{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:auto!important;scroll-behavior:smooth}
html[data-studio-device="mobile"] body{height:auto!important;min-height:100dvh!important;max-height:none!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:auto!important;touch-action:pan-y pinch-zoom!important;-webkit-overflow-scrolling:touch!important;position:relative!important}
html[data-studio-device="mobile"] .page,html[data-studio-device="mobile"] .classes-page,html[data-studio-device="mobile"] .themes-page,html[data-studio-device="mobile"] .notes-page,html[data-studio-device="mobile"] .presentation-page,html[data-studio-device="mobile"] .rush-studio-page,html[data-studio-device="mobile"] .maintenance-page{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;touch-action:pan-y!important}
html[data-studio-device="mobile"] .panel:not(.node-activity-dialog),html[data-studio-device="mobile"] section,html[data-studio-device="mobile"] article{max-width:100%;min-width:0}
html[data-studio-device="mobile"] .studio-section-tabs{touch-action:pan-x!important;overscroll-behavior-x:contain!important}
html[data-studio-device="mobile"] .studio-tool-panel,html[data-studio-device="mobile"] dialog[open],html[data-studio-device="mobile"] .profile-popover{touch-action:pan-y!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important}
html[data-studio-device="mobile"] .list-panel,html[data-studio-device="mobile"] .class-library-panel,html[data-studio-device="mobile"] .theme-library,html[data-studio-device="mobile"] .maintenance-library{overflow:visible!important}
html[data-studio-device="mobile"] .project-actions button,html[data-studio-device="mobile"] .project-actions a{white-space:normal!important;line-height:1.2!important}
@media(max-width:480px){html[data-studio-device="mobile"] .page,html[data-studio-device="mobile"] .themes-page,html[data-studio-device="mobile"] .rush-studio-page{width:calc(100% - 10px)!important;margin-top:6px!important}html[data-studio-device="mobile"] .upload-panel,html[data-studio-device="mobile"] .list-panel,html[data-studio-device="mobile"] .classroom-hero-panel,html[data-studio-device="mobile"] .class-library-panel{padding:12px!important}html[data-studio-device="mobile"] .project-actions{grid-template-columns:1fr!important}}
