/* Normal desktop and phone navigation remain intact outside explicit writing. */
.sp-mobile-write-start,.sp-mobile-write-done{display:none!important}
@media(max-width:760px){
 .sp-room .sp-mobile-write-start{display:inline-flex!important;grid-column:1/-1;justify-self:start;min-height:44px}
 html.sp-mobile-writing .sidebar,html.sp-mobile-writing .topbar,html.sp-mobile-writing body>.mobile-bottom-nav,
 html.sp-mobile-writing #privacy-footer{display:none!important}
 html.mobile-app-frame.sp-mobile-writing body{grid-template-rows:minmax(0,1fr)}
 html.mobile-app-frame.sp-mobile-writing .shell{grid-template-rows:minmax(0,1fr)}
 html.mobile-app-frame.sp-mobile-writing .main{grid-row:1;overflow:hidden}
 html.sp-mobile-writing .main>.page{height:100%;padding:0!important;margin:0;overflow:hidden!important}
 html.sp-mobile-writing .sp-room{height:100%;max-width:none}
 html.sp-mobile-writing .sp-room>:not(#sp-episode){display:none!important}
 html.sp-mobile-writing #sp-episode{height:var(--sp-visible-height,100dvh);min-height:0;margin:0;padding:0;display:flex;flex-direction:column;overflow:hidden}
 html.sp-mobile-writing .sp-room .sp-writing-bars{position:static;display:block;flex:0 0 auto;margin:0;padding:4px 6px;border-radius:0;max-height:80px}
 html.sp-mobile-writing .sp-writing-bars>:not(.sp-editor-tools){display:none!important}
 html.sp-mobile-writing .sp-room .sp-editor-tools{display:flex!important;gap:4px;overflow:visible;min-height:44px;flex-wrap:wrap!important}
 html.sp-mobile-writing .sp-editor-tools>:is(label,.sp-more-toggle,.sp-secondary-tools){display:none!important}
 html.sp-mobile-writing .sp-room .sp-editor-tools .button{font-size:13px;padding:5px 8px;min-height:44px!important;white-space:nowrap}
 html.sp-mobile-writing .sp-history-controls{display:flex;gap:4px}
 html.sp-mobile-writing .sp-room .sp-editor-tools [data-sp-history]{font-size:0!important;min-width:44px;width:44px;padding:4px}
 html.sp-mobile-writing [data-sp-history]::before{font-size:20px;content:'↶'}
 html.sp-mobile-writing [data-sp-history=redo]::before{content:'↷'}
 html.sp-mobile-writing .sp-room .sp-editor-tools>[data-sp-editor-status]{display:block!important;flex-basis:100%;font-size:11px;line-height:16px;white-space:nowrap;margin:0;padding:0;color:var(--toolbar-ink,var(--ink))}
 html.sp-mobile-writing .sp-mobile-write-done{display:inline-flex!important;margin-left:auto}
 html.sp-mobile-writing .sp-mobile-write-error{flex:0 0 auto;margin:0;padding:8px;background:var(--panel);color:var(--ink);font-size:13px;max-height:80px;overflow:auto}
 html.sp-mobile-writing .sp-room .sp-editor-layout{display:flex;flex:1 1 auto;min-height:0;overflow:hidden}
 html.sp-mobile-writing .sp-writing-column{flex:1;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:12px}
 html.sp-mobile-writing .sp-room .sp-workspace-dock{display:none!important}
 html.sp-mobile-writing .sp-room .sp-paper{margin:0!important;padding:14px 16px;min-height:100%;border-radius:0;width:100%;box-sizing:border-box}
 html.sp-mobile-writing .sp-room .sp-paper :is(input,textarea){font-size:16px!important}
 html.sp-mobile-writing .sp-room .sp-paper textarea{max-height:max(80px,calc(var(--sp-visible-height,100dvh) - 90px));overflow-y:auto!important}
 html.sp-mobile-writing .sp-room .sp-paper .sp-scene{scroll-margin-top:12px}
}
