/* Library R2: existing Bowen palette, clear hierarchy, conversation on demand.
   Scoped to the new page; no global or billing rules. */
.notebook-page[data-library-layout="r2"] .nb-project-current-heading,
.notebook-page[data-library-layout="r2"] .nb-project-current > strong,
.notebook-page[data-library-layout="r2"] .nb-project-current > small,
.notebook-page[data-library-layout="r2"] .nb-workspace-copy small,
.notebook-page[data-library-layout="r2"] .nb-workspace-actions > button[aria-label="资料"] {display:none;}
.notebook-page[data-library-layout="r2"] .nb-project-current {padding:0;margin:0 12px 10px;background:none;border:0;}
.notebook-page[data-library-layout="r2"] .nb-mobile-project-select {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:54px;width:100%;padding:9px 12px;text-align:left;color:var(--color-text);background:var(--color-surface-muted);border:1px solid var(--color-border);border-radius:var(--radius-sm);font-size:15px;font-weight:700;cursor:pointer;}
.notebook-page[data-library-layout="r2"] .nb-mobile-project-select > span:first-child {min-width:0;overflow-wrap:anywhere;}
.notebook-page[data-library-layout="r2"] .nb-mobile-project-select small {display:block;margin-top:3px;font-size:12px;font-weight:400;color:var(--color-text-secondary);}
.notebook-page[data-library-layout="r2"] .nb-mobile-library-tabs {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px;margin:0 12px 10px;border-radius:var(--radius-sm);background:var(--color-surface-muted);}
.notebook-page[data-library-layout="r2"] .nb-mobile-library-tabs button {min-height:40px;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--color-text);font-size:14px;cursor:pointer;}
.notebook-page[data-library-layout="r2"] .nb-mobile-library-tabs button[aria-selected="true"] {background:var(--color-creator);color:white;}
.notebook-page[data-library-layout="r2"] button:focus-visible,
.notebook-page[data-library-layout="r2"] summary:focus-visible,
.notebook-page[data-library-layout="r2"] input:focus-visible {outline:2px solid var(--color-creator);outline-offset:2px;}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-toggle {display:none;}
.notebook-page[data-library-layout="r2"] .nb-library-extra-kinds {margin:0 12px 10px;font-size:13px;}
.notebook-page[data-library-layout="r2"] .nb-library-extra-kinds > summary {padding:10px 0;cursor:pointer;color:var(--color-text-secondary);}
.notebook-page[data-library-layout="r2"] .nb-library-extra-kinds .nb-asset-shortcuts {margin:0;}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-search {display:flex;align-items:center;gap:6px;padding:8px;}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-search input {flex:1;min-width:0;min-height:38px;width:100%;padding:8px;border:1px solid var(--color-border);border-radius:var(--radius-sm);font:inherit;background:var(--color-bg-elevated);color:var(--color-text);}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-search button {min-height:38px;border:0;background:var(--color-surface-muted);border-radius:var(--radius-sm);color:var(--color-text);}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-expand {display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:38px;background:none;border:0;color:var(--color-text-secondary);font-size:18px;cursor:pointer;}
.notebook-page[data-library-layout="r2"] .nb-folder-node-line {gap:2px;}
.notebook-page[data-library-layout="r2"] .nb-folder-filter {min-width:0;}
.notebook-page[data-library-layout="r2"] .nb-folder-filter > span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.notebook-page[data-library-layout="r2"] .nb-folder-actions {flex-shrink:0;}
.notebook-page[data-library-layout="r2"] .nb-workspace-toolbar {padding:12px 16px;gap:10px;}
.notebook-page[data-library-layout="r2"] .nb-workspace-copy > span {display:none;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero {min-height:0;padding:16px;gap:12px;margin-bottom:12px;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-copy > strong {font-size:22px;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-metrics {display:none;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-side {flex:0 0 auto;min-width:0;}
.notebook-page[data-library-layout="r2"] .nb-folder-card-grid {gap:8px;max-height:192px;overflow-y:auto;overscroll-behavior:contain;}
.notebook-page[data-library-layout="r2"] .nb-source-scope-trigger > span:first-child {display:none;}
.notebook-page[data-library-layout="r2"] .nb-folder-card {min-height:54px;}
.notebook-page[data-library-layout="r2"] .nb-folder-card em {display:none;}
.notebook-page[data-library-layout="r2"][data-mobile-pane="library"] .nb-chat-panel {display:none!important;}
@media (min-width:761px) {
.notebook-page[data-library-layout="r2"] .nb-projects-sider {width:252px!important;min-width:252px!important;max-width:252px!important;flex:0 0 252px!important;}
.notebook-page[data-library-layout="r2"] .nb-sidebar-folders {margin:0 12px 10px;min-height:0;flex:1;}
.notebook-page[data-library-layout="r2"] .nb-sidebar-folders .nb-folder-panel {min-height:0;max-height:none;height:100%;}
.notebook-page[data-library-layout="r2"] .nb-sidebar-folders .nb-folder-tree {overflow-y:auto;min-height:0;}
.notebook-page[data-library-layout="r2"] .nb-quota {margin:0 12px 12px;font-size:11px;}
.notebook-page[data-library-layout="r2"] .nb-library-shell {padding:16px;}
.notebook-page[data-library-layout="r2"] .nb-main-canvas {min-width:0!important;}
.notebook-page[data-library-layout="r2"][data-mobile-pane="library"] .nb-main-canvas {width:100%!important;flex:1!important;}
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-chat-panel {display:flex;max-width:56%;}
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-chat-panel.is-focus {max-width:100%;}
}
@media (max-width:760px) {
.notebook-page[data-library-layout="r2"] .notebook-layout,
.notebook-page[data-library-layout="r2"] .nb-projects,
.notebook-page[data-library-layout="r2"] .nb-main,
.notebook-page[data-library-layout="r2"] .nb-workspace,
.notebook-page[data-library-layout="r2"] .nb-workbench-body {height:auto!important;min-height:0!important;}
.notebook-page[data-library-layout="r2"] .nb-projects-sider {width:100%!important;min-width:0!important;max-width:none!important;height:auto!important;max-height:none!important;flex:0 0 auto!important;overflow:visible!important;}
.notebook-page[data-library-layout="r2"] .nb-projects-header {min-height:38px;padding:4px 12px;}
.notebook-page[data-library-layout="r2"] .nb-projects-header-actions button {min-height:38px;min-width:44px;}
.notebook-page[data-library-layout="r2"] .nb-project-current {margin:0 12px 8px;}
.notebook-page[data-library-layout="r2"] .nb-mobile-library-tabs {margin-bottom:8px;}
.notebook-page[data-library-layout="r2"] .nb-mobile-library-tabs button {min-height:44px;}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-toggle {display:flex;align-items:center;justify-content:flex-start;width:calc(100% - 24px);margin:0 12px 8px;padding:8px 12px;min-height:44px;border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-bg-elevated);color:var(--color-text);font-size:14px;text-align:left;}
.notebook-page[data-library-layout="r2"][data-mobile-folders="closed"] .nb-library-extra-kinds,
.notebook-page[data-library-layout="r2"][data-mobile-folders="closed"] .nb-sidebar-folders,
.notebook-page[data-library-layout="r2"][data-mobile-folders="closed"] .nb-quota {display:none!important;}
.notebook-page[data-library-layout="r2"] .nb-sidebar-folders {margin:0 12px 10px;}
.notebook-page[data-library-layout="r2"] .nb-sidebar-folders .nb-folder-panel {max-height:none!important;}
.notebook-page[data-library-layout="r2"] .nb-sidebar-folders .nb-folder-tree {max-height:260px;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
.notebook-page[data-library-layout="r2"] .nb-quota {margin:0 12px 10px;}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-search input {font-size:16px;min-height:44px;}
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-search button,
.notebook-page[data-library-layout="r2"] .nb-mobile-folder-expand {min-height:44px;min-width:44px;}
.notebook-page[data-library-layout="r2"] .nb-workspace-toolbar {padding:6px 12px;min-height:0;gap:6px;}
.notebook-page[data-library-layout="r2"] .nb-workspace-heading,
.notebook-page[data-library-layout="r2"] .nb-workspace-stats {display:none;}
.notebook-page[data-library-layout="r2"] .nb-workspace-actions {display:flex;flex-wrap:wrap;gap:6px;width:100%;}
.notebook-page[data-library-layout="r2"] .nb-workspace-actions .ant-btn {min-height:40px;min-width:44px;padding:4px 12px;}
.notebook-page[data-library-layout="r2"] .nb-workbench-body {display:block!important;overflow:visible!important;}
.notebook-page[data-library-layout="r2"] .nb-main-canvas,
.notebook-page[data-library-layout="r2"] .nb-chat-panel {min-height:0!important;min-width:0!important;max-width:none!important;width:100%!important;height:auto!important;}
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-main-canvas,
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-workspace-toolbar,
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-mobile-folder-toggle,
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-projects-header {display:none!important;}
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-chat-panel {display:flex!important;height:var(--nb-chat-available-height,calc(100dvh - 210px))!important;max-height:var(--nb-chat-available-height,calc(100dvh - 210px))!important;}
.notebook-page[data-library-layout="r2"][data-mobile-pane="chat"] .nb-chat-messages {min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px; -webkit-overflow-scrolling:touch;}
.notebook-page[data-library-layout="r2"] .nb-input-area {flex:0 0 auto;padding:8px 12px calc(8px + env(safe-area-inset-bottom));}
.notebook-page[data-library-layout="r2"] .nb-input-row textarea,
.notebook-page[data-library-layout="r2"] .nb-input-row input {font-size:16px;}
.notebook-page[data-library-layout="r2"] .nb-chat-resize-handle,
.notebook-page[data-library-layout="r2"] .nb-chat-panel-actions button[aria-label="拉宽对话"],
.notebook-page[data-library-layout="r2"] .nb-chat-panel-actions button[aria-label="收窄对话"],
.notebook-page[data-library-layout="r2"] .nb-chat-panel-actions button[aria-label="展开对话"],
.notebook-page[data-library-layout="r2"] .nb-chat-panel-actions button[aria-label="退出对话展开"] {display:none!important;}
.notebook-page[data-library-layout="r2"] .nb-library-shell {padding:10px 12px 16px;overflow:visible;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero {flex-direction:column;align-items:stretch;padding:12px;gap:8px;margin-bottom:10px;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-copy {gap:3px;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-copy > span:first-child {display:none;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-copy > strong {font-size:20px;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-side {width:100%;gap:0;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-actions {display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-start;}
.notebook-page[data-library-layout="r2"] .nb-folder-hero-actions .ant-btn {min-height:44px;padding-inline:10px;}
.notebook-page[data-library-layout="r2"] .nb-folder-card-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:10px;}
.notebook-page[data-library-layout="r2"] .nb-folder-card {min-width:0;padding:10px;}
.notebook-page[data-library-layout="r2"] .nb-folder-card span {overflow-wrap:anywhere;}
.notebook-page[data-library-layout="r2"] .nb-library-filters {gap:6px;grid-template-columns:repeat(2,minmax(0,1fr))!important;margin-bottom:10px;}
.notebook-page[data-library-layout="r2"] .nb-library-filters > :first-child {grid-column:1 / -1;}
.notebook-page[data-library-layout="r2"] .nb-library-filters .ant-input-affix-wrapper,
.notebook-page[data-library-layout="r2"] .nb-library-filters .ant-select-selector {min-height:44px!important;}
.notebook-page[data-library-layout="r2"] .nb-library-filters input,
.notebook-page[data-library-layout="r2"] .nb-library-filters .ant-select-selection-item {font-size:16px;}
.notebook-page[data-library-layout="r2"] .nb-library-row {gap:6px;grid-template-columns:minmax(0,1fr) auto!important;min-height:0;min-width:0;padding:10px;}
.notebook-page[data-library-layout="r2"] .nb-library-row-actions {grid-column:2;grid-row:1;}
.notebook-page[data-library-layout="r2"] .nb-library-row-actions .ant-btn {min-height:44px;min-width:44px;}
.notebook-page[data-library-layout="r2"] .nb-library-tags {grid-column:1 / -1;justify-content:flex-start;max-width:none;}
}
/* A useful error with a retry button is ready content, not a blank boot screen.
   Marker is reference-counted by mounted notebook errors and removed on recovery. */
html[data-bowen-notebook-read-errors] .bowen-page-loading {
  display: none !important;
  pointer-events: none !important;
}
