@media screen {
  /* Keep one Letter-page geometry at every viewport. Native CSS zoom scales
     its full layout, including margins and guides, with normal caret hit testing. */
  body.studio-refined #writerPaperWrap {width:816px;min-width:816px;min-height:1056px;zoom:var(--writer-view-scale,1);transform:none;}
  body.studio-refined #writerPaper {width:816px;min-width:816px;min-height:1056px;padding:96px 96px 96px 144px;border-radius:2px;font:12pt/1 var(--mono);}
  body.studio-refined #writerPaper>.writerBlock[data-type="character"] {width:42%;margin:1em 0 0 39%;}
  body.studio-refined #writerPaper>.writerBlock[data-type="parenthetical"] {width:40%;margin:0 0 0 27%;}
  body.studio-refined #writerPaper>.writerBlock[data-type="dialogue"] {width:60%;margin:0 0 1em 17%;}
  body.studio-refined #writerPagesView {overflow:auto;scroll-behavior:auto;}
  body.studio-refined #writerStatusBar {gap:8px;}
  body.studio-refined #writerStatusBar #writerShortcutHint {margin-left:0;flex:1;min-width:0;}
  body.studio-refined #writerStatusBar #writerStats {flex:none;}
  .workspaceZoom {display:inline-flex;align-items:center;gap:0;flex:none;min-width:0;}
  body.studio-refined .workspaceZoom button {display:grid;place-items:center;flex:none;width:30px;height:30px;min-height:30px;padding:0;border:1px solid var(--line);border-radius:5px 0 0 5px;background:var(--surface-2);color:var(--text);}
  body.studio-refined .workspaceZoom button:last-child {border-radius:0 5px 5px 0;}
  .workspaceZoom svg {display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;}
  body.studio-refined .workspaceZoom select {display:block;flex:none;width:112px;height:30px;min-height:30px;margin:0;padding:4px 26px 4px 10px;border:1px solid var(--line);border-left:0;border-right:0;border-radius:0;appearance:none;background-color:var(--surface-2);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23adb5b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:15px;background-position:right 6px center;color:var(--text);font:12px/1.3 var(--sans);}
  #writerPageZoom {margin-left:auto;}
  body.studio-refined .systemWriterView .systemMenuPanel {min-width:240px;}
  body.studio-refined .systemWriterTools .writerStateTool span {font:400 13px/20px var(--sans);}
  body.studio-refined .systemWriterView .writerViewSwitch {display:flex;flex-direction:column;gap:2px;margin:0 0 8px;padding:0 0 8px;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;background:none;}
  body.studio-refined .systemWriterView .writerViewSwitch button {display:flex;align-items:center;justify-content:flex-start;width:100%;min-height:36px;margin:0;padding:8px 12px;border:0;border-radius:4px;font:13px/20px var(--sans);}
  body.studio-refined .systemWriterView .writerViewSwitch button[aria-selected="true"]::after {content:'✓';margin-left:auto;color:var(--icon-mint);}
  body.studio-refined .systemWriterView .systemSceneNumberDisplay {display:flex;align-items:center;gap:8px;}
  body.studio-refined .systemWriterView .systemSceneNumberDisplay::before {content:'';display:grid;place-items:center;flex:none;width:14px;height:14px;border:1px solid var(--line);border-radius:3px;font:11px/1 var(--sans);}
  body.studio-refined .systemWriterView .systemSceneNumberDisplay[aria-pressed="true"]::before {content:'✓';border-color:var(--icon-mint);color:var(--icon-mint);}
  body.studio-refined .workspaceSpacingField {display:grid;gap:8px;min-width:180px;padding:8px 10px;color:var(--dim);font:12px/18px var(--sans);}
  body.studio-refined .workspaceSpacingField select {width:100%;min-height:36px;margin:0;padding:7px 10px;border:1px solid var(--line);border-radius:5px;background:var(--surface-2);color:var(--text);font:12px/20px var(--sans);}
  body.studio-refined #readerStatusBar {display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;order:2;width:100%;min-height:40px;padding:4px 24px;border-top:1px solid var(--line-soft);background:var(--panel);}
  body.studio-refined #readerStatusBar[hidden] {display:none!important;}
  body.studio-refined #readerStatusBar #readPosition {min-width:0;margin:0;text-align:left;}
  body.studio-refined #readerStatusBar #readerTextZoom {margin-left:auto;}
  body.studio-refined #readerStatusBar .workspaceZoom select {width:112px;}
  /* These are screen annotations; canonical locked numbering still prints normally. */
  body.studio-refined #writerPaper .writerBlock[data-type="scene"][data-view-scene-number]:not([data-view-scene-number=""])::before {content:attr(data-view-scene-number);display:block;position:absolute;top:0;right:auto;left:-54px;width:40px;margin:0;color:#9fa5a1;font:400 12pt/1 var(--mono);letter-spacing:0;text-align:right;pointer-events:none;}
  body.studio-refined[data-writer-scene-numbers="hidden"] #writerPaper .writerBlock[data-type="scene"][data-view-scene-number]:not([data-view-scene-number=""])::before {display:none;}
  .workspaceMobileAppearance {display:none;}
  body.studio-refined #appearanceSettingsPanel {display:block;height:auto;min-height:0;background:var(--panel);}
  body.studio-refined #appearanceSettingsPanel>header {position:static;inset:auto;z-index:auto;display:flex;align-items:center;justify-content:space-between;gap:16px;width:auto;height:auto;min-height:0;margin:0;padding:0 0 16px;border:0;border-bottom:1px solid var(--line-soft);background:none;backdrop-filter:none;-webkit-backdrop-filter:none;transform:none;}
  body.studio-refined #appearanceSettingsPanel .appearanceSettingsBody {position:static;display:block;height:auto;min-height:0;max-height:none;margin:0;padding:0;overflow:visible;background:var(--panel);}
  body.studio-refined #appearanceSettingsPanel .workspaceAppearanceRow {display:grid;grid-template-columns:minmax(0,1fr);gap:8px;min-height:0;margin:0;padding:16px 0;}
  body.studio-refined #appearanceSettingsPanel .workspaceAppearanceRow[hidden] {display:none!important;}
  body.studio-refined #appearanceSettingsPanel .workspaceAppearanceRow:not([hidden])~.workspaceAppearanceRow:not([hidden]) {border-top:1px solid var(--line-soft);}
  body.studio-refined #appearanceSettingsPanel .workspaceAppearanceRow>:is(b,label) {font-size:13px;font-weight:600;}
  body.studio-refined #appearanceSettingsPanel .workspaceReaderSpacing select {justify-self:start;width:170px;max-width:100%;min-height:36px;padding:7px 10px;border:1px solid var(--line);border-radius:5px;background:var(--surface-2);color:var(--text);font:12px/20px var(--sans);}
  body.studio-refined #appearanceSettingsPanel .workspaceAppearanceRow>small {font-size:12px;line-height:1.6;color:var(--dim);}
  body.studio-refined #appearanceSettingsPanel .readerFontControls {justify-self:start;}
  body.studio-refined #appearanceSettingsPanel .workspaceWriterZoom .workspaceZoom {grid-row:auto;}
  body.studio-refined:not(.writer-mode) #appearanceSettingsPanel .workspaceWriterLayout {display:none!important;}
  body.studio-refined #appearanceSettingsPanel .workspaceWriterLayout .writerViewSwitch {display:flex;flex-direction:row;width:100%;gap:4px;padding:3px;border-radius:6px;}
  body.studio-refined #appearanceSettingsPanel .workspaceWriterLayout .writerViewSwitch button {flex:1;min-width:0;height:36px;padding:8px 10px;border-radius:4px;font-size:12px;}
  body.studio-refined #appearanceSettingsPanel #writerOutlineTools {display:flex;align-items:center;margin-top:2px;}
  body.studio-refined #appearanceSettingsPanel .workspaceZoom button,body.studio-refined #appearanceSettingsPanel .workspaceZoom select {height:36px;min-height:36px;}
  body.studio-refined #appearanceSettingsPanel .workspaceZoom select {width:170px;}
  /* The scene strip and Writer toolbar occupy the same row of the workspace. */
  body.studio-refined #writerToolbar {height:56px;min-height:56px;}
  body.studio-refined #readerBar {position:sticky;top:0;left:auto;right:auto;width:100%;max-width:none;height:56px;min-height:56px;margin:0;padding:8px 24px;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;background:var(--bg);box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;}
  body.studio-refined #readerBar .readerBarCopy {display:flex;align-items:center;justify-content:space-between;flex:1;gap:16px;width:100%;min-width:0;margin:0;}
  body.studio-refined #readerScene {min-width:0;max-width:none;font-size:13px;line-height:20px;}
  body.studio-refined #readerSpeaker {max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:20px;}
  @media(max-width:900px) {
    body.studio-refined #appUtilityDock,body.studio-refined #appearanceSettings {display:contents!important;pointer-events:auto;}
    body.studio-refined #appUtilityDock>:not(#appearanceSettings),body.studio-refined #appearanceSettings>#appearanceSettingsBtn {display:none!important;}
    body.studio-refined #sidebar .workspaceMobileAppearance {display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;min-height:40px;margin:0;padding:9px 12px;border:1px solid var(--line);border-radius:6px;background:var(--surface-2);color:var(--text);font:13px/20px var(--sans);text-align:left;}
    .workspaceMobileAppearance svg {display:block;flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}
    body.studio-refined #appearanceSettingsPanel {position:fixed;top:calc(var(--studio-header,64px) + 8px);right:12px;bottom:auto;left:auto;z-index:1100;width:min(340px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - var(--studio-header,64px) - 24px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:8px;background:var(--panel);opacity:1;pointer-events:auto;}
  }
  @media(max-width:700px) {
    body.studio-refined #readerStatusBar {padding:4px 12px;}
    body.studio-refined #readerStatusBar .workspaceZoom select {width:94px;}
    body.studio-refined #readerBar {padding-inline:12px;}
    body.studio-refined #readerBar .readerBarCopy {gap:12px;}
    body.studio-refined #readerScene {font-size:12px;}
    body.studio-refined #readerSpeaker {max-width:90px;font-size:11px;}
    body.studio-refined #writerPagesView {padding:18px 12px 48px;}
    body.studio-refined #writerStatusBar {padding:4px 10px;gap:4px;min-height:42px;}
    body.studio-refined #writerStatusBar #writerStats {flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;}
    body.studio-refined #writerStatusBar #writerShortcutHint,body.studio-refined #writerStatusBar #writerDocumentStatus {display:none;}
    body.studio-refined #writerStatusBar .workspaceZoom select {width:94px;font-size:11px;}
    body.studio-refined #writerStatusBar .workspaceZoom button {width:28px;}
  }
}
@media print {.workspaceZoom,#readerStatusBar {display:none!important;}}
@media screen {
  body.studio-refined #writerPageNumbers {right:26px;width:32px;}
  body.studio-refined #writerPageNumbers .writerPageNumber {display:grid;place-items:center;right:0;width:32px;height:32px;font:12pt/1 var(--mono);font-variant-numeric:tabular-nums;}
  body.studio-refined #writerPageNumbers .writerPageRule {height:12px;transform:translateY(-50%);border-block:1px solid var(--line-strong);background:var(--bg);box-shadow:none;}
}
