@media screen {
  html.ipad-device {--tablet-viewport-height:100dvh;-webkit-text-size-adjust:100%;height:100%;overflow:hidden;}
  html.ipad-device body.studio-refined {--studio-header:64px;box-sizing:border-box;display:flex;flex-direction:row;min-width:0;width:100%;height:var(--tablet-viewport-height);min-height:0;max-height:var(--tablet-viewport-height);margin:0;padding:64px 0 0;overflow:hidden;}
  html.ipad-device body.studio-refined #sidebar {display:flex;position:relative;inset:auto;flex:0 0 var(--studio-side);width:var(--studio-side);min-width:var(--studio-side);height:calc(var(--tablet-viewport-height) - 64px);overflow:visible;transform:none;border-right:1px solid #000;z-index:130;}
  html.ipad-device body.studio-refined.workspace-sidebar-hidden:not(.splash-home) #sidebar {flex-basis:0;width:0;min-width:0;border:0;}
  html.ipad-device body.studio-refined #sidebar header#brand {position:fixed;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;inset:0 0 auto;box-sizing:border-box;width:100%;height:64px;min-height:64px;padding:0;background:var(--header-bg);transform:none;}
  html.ipad-device body.studio-refined #brand .brandHeading {position:relative;inset:auto;display:grid!important;place-items:center;flex:0 0 304px;box-sizing:border-box;width:304px;height:100%;min-height:0;padding:0;}
  html.ipad-device body.studio-refined #brand #brandSplash {display:inline-flex;align-items:center;justify-content:center;gap:9px;width:max-content;max-width:100%;min-height:44px;padding:5px 14px;}
  html.ipad-device body.studio-refined #brand .brandLockup>span {display:inline;font-size:22px;}
  html.ipad-device body.studio-refined #brand #brandSplash>.brandMark {width:32px;height:32px;}
  html.ipad-device body.studio-refined #brand #workspaceDock {position:absolute;inset:0 0 0 304px;display:flex;align-items:center;justify-content:center;gap:8px;width:auto;height:100%;margin:0;padding:0 8px;transform:none;}
  html.ipad-device body.studio-refined:is(.writer-sidebar-hidden,.workspace-sidebar-hidden):not(.splash-home) #brand .brandHeading {display:grid!important;}
  html.ipad-device body.studio-refined #brand>.workspaceHeaderPhoto {position:absolute;display:block;z-index:0;left:calc(var(--workspace-photo-rail,304px) + (100% - var(--workspace-photo-rail,304px))/2);top:0;width:calc((100% - var(--workspace-photo-rail,304px))*.82);height:64px;overflow:hidden;transform:translateX(-50%);pointer-events:none;opacity:0;mask-image:linear-gradient(to right,transparent,#000 14%,#000 86%,transparent);}
  html.ipad-device body.studio-refined #brand>.workspaceHeaderPhoto>img {position:absolute;display:block;left:50%;top:50%;width:100%;max-width:none;height:var(--workspace-photo-height,64px);margin:0;object-fit:cover;object-position:var(--workspace-photo-crop);transform:translate(-50%,-50%) translate(var(--workspace-photo-x,0px),0px) scale(var(--workspace-photo-scale,1));filter:grayscale(1) brightness(.78) contrast(1.06);}
  html.ipad-device body.studio-refined #brand>.workspaceHeaderPhoto[data-workspace=write] {--workspace-photo-height:65px;--workspace-photo-crop:50% 62%;}
  html.ipad-device body.studio-refined #brand>.workspaceHeaderPhoto[data-workspace=read] {--workspace-photo-crop:50% 88%;--workspace-photo-scale:1;}
  html.ipad-device body.studio-refined #brand>.workspaceHeaderPhoto[data-workspace=production] {--workspace-photo-crop:50% 42%;--workspace-photo-scale:1.42;}
  html.ipad-device body.studio-refined:not(.splash-home) #brand:has(#writerBtn[aria-pressed=true])>[data-workspace=write],html.ipad-device body.studio-refined:not(.splash-home) #brand:has(#brandHome[aria-pressed=true])>[data-workspace=read],html.ipad-device body.studio-refined:not(.splash-home) #brand:has(#toolsBtn[aria-pressed=true])>[data-workspace=production] {opacity:.52!important;}
  html.ipad-device body.studio-refined #brand .systemGlobalActions {position:absolute;inset:18px 18px auto auto;display:flex;align-items:center;height:28px;margin:0;padding:0;}
  html.ipad-device body.studio-refined #brand #systemFileMenu>summary {box-sizing:border-box;display:grid;place-items:center;width:28px;min-width:0;height:28px;min-height:0;margin:0;padding:0;gap:0;font:500 11px/18px var(--sans);}
  html.ipad-device body.studio-refined #brand #systemFileMenu>summary>svg {width:16px;height:16px;}
  html.ipad-device body.studio-refined #headerSaveStatus {left:calc(var(--studio-side) + 12px);}
  html.ipad-device body.studio-refined #main {position:relative;inset:auto;display:flex;flex-direction:column;flex:1;min-width:0;width:auto;height:calc(var(--tablet-viewport-height) - 64px);min-height:0;margin:0;padding:0;overflow:hidden;}
  html.ipad-device body.studio-refined #sidebar :is(#writerDrawer,#productionDrawer) {flex:1;min-height:0;max-height:none;height:100%;overflow:hidden;}
  html.ipad-device body.studio-refined .workspaceDrawerScroll {overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
  html.ipad-device body.studio-refined #main :is(#writerToolbar,#readerBar,#productionWorkspaceBar) {position:relative;inset:auto;box-sizing:border-box;align-items:center;flex:none;width:100%;height:auto;min-height:0;padding:8px;gap:8px;border-bottom:1px solid #000;overflow:visible;}
  html.ipad-device body.studio-refined #writerToolbar {flex-wrap:nowrap;}
  html.ipad-device body.studio-refined #writerFormatRail {position:relative;display:flex;flex:0 1 auto;min-width:0;min-height:0;height:auto;margin:0;padding:0;}
  html.ipad-device body.studio-refined .studioMobileFormats {display:none;}
  html.ipad-device body.studio-refined :is(#writerPagesView,#writerOutlineView,#readPacket,#script) {min-height:0;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
  html.ipad-device body.studio-refined :is(#writerPaper,#script,.pkContent) {touch-action:pan-x pan-y pinch-zoom;-webkit-user-select:text;user-select:text;}
  html.ipad-device body.studio-refined #readSeek {min-height:16px;touch-action:pan-y;}
  html.ipad-device body.studio-refined :is(.writerNotesToolbar,.readOwnRoleRow,.readCastRow) {gap:8px;}
  html.ipad-device body.studio-refined #sidebar #castList .studioTuneButton.writerCardFold {width:20px;min-width:20px;height:20px;clip-path:none;z-index:2;}
  html.ipad-device body.studio-refined #sidebar #castList .studioCast:has(.studioTuneButton[aria-expanded=true]) {padding-bottom:16px;}
  html.ipad-device body.studio-refined #sidebar #writerDrawer #castSection #readRole {height:100%;}
  html.ipad-device body.studio-refined #sidebar #writerReviewComposer .writerNoteComposerFoot :is(#tabletNoteSave,#writerNoteVoice) {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:28px;min-height:28px;margin:0;padding:0 9px;border:1px solid var(--composer-edge);border-radius:5px;background:var(--surface-1);color:var(--icon-mint);font:500 11px/18px var(--sans);}
  html.ipad-device body.studio-refined #sidebar #writerReviewComposer .writerNoteComposerFoot #writerNoteVoice {margin-left:auto;}
  html.ipad-device body.studio-refined #main #cueBar {z-index:200;}
  html.ipad-device .tabletOutlineGhost {position:fixed!important;z-index:3000!important;box-sizing:border-box;width:240px!important;max-width:240px!important;max-height:180px;overflow:hidden;opacity:.9;pointer-events:none;box-shadow:0 12px 32px #0006;transform:rotate(2deg);}
  html.ipad-device.tablet-board-dragging {user-select:none;-webkit-user-select:none;}
  html.ipad-device body.studio-refined :is(.writerSceneDrag,[data-select-outline-section]) {touch-action:none;}
  html.ipad-device #writerOutlineCards {-webkit-touch-callout:none;}
  html.ipad-device #writerOutlineCards :is(input,textarea,[contenteditable]) {-webkit-touch-callout:default;}
  html.ipad-device body.studio-refined #insWrap {position:relative;inset:auto;width:100%;min-height:0;height:100%;}
  html.ipad-device body.studio-refined :is(#cueBar,#readRoleGuide) {--guide-rail:var(--studio-side);}
  html.ipad-device #tabletSidebarDismiss {display:block;position:fixed;inset:64px 0 0;z-index:120;width:auto;height:auto;margin:0;padding:0;border:0;border-radius:0;background:#0003;}
  html.ipad-device #tabletSidebarDismiss[hidden] {display:none;}
  html.ipad-device.tablet-compact body.studio-refined #sidebar {flex-basis:0;width:0;min-width:0;border:0;}
  html.ipad-device.tablet-compact body.studio-refined #sidebar :is(#writerDrawer,#productionDrawer) {position:fixed;inset:64px auto 0 0;box-sizing:border-box;width:304px;min-width:304px;height:calc(var(--tablet-viewport-height) - 64px);background:var(--panel);border-right:1px solid #000;box-shadow:14px 0 32px #0004;z-index:140;}
  html.ipad-device.tablet-compact body.studio-refined.workspace-sidebar-hidden #sidebar :is(#writerDrawer,#productionDrawer) {display:none;}
  html.ipad-device.tablet-compact body.studio-refined :is(#cueBar,#readRoleGuide) {--guide-rail:0px;}
  /* The desktop controls remain the visual source of truth. Touch support must
     not enlarge an inset face beyond its shared 28px outer frame. */
  html.ipad-device body.studio-refined #brand #workspaceDock>div {display:flex;align-items:center;height:36px;min-height:0;}
  html.ipad-device body.studio-refined #brand #workspaceDock :is(#writerBtn,#brandHome,#toolsBtn) {height:36px;min-height:36px;padding-inline:20px;}
  html.ipad-device:not(.tablet-compact) body.studio-refined.workspace-sidebar-hidden #brand .brandHeading {display:none!important;}
  html.ipad-device:not(.tablet-compact) body.studio-refined.workspace-sidebar-hidden #brand #workspaceDock {left:0;}
  html.ipad-device:not(.tablet-compact) body.studio-refined.workspace-sidebar-hidden #headerSaveStatus {left:12px;}
  html.ipad-device.tablet-compact body.studio-refined #brand {--workspace-photo-rail:304px;}
  html.ipad-device body.studio-refined :is(#writerStatusBar,#readerStatusBar) {padding:0;}
  @media(max-width:980px) {
    html.ipad-device body.studio-refined #brand #workspaceDock :is(#writerBtn,#brandHome,#toolsBtn) {padding-inline:12px;}
    html.ipad-device body.studio-refined #brand #workspaceDock .workspaceLabel {top:-1px;font:650 12px/20px var(--sans);letter-spacing:1.7px;text-transform:uppercase;white-space:nowrap;}
    html.ipad-device body.studio-refined #brand #workspaceDock :is(#writerBtn,#brandHome,#toolsBtn)[aria-pressed=true]::after {bottom:6px;width:calc(100% - 24px);height:1.5px;}
  }
  html.ipad-device body.studio-refined.splash-home #sidebar {flex-basis:0;width:0;min-width:0;border:0;}
  html.ipad-device body.studio-refined.splash-home #sidebar header#brand {background:transparent;border:0;box-shadow:none;}
  html.ipad-device body.studio-refined.splash-home #main {overflow:auto;}
}
@media print {#tabletSidebarDismiss {display:none!important;}}
