.focused-notebook{--focus-ink:#203d40;--focus-paper:#fbfaf6;background:var(--focus-paper);border-radius:22px;padding:26px;color:var(--focus-ink)}
.focused-notebook .notebook-heading-row h2{font-size:30px;letter-spacing:-.7px}.focused-notebook .eyebrow{color:#58766c}
.focused-shell{display:grid;grid-template-columns:minmax(260px,33%) minmax(0,1fr);gap:26px;margin-top:20px;align-items:start}
.focused-library{padding:18px;background:#f0f2eb;border-radius:16px;min-width:0}.focused-workspace{min-width:0;background:#fff;border:1px solid #d8e0d7;border-radius:16px;padding:22px;min-height:470px}
.focused-notebook .notebook-search-panel{margin:0 0 12px;padding:0;background:transparent;border:0}.focused-notebook .notebook-search-row{display:flex;flex-wrap:wrap;gap:6px}.focused-notebook .notebook-search-input{width:100%;flex-basis:100%}
.focused-notebook .notebook-list{max-height:65vh;overflow:auto}.focused-notebook .notebook-list-item{border-radius:10px;margin:6px 0;background:#fff}.focused-notebook .notebook-list-item.selected{border-color:#23756b;background:#e6f1eb}
.focused-notebook .notebook-note-meta{margin-top:15px}.focused-notebook .notebook-note-body{white-space:pre-wrap;line-height:1.75;font-family:inherit;background:transparent;border:0;padding:20px 0;overflow-wrap:anywhere}
.focused-notebook .notebook-note{border:0;padding:0;background:transparent}.focused-notebook .notebook-toolbar{gap:9px;align-items:start}.focused-notebook .secondary-action{border-radius:9px}
.focused-storage,.focused-more,.notebook-source-details{border:1px solid #d4ded4;border-radius:10px;padding:12px;margin:12px 0}.focused-more{margin:0}.focused-storage>button{margin:12px 8px 12px 0}summary{cursor:pointer;font-weight:600}
.focused-card{padding:16px;border:1px solid #cbdacf;border-radius:12px;margin:12px 0}.focused-card p{white-space:pre-wrap}.focused-card dl div{display:flex;gap:10px}.focused-card dt{font-weight:600}.focused-card dd{margin:0}
#notebookModal{position:relative;z-index:1200}#notebookChatModal{position:relative;z-index:1100}.notebook-modal-card{max-height:88vh;overflow:auto}.notebook-modal-card .modal-buttons{position:sticky;bottom:-1px;background:var(--panel-bg,#fff);padding:14px 0}
.integration-banner{background:#ffedbd;color:#433816;padding:10px 20px;border-bottom:2px solid #d2ad50;font-size:14px;position:sticky;top:0;z-index:900}.integration-controls{background:#fff8e6;border:1px solid #d2ad50;padding:12px 18px;margin:10px auto;max-width:1400px}.integration-controls button,.integration-controls select{margin:6px;padding:8px}.integration-controls pre{max-height:260px;overflow:auto;white-space:pre-wrap}
@media(max-width:850px){.focused-shell{grid-template-columns:1fr}.focused-library .notebook-list{max-height:320px}.focused-notebook{padding:14px}.focused-workspace{padding:14px}}
@media print{.integration-controls,.integration-banner{display:none}}

.focused-workspace:has(#notebookStudyBuilder .notebook-study-output-card:not(.notebook-study-output-card-collapsed)) #notebookDetail{display:none}

/* The paper workspace stays readable under either inherited app theme. */
.focused-notebook :is(.body-copy,.field-hint,.notebook-study-toolbar-status,#notebookSummary,.notebook-library-heading span,.notebook-item-meta,.notebook-tags,.notebook-row-date){color:#526964}
.focused-notebook :is(.notebook-library-card,.notebook-explorer-card,.notebook-view-toggle,.notebook-folder-current){background:#e8eee7;color:#203d40;border-color:#c8d5ca}
.focused-notebook :is(.notebook-library-heading h3,.notebook-library-heading .eyebrow,.notebook-item-title){color:#203d40}
.focused-notebook :is(.notebook-folder-tab,.notebook-folder-count,.notebook-search-input,.notebook-input){background:#fff;color:#25443e;border-color:#b8cac0}
.focused-notebook :is(.secondary-action,.primary-action,.notebook-view-toggle button){background:#fff;color:#245e51;border:1px solid #b6cbbf}
.focused-notebook .notebook-toolbar>button{background:#235f53;color:#fff;border-color:#235f53}
.focused-notebook .notebook-folder-tab.active,.focused-notebook .notebook-note-row.selected{background:#dcece1;color:#173e32;border-color:#679880}
.focused-notebook .notebook-criteria-panel{background:#fff;color:#203d40}
.focused-notebook .notebook-note-body{color:#203d40}

/* Keep the source list, next actions and generated output in one working viewport. */
.focused-shell{grid-template-columns:minmax(310px,40%) minmax(0,1fr)}
.focused-library{position:sticky;top:58px}.focused-workspace{position:sticky;top:58px;max-height:81vh;overflow:auto}
.focused-notebook .notebook-list{max-height:38vh;overflow:auto;overscroll-behavior:contain}
.result-note-row{display:flex;align-items:start;gap:8px}.result-note-row>.notebook-note-row{flex:1;min-width:0}
.result-note-check{padding:15px 0 0;cursor:pointer}.result-note-check input{width:20px;height:20px;accent-color:#235f53}
.notebook-result-actions{border-top:1px solid #b6cbbf;background:#f0f2eb;padding-top:12px;margin-top:12px}
.notebook-result-actions .action-row{display:flex;gap:7px;flex-wrap:wrap;margin:8px 0}
.notebook-result-actions button{padding:8px 10px;border:1px solid #9eb4a7;border-radius:8px;cursor:pointer}
.notebook-result-actions button:disabled{opacity:.45;cursor:default}.result-build-buttons{display:flex;gap:8px;flex-wrap:wrap}
.focused-notebook .result-build-buttons button{background:#235f53;color:white}.result-selection-count{font-weight:700}
.notebook-result-actions details{margin:10px 0}.notebook-result-actions label{display:block}.notebook-result-actions select{margin:5px;width:95%;color:#203d40;background:white}
.focused-notebook .notebook-study-actions{position:sticky;bottom:0;background:#fff;padding:10px 0;z-index:2}
@media(max-width:850px){.focused-shell{grid-template-columns:1fr}.focused-library,.focused-workspace{position:static;max-height:none}.focused-notebook .notebook-list{max-height:40vh}}

.focused-notebook :is(.notebook-study-output-card,.notebook-study-section,.notebook-study-mini-section,.notebook-empty,.notebook-flipcard,.notebook-flipcard-save-panel){background:#fff;color:#203d40;border-color:#c6d5cb}
.focused-notebook :is(.notebook-study-output-card h3,.notebook-study-output-card h4,.notebook-study-output-card p,.notebook-study-output-card small){color:#203d40}
.focused-notebook .notebook-library-card{display:block}.focused-notebook .notebook-folder-notes{max-height:none;overflow:visible}.focused-notebook .notebook-folder-browser{margin:6px 0}
.focused-notebook .notebook-library-heading{display:none}.focused-notebook .notebook-folder-tabs{max-height:150px;overflow:auto}
.manual-deck-resize-corner-bottom-right{right:2px;bottom:2px;width:22px;height:22px;background:repeating-linear-gradient(135deg,transparent 0 4px,#6da69a 5px 6px);clip-path:polygon(100% 0,100% 100%,0 100%)}

/* Size cards to their actual workspace, including a narrow column on a wide screen. */
.focused-notebook .notebook-flipcard-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))}
.focused-notebook :is(.notebook-study-output-card,.notebook-flipcard,.notebook-flipcard-answer,.focused-deck,.focused-card){min-width:0;max-width:100%;overflow-wrap:anywhere}
.focused-notebook :is(.notebook-flipcard h4,.notebook-flipcard-answer p,.notebook-flipcard-answer em,.focused-card summary,.focused-card p,.focused-card dd){white-space:pre-wrap;overflow-wrap:anywhere}
.focused-notebook .notebook-flipcard-header{flex-wrap:wrap;align-items:flex-start}
.focused-notebook .notebook-flipcard-header>*{min-width:0;max-width:100%}
.focused-notebook .notebook-flipcard small{text-align:left;overflow-wrap:anywhere}
.focused-card dl div{flex-wrap:wrap}.focused-card dt{flex:0 1 auto}.focused-card dd{flex:1 1 180px;min-width:0}
.focused-notebook :is(.notebook-flipcard-save-fields,.notebook-study-modal-grid){grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
.focused-notebook .notebook-flipcard-save-fields>*{min-width:0}
/* The floating editor can be narrower than the browser; fit fields to the window. */
.manual-deck-window-body{min-width:0;min-height:0;overflow-wrap:anywhere}
:is(.manual-deck-fields-grid,.manual-flipcard-meta-grid,.manual-flipcard-sides){grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))}
:is(.manual-flipcard-editor,.manual-flipcard-side,.manual-flipcard-why,.manual-deck-fields-grid label,.manual-flipcard-meta-grid label){min-width:0;max-width:100%}
.manual-deck-window :is(input:not([type=checkbox]),textarea,select),.notebook-modal-card :is(input:not([type=checkbox]),textarea,select){box-sizing:border-box;min-width:0;max-width:100%;width:100%}
.manual-deck-window textarea,.notebook-modal-card textarea{white-space:pre-wrap;overflow-wrap:anywhere;resize:vertical}
.manual-flipcard-editor-header,.manual-deck-window-actions{flex-wrap:wrap}
/* Keep card controls whole while long category labels wrap onto their own line. */
.focused-notebook .notebook-flipcard-identity{flex:0 0 auto}
.focused-notebook .notebook-flipcard-select{white-space:nowrap}
.focused-notebook .notebook-flipcard-select input{flex:0 0 auto;width:18px;height:18px;min-height:18px}
.focused-notebook .notebook-flipcard-header>small{flex:1 1 100px}
.focused-notebook .notebook-flipcard-answer{background:#f0f5f1;color:#203d40}
.focused-notebook .notebook-flipcard-answer em{color:#426158}
