/* Task-focused phone/tablet shell. Desktop uses the original controls in place. */
.mobile-primary-actions,.mobile-bottom-nav,.mobile-alerts,#mobile-preview-focus {display:none;}
.mobile-sheet:not([open]) {display:none;}
@media(max-width:1024px){
  body.mobile-studio {padding-bottom:0;}
  .mobile-studio .mobile-alerts:not(:empty) {display:block;flex:none;max-height:100px;overflow:auto;}
  .mobile-studio .mobile-alerts .project-conflict {margin:4px 10px;padding:8px;display:flex;flex-wrap:wrap;gap:6px;}
  .mobile-studio > header {flex-wrap:nowrap;padding:8px 10px;gap:8px;min-height:56px;}
  .mobile-studio > header .identity {flex:1;flex-wrap:nowrap;min-width:0;gap:6px;}
  .mobile-studio > header .brand {font-size:16px;}
  .mobile-studio > header .brandmark {width:25px;height:25px;}
  .mobile-studio > header .project {display:none;}
  .mobile-studio .mobile-primary-actions {display:flex;align-items:center;gap:8px;flex:none;}
  .mobile-studio .mobile-primary-actions button {min-height:38px!important;}
  .mobile-studio #mobile-project-open {width:38px;}
  .mobile-studio main {grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;}
  .mobile-studio .layout > :is(.left,.right) {display:none;}
  .mobile-studio .stage {grid-column:1;grid-row:1;min-height:0;padding:8px 10px;gap:0;}
  .mobile-studio .stage > :is(.workspace-scroll,.mobile-nav-host) {display:none!important;}
  .mobile-studio .stage .preview-panel {height:auto;flex:1;min-height:0;gap:8px;}
  .mobile-studio .preview-panel > .bar {flex-wrap:nowrap;min-height:32px;}
  .mobile-studio #activeName {margin-right:auto;max-width:calc(100% - 50px);font-size:9px;}
  .mobile-studio .preview-panel > .bar .push {display:none;}
  .mobile-studio #mobile-preview-focus {display:flex;flex:none;width:34px;min-height:32px!important;margin-left:auto;}
  .mobile-studio .preview-panel .monitor {flex:1;min-height:0;width:100%;border-radius:12px;}
  .mobile-studio .preview-panel .transport {height:auto;min-height:38px;gap:8px;}
  .mobile-studio .transport button {min-height:36px!important;min-width:36px;}
  .mobile-studio .transport #start {display:none;}
  .mobile-studio .transport .time {font-size:10px;white-space:nowrap;}
  .mobile-studio .transport input[type=range] {min-width:24px;flex:1;}
  .mobile-studio .preview-empty {padding:20px;gap:16px;}
  .mobile-studio .preview-empty p {max-width:25em;font-size:12px;}
  .mobile-studio .preview-empty button {min-height:40px!important;}
  .mobile-studio .editor {display:none;grid-row:2;max-height:min(29dvh,240px);padding:7px 10px;}
  .mobile-studio.mobile-timeline-visible .editor {display:flex;}
  .mobile-studio .editor > .toolbar {gap:5px;overflow:visible;}
  .mobile-studio .editor .timeline-controls {width:100%;justify-content:space-between;gap:5px;}
  .mobile-studio .editor .timeline-controls > .eyebrow,.mobile-studio .editor #timeline-toggle,.mobile-studio .editor #assistant-launcher-host,.mobile-studio .editor #duration {display:none;}
  .mobile-studio .editor .timeline-controls button {min-height:34px!important;height:34px;}
  .mobile-studio .timeline .grid {grid-template-columns:118px minmax(0,1fr);}
  .mobile-studio .tracklabels > div {gap:3px;padding:0 4px;}
  .mobile-studio .tracklabels span {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px;overflow-wrap:normal;}
  .mobile-studio .tracklabels b {display:none;}
  .mobile-studio .tracklabels button {min-width:25px;min-height:28px!important;padding:3px!important;font-size:10px!important;}
  .mobile-studio .mobile-bottom-nav {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;flex:none;margin:0;padding:8px 10px max(8px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#0b100ee6;}
  .mobile-studio .mobile-bottom-nav > button {display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-width:0;width:100%;height:54px;min-height:54px!important;padding:5px 3px!important;white-space:nowrap;font-size:10px!important;line-height:1.2!important;border-radius:10px!important;}
  .mobile-studio .mobile-bottom-nav svg {width:21px;height:21px;flex:none;}
  .mobile-studio .mobile-bottom-nav #assistant-open {position:static;box-shadow:none;right:auto;bottom:auto;font-size:10px!important;}
  .mobile-studio .mobile-bottom-nav #assistant-open svg {width:24px;height:24px;}
  .mobile-studio .mobile-icon-button {display:flex;align-items:center;justify-content:center;padding:7px!important;flex:none;}
  .mobile-studio .mobile-icon-button > span {display:none;}
  .mobile-studio .mobile-icon-button svg {width:22px;height:22px;}
  .mobile-studio .mobile-sheet {position:fixed;inset:auto 0 var(--mobile-keyboard-offset,0px);margin:0 auto;width:min(100%,680px);max-width:100%;max-height:min(76dvh,calc(var(--mobile-viewport-height,100dvh) - 16px));padding:0;border:1px solid #c5ed8030;border-bottom:0;border-radius:20px 20px 0 0;background:#101613;color:var(--ink);box-shadow:0 -15px 70px #0006;overflow:hidden;}
  .mobile-studio .mobile-sheet[open] {display:flex;flex-direction:column;}
  .mobile-sheet::backdrop {background:#03070677;}
  .mobile-studio .mobile-sheet-heading {display:flex;align-items:center;gap:10px;padding:12px 14px;flex:none;border-bottom:1px solid var(--line);}
  .mobile-studio .mobile-sheet-heading h2 {margin:0;flex:1;font-size:15px;outline:0;}
  .mobile-studio .mobile-sheet-heading button {width:40px;min-height:40px!important;}
  .mobile-studio .mobile-sheet-content {min-height:0;overflow:auto;overscroll-behavior:contain;padding:14px 14px max(20px,env(safe-area-inset-bottom));}
  .mobile-studio .mobile-sheet-pane {min-width:0;}
  .mobile-studio .mobile-sheet-pane h3 {margin:0 0 12px;color:var(--dim);font-size:11px;}
  .mobile-studio .mobile-sheet .header-actions {display:flex;flex-wrap:wrap;align-items:center;gap:10px;width:100%;}
  .mobile-studio .mobile-sheet .header-actions > :is(button,a) {flex:1 1 140px;text-align:center;white-space:normal;}
  .mobile-studio .mobile-sheet .header-actions :is(button,a,select) {min-height:40px!important;}
  .mobile-studio .mobile-sheet .header-actions .locale-switch {flex:1 1 140px;}
  .mobile-studio .mobile-sheet .header-actions .locale-switch select {flex:1;max-width:none;}
  .mobile-studio .mobile-sheet .header-actions .export-quality {flex:1 1 140px;}
  .mobile-studio .mobile-sheet #production-header {flex:1 0 100%;display:flex;flex-wrap:wrap;gap:10px;}
  .mobile-studio .mobile-sheet #production-header > * {flex:1;min-width:100px;}
  .mobile-studio .mobile-view-actions,.mobile-studio .mobile-upload-actions {display:flex;gap:10px;flex-wrap:wrap;margin:0 0 14px;}
  .mobile-studio :is(.mobile-view-actions,.mobile-upload-actions) > button {flex:1;min-height:40px!important;}
  .mobile-studio .mobile-sheet #nav {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 18px;}
  .mobile-studio .mobile-sheet #nav button {min-height:46px!important;white-space:normal;text-align:left;}
  .mobile-studio .mobile-extra-tools {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;border-top:1px solid var(--line);padding-top:14px;}
  .mobile-studio .mobile-extra-tools button {min-height:42px!important;}
  .mobile-studio .mobile-sheet #shots {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .mobile-studio .mobile-sheet #shots > .note {grid-column:1/-1;}
  .mobile-studio .mobile-sheet #inspector-dock .dock-heading {display:none;}
  .mobile-studio .mobile-sheet .dock-tabs {position:static;padding-top:0;}
  .mobile-studio .mobile-sheet :is(input:not([type=checkbox]):not([type=range]),textarea) {font-size:16px;}
  .mobile-studio .mobile-sheet #inspector-body .fields {grid-template-columns:repeat(2,minmax(0,1fr));}
  .mobile-studio .assistant-panel {right:8px!important;bottom:calc(78px + env(safe-area-inset-bottom) + var(--mobile-keyboard-offset,0px))!important;width:calc(100% - 16px);height:min(640px,calc(var(--mobile-viewport-height,100dvh) - 100px))!important;max-height:calc(var(--mobile-viewport-height,100dvh) - 100px);}
  .mobile-studio .assistant-form textarea {font-size:16px;}
  .mobile-studio .toast {bottom:80px;}
  .mobile-studio.mobile-preview-focus > :is(header,.mobile-bottom-nav),.mobile-studio.mobile-preview-focus .editor {display:none!important;}
  .mobile-studio.mobile-preview-focus .stage {padding:5px;}
}
@media(max-width:360px){.mobile-studio > header .brand{font-size:14px}.mobile-studio > header .brandmark{width:22px;height:22px}.mobile-studio .mobile-primary-actions{gap:5px}.mobile-studio .mobile-primary-actions #export{font-size:11px!important}.mobile-studio .mobile-bottom-nav>button{font-size:9px!important}}

/* One project header, contextual editing, and touch-sized track controls. */
body > header {flex-wrap:nowrap;gap:16px;min-height:58px;}
body > header .identity {flex:1;min-width:0;}
.mobile-primary-actions {display:flex;align-items:center;gap:8px;flex:none;}
.mobile-primary-actions button {display:flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap;}
.mobile-primary-actions svg,.selected-clip-actions svg {width:18px;height:18px;flex:none;}
.mobile-icon-button > span {display:none;}
.mobile-icon-button {display:flex;align-items:center;justify-content:center;width:40px;padding:8px;}
.mobile-icon-button svg {width:22px;height:22px;}
button:not(.primary):not([aria-pressed="true"]):not(.clip) {box-shadow:inset 0 1px 0 #ffffff08;background:#ffffff06;}
button:disabled {opacity:.42;cursor:default;}
.mobile-alerts:not(:empty) {display:block;max-height:100px;overflow:auto;flex:none;}
.mobile-alerts .project-conflict {margin:4px 12px;}
.mobile-sheet {position:fixed;inset:68px 16px auto auto;margin:0;width:min(540px,calc(100vw - 32px));max-height:calc(100dvh - 90px);padding:0;border:1px solid #c5ed8030;border-radius:16px;background:#101613;color:var(--ink);overflow:hidden;box-shadow:0 20px 80px #0007;}
.mobile-sheet[open] {display:flex;flex-direction:column;}
.mobile-sheet-heading {display:flex;gap:10px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line);flex:none;}
.mobile-sheet-heading h2 {font-size:16px;flex:1;margin:0;outline:0;}
.mobile-sheet-content {overflow:auto;overscroll-behavior:contain;padding:16px;min-height:0;}
.mobile-sheet .header-actions {display:flex;flex-wrap:wrap;gap:10px;width:100%;}
.mobile-sheet .header-actions > * {flex:1 1 140px;min-width:0;}
.mobile-sheet .header-actions #production-header {flex-basis:100%;display:flex;flex-wrap:wrap;gap:10px;}
.mobile-sheet .header-actions #production-header > * {flex:1;}
.mobile-sheet .header-actions :is(button,a,select) {min-height:40px;}
.mobile-view-actions {display:flex;gap:8px;margin-bottom:14px;}
.mobile-sheet #project-save-quick {margin-bottom:14px;}
#nav,.mobile-studio .mobile-sheet #nav {display:flex;flex-direction:column;gap:8px;}
.nav-group {border:0;border-bottom:1px solid #ffffff0a;padding:4px 0 10px;}
.nav-group > summary {font-size:11px;font-weight:600;color:var(--dim);cursor:pointer;padding:8px 2px;letter-spacing:.02em;}
.nav-group-items {display:grid;gap:6px;}
.nav-group-items button {width:100%;text-align:left;white-space:normal;}
.clip-story-fields,.clip-advanced-fields {grid-column:1/-1;border-top:1px solid var(--line);margin-top:12px;padding-top:10px;}
.clip-story-fields > summary,.clip-advanced-fields > summary {cursor:pointer;color:var(--dim);font-size:12px;padding:4px 0 10px;}
.clip-story-fields > .fields {display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.timeline-zoom {margin-left:auto;flex:none;}
.timeline-zoom label {display:flex;align-items:center;gap:6px;color:var(--dim);font-size:11px;}
.timeline-zoom select {width:62px;padding:5px 8px;min-height:32px;}
.tracklabels button {display:flex;align-items:center;justify-content:center;}
.tracklabels button svg {width:16px;height:16px;}
.tracklabels span {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;}
.lane .clip:not(.visual-clip) {height:44px;}
.selected-clip-actions {display:none;}
.tool-side-panel {position:fixed;inset:70px 10px auto auto;margin:0;width:330px;max-height:calc(100dvh - 100px);z-index:70;border-radius:14px;box-shadow:0 10px 40px #0005;}
.tool-side-panel .editor-controls,.tool-side-panel .tool-grid {grid-template-columns:1fr;}
.tool-side-panel .transcript-row {grid-template-columns:22px minmax(0,1fr);}
.tool-side-panel .transcript-row textarea {grid-column:1/-1;}
@media(min-width:1025px){
  .timeline .grid {grid-template-columns:146px minmax(0,1fr);}
  body > header .brand {font-size:19px;}
  body > header .project {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;}
  .editor-tool-open .right {visibility:hidden;}
  .tool-side-panel {width:calc(100vw * .25 - 20px);min-width:280px;max-width:380px;}
}
@media(max-width:1024px){
  .mobile-studio .selected-clip-actions:not([hidden]) {display:flex;align-items:center;gap:6px;flex:none;min-width:0;}
  .selected-clip-name {flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dim);font-size:11px;}
  .selected-clip-actions button {display:flex;align-items:center;gap:6px;font-size:11px!important;min-height:40px!important;padding:6px 10px!important;}
  .mobile-studio .mobile-primary-actions button {min-height:44px!important;}
  .mobile-studio #mobile-project-open {width:44px;}
  .mobile-studio .mobile-sheet #nav .nav-group-items {grid-template-columns:repeat(2,minmax(0,1fr));}
  .mobile-studio .mobile-sheet .nav-group summary {font-size:12px;min-height:38px;display:flex;align-items:center;}
  .mobile-studio .mobile-sheet .nav-group summary::before {content:'›';font-size:18px;margin-right:8px;}
  .mobile-studio .mobile-sheet .nav-group[open] summary::before {transform:rotate(90deg);}
  .mobile-studio .editor > .toolbar {flex-wrap:wrap;}
  .mobile-studio .editor .timeline-controls {flex:1 1 auto;width:auto;justify-content:flex-start;}
  .mobile-studio .timeline-zoom label {font-size:0;}
  .mobile-studio .timeline-zoom select {font-size:12px;min-height:34px;}
  .mobile-studio .timeline .grid {grid-template-columns:146px minmax(0,1fr);}
  .mobile-studio .tracklabels > div {gap:2px;padding:0 3px;}
  .mobile-studio .tracklabels button {width:44px;min-width:44px;height:44px;min-height:44px!important;padding:10px!important;}
  .mobile-studio .tracklabels button svg {width:18px;height:18px;}
  .mobile-studio .tracklabels span {font-size:10px;}
  .mobile-studio .mobile-sheet .header-actions .export-quality {flex-direction:column;align-items:flex-start;}
  .mobile-studio #export-download {font-size:11px;max-width:100px;white-space:normal;}
}
@media(min-width:768px) and (max-width:1024px){
  .mobile-studio {--tablet-panel-height:calc(100dvh - 148px);}
  .mobile-studio.mobile-timeline-visible {--tablet-panel-height:calc(100dvh - 148px - min(32dvh,280px));}
  .mobile-studio .mobile-sheet {inset:66px 10px auto auto;width:330px;height:var(--tablet-panel-height);max-width:calc(100vw - 24px);max-height:var(--tablet-panel-height);border:1px solid #c5ed8030;border-radius:14px;z-index:70;box-shadow:0 10px 40px #0005;}
  .mobile-studio.tablet-panel-open .stage,.mobile-studio.editor-tool-open .stage {margin-right:350px;}
  .mobile-studio .mobile-sheet #nav .nav-group-items {grid-template-columns:1fr;}
  .mobile-studio .editor {max-height:min(32dvh,280px);}
  .mobile-studio .tool-side-panel {inset:66px 10px auto auto;height:var(--tablet-panel-height);max-height:var(--tablet-panel-height);width:330px;}
  .mobile-studio .mobile-bottom-nav {padding-right:max(10px,calc((100vw - 600px)/2));padding-left:max(10px,calc((100vw - 600px)/2));}
}
