/* One rail, one disclosure row, and one content boundary across workspaces. */
@media screen {
  body.studio-refined {--sidebar-inset:16px;--sidebar-row:44px;--sidebar-row-gap:4px;}
  .sidebarScrollEdges {position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden;}
  .sidebarScrollFade {position:absolute;display:block;pointer-events:none;opacity:0;transition:opacity 140ms ease;}
  .sidebarScrollFade[hidden] {display:none;}
  .sidebarScrollFade[data-active="true"] {opacity:1;}
  .sidebarScrollFade[data-edge="top"] {background:linear-gradient(to bottom,var(--panel) 0,var(--panel) 4px,transparent 100%);}
  .sidebarScrollFade[data-edge="bottom"] {background:linear-gradient(to top,var(--panel) 0,var(--panel) 4px,transparent 100%);}
  .sidebarSoftScroll {scroll-padding-top:var(--sidebar-scroll-safe-top,16px);scroll-padding-bottom:16px;}
  .containedScrollEdges {position:fixed;inset:0;z-index:1010;pointer-events:none;overflow:hidden;}
  .containedScrollFade {position:absolute;display:block;pointer-events:none;opacity:0;transition:opacity 140ms ease;}
  .containedScrollFade[hidden] {display:none;}
  .containedScrollFade[data-active="true"] {opacity:1;}
  .containedScrollFade[data-edge="top"] {background:linear-gradient(to bottom,var(--panel) 0,var(--panel) 4px,transparent 100%);}
  .containedScrollFade[data-edge="bottom"] {background:linear-gradient(to top,var(--panel) 0,var(--panel) 4px,transparent 100%);}
  @media(prefers-reduced-motion:reduce) {.containedScrollFade {transition:none;}}
  @media(prefers-reduced-motion:reduce) {.sidebarScrollFade {transition:none;}}
  body.studio-refined #productionNextStep {display:none!important;}

  body.studio-refined #sidebar :is(#writerDrawer,#productionDrawer) {padding:0;overflow:hidden;scrollbar-gutter:auto;}
  body.studio-refined #sidebar #writerDrawer>.workspaceDrawerScroll,
  body.studio-refined #sidebar #sideScroll {
    box-sizing:border-box;display:flex;flex-direction:column;flex:1 1 auto!important;min-height:0;min-width:0;
    width:auto;margin:0 4px 0 0;padding:16px 4px 24px 16px;gap:var(--sidebar-row-gap);
    overflow-x:hidden;overflow-y:auto;scrollbar-gutter:stable;scrollbar-width:auto;
  }
  body.studio-refined #sidebar #writerDrawer>.workspaceDrawerScroll,
  body.studio-refined #sidebar #sideScroll {padding-bottom:24px;}
  body.studio-refined #sidebar #productionDrawer {padding-bottom:24px;}
  body.studio-refined #sidebar #productionDrawer>.workspaceDrawerScroll {
    display:flex;flex-direction:column;min-height:0;min-width:0;width:100%;margin:0;padding:16px 16px 0;
    gap:20px;overflow:hidden!important;scrollbar-gutter:auto;
  }
  body.studio-refined #sidebar :is(#sideScroll,#writerDrawer>.workspaceDrawerScroll,#productionDrawer>.workspaceDrawerScroll)::-webkit-scrollbar {width:8px;}
  body.studio-refined #sidebar :is(#sideScroll,#writerDrawer>.workspaceDrawerScroll,#productionDrawer>.workspaceDrawerScroll)::-webkit-scrollbar-thumb {
    border:2px solid transparent;border-radius:8px;background:var(--line-strong);background-clip:padding-box;
  }
  body.studio-refined #sidebar :is(#sideScroll,#writerDrawer>.workspaceDrawerScroll,#productionDrawer>.workspaceDrawerScroll)::-webkit-scrollbar-track {background:transparent;}

  body.studio-refined #sidebar :is(#writerDrawer .writerSideSection,#sideScroll .section) {flex:none;min-width:0;width:100%;margin:0;padding:0;border:0;background:none;box-shadow:none;}
  body.studio-refined #sidebar #notesPane {flex:none;width:100%;min-width:0;margin:0;padding:0;}
  body.studio-refined #sidebar :is(#writerDrawer .writerDetails>summary,#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary) {
    box-sizing:border-box;display:grid;grid-template-columns:20px minmax(0,1fr) auto 18px;align-items:center;column-gap:10px;
    width:100%;height:var(--sidebar-row);min-height:var(--sidebar-row);margin:0;padding:0 12px;
    border:0;border-radius:7px;background:transparent;box-shadow:none;color:var(--dim);
    font:500 13px/20px var(--sans);text-transform:none;letter-spacing:0;text-align:left;cursor:pointer;list-style:none;
  }
  body.studio-refined #sidebar :is(.writerDetails>summary,.secToggle,.productionCommentsDisclosure>summary)::after {display:none;content:none;}
  body.studio-refined #sidebar :is(.writerDetails>summary,.productionCommentsDisclosure>summary)::-webkit-details-marker {display:none;}
  body.studio-refined #sidebar :is(.writerDetails>summary,.secToggle,.productionCommentsDisclosure>summary):hover {background:var(--surface-2);color:var(--text);}
  body.studio-refined #sidebar :is(.writerDetails[open]>summary,#sideScroll .section.open>.secToggle,.productionCommentsDisclosure[open]>summary) {background:var(--surface-3);color:var(--text);}
  body.studio-refined #sidebar .sidebarSectionIcon {grid-column:1;display:grid;place-items:center;width:20px;height:20px;line-height:0;}
  body.studio-refined #sidebar .sidebarSectionIcon .systemIcon {width:20px;height:20px;}
  body.studio-refined #sidebar .sidebarSectionLabel {grid-column:2;display:block!important;min-width:0;font:inherit;line-height:20px!important;letter-spacing:0;text-transform:none;}
  body.studio-refined #sidebar .sidebarSectionCount {grid-column:3;min-width:0;max-width:110px;margin:0;font:450 11px/18px var(--sans);letter-spacing:0;text-transform:none;color:var(--dim);white-space:nowrap;}
  body.studio-refined #sidebar .sidebarSectionCount:empty {display:none;}
  body.studio-refined #sidebar .sidebarSectionChevron {grid-column:4;display:grid!important;place-items:center;position:static;flex:none;width:18px;height:18px;margin:0;padding:0;border:0;background:none;color:var(--dim);line-height:0;transform:none;}
  body.studio-refined #sidebar .sidebarSectionChevron svg {display:block;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;}

  body.studio-refined #sidebar #productionDrawer #insTabs {display:grid;grid-template-columns:minmax(0,1fr);flex:none;width:100%;height:auto;min-height:0;gap:var(--sidebar-row-gap);margin:0!important;padding:0;border:0;background:none;}
  body.studio-refined #sidebar #productionDrawer #insTabs button {display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;height:var(--sidebar-row);min-height:var(--sidebar-row);margin:0;padding:0 12px;border:0;border-radius:7px;background:none;box-shadow:none;font:500 13px/20px var(--sans);color:var(--dim);text-align:left;}
  body.studio-refined #sidebar #productionDrawer #insTabs button:hover {background:var(--surface-2);color:var(--text);}
  body.studio-refined #sidebar #productionDrawer #insTabs button.active {background:var(--surface-3);color:var(--text);}
  body.studio-refined #sidebar #productionDrawer #insTabs .productionNavLabel {text-align:left;line-height:20px;}

  body.studio-refined #sidebar #writerDrawer .writerDetailsBody,
  body.studio-refined #sidebar #sideScroll .section>.secBody {box-sizing:border-box;width:100%;min-width:0;margin:0;padding:12px 0 16px;max-height:none;overflow:visible;}
  body.studio-refined #sidebar :is(#writerSceneNav,#writerSnapshotList,#sceneList) {box-sizing:border-box;display:grid;gap:8px;width:100%;min-width:0;max-width:none;max-height:none;margin:0;padding:0;overflow:visible;scrollbar-gutter:auto;scrollbar-width:auto;}
  body.studio-refined #sidebar :is(.writerSceneNavItem,.sceneItem,.writerSnapshot) {box-sizing:border-box;min-width:0;width:100%;max-width:none;margin:0;border-radius:7px;}
  body.studio-refined #sidebar #writerSceneNav .writerSceneNavItem {display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:10px;min-height:56px;padding:10px 12px;}
  body.studio-refined #sidebar .writerSceneNavItem>span {display:grid;gap:3px;min-width:0;}
  body.studio-refined #sidebar .writerSceneNavItem b {font-size:12px;line-height:18px;}
  body.studio-refined #sidebar .writerSceneNavItem small {font-size:11px;line-height:17px;}
  body.studio-refined #sidebar #sceneList .sceneItem {grid-template-columns:24px minmax(0,1fr);gap:10px;min-height:56px;padding:10px 12px;}
  body.studio-refined #sidebar #sceneList .sceneItem b {font-size:12px;line-height:18px;}
  body.studio-refined #sidebar #writerSnapshotBtn {width:100%;min-height:36px;margin:0 0 10px;}
  body.studio-refined #sidebar .writerSnapshot {padding:12px;}
  body.studio-refined #sidebar #writerDrawer .writerDetailsBody label {font-size:12px;line-height:18px;text-transform:none;letter-spacing:0;}
  body.studio-refined #sidebar .workspaceBottomDock {padding-inline:16px;}
  body.studio-refined #sidebar .tableReadBottomDock {width:100%;margin-inline:0;}

  @media(min-width:701px) {
    body.studio-refined #productionNextStep:not(.workflowInline) {left:16px;width:calc(var(--studio-side) - 32px);}
    body.studio-refined #sidebar #writerDrawer>.workspaceDrawerScroll,
    body.studio-refined #sidebar #sideScroll {max-height:calc(100dvh - var(--studio-header) - 16px);padding-bottom:16px;}
    body.studio-refined #sidebar #productionDrawer {padding-bottom:16px;}
  }
  @media(min-width:701px) and (max-height:600px) {
    body.studio-refined #sidebar #productionDrawer>.workspaceDrawerScroll {width:auto;margin-right:4px;padding-right:4px;padding-bottom:16px;overflow-x:hidden!important;overflow-y:auto!important;scrollbar-gutter:stable;scrollbar-width:auto;}
    body.studio-refined #sidebar #productionProjectUtilities,
    body.studio-refined #sidebar #productionProjectUtilities>.productionCommentsDisclosure[open],
    body.studio-refined #sidebar #productionProjectUtilities>.productionCommentsDisclosure[open]::details-content,
    body.studio-refined #sidebar #productionDrawer .productionCommentsBody,
    body.studio-refined #sidebar #productionDrawer .productionInlineCommentList {flex:none;}
    body.studio-refined #sidebar #productionDrawer .productionInlineCommentList {width:100%;margin:0;padding:2px 0;max-height:none;overflow:visible;scrollbar-gutter:auto;}
  }

  @media(max-width:700px) {
    body.studio-refined #sidebar :is(#writerDrawer,#productionDrawer) {padding-inline:0;}
    body.studio-refined #sidebar #productionDrawer>.workspaceDrawerScroll {padding-top:16px;}
  }
}
@media print {.sidebarScrollEdges,.containedScrollEdges {display:none!important;}}

/* Writer's approved navigation shell, shared without changing workspace tools. */
@media screen {
  body.studio-refined #sidebar #sideScroll {width:100%;max-height:none;margin:0;padding:0 16px 16px;gap:4px;}
  body.studio-refined #sidebar #productionDrawer>.workspaceDrawerScroll {padding:0 16px;gap:4px;}
  body.studio-refined #sidebar #productionDrawer #insTabs {gap:4px;}
  body.studio-refined #sidebar #sideScroll .section {--sidebar-section-tone:#a9a0c8;}
  body.studio-refined #sidebar #sideScroll #castSection {--sidebar-section-tone:#ce9c83;}
  body.studio-refined #sidebar #sideScroll #sceneSection {--sidebar-section-tone:#80b6a6;}
  body.studio-refined #sidebar #sideScroll #notesSection,
  body.studio-refined #sidebar .productionCommentsDisclosure {--sidebar-section-tone:var(--icon-gold);}
  body.studio-refined #sidebar #productionDrawer #insTabs [data-view="today"] {--sidebar-section-tone:#ce9c83;}
  body.studio-refined #sidebar #productionDrawer #insTabs [data-view="breakdown"] {--sidebar-section-tone:#80b6a6;}
  body.studio-refined #sidebar #productionDrawer #insTabs [data-view="director"] {--sidebar-section-tone:#90abc7;}
  body.studio-refined #sidebar #productionDrawer #insTabs [data-view="ad"] {--sidebar-section-tone:#a9a0c8;}
  body.studio-refined #sidebar #productionDrawer #insTabs [data-view="callsheet"] {--sidebar-section-tone:var(--icon-gold);}
  body.studio-refined #sidebar :is(#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary),
  body.studio-refined #sidebar #productionDrawer #insTabs button {
    box-sizing:border-box;display:flex;align-items:center;justify-content:flex-start;gap:8px;
    width:100%;height:44px;min-height:44px;margin:0;padding:0 11px;
    border:2px solid transparent;border-radius:7px;background:none;box-shadow:none;
    color:var(--text);font:550 14px/20px var(--sans);letter-spacing:-.1px;text-align:left;text-transform:none;
  }
  body.studio-refined #sidebar :is(#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary) .sidebarSectionIcon {flex:none;}
  body.studio-refined #sidebar :is(#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary) .sidebarSectionLabel,
  body.studio-refined #sidebar #productionDrawer #insTabs .productionNavLabel {
    position:relative;top:-1px;display:block;flex:0 1 auto;min-width:0;margin:0;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:inherit;letter-spacing:inherit;text-align:left;line-height:20px;
  }
  body.studio-refined #sidebar :is(#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary) .sidebarSectionCount {
    position:relative;top:-1px;flex:none;margin:0;font:600 14px/20px var(--sans);
    font-variant-numeric:tabular-nums;color:color-mix(in srgb,var(--text) 80%,var(--dim));
  }
  body.studio-refined #sidebar .productionCommentsDisclosure>summary .sidebarSectionCount {max-width:98px;overflow:hidden;text-overflow:ellipsis;font:500 11px/20px var(--sans);}
  body.studio-refined #sidebar :is(#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary) .sidebarSectionChevron {margin-left:auto;flex:none;}
  body.studio-refined #sidebar :is(#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary) .systemIcon,
  body.studio-refined #sidebar #productionDrawer #insTabs button>.systemIcon {flex:none;width:20px;height:20px;color:var(--sidebar-section-tone);}
  body.studio-refined #sidebar :is(#sideScroll .section>.secToggle,.productionCommentsDisclosure>summary) .iconAccent,
  body.studio-refined #sidebar #productionDrawer #insTabs .iconAccent {stroke:var(--text);}
  body.studio-refined #sidebar :is(#sideScroll .section.open>.secToggle,.productionCommentsDisclosure[open]>summary),
  body.studio-refined #sidebar #productionDrawer #insTabs button.active {
    border-color:color-mix(in srgb,var(--sidebar-section-tone) 32%,var(--line));
    background:color-mix(in srgb,var(--sidebar-section-tone) 14%,var(--surface-1))!important;
    color:var(--text);box-shadow:none;
  }
  body.studio-refined #sidebar #sideScroll .section>.secBody {padding:8px 0;}
}
