/* Schafer Widget System v1 — canonical layout primitives.
   Adopt explicitly using .sch-page, .sch-grid, .sch-widget.
   Legacy .panel remains untouched until each page is verified. */
:root{--sch-content-max:1300px;--sch-page-gutter:38px;--sch-widget-gap:16px;--sch-widget-pad:22px;--sch-widget-radius:14px;--sch-widget-border:var(--line,#e2e6e8)}
.sch-page{box-sizing:border-box;width:100%;max-width:var(--sch-content-max);min-width:0;margin-inline:auto;padding:35px var(--sch-page-gutter) 70px}
.sch-page,.sch-page *{box-sizing:border-box}
.sch-page__title{margin:5px 0 16px;line-height:1.25}
.sch-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--sch-widget-gap);min-width:0;width:100%;align-items:stretch}
.sch-grid--halves{grid-template-columns:repeat(2,minmax(0,1fr))}
.sch-widget{min-width:0;max-width:100%;width:100%;margin:0;background:var(--paper);border:1px solid var(--sch-widget-border);border-radius:var(--sch-widget-radius);padding:var(--sch-widget-pad);box-shadow:0 3px 15px #20304706}
.sch-widget__header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;min-width:0;margin-bottom:16px;flex-wrap:wrap}
.sch-widget__title{font:normal 24px 'EB Garamond',serif;margin:0;line-height:1.25;min-width:0}
.sch-widget__header>.btn{flex:0 0 auto}
.sch-widget__body{min-width:0}
.sch-widget__body>:first-child{margin-top:0}
.sch-widget__actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sch-widget__actions>.btn{min-width:0}
.sch-widget .sch-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr));gap:12px;min-width:0}
.sch-widget .sch-fields>*{min-width:0}
.sch-widget .sch-fields .field{min-width:0;width:100%;max-width:100%}
.sch-widget .sch-index-rows{min-width:0;max-width:100%}
.sch-widget .sch-index-rows>*{min-width:0}
@media(max-width:900px){.sch-page{--sch-page-gutter:24px}}
@media(max-width:780px){.sch-grid--halves{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){.sch-page{--sch-page-gutter:18px}.sch-widget{--sch-widget-pad:18px}}

/* Widget System v2: variants and shared interactive primitives. */
:root{--sch-control-height:40px;--sch-control-radius:9px;--sch-focus:#3a6e96;--sch-muted:#687786}
.sch-grid--thirds{grid-template-columns:repeat(3,minmax(0,1fr))}
.sch-grid--sidebar{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.sch-widget--short{min-height:140px}
.sch-widget--medium{min-height:226px}
.sch-widget--tall{min-height:360px}
.sch-widget--full{grid-column:1/-1}
.sch-widget__subtitle{font-size:13px;color:var(--sch-muted);margin:4px 0 0}
.sch-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:var(--sch-control-height);padding:9px 16px;border:1px solid transparent;border-radius:var(--sch-control-radius);background:var(--navy,#17324b);color:white;cursor:pointer;font:inherit;font-size:13px}
.sch-button--secondary{background:transparent;color:var(--navy,#17324b);border-color:var(--sch-widget-border)}
.sch-button--small{min-height:30px;padding:5px 12px;font-size:12px;border-radius:999px}
.sch-button--danger{background:#9c3f3f;color:white}
.sch-button:disabled{opacity:.5;cursor:not-allowed}
.sch-button:focus-visible,.sch-input:focus-visible,.sch-select:focus-visible,.sch-tab:focus-visible{outline:2px solid var(--sch-focus);outline-offset:2px}
.sch-field{display:flex;flex-direction:column;gap:5px;min-width:0}
.sch-field__label{font-size:12px;font-weight:600;color:var(--navy,#17324b)}
.sch-input,.sch-select{display:block;width:100%;max-width:100%;min-width:0;min-height:var(--sch-control-height);border:1px solid var(--sch-widget-border);border-radius:8px;padding:8px 11px;background:var(--paper,#fff);color:inherit;font:inherit}
.sch-combobox{position:relative;min-width:0}
.sch-combobox__results{position:absolute;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;background:var(--paper,#fff);border:1px solid var(--sch-widget-border);border-radius:8px;z-index:20}
.sch-combobox__option{display:block;width:100%;text-align:left;padding:9px 11px;border:0;background:transparent;cursor:pointer}
.sch-combobox__option:hover,.sch-combobox__option:focus-visible{background:#edf1f4}
.sch-scripture-picker,.sch-date-picker{min-width:0;max-width:100%}
.sch-workspace-tabs{display:grid;min-width:0;max-width:100%;overflow-x:auto}
.sch-workspace-tabs button{min-width:0}
.sch-dialog{width:min(95vw,720px);max-height:90vh;overflow:auto;border:1px solid var(--sch-widget-border);border-radius:14px;padding:0;background:var(--paper,#fff)}
.sch-dialog__header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 22px;border-bottom:1px solid var(--sch-widget-border)}
.sch-dialog__close{margin-left:auto}
.sch-dialog__body{padding:22px;min-width:0}
.sch-dialog__footer{display:flex;align-items:center;gap:10px;padding:14px 22px;border-top:1px solid var(--sch-widget-border)}
.sch-dialog__cancel{margin-right:auto}
.sch-dialog__save{margin-left:auto}
.sch-empty{padding:24px;text-align:center;color:var(--sch-muted)}
.sch-table-wrap{width:100%;max-width:100%;overflow-x:auto}
.sch-table{width:100%;border-collapse:collapse}
.sch-table th,.sch-table td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--sch-widget-border)}
.sch-status{font-size:12px;border-radius:999px;padding:4px 9px;background:#edf1f4;color:#17324b}
@media(max-width:900px){.sch-grid--thirds,.sch-grid--sidebar{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){.sch-dialog__header,.sch-dialog__body,.sch-dialog__footer{padding-inline:16px}}

/* Site-wide migration layer: canonical widget shell and page grid.
   Feature-specific content is intentionally left to each feature. */
#app.main.sch-page,.main.sch-page{box-sizing:border-box!important;width:100%!important;max-width:var(--sch-content-max)!important;min-width:0;margin:0 auto!important;padding:35px var(--sch-page-gutter) 70px!important}
#app.sch-page>.panel,#app.sch-page>.sch-grid>.panel,#app.sch-page>.sermon-top-grid>.panel,#schaferAdminPanel.sch-page>.panel{box-sizing:border-box;min-width:0;max-width:100%;border-radius:var(--sch-widget-radius);padding:var(--sch-widget-pad);border:1px solid var(--sch-widget-border);background:var(--paper)}
#app.sch-page>.sermon-top-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sch-widget-gap);width:100%;min-width:0}
#app.sch-page>.sermon-top-grid>.panel{margin:0}
#app.sch-page>.panel>.row:first-child>h2,#schaferAdminPanel.sch-page>.panel>.row:first-child>h2{margin-top:0}
#app.sch-page .panel>.row:first-child{min-width:0}
#app.sch-page .panel>.row:first-child>.btn{flex-shrink:0}
#app.sch-page .panel .field{max-width:100%}
#app.sch-page .research-workspace-tabs,#app.sch-page .sch-workspace-tabs{max-width:100%}
#app.sch-page .sermon-top-grid+.panel{margin-top:var(--sch-widget-gap)}
#app.sch-page .sch-widget{padding:var(--sch-widget-pad)}
#app.sch-page .sch-grid>.sch-widget{margin:0}
#schaferAdminPanel.sch-page{box-sizing:border-box}
#schaferAdminPanel.sch-page .sch-widget{margin:16px 0}
@media(max-width:900px){#app.main.sch-page,.main.sch-page{padding:24px!important}}
@media(max-width:780px){#app.sch-page>.sermon-top-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){#app.main.sch-page,.main.sch-page{padding:18px!important}}
/* Admin-adjustable design tokens; these feed all standard and migrated widgets. */
:root{--sch-content-max:1300px;--sch-page-gutter:38px;--sch-widget-gap:16px;--sch-widget-pad:22px;--sch-widget-radius:14px;--sch-control-radius:9px;--sch-control-height:40px}

/* Alignment invariant: every main tab has precisely the same page box.
   Override the legacy sermon-only !important rules with a later,
   higher-specificity selector shared by all pages. */
html body .layout #app.main.sch-page[data-view]{box-sizing:border-box!important;width:100%!important;max-width:var(--sch-content-max)!important;min-width:0!important;margin-left:auto!important;margin-right:auto!important;padding:35px var(--sch-page-gutter) 70px!important;position:relative}
html body .layout #app.main.sch-page[data-view]>.sermon-top-grid,
html body .layout #app.main.sch-page[data-view]>.sch-grid{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important}
html body .layout #app.main.sch-page[data-view]>.panel,
html body .layout #app.main.sch-page[data-view]>.sch-grid,
html body .layout #app.main.sch-page[data-view]>.sermon-top-grid{transform:none!important;left:auto!important;right:auto!important}
html body .layout #app.main.sch-page[data-view]>.sermon-top-grid{grid-template-columns:repeat(var(--sermon-top-columns,2),minmax(0,1fr))!important;gap:var(--sch-widget-gap)!important}
@media(max-width:900px){html body .layout #app.main.sch-page[data-view]{padding:24px var(--sch-page-gutter) 70px!important}}
@media(max-width:780px){html body .layout #app.main.sch-page[data-view]>.sermon-top-grid{grid-template-columns:minmax(0,1fr)!important}}
@media(max-width:600px){html body .layout #app.main.sch-page[data-view]{padding:18px var(--sch-page-gutter) 70px!important}}
/* Adjustable typography and widget layout tokens */
:root{--sch-title-size:24px;--sch-body-size:14px;--sch-widget-min-short:140px;--sch-widget-min-medium:226px;--sch-widget-min-tall:360px;--sch-border-width:1px;--sch-tab-height:44px;--sch-dialog-max:720px}
#app.sch-page .sch-widget__title,#schaferAdminPanel.sch-page .sch-widget__title{font-size:var(--sch-title-size)}
#app.sch-page .sch-widget,#schaferAdminPanel.sch-page .sch-widget{border-width:var(--sch-border-width)}
.sch-widget--short{min-height:var(--sch-widget-min-short)}
.sch-widget--medium{min-height:var(--sch-widget-min-medium)}
.sch-widget--tall{min-height:var(--sch-widget-min-tall)}
.sch-workspace-tabs button{min-height:var(--sch-tab-height)}
.sch-dialog{max-width:var(--sch-dialog-max)}

/* Nested Admin Design Studio */
#schaferAdminPanel .sch-design-workspace[hidden],#schaferAdminPanel #schaferDesignStudioEntry[hidden]{display:none!important}
#schaferAdminPanel .sch-design-workspace__columns{display:grid;grid-template-columns:minmax(280px,0.9fr) minmax(0,1.4fr);gap:20px;align-items:start}
#schaferAdminPanel .sch-design-workspace__controls,#schaferAdminPanel .sch-design-workspace__preview{display:flex;flex-direction:column;gap:16px;min-width:0}
#schaferAdminPanel .sch-design-workspace__controls>.sch-widget,#schaferAdminPanel .sch-design-workspace__preview>.sch-widget{margin:0}
#schaferAdminPanel .sch-design-workspace__controls .sch-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
#schaferAdminPanel .sch-design-workspace__preview .sch-grid--halves>.sch-widget{margin:0}
#schaferAdminPanel .sch-design-workspace__preview .sch-widget__title{font-size:var(--sch-title-size)}
#schaferAdminPanel .sch-design-workspace__preview .sch-widget__actions{margin-top:12px}
#schaferAdminPanel .sch-design-workspace__preview .sch-dialog{box-shadow:none}
@media(max-width:1050px){#schaferAdminPanel .sch-design-workspace__columns{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){#schaferAdminPanel .sch-design-workspace__controls .sch-fields{grid-template-columns:minmax(0,1fr)}}

/* Canonical shared page geometry. No tab names or per-page offsets.
   Both top-level panels and nested workspaces inherit this one origin. */
#app.sch-page>.sermon-workspace,
#app.sch-page>.service-workspace,
#app.sch-page>.research-workspace{box-sizing:border-box;width:100%;max-width:100%;min-width:0;margin-left:0;margin-right:0}
#app.sch-page>.sermon-top-grid,
#app.sch-page>.sch-grid,
#app.sch-page>.project-top-widgets,
#app.sch-page>.library-top-widgets{box-sizing:border-box;max-width:100%;min-width:0;margin-left:0;margin-right:0}
#app.sch-page .sermon-index-controls.sch-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr));gap:12px;align-items:end;min-width:0;max-width:100%}
#app.sch-page .sermon-index-controls.sch-fields>.service-field{min-width:0}
#app.sch-page .sermon-index-controls.sch-fields .field{width:100%;max-width:100%;min-width:0}

/* Root cause of small page-to-page horizontal jumps:
   scrollbar presence changes the layout viewport width when a page is taller.
   Reserve the same scrollbar gutter for short and long pages. */
html{scrollbar-gutter:stable}
html body .layout{min-width:0}
html body .layout>#app.main.sch-page{flex:1 1 auto;min-width:0}

/* Bridge the existing site widgets to the same Design Studio tokens.
   Do not require a per-feature rewrite for shared visual settings. */
#app.sch-page .panel,#schaferAdminPanel.sch-page .panel{border-radius:var(--sch-widget-radius);padding:var(--sch-widget-pad);border-width:var(--sch-border-width)}
#app.sch-page .btn,#schaferAdminPanel.sch-page .btn{border-radius:var(--sch-control-radius);min-height:var(--sch-control-height)}
#app.sch-page .panel h2:first-child,#app.sch-page .panel .row:first-child>h2,#schaferAdminPanel.sch-page .panel h2:first-child{font-size:var(--sch-title-size)}
#app.sch-page .research-workspace-tabs button,#app.sch-page .sch-workspace-tabs button{min-height:var(--sch-tab-height)}
#app.sch-page .sermon-top-grid>.panel{min-height:var(--sch-widget-min-medium)}

/* Modal action hierarchy and destructive-action semantics */
:root{--sch-delete-bg:#f8e9e9;--sch-delete-ink:#9a414b;--sch-delete-border:#eacbd0}
button.sch-delete-button,button[onclick*="delete" i]:not(.nav):not(.sch-tag-remove),button[id*="Delete"]:not(.sch-tag-remove){background:var(--sch-delete-bg)!important;color:var(--sch-delete-ink)!important;border:1px solid var(--sch-delete-border)!important;box-shadow:none}
button.sch-delete-button:hover,button[onclick*="delete" i]:not(.nav):not(.sch-tag-remove):hover,button[id*="Delete"]:not(.sch-tag-remove):hover{background:#f2dada!important}
.sch-modal-footer{display:flex;align-items:center;gap:10px;margin-top:20px;flex-wrap:wrap}
.sch-modal-footer .sch-modal-footer-spacer{flex:1 1 auto}
.sch-modal-footer>button{flex-shrink:0}
#libraryModal .sch-modal-footer,#readingModal .sch-modal-footer{justify-content:flex-end}
#libraryModal .library-taxonomy-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:end;min-width:0}
#libraryModal .library-taxonomy-row>.library-form-half{min-width:0;width:100%}
#libraryModal .library-taxonomy-row .library-tag-section>strong{display:block;font-size:12px;font-weight:600;margin-bottom:5px;color:var(--ink)}
#libraryModal .library-taxonomy-row .library-tag-controls{margin-top:0}
#libraryModal .library-taxonomy-row .library-shelf-row{align-items:end}
#libraryModal .library-taxonomy-row .library-tag-controls select{height:42px}
#libraryModal .sch-isbn-label{display:flex;flex-direction:column;align-items:flex-start;gap:5px;font-size:12px;font-weight:600}
#libraryModal .sch-isbn-label input{margin-top:0}
#libraryModal .library-selected-tags .sch-removable-tag{display:inline-flex;align-items:center;gap:6px;padding:4px 7px 4px 10px}
#libraryModal .sch-tag-remove{border:0;background:transparent;color:#455a6a;font-weight:700;font-size:14px;line-height:1;cursor:pointer;padding:1px 3px;border-radius:50%}
#libraryModal .sch-tag-remove:hover{background:#d9e0e6}
@media(max-width:720px){#libraryModal .library-taxonomy-row{grid-template-columns:minmax(0,1fr)}}
@media(max-width:480px){.sch-modal-footer .sch-modal-footer-spacer{flex-basis:100%;height:0;order:0}}

/* Direct-child vertical rhythm: old tab-specific margin:0 rules had collapsed
   the gaps between consecutive top-level widgets. */
#app.sch-page>.panel + .panel,
#app.sch-page>.sch-widget + .sch-widget,
#app.sch-page>.sermon-top-grid + .panel,
#app.sch-page>.sermon-top-grid + .sch-widget,
#app.sch-page>.project-top-widgets + .panel,
#app.sch-page>.library-top-widgets + .panel,
#app.sch-page>.sch-grid + .panel,
#app.sch-page>.sch-grid + .sch-grid{margin-top:var(--sch-widget-gap)!important}
#app.sch-page>.panel,#app.sch-page>.sch-widget{margin-bottom:0}

/* Align the Tags caption and control baseline with Shelf (the Shelf label
   reserves space internally; Tags is a separate block). */
#libraryModal .library-taxonomy-row .library-tag-section{padding:0}
#libraryModal .library-taxonomy-row .library-tag-section>strong{font-size:12px;font-weight:600;line-height:18px;margin:0 0 5px}
#libraryModal .library-taxonomy-row .library-shelf-row label{font-size:12px;font-weight:600}
#schaferFeedbackDialog #schaferFeedbackText{display:block;width:100%;min-height:260px;resize:vertical;line-height:1.6;margin:12px 0 16px}
#schaferFeedbackDialog #schaferFeedbackForm{display:flex;flex-direction:column;gap:10px}
#schaferFeedbackDialog #schaferFeedbackForm .sch-modal-footer{width:100%;justify-content:flex-end}
#biblePlanModal .sch-modal-footer{margin-top:22px}
@media(max-width:720px){#libraryModal .library-taxonomy-row .library-tag-section{padding-top:0}}

/* Shelf and Tags now share a genuine two-row label/control structure.
   Eliminate the old late-injected 5px margin and label's inherited spacing. */
#libraryModal .library-taxonomy-row{align-items:start}
#libraryModal .library-taxonomy-row .library-shelf-row,
#libraryModal .library-taxonomy-row .library-tag-section{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:20px 42px;column-gap:8px;row-gap:5px;align-items:stretch;padding:0;margin:0;min-height:67px}
#libraryModal .library-taxonomy-row .library-shelf-row>label{grid-column:1;grid-row:1/3;display:grid;grid-template-rows:20px 42px;row-gap:5px;align-items:stretch;margin:0;min-width:0}
#libraryModal .library-taxonomy-row .library-shelf-row>label>select{margin:0;height:42px}
#libraryModal .library-taxonomy-row .library-shelf-row>button{grid-column:2;grid-row:2;margin:0;height:42px}
#libraryModal .library-taxonomy-row .library-tag-label{grid-column:1/-1;grid-row:1;display:block;margin:0;padding:0;font-size:12px;font-weight:600;line-height:20px}
#libraryModal .library-taxonomy-row .library-tag-controls{display:contents}
#libraryModal .library-taxonomy-row .library-tag-controls>select{grid-column:1;grid-row:2;margin:0;height:42px;min-width:0;width:100%}
#libraryModal .library-taxonomy-row .library-tag-controls>button{grid-column:2;grid-row:2;margin:0;height:42px}
#libraryModal .library-taxonomy-row .library-tag-picker{grid-column:1/-1}
#app .research-catalog-title{display:block;flex:1;min-width:0;padding:4px 2px;border:0;background:transparent;color:inherit;font:inherit;text-align:left;line-height:1.5;overflow-wrap:anywhere;cursor:pointer}
#app .research-catalog-title:hover,#app .research-catalog-title:focus-visible{text-decoration:underline;text-underline-offset:3px;color:#142c40}

/* Four-column Shelf/Tag manager: icon actions remain visually unboxed. */
#libraryManagerModal .library-taxonomy-manager-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 18px;margin-top:18px}
#libraryManagerModal .library-taxonomy-manager-item{display:flex;align-items:center;gap:7px;min-width:0;min-height:42px;padding:6px 0;border-bottom:1px solid var(--line)}
#libraryManagerModal .library-taxonomy-manager-name{flex:1;min-width:0;overflow-wrap:anywhere;font-size:14px}
#libraryManagerModal .library-taxonomy-manager-actions{display:flex;align-items:center;gap:3px;margin-left:auto;flex:none}
#libraryManagerModal .library-taxonomy-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:26px;padding:3px;border:0!important;border-radius:0;background:transparent!important;color:#203a4f;cursor:pointer;box-shadow:none!important}
#libraryManagerModal .library-taxonomy-icon:hover{color:#0b2237;background:transparent!important}
#libraryManagerModal .library-taxonomy-icon-delete{color:#bd6774!important}
#libraryManagerModal .library-taxonomy-icon-delete:hover{color:#9a414b!important;background:transparent!important}
#libraryCitationModal .library-citation-actions{display:flex;justify-content:flex-end;width:100%}
#libraryTaxonomyModal .sch-modal-footer{justify-content:flex-end}
#readingPlanManagerModal .reading-plan-manager-link{width:100%}
@media(max-width:900px){#libraryManagerModal .library-taxonomy-manager-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:540px){#libraryManagerModal .library-taxonomy-manager-grid{grid-template-columns:minmax(0,1fr)}}

/* Research overview follows the same two-column widget grid as Project workspace. */
.research-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px;align-items:stretch}
.research-overview-grid>.panel{margin:0;min-width:0}
.research-overview-grid .research-next-actions-panel{display:flex;flex-direction:column}
.research-actions-list{margin-top:16px;max-height:380px;overflow-y:auto}
.research-task-row{min-height:46px;gap:10px}
.research-task-row .task-title-link{font:inherit;color:inherit;text-decoration:none;padding:0;min-width:0;overflow-wrap:anywhere}
.research-task-row .task-title-link:hover{text-decoration:underline}
.research-thesis-panel{margin-top:0}
#researchActionDialog .stack-label{display:block;margin:14px 0;font-weight:600}
#researchActionDialog .stack-label .field{display:block;width:100%;margin-top:7px;box-sizing:border-box;font-weight:400}
@media(max-width:780px){.research-overview-grid{grid-template-columns:minmax(0,1fr)}}

/* Next Actions: fixed-height scroll region like All Project Tasks.
   The widget does not grow as actions are added. */
.research-overview-grid>.research-next-actions-panel{min-height:0;min-width:0;height:300px;max-height:300px;overflow:hidden;box-sizing:border-box}
.research-overview-grid>.research-next-actions-panel>.row{flex:0 0 auto}
.research-overview-grid>.research-next-actions-panel>.research-actions-list{flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:16px;padding-right:4px}

/* Research notes: two-column workspace cards and larger rich-text editor. */
.research-note-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:18px}
.research-note-card{border:1px solid #dce3e8;border-radius:15px;padding:20px 22px;min-width:0;background:#fff}
.research-note-card .research-catalog-title{font-size:16px;color:#17324b}
.research-note-card-content{margin-top:12px;white-space:normal;overflow-wrap:anywhere;line-height:1.55;font-size:14px}
.research-note-card-content p{margin:0 0 10px;white-space:pre-wrap}
#researchItemDialog .research-note-field{display:block;margin:16px 0 8px;font-weight:600}
#researchItemDialog .research-note-field>.field{display:block;width:100%;margin-top:7px;box-sizing:border-box;font-weight:400}
#researchItemDialog .research-note-toolbar{display:flex;gap:5px;flex-wrap:wrap;border:1px solid #dce3e8;border-bottom:0;border-radius:9px 9px 0 0;padding:8px;background:#f5f7f8}
#researchItemDialog .research-note-toolbar button{background:#fff;border:1px solid #dce3e8;border-radius:5px;padding:6px 10px;color:#17324b;cursor:pointer}
#researchItemDialog .research-note-editor{min-height:300px;max-height:52vh;overflow:auto;padding:16px;border:1px solid #cbd5dd;border-radius:0 0 9px 9px;background:white;line-height:1.6;outline-offset:2px}
#researchItemDialog .research-note-source-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:14px}
#researchItemDialog .research-note-book-matches{position:relative;max-height:180px;overflow:auto;border:1px solid #dce3e8;border-radius:8px;margin-top:4px;background:white}
#researchItemDialog .research-note-book-matches[hidden]{display:none}
#researchItemDialog .research-note-book-result{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #edf0f2;padding:9px 12px;background:white;cursor:pointer;color:#17324b}
#researchItemDialog .research-note-book-result:hover{background:#f0f4f7}
#researchItemDialog .research-note-footer{display:flex;align-items:center;gap:10px;margin-top:22px}
@media(max-width:720px){.research-note-cards,#researchItemDialog .research-note-source-grid{grid-template-columns:minmax(0,1fr)}}

/* Project-to-workspace assignment and searchable library-source picker */
#projectAssignWorkspaceDialog .project-archive-choice{display:flex;align-items:center;gap:9px;margin:18px 0;font-size:14px;color:#17324b}
#projectAssignWorkspaceDialog .project-archive-choice input{width:18px;height:18px;accent-color:#102d42}
#projectAssignWorkspaceDialog #projectAssignedWorkspaces{margin-top:16px}
#projectAssignWorkspaceDialog #projectAssignedWorkspaces .line{display:flex;align-items:center;justify-content:space-between;gap:12px}
#researchSourceDialog label{display:block;margin:12px 0;position:relative}
#researchSourceDialog #researchSourceMatches{max-height:225px;overflow-y:auto;border:1px solid #dce3e8;border-radius:8px;background:#fff;margin-top:5px}
#researchSourceDialog #researchSourceMatches[hidden]{display:none}
#researchSourceDialog #researchSourceMatches .research-note-book-result{display:block;width:100%;text-align:left;padding:9px 12px;border:0;border-bottom:1px solid #edf0f2;background:#fff;cursor:pointer;color:#17324b}
#researchSourceDialog #researchSourceMatches .research-note-book-result:hover{background:#f0f4f7}



/* Pilot action hierarchy: the shape is invariant across component families. */
:root{--sch-control-radius:999px;--sch-title-size:26.667px}
html body button,html body input[type="submit"],html body input[type="button"],html body label.btn{border-radius:999px!important}
html body .sch-action-primary:not(.sch-component-control){background:var(--navy)!important;color:white!important;border:1px solid transparent!important}
html body .sch-action-secondary:not(.sch-component-control){background:#edf1f4!important;color:var(--ink)!important;border:1px solid transparent!important}
html body .sch-action-tertiary:not(.sch-component-control){background:transparent!important;color:var(--navy)!important;border:0!important;box-shadow:none!important;text-decoration:none;text-underline-offset:3px}
html body .sch-action-tertiary:not(.sch-component-control):hover,html body .sch-action-tertiary:not(.sch-component-control):focus-visible{text-decoration:underline}
html body .sch-action-delete{background:var(--sch-delete-bg)!important;color:var(--sch-delete-ink)!important;border:1px solid var(--sch-delete-border)!important}
html body .sch-action-delete:hover{background:#f2dada!important}
.sch-action-footer{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px;width:100%;margin-top:20px;grid-column:1/-1}
.sch-action-footer>.sch-action-delete{order:-1;margin-left:0!important;margin-right:auto!important}
.sch-action-footer>.sch-action-primary{margin-left:0!important}
.sch-widget.sch-action-stack{display:flex;flex-direction:column}
.sch-widget>.sch-action-footer{margin-top:auto;padding-top:20px}
html body .sch-widget__title,html body .panel>h2:first-child,html body .panel>.row:first-child>h2{font-family:'EB Garamond',serif!important;font-size:var(--sch-title-size)!important}
.sch-confirm{width:min(500px,95vw);border:1px solid var(--line);border-radius:14px;padding:24px;box-shadow:0 20px 70px #142c4033}
.sch-confirm h2{margin-bottom:14px}.sch-confirm p{white-space:pre-wrap}
.sch-confirm .sch-action-primary{order:2}

/* Schedule cards are content surfaces, not action pills. */
html body :is(.day,.overview-day,.overview-month-day,.service-day,.reading-day-card,.reading-calendar-cell,[data-schedule-card]){border-radius:9px!important}

/* Preserve sidebar contrast and reserve visible space for account controls. */
html body .side #sidebarAccountButton{color:#d6e0e6!important;background:transparent!important;min-height:40px}
html body .side #sidebarAccountButton:hover,html body .side #sidebarAccountButton:focus-visible{color:#fff!important;background:#2a465c!important}
html body .side{overflow-y:hidden!important}
.side>.brand,.side>.tag,.side>.desk-view-picker{flex-shrink:0}
html body .side #navs{flex:1 1 auto;min-height:70px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#496176 transparent}
html body .side .sidebar-account-footer{flex-shrink:0;position:relative!important;z-index:6}

/* One shared view picker; switching moves the selected bubble. */
.desk-view-picker{position:relative;isolation:isolate;display:grid;grid-template-columns:1fr 1fr;gap:0;padding:3px;border-radius:999px;background:#edf1f4;width:210px;max-width:100%;margin:10px 0}
.desk-view-picker[hidden]{display:none!important}
.desk-view-picker::before{content:'';position:absolute;z-index:-1;top:3px;bottom:3px;left:3px;width:calc(50% - 3px);border-radius:999px;background:var(--navy);transform:translateX(0);transition:transform .2s ease}
.desk-view-picker[data-selected="student"]::before{transform:translateX(100%)}
html body .desk-view-picker .desk-view-choice{position:relative;min-width:0;min-height:30px;margin:0;padding:5px 10px;border:0!important;background:transparent!important;color:var(--ink)!important;font-size:12px;font-weight:400;text-decoration:none!important;box-shadow:none!important}
html body .desk-view-picker .desk-view-choice[aria-pressed="true"]{color:#fff!important}
.desk-view-picker--sidebar{width:100%;margin:0 0 10px;background:#ffffff14}
.desk-view-picker--sidebar::before{background:#36546b}
html body .desk-view-picker--sidebar .desk-view-choice{color:#c5d4df!important}
html body .desk-view-picker--sidebar .desk-view-choice[aria-pressed="true"]{color:#fff!important}
.desk-account-preferences{border-bottom:1px solid var(--line);padding:8px 0 18px;margin-bottom:18px}
.desk-picker-hide{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:300;margin-top:12px}
.desk-picker-hide input{width:16px;height:16px;flex-shrink:0;accent-color:var(--navy)}
.workspace-home-widget{min-height:750px}
@media(prefers-reduced-motion:reduce){.desk-view-picker::before{transition:none}}
@media(max-width:600px){html body .side{height:auto!important;max-height:none!important;overflow:visible!important}html body .side #navs{flex:none;min-height:0;overflow-x:auto;overflow-y:hidden}.desk-view-picker--sidebar{width:210px;margin-top:8px}.workspace-home-widget{min-height:min(750px,80dvh)}}

/* Shared action feedback and single-line control dimensions. */
html body :is(.sch-action-primary,.sch-action-secondary):hover,
html body :is(.sch-action-primary,.sch-action-secondary):focus-visible{text-decoration:underline;text-underline-offset:3px}
html body :is(button.btn,button.sch-button,label.btn){height:var(--sch-control-height)!important;min-height:var(--sch-control-height)!important}
html body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="image"]),
html body select:not([multiple]):not([size]),
html body .schafer-select-trigger{box-sizing:border-box;height:var(--sch-control-height)!important;min-height:var(--sch-control-height)!important;border-radius:999px!important}
/* Multi-line writing areas retain their usable height and generous corners. */
html body textarea,html body [contenteditable="true"]{border-radius:20px!important}
html body :is(label.library-choice,label.research-tag-option,label:has(>input[type="checkbox"]):not(.task-check-label),label:has(>input[type="radio"])){box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;gap:8px;min-height:var(--sch-control-height)!important;border-radius:999px!important;padding:7px 12px;background:#edf1f4!important;color:var(--ink);border:1px solid transparent}
html body label:has(>input[type="checkbox"]):not(.task-check-label)>input,
html body label:has(>input[type="radio"])>input{flex-shrink:0;accent-color:var(--navy)}

/* Library keeps its established two-row action grid and centered citation action. */
html body #app .library-top-widgets{grid-template-columns:minmax(0,3fr) minmax(190px,1fr)}
html body #app .library-actions>div{grid-template-rows:repeat(2,var(--sch-control-height))}
html body #app .library-actions button{width:100%;height:var(--sch-control-height)!important;min-height:var(--sch-control-height)!important}
html body #app .library-actions .library-import-btn{background:#F0EADF!important;color:#142c40!important;border:1px solid #D6D0C6!important}
html body #app .library-actions .library-import-btn:hover{background:#e5dccb!important}
html body #app .library-citation-card,html body #app .project-study-widget{display:flex;flex-direction:column;gap:0}
html body #app .library-citation-card>h2,html body #app .project-study-widget>h2{align-self:stretch}
html body #app .library-citation-card>.btn,html body #app .project-study-widget>.btn{align-self:center;margin:auto 0!important;flex-shrink:0;width:auto}

/* Workspace home: one-third chooser, two-thirds detail panels in a 2:2:1 ratio. */
#app .workspace-home-widget{height:750px;min-height:750px;display:flex;flex-direction:column;gap:18px}
.workspace-home-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:20px;flex:1;min-height:0;min-width:0}
.workspace-home-list{overflow-y:auto;min-height:0;min-width:0;border-right:1px solid var(--line);padding-right:14px;scrollbar-gutter:stable}
.workspace-home-panels{display:grid;grid-template-rows:minmax(0,2fr) minmax(0,2fr) minmax(0,1fr);gap:14px;min-height:0;min-width:0}
.workspace-home-panel{display:flex;flex-direction:column;min-height:0;min-width:0;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--paper)}
html body .workspace-home-panel h3{font:normal 22px/1.2 'EB Garamond',serif;margin:0 0 10px}
.workspace-panel-list{min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}
.workspace-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px;flex-shrink:0}
.workspace-panel-heading h3{margin:0!important}
.workspace-panel-heading .workspace-show-all{height:auto!important;min-height:0!important;padding:2px 0;font-size:12px}
.workspace-select-row{display:flex;align-items:center;gap:6px;margin-bottom:8px;min-width:0;border-radius:999px;padding:3px}
.workspace-select-row.is-selected{background:#edf1f4}
html body .workspace-select-row .workspace-selection{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1px;flex:1;min-width:0;text-align:left;padding:4px 10px;font-size:13px;line-height:1.1}
.workspace-selection>span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .workspace-select-row .workspace-go-to{flex:none;width:auto;gap:8px;padding:8px 12px;font-size:12px;white-space:nowrap}
.workspace-task-row{display:flex;align-items:center;gap:12px;min-width:0;padding:7px 0;border-bottom:1px solid var(--line)}
html body .workspace-task-row .workspace-task-title{height:auto!important;min-height:0!important;flex:1;min-width:0;text-align:left;justify-content:flex-start;overflow-wrap:anywhere;padding:2px 0;font-size:13px}
.workspace-task-row>.small{flex-shrink:0;text-align:right}
.workspace-quick-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:auto}
.workspace-quick-buttons .btn{width:100%;font-size:13px;padding:8px;min-width:0}
@media(max-width:780px){#app .workspace-home-widget{height:auto;min-height:750px}.workspace-home-layout{grid-template-columns:minmax(0,1fr);flex:none}.workspace-home-list{max-height:220px;border-right:0;border-bottom:1px solid var(--line);padding:0 0 12px}.workspace-home-panels{height:650px}html body #app .library-top-widgets{grid-template-columns:minmax(0,1fr)}html body #app .library-citation-card{min-height:170px}}
@media(max-width:440px){.workspace-home-panel{padding:12px}.workspace-home-layout{gap:14px}.workspace-task-row{align-items:flex-start;flex-wrap:wrap;gap:4px}.workspace-task-row>.small{width:100%;text-align:left}.workspace-quick-buttons{gap:6px}}
html body #app .library-top-widgets .panel>h2{margin:0 0 16px!important}

/* Wider, symmetric page footprint; migrated Design Studio defaults use this too. */
:root{--sch-content-max:1600px}
html body .main{max-width:var(--sch-content-max)!important}
html body .sch-pager-button{width:var(--sch-pager-width,100px)!important;min-width:0!important;text-align:center!important;justify-content:center!important;flex-shrink:0}

/* Workspace: 800px tall and columns in a 1:3:1 proportion. */
html body #app .workspace-home-widget{height:800px;min-height:800px}
.workspace-home-layout{grid-template-columns:minmax(0,1fr) minmax(0,3fr) minmax(0,1fr)}
.workspace-home-next-days{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0;border-left:1px solid var(--line);padding-left:14px}
.workspace-home-next-days h3{font:normal 22px/1.2 'EB Garamond',serif;margin:0;flex-shrink:0}
.workspace-day-stack{display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:10px;flex:1;min-height:0}
.workspace-day-stack .day{width:100%;height:100%;min-height:0;overflow-y:auto;flex-shrink:0}
.workspace-day-stack .day .task{-webkit-line-clamp:3}

/* Research catalogue actions share the same lower baseline in every card. */
html body #app .research-project-card{display:flex;flex-direction:column;min-height:220px}
html body #app .research-project-card .research-workspace-card-actions{margin-top:auto;padding-top:12px;flex-shrink:0}
html body #app .research-workspace-tabs{border-radius:999px;padding:0;overflow:hidden}
html body #app .research-workspace-tabs button{border:0;border-radius:999px!important}
.research-overview-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:18px;align-items:stretch}
.research-overview-column{min-width:0;min-height:0;height:380px;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px;padding:16px;overflow:hidden}
.research-overview-column h3{font:normal 22px/1.2 'EB Garamond',serif;margin:0 0 14px}
.research-context-column{overflow-y:auto}
.research-context-column>label:first-child{margin-top:0!important;font:normal 22px/1.2 'EB Garamond',serif}
.research-context-column textarea{display:block;margin-top:8px;min-height:100px!important;font:300 14px/1.5 Inter,sans-serif}
.research-attached-projects{overflow-y:auto;min-height:0;display:flex;flex-direction:column;gap:8px}
html body .research-attached-projects>.btn{height:auto!important;min-height:40px;justify-content:flex-start;text-align:left;white-space:normal;overflow-wrap:anywhere;padding:7px 0;flex-shrink:0}
.research-overview-column .research-next-actions{display:flex;flex-direction:column;min-height:0;height:100%;margin:0}
.research-overview-column .research-next-actions>.row{flex-wrap:wrap;margin-bottom:12px;flex-shrink:0}
.research-overview-column .research-next-actions h3{margin:0}
.research-action-list{min-height:0;overflow-y:auto}
.research-next-action{display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:7px}
.research-next-action .research-action-text{grid-column:2;min-width:0;width:100%}
.research-next-action .research-round-btn{grid-column:2;justify-self:start;font-size:12px;padding:0}
.research-next-action .research-pencil{grid-column:3;grid-row:1;min-width:22px}
.research-next-action:has(input[type="checkbox"]:checked) .research-action-text{text-decoration:line-through;opacity:.65}
@media(max-width:1100px){html body #app .workspace-home-widget{height:auto;min-height:800px}.workspace-home-layout{grid-template-columns:minmax(0,1fr) minmax(0,3fr)}.workspace-home-panels{height:650px}.workspace-home-next-days{grid-column:1/-1;border-left:0;border-top:1px solid var(--line);padding:14px 0 0;height:260px}.workspace-day-stack{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:minmax(0,1fr)}.research-overview-columns{grid-template-columns:minmax(0,1fr)}.research-overview-column{height:360px}}
@media(max-width:780px){.workspace-home-layout{grid-template-columns:minmax(0,1fr)}.workspace-home-list{max-height:220px}.research-workspace-grid{grid-template-columns:minmax(0,1fr)!important}}
@media(max-width:600px){.workspace-home-next-days{height:650px}.workspace-day-stack{grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(3,minmax(0,1fr))}.research-workspace-tabs{grid-template-columns:repeat(5,minmax(100px,1fr))!important;overflow-x:auto!important}}

/* Workspaces keeps its widget height without a vacant page footer. */
html body .layout #app.main.sch-page[data-view="workspace"]{padding-top:18px!important;padding-bottom:0!important}
@media(min-width:1101px){.workspace-home-next-days{position:relative;gap:0}.workspace-home-next-days>h3{position:absolute;left:14px;bottom:calc(100% + 18px);margin:0;white-space:nowrap}.workspace-day-stack{height:100%}}

/* Planner quick actions remain together instead of creating an extra footer. */
html body #app .planner-quick-panel{min-height:0!important;height:auto!important;padding-bottom:18px}
.planner-quick-actions{margin-top:4px!important;margin-bottom:0;align-items:center}
.planner-quick-panel .planner-upload{display:inline-flex;align-items:center;justify-content:center}
.planner-day-heading{margin-top:18px;align-items:center;flex-wrap:wrap}
.planner-day-heading h2{margin:0}
.planner-day-heading .controls{margin:0}
.planner-day-task-line{display:flex;align-items:center;gap:9px;min-width:0;flex:1}
.planner-day-task-line .task-title-link{text-align:left;overflow-wrap:anywhere}
.planner-day-panels-widget{margin-top:16px}
.planner-day-task-carousel{display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 42px)/4);gap:14px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;padding-bottom:12px;min-width:0}
.planner-day-task-panel{display:flex;flex-direction:column;min-width:0;min-height:200px;border:1px solid var(--line);border-radius:14px;background:var(--bg);padding:16px;scroll-snap-align:start}
.planner-day-task-panel>.task-title-link{text-align:left;font-size:15px;line-height:1.4;overflow-wrap:anywhere;padding:0}
.planner-task-panel-notes{max-height:100px;overflow:auto;overflow-wrap:anywhere}
.planner-day-task-panel>.task-check-label{margin-top:auto;padding-top:12px}

/* Shared day cards: one task list, with priority events above and meetings below. */
.calendar>.day:not(.empty-day){height:230px;min-height:230px}
article.day{cursor:pointer;display:flex;flex-direction:column;gap:7px;overflow:hidden}
html body button.planner-day-open{border:0;background:transparent!important;color:var(--ink)!important;font-size:12px;font-weight:600;padding:0;min-width:0;text-align:left}
.planner-day-open:hover{text-decoration:underline!important}
.planner-card-tasks{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;gap:5px;width:100%}
.planner-card-task{display:flex;align-items:center;gap:6px;min-width:0;flex-shrink:0;color:#98582e}
.planner-card-task.is-complete{color:#26734a}
html body button.planner-card-task-title{display:block;flex:1;min-width:0;max-width:100%;padding:0;border:0;background:transparent!important;color:inherit!important;font-size:11px;line-height:1.45;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.planner-card-task .task-circle{width:15px;height:15px;flex-basis:15px;margin:0;border-color:#b08a42}
.planner-card-task .task-circle:checked{background:#26734a;border-color:#26734a}
.planner-card-task .task-circle:checked:after{font-size:10px;line-height:12px}
.planner-day-top-events,.planner-day-meetings{display:flex;flex-direction:column;gap:4px;flex-shrink:0;width:100%;max-height:32%;overflow-y:auto}
.planner-day-meetings{margin-top:auto}
html body button.planner-day-event{display:block;width:100%;min-width:0;border:0;padding:5px 8px;font-size:11px;line-height:1.3;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}
html body button.planner-day-event--service{background:#f2e4e9!important;color:#783c50!important}
html body button.planner-day-event--project{background:#e7eff8!important;color:#365d87!important}
html body button.planner-day-event--meeting{background:#e6f1ea!important;color:#315d4a!important}
.workspace-day-stack article.day{height:100%;min-height:0;overflow:hidden}
/* Calendar event entries remain compact rectangles, unlike the day-card bubbles. */
html body button.overview-event,html body button.service-calendar-event{border-radius:5px!important}

/* Task completion draws a strike across the rendered text. */
html body .sch-task-title{position:relative;text-decoration:none!important}
html body .sch-task-title::after{content:'';position:absolute;left:0;top:50%;width:var(--sch-strike-width,100%);height:1px;background:currentColor;transform:scaleX(0);transform-origin:left center;pointer-events:none}
html body .sch-task-title.sch-task-complete::after{transform:scaleX(1)}
html body .sch-task-title.sch-task-complete.sch-task-animate::after{animation:sch-task-strike .35s ease-out}
@keyframes sch-task-strike{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media(prefers-reduced-motion:reduce){html body .sch-task-title.sch-task-complete.sch-task-animate::after{animation:none}}
@media(max-width:780px){.planner-day-task-carousel{grid-auto-columns:calc((100% - 14px)/2)}}
@media(max-width:480px){.planner-day-task-carousel{grid-auto-columns:100%}.planner-quick-actions{gap:6px}.planner-quick-actions>.btn{font-size:11px;padding:7px 9px}}
html body button.planner-card-task-title:hover,html body button.planner-card-task-title:focus-visible{text-decoration:underline!important;text-underline-offset:3px}
.planner-day-task-carousel:has(>p:only-child){display:block}
html body button.planner-day-event:hover{text-decoration:underline;text-underline-offset:3px}

/* Sermon and service indexing: shared exports, compact creation, clear panel gaps. */
html body #app .sermon-create-widget>.row,html body #app .sermon-template-widget>.row{justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
html body #app .sermon-create-widget>.row h2,html body #app .sermon-template-widget>.row h2{flex:1;margin:0}
html body #app .sermon-create-widget>.row>button,html body #app .sermon-template-widget>.row>button{margin-left:auto;flex:0 0 auto}
html body #app .sermon-create-widget,html body #app .sermon-template-widget{min-height:0;padding-bottom:18px}
html body #app .sermon-continue{margin-top:12px}
html body #app .sermon-index-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 20px}
html body #app .sermon-index-entry{display:flex;flex-direction:column;gap:10px;min-width:0;padding:10px 0;overflow-wrap:anywhere}
.sermon-index-entry-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:auto}
html body #app .sermon-index-entry-actions>.btn{font-size:12px;padding:7px 12px;width:auto;white-space:normal;min-width:0}
html body #app .sermon-index-entry-actions>.btn:disabled{background:#e2e6e8!important;color:#7b8790!important;opacity:1;cursor:not-allowed;text-decoration:none!important}
.index-file-actions{display:flex;align-items:flex-start;gap:9px 12px;flex-wrap:wrap;margin:12px 0 18px}
.index-file-actions>.btn,.index-sync-action>.btn{white-space:nowrap}
.index-sync-action{display:flex;flex-direction:column;align-items:flex-start;max-width:240px;gap:4px}
.index-sync-action>[role="status"]{font-size:11px;line-height:1.35;padding-inline:12px}
.index-file-actions .btn{font-size:13px}
html body #app .sermon-workspace>.panel+.panel{margin-top:var(--sch-widget-gap)!important}
html body .layout #app.main.sch-page[data-view]>.service-planner-top-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2fr)!important}
html body #app .service-plan-button{display:block;width:100%}
html body #app .service-planner-top-grid>.panel{padding:18px;min-width:0}
html body #app .service-planner-top-grid h2{margin-top:0}
.service-mini-panel{border:1px solid var(--line);border-radius:12px;padding:10px;margin:8px 0;min-width:0}
.service-mini-panel>.row{display:flex;justify-content:space-between;align-items:center;gap:4px;flex-wrap:nowrap}
html body #app .service-mini-panel>.row>.btn{min-height:28px;height:28px;width:28px;padding:0;flex:0 0 28px}
.service-mini-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center;margin-top:10px}
html body #app .service-mini-day{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;height:28px;padding:0;border:0;border-radius:4px!important;background:#e8edf0;color:var(--navy);font-size:11px}
html body #app .service-mini-day:disabled{background:transparent;color:var(--muted);opacity:1;cursor:default}
html body #app .service-mini-day.today{outline:1px solid var(--gold);outline-offset:-1px}
.service-calendar-dot{width:4px;height:4px;border-radius:50%;background:var(--navy);display:block}
.service-index-preview{max-height:400px;overflow:auto}
.service-index-table{min-width:900px}
.service-index-table th,.service-index-table td{vertical-align:top}
.service-index-table td:last-child{white-space:nowrap;text-align:right}
.service-manage-dialog{width:min(1450px,96vw)!important;max-width:96vw!important}
.service-manage-scroll{max-height:65vh;overflow:auto;overscroll-behavior:contain}
.service-manage-scroll thead{position:sticky;top:0;z-index:2;background:var(--paper,#fff)}
.service-manage-scroll .service-index-table{min-width:1150px}
.service-manage-scroll th>.field,.service-index-scripture-label{display:block;margin-top:8px;font-weight:300}
.service-manage-scroll th{min-width:175px;font-weight:400}
.service-manage-scroll th:first-child{min-width:200px}
.service-index-date-filters{display:grid;gap:8px;margin-top:8px}
.service-index-date-filters label{font-size:12px;font-weight:300}
.service-index-date-filters input{display:block;width:100%}
.index-format-dialog{width:min(1250px,96vw)!important;max-width:96vw!important}
.index-column-scroll{overflow-x:auto;overscroll-behavior:contain;padding:4px 0 16px;margin:14px 0}
.index-column-row{display:flex;gap:12px;min-width:max-content}
.index-column-card{flex:0 0 270px;min-width:0;border:1px solid var(--line);border-radius:14px;padding:12px}
.index-column-name{display:flex;align-items:center;gap:5px;margin-top:8px}
.index-column-name input{width:175px;min-width:0}
.index-column-name input[readonly]{border-color:transparent;background:transparent!important}
.index-icon{border:0;background:transparent;padding:4px;min-width:26px;min-height:26px;display:inline-flex;justify-content:center;align-items:center;cursor:pointer}
.index-icon.sch-delete-button{background:#f9e6e8!important;color:#9c4350!important;border-radius:999px!important;flex:0 0 26px}
.index-format-add{align-items:flex-end;gap:10px;flex-wrap:wrap}
.index-format-add>label{margin:0!important;min-width:200px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1150px){html body #app .sermon-index-grid{grid-template-columns:repeat(2,minmax(0,1fr))}html body .layout #app.main.sch-page[data-view]>.service-planner-top-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.service-upcoming-widget{grid-column:1/-1}}
@media(max-width:700px){html body #app .sermon-index-grid{grid-template-columns:minmax(0,1fr)}html body .layout #app.main.sch-page[data-view]>.service-planner-top-grid{grid-template-columns:minmax(0,1fr)!important}.service-upcoming-widget{grid-column:auto}.index-file-actions{gap:10px}.index-sync-action{max-width:100%}}

/* Compact action rows keep related buttons together and primary actions outside. */
html body dialog .sch-action-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:12px;padding-top:0}
html body dialog .sch-action-footer>.sch-action-primary{order:2}
html body dialog .sch-action-footer>.sch-action-secondary{order:1}
html body dialog .sch-action-footer>.sch-action-delete{order:-1;margin-right:auto!important;margin-left:0!important}
html body dialog .sch-action-footer>.sch-modal-footer-spacer{order:0;flex:1}
html body #readingModal .reading-dialog-actions{display:flex;gap:10px;align-items:center;margin-top:12px}
html body #readingModal .reading-dialog-actions>.btn{grid-area:auto;flex:0 0 auto;width:auto}
html body #readingModal .reading-dialog-actions .sch-modal-footer-spacer{flex:1}
html body #sermonIndexEditModal .sermon-index-notes{min-height:130px;height:130px;max-height:none;resize:vertical;overflow:auto;border-radius:18px}
html body #sermonIndexEditModal label:last-of-type{margin-bottom:0}
html body #editorModal .modal-header>.controls{margin:0}
html body #libraryManagerModal>.row h2{flex:1;margin:0}
html body #libraryManagerModal>.row>.btn{flex:0 0 auto;width:auto}
html body #app .sermon-top-grid>.sermon-create-widget,html body #app .sermon-top-grid>.sermon-template-widget{min-height:0!important;padding-top:18px;padding-bottom:18px}
html body #app .sermon-template-widget>div:last-child{margin-top:10px!important}
html body #app .sermon-create-widget>p,html body #app .sermon-template-widget>p{margin-bottom:8px}
html body #app .sermon-index-entry{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:12px;padding-block:10px}
html body #app .sermon-index-entry:not(:nth-child(3n+1)){border-left:1px solid var(--line);padding-left:20px}
html body #app .sermon-index-entry-actions{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;margin:0}
html body #app .sermon-index-entry-actions>.btn{min-height:28px;height:auto;background:transparent!important;border:0!important;padding:3px 0;font-size:12px;text-align:left;white-space:normal}
html body #app .sermon-index-entry-actions>.btn:disabled{background:transparent!important;color:#929ba3!important;opacity:1}
html body #app .sermon-index-entry .sermon-index-title{font-size:17px!important}
html body #app .sermon-index-entry .muted{font-size:13px}
.planner-week-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:10px 0 16px}
.planner-week-heading>h2{margin:0;flex:1}
.planner-week-heading>.week-controls{margin:0;flex:0 0 auto}
html body #serviceIndexFormatDialog{min-height:min(560px,90dvh);max-height:94dvh;overflow:visible}
html body #serviceIndexFormatDialog form{max-height:90dvh;overflow-y:auto;overflow-x:visible}
html body #serviceIndexFormatDialog .index-format-add>label{min-width:220px}
html body #app .reading-setup-actions{width:230px;flex:0 0 230px;display:flex;flex-direction:column;align-items:stretch;gap:8px}
html body #app .reading-setup-actions>.btn{width:100%;margin:0}
@media(max-width:1150px){html body #app .sermon-index-entry:not(:nth-child(3n+1)){border-left:0;padding-left:0}html body #app .sermon-index-entry:nth-child(2n){border-left:1px solid var(--line);padding-left:20px}}
@media(max-width:700px){html body #app .sermon-index-entry:nth-child(n){border-left:0;padding-left:0}.planner-week-heading{align-items:flex-start}.planner-week-heading>.week-controls{flex-wrap:wrap}html body #app .reading-setup-actions{width:100%;flex-basis:auto}html body #serviceIndexFormatDialog{min-height:0;overflow-y:auto}}
html body #app .reading-setup-panel{grid-template-columns:minmax(0,1fr) minmax(0,230px)}
html body #app .reading-setup-copy h2{white-space:normal}
html body #app .reading-setup-actions{width:100%;max-width:230px}
html body #serviceIndexFormatDialog form{max-height:none;overflow:visible}
@media(max-width:900px){html body #app .reading-setup-panel{grid-template-columns:minmax(0,1fr)}html body #app .reading-setup-actions{max-width:none}}
@media(max-height:650px){html body #serviceIndexFormatDialog{min-height:0;overflow-y:auto}html body #serviceIndexFormatDialog form{max-height:86dvh;overflow-y:auto}}
html body dialog [hidden]{display:none!important}

/* Keep wide service tables inside their widgets, never the page viewport. */
html body .layout #app.main.sch-page[data-view="services"]{flex:1 1 0%;min-width:0!important;overflow-x:clip}
html body #app[data-view="services"]>.panel,html body #app[data-view="services"]>.sermon-top-grid{width:100%;min-width:0;max-width:100%}
html body #app[data-view="services"] .service-index-preview,html body #app[data-view="services"] .service-hymn-filters,html body #app[data-view="services"] .index-file-actions{min-width:0;max-width:100%}
html body #app[data-view="services"] .service-index-preview{width:100%;overflow:auto}
html body #app .service-church-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 20px}
html body #app .service-church-card{min-width:0;gap:5px;padding:10px 0;overflow-wrap:anywhere}
html body #app .service-church-card:not(:nth-child(3n+1)){border-left:1px solid var(--line);padding-left:20px}
.service-church-title-row{display:flex;gap:10px;align-items:center;width:100%;min-width:0}
.service-church-title-row>strong{flex:1;min-width:0}
html body #app .service-church-title-row>.service-edit-church{flex:0 0 auto;min-width:0;width:auto;align-self:center;margin:0 0 0 auto;font-size:12px;padding:6px 12px}
html body #app .service-church-card>.service-default-tag{align-self:flex-start}
.service-manage-filters{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;align-items:start;margin:16px 0}
html body #serviceManageDialog .service-manage-filters>label{display:flex!important;flex-direction:column;gap:6px;min-width:0;margin:0!important;font-size:12px;font-weight:300}
.service-manage-filters>label>span:first-child{line-height:18px;min-height:18px}
html body #serviceManageDialog .service-manage-filters .field{width:100%;min-width:0;min-height:40px;height:40px;margin:0!important}
html body #serviceManageDialog .service-manage-filters :is(.schafer-select-wrap,.schafer-book-field){min-width:0;width:100%;margin:0;height:40px}
html body #serviceManageDialog .service-manage-filters .schafer-select-trigger{height:40px;min-height:40px}
.service-manage-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:6px 0 12px}
html body #serviceManageDialog .service-manage-scroll{min-width:0;max-width:100%;max-height:50vh}
html body #serviceManageDialog .service-index-table{min-width:800px;width:100%;table-layout:fixed}
html body #serviceManageDialog .service-index-table th{min-width:0;vertical-align:middle}
.service-index-table td{overflow-wrap:anywhere}
html body .service-index-table td:last-child .btn{min-width:0;max-width:100%;padding:4px 0;white-space:normal;font-size:12px}
html body .service-index-table td.service-index-empty{text-align:left}
html body #app .library-list-details{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}
html body #app .library-list-details>.library-reading-plan{flex:0 0 auto;margin-left:auto;min-height:24px;height:auto;padding:0;border:0!important;background:transparent!important;font-size:12px;white-space:nowrap}
@media(max-width:1150px){html body #app .service-church-grid{grid-template-columns:repeat(2,minmax(0,1fr))}html body #app .service-church-card:not(:nth-child(3n+1)){border-left:0;padding-left:0}html body #app .service-church-card:nth-child(2n){border-left:1px solid var(--line);padding-left:20px}}
@media(max-width:1000px){.service-manage-filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){html body #app .service-church-grid{grid-template-columns:minmax(0,1fr)}html body #app .service-church-card:nth-child(n){border-left:0;padding-left:0}.service-manage-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.service-manage-filters{grid-template-columns:minmax(0,1fr)}}

/* My Desk: common quarter/quarter/half top row, view-specific thirds below. */
html body #app .overview-desk-top{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2fr);align-items:stretch}
html body #app .overview-desk-second{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
html body #app .desk-widget{display:flex;flex-direction:column;min-width:0;min-height:0;height:390px;margin:0;overflow:hidden}
html body #app .overview-desk-top>.desk-widget{height:440px}
html body #app .desk-widget>h2{flex:0 0 auto;margin:0 0 14px}
.desk-scroll{flex:1 1 auto;min-height:0;min-width:0;max-width:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-right:4px}
html body #app .desk-ellipsis{display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;overflow-wrap:normal!important}
html body #app .desk-focus-tasks .line{display:block}
html body #app .desk-focus-tasks .project-title-link{width:100%;text-align:left}
.desk-focus-controls{display:flex;align-items:center;gap:5px;flex-wrap:nowrap;flex:0 0 auto}
html body #app .desk-focus-controls>.btn{flex:1 1 0;min-width:0;width:auto;padding:7px 5px;font-size:11px;white-space:nowrap}
html body #app .desk-focus-controls>.btn:last-child{flex:1.5 1 0}
html body #app .desk-meetings>.sch-action-footer{margin-top:10px;padding-top:0;flex:0 0 auto}
html body #app .desk-widget .desk-list-row{display:flex;gap:10px;align-items:center;min-width:0}
.desk-row-copy{flex:1;min-width:0}
html body #app .desk-list-row>.btn{flex:0 0 auto;width:auto;margin-left:auto;padding:5px 0;font-size:12px;white-space:nowrap;min-height:30px}
html body #app .desk-reading h3{font:400 20px/1.3 'EB Garamond',serif;margin:12px 0 6px}
html body #app .desk-reading h3:first-child{margin-top:0}
html body #app .desk-calendar .overview-calendar-buttons{flex:0 0 auto;margin-bottom:12px}
html body #app .desk-calendar-body>.overview-six{min-height:100%;grid-template-rows:repeat(2,minmax(0,1fr))}
html body #app .desk-calendar-body .overview-agenda{max-height:none;overflow:visible}
html body #app .desk-calendar-body .overview-day{min-height:0;overflow-y:auto}
html body #app .sermon-complete-control{margin-left:auto;flex:0 0 auto}
html body #app .sermon-title-row{flex-wrap:wrap}
html body #app .sermon-index-controls{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px}
html body #app .sermon-index-controls>.service-field{flex:1 1 145px;min-width:0}
.sermon-progress-filter{display:flex;flex-direction:column;gap:5px;flex:0 0 auto}
.sermon-progress-pills{display:flex;align-items:center;gap:7px}
html body :is(label.sermon-status-choice,.sermon-progress-pills>label){display:inline-flex!important;align-items:center;gap:7px;width:auto!important;min-height:40px;margin:0!important;padding:8px 12px;border:0;border-radius:999px;background:#edf1f4;color:var(--ink);font-size:12px;white-space:nowrap;font-weight:300}
html body .sermon-status-choice input{width:15px!important;height:15px!important;min-height:0!important;flex:0 0 auto;margin:0!important}
html body #app .sermon-index-meta{display:flex;align-items:center;gap:8px;min-width:0}
.sermon-index-description{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body #app .sermon-progress-badge{flex:0 0 auto;margin-left:auto;padding:3px 7px;font-size:10px;white-space:nowrap;background:#edf1f4;color:var(--ink)}
@media(max-width:1150px){html body #app .overview-desk-top{grid-template-columns:repeat(2,minmax(0,1fr))}html body #app .overview-desk-top>.desk-calendar{grid-column:1/-1}html body #app .overview-desk-second{grid-template-columns:minmax(0,1fr)}html body #app .desk-widget{height:360px}}
@media(max-width:650px){html body #app .overview-desk-top{grid-template-columns:minmax(0,1fr)}html body #app .overview-desk-top>.desk-calendar{grid-column:auto}html body #app .overview-desk-top>.desk-widget{height:390px}html body #app .desk-calendar-body>.overview-six{grid-template-rows:none}.sermon-progress-filter{flex:1 1 100%}}
html body #app .desk-projects .desk-list-row>[data-action-kind="secondary"]{padding:5px 10px}

/* Library entry metadata follows the same two-column reading order. */
html body #libraryModal .library-links-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
html body #libraryModal .library-links-grid>.library-logos-field{grid-column:1;grid-row:1}
html body #libraryModal .library-links-grid>.library-accordance-field{grid-column:1;grid-row:2}
html body #libraryModal .library-links-grid>#libFormats{grid-column:2;grid-row:1/3;align-self:start;min-width:0;margin:0}
html body #libraryModal .library-links-grid>label{min-width:0;margin:0;display:flex;flex-direction:column;gap:5px}
html body #libraryModal .library-links-grid>label>.field{width:100%;margin:0}
html body #libraryModal .library-tag-section{position:relative}
html body #libraryModal .library-tag-controls>#libTagSearch{grid-column:1;grid-row:2;margin:0;height:40px;min-width:0;width:100%}
html body #libraryModal .library-tag-search-results{position:absolute;z-index:40;left:0;right:0;top:100%;max-height:220px;overflow-y:auto;border:1px solid var(--line);border-radius:12px;background:var(--paper,#fff);box-shadow:0 6px 18px #142c401a;margin-top:4px;padding:5px}
html body #libraryModal .library-tag-search-results[hidden]{display:none!important}
.library-tag-search-option{display:block;width:100%;border:0;border-radius:8px;background:transparent;color:inherit;text-align:left;font:inherit;font-size:13px;padding:8px 10px;cursor:pointer}
.library-tag-search-option:hover,.library-tag-search-option:focus-visible{background:#edf1f4;outline:0}
.library-tag-search-results>p{padding:5px;margin:0}
html body #app .project-top-widgets>.panel{min-height:0!important;padding-top:18px;padding-bottom:18px}
html body #app .project-launch-widget>.row{display:flex;justify-content:space-between;align-items:center;gap:12px}
html body #app .project-launch-widget>.row h2{margin:0}
html body #app .project-launch-widget>p{margin:10px 0 14px}
.project-continue-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px}
.project-continue-row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body #app .project-continue-row>.btn{width:auto;min-width:0;padding:8px 12px;font-size:12px;white-space:nowrap}
html body #app .project-taxonomy-widget>h2{margin:0 0 14px}
.project-taxonomy-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;align-items:stretch}
html body #app .project-taxonomy-actions>.btn{width:100%;min-width:0;margin:0;padding:8px 5px;white-space:normal;font-size:12px}
@media(max-width:720px){html body #libraryModal .library-links-grid{grid-template-columns:minmax(0,1fr)}html body #libraryModal .library-links-grid>.library-logos-field{grid-column:1;grid-row:1}html body #libraryModal .library-links-grid>.library-accordance-field{grid-column:1;grid-row:2}html body #libraryModal .library-links-grid>#libFormats{grid-column:1;grid-row:3}}
@media(max-width:480px){.project-continue-row{grid-template-columns:minmax(0,1fr) auto}.project-continue-row>span{grid-row:2;grid-column:1/-1}.project-taxonomy-actions{gap:5px}html body #app .project-taxonomy-actions>.btn{font-size:11px;padding-inline:3px}}
html body #libraryModal .library-tag-controls>#libTagSearch{height:42px}

/* Keep the workspace creation action visible while its list scrolls. */
.workspace-home-list{display:flex;flex-direction:column;overflow:hidden;gap:12px}
.workspace-home-choices{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden}
html body .workspace-new-button{width:100%;flex-shrink:0;font-size:13px;padding-inline:8px}
.workspace-home-dialog{width:min(760px,95vw);max-height:90vh;overflow-y:auto;box-sizing:border-box}
.workspace-form-field{display:block;margin:12px 0}
.workspace-form-field .field{display:block;width:100%;box-sizing:border-box;margin-top:6px}
.workspace-attachment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:18px}
.workspace-attachment-grid section{min-width:0}
.workspace-attachment-grid h3{font:normal 22px/1.2 'EB Garamond',serif;margin:0 0 10px}
.workspace-attachment-list{height:220px;overflow-y:auto;border:1px solid var(--line);border-radius:14px;padding:10px}
.workspace-attachment{display:flex;align-items:center;gap:8px;margin-bottom:8px;border-radius:999px;background:#edf1f4;padding:8px 12px;font-size:13px;cursor:pointer}
.workspace-attachment input{flex:none}
.workspace-attachment span{min-width:0;overflow-wrap:anywhere}
.research-project-browser{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:stretch}
.research-project-selector{height:260px;overflow-y:auto;overflow-x:hidden;padding-right:18px;border-right:1px solid var(--line);scrollbar-gutter:stable;box-sizing:border-box}
html body #app .research-project-choice{display:flex;width:100%;text-align:left;justify-content:flex-start;min-width:0;height:auto;min-height:40px;margin:0 0 8px;white-space:normal;overflow-wrap:anywhere}
.research-project-preview{min-width:0}
html body #app .research-project-preview .research-project-card{min-height:260px;box-sizing:border-box;height:100%}
@media(max-width:780px){.workspace-home-list{min-height:180px}.research-project-browser,.workspace-attachment-grid{grid-template-columns:minmax(0,1fr)}.research-project-selector{height:180px;border-right:0;border-bottom:1px solid var(--line);padding:0 0 12px}.workspace-attachment-list{height:160px}}

/* Project writing uses the shared outline structure on white panels. */
html body #app .project-outline-widget{background:#fff}
html body #app .project-outline-widget .sermon-heading,
html body #app .project-outline-widget .sermon-subheading,
html body #app .project-outline-widget .sermon-format-bar{background:#fff;border-color:var(--line)}
html body #app .project-outline-widget .sermon-rich-notes{border-color:var(--line);resize:vertical}
.project-writing-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.project-writing-heading h2{margin:0}
.project-writing-heading .controls{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}
.project-draft-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;margin-top:18px}
.project-draft-layout.with-outline{grid-template-columns:minmax(0,1fr) minmax(0,3fr)}
.project-draft-field{display:flex;flex-direction:column;gap:8px;min-width:0;font-size:13px}
html body #app #projectDraftText{width:100%;min-height:600px;resize:vertical;line-height:1.7;box-sizing:border-box}
.project-draft-outline{min-width:0;max-height:660px;overflow-y:auto;overflow-wrap:anywhere;border-right:1px solid var(--line);padding-right:18px}
.project-draft-outline h3{font:normal 22px/1.2 'EB Garamond',serif;margin:0 0 14px}
.project-draft-outline .sermon-outline-preview{padding:0}
.workspace-source-summary{margin-top:16px;max-height:160px;overflow:auto}
.workspace-source-summary ul{padding-left:20px}
@media(max-width:780px){.project-draft-layout.with-outline{grid-template-columns:minmax(0,1fr)}.project-draft-outline{max-height:230px;border-right:0;border-bottom:1px solid var(--line);padding:0 0 14px}.project-writing-heading .controls{margin-left:0}html body #app #projectDraftText{min-height:420px}.project-outline-widget .sermon-subheading{margin-left:10px}}

/* Outline hierarchy: I. headings, A. subheadings, 1. subpoints. */
html body #app .sermon-outline-line{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;min-width:0}
html body #app .sermon-outline-line .sermon-outline-title{flex:1 1 180px;min-width:90px;max-width:none}
html body #app .sermon-outline-line>strong{flex:none;min-width:22px}
html body #app .sermon-outline-line>.btn{flex:none;white-space:nowrap;width:auto}
html body #app .sermon-outline-line>.outline-remove{margin-left:auto}
.sermon-subpoint{margin:12px 0 12px 22px;min-width:0}
.sermon-preview-point{margin:8px 0 8px 24px}
.research-source-card .research-source-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:auto}

/* A single rounded text-box shell contains its secondary-gray formatting ribbon. */
html body .sch-rich-editor{border:1px solid #cbd5dd;border-radius:18px;background:#fff;overflow:hidden;min-width:0;margin-top:8px}
html body .sch-rich-editor:focus-within{outline:2px solid var(--sch-focus,#3a6e96);outline-offset:2px}
html body .sch-rich-editor>:is(.notes-toolbar,.research-note-toolbar,.sermon-format-bar,.sermon-notes-toolbar){display:flex!important;gap:5px;flex-wrap:wrap;margin:0!important;padding:7px 10px!important;background:#edf1f4!important;color:var(--ink)!important;border:0!important;border-bottom:1px solid #cbd5dd!important;border-radius:0!important;box-sizing:border-box}
html body .sch-rich-editor>:is(.notes-toolbar,.research-note-toolbar,.sermon-format-bar,.sermon-notes-toolbar) button{background:#edf1f4!important;color:var(--ink)!important;border:1px solid transparent!important;border-radius:999px!important;padding:5px 10px;min-height:30px;cursor:pointer;box-shadow:none!important}
html body .sch-rich-editor>:is(.notes-toolbar,.research-note-toolbar,.sermon-format-bar,.sermon-notes-toolbar) button:hover{background:#dfe6ec!important;text-decoration:underline;text-underline-offset:3px}
html body .sch-rich-editor>[contenteditable="true"]{border:0!important;border-radius:0!important;margin:0!important;background:#fff!important;box-shadow:none!important;outline:none!important;box-sizing:border-box;width:100%;padding:14px!important;resize:vertical!important;overflow:auto!important}
html body .project-tall-widget>.sch-rich-editor{display:flex;flex-direction:column;flex:1;min-height:0}
html body .project-tall-widget>.sch-rich-editor>.project-notes-editor{flex:1;min-height:180px}
@media(max-width:780px){html body #app .sermon-outline-line{flex-wrap:wrap}html body #app .sermon-outline-line .sermon-outline-title{flex-basis:calc(100% - 70px)}.sermon-subpoint{margin-left:12px}html body #app .sermon-outline-line>.outline-remove{margin-left:auto}}

.research-draft-field{margin:18px 0;min-width:0}
.research-draft-field>label{display:block;margin-bottom:6px;font-size:13px}
html body .research-draft-editor{white-space:pre-wrap;line-height:1.7;resize:vertical}


/* Library publication metadata editor. */
#libraryModal .library-entry-header{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#libraryModal .library-entry-header h2{flex:1;min-width:160px;margin:0}
#libraryModal .library-publication-picker{margin-left:auto;display:flex;flex-direction:column;gap:4px;min-width:200px;font-size:12px}
#libraryModal [hidden]{display:none!important}
#libraryModal .library-article-attachment{border:1px solid var(--line);border-radius:8px;padding:14px;min-width:0}
#libraryModal .library-article-file-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;overflow-wrap:anywhere}
#libraryModal .library-article-file-row span{flex:1;min-width:0}
#libraryModal input[type=file]{max-width:100%;box-sizing:border-box}
@media(max-width:560px){#libraryModal .library-entry-header h2{flex-basis:100%}#libraryModal .library-publication-picker{flex:1;min-width:0;margin-left:0}}

/* Reading plan editor: one book, with whole-book or selected-section scheduling. */
#readingModal.reading-plan-dialog{border:0;border-radius:14px;padding:24px;width:min(680px,95vw);max-height:90vh;overflow:auto;box-sizing:border-box}
#readingModal.reading-sections-expanded{width:min(1000px,96vw)}
#readingModal [hidden]{display:none!important}
#readingModal .field{width:100%;box-sizing:border-box;display:block;margin-top:5px}
#readingModal .reading-course-field{display:block;margin:14px 0}
#readingModal .reading-library-picker{position:relative;margin:14px 0}
#readingModal #readingBookResults{position:absolute;z-index:30;top:100%;left:0;right:0;max-height:230px;overflow-y:auto;background:white;border:1px solid var(--line);border-radius:8px}
#readingModal .reading-mode-choices{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}
#readingModal .reading-mode-option{display:flex;align-items:center;justify-content:flex-start;gap:12px;position:relative;padding:12px 16px!important;min-height:46px;text-align:left;cursor:pointer;white-space:normal}
#readingModal .reading-mode-option>input{position:absolute;opacity:0;width:1px;height:1px}
#readingModal .reading-mode-check{display:grid;place-items:center;width:20px;height:20px;flex:0 0 20px;border:1px solid currentColor;border-radius:50%;box-sizing:border-box}
#readingModal .reading-mode-option input:checked+.reading-mode-check{background:var(--navy,#142c40);color:white;border-color:var(--navy,#142c40)}
#readingModal .reading-mode-option input:checked+.reading-mode-check:after{content:'✓';font-size:13px}
#readingModal .reading-mode-option:focus-within{outline:2px solid #377ed4;outline-offset:2px}
#readingModal .reading-section-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px;align-items:start}
#readingModal .reading-range-left{min-width:0}
#readingModal .reading-range-entry{display:flex;gap:10px;align-items:flex-end}
#readingModal .reading-range-entry>label{flex:1;min-width:80px}
#readingModal .reading-range-entry>button{flex:1;min-height:42px;white-space:normal;line-height:1.3;padding:8px 10px!important}
#readingModal .reading-range-bubbles{border:1px solid var(--line);border-radius:10px;padding:12px;min-height:116px}
#readingModal .reading-range-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
#readingModal .reading-range-tags .pill{display:inline-flex;align-items:center;gap:8px}
@media(max-width:650px){#readingModal .reading-section-layout{grid-template-columns:1fr}#readingModal .reading-mode-option{padding:10px!important;gap:8px}#readingModal .reading-range-entry>button{font-size:12px}}

/* Projects: half-width launch card and two quarter-width cards. */
html body #app .project-top-widgets{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr)}
html body #app .project-taxonomy-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
html body #app .project-taxonomy-actions>.btn:nth-child(1){grid-column:1;grid-row:1}
html body #app .project-taxonomy-actions>.btn:nth-child(2){grid-column:2;grid-row:1}
html body #app .project-taxonomy-actions>.btn:nth-child(3){grid-column:1;grid-row:2}
html body #app .project-taxonomy-actions>.btn:nth-child(4){grid-column:2;grid-row:2}
.project-study-widget h2{margin:0}
.project-study-widget>.btn{white-space:normal}
.syllabus-study-dialog,.syllabus-study-edit{box-sizing:border-box;border:0;border-radius:14px;padding:24px;width:min(640px,95vw);max-height:92vh;overflow:auto}
.syllabus-study-dialog.syllabus-study-review{width:min(1350px,97vw)}
.syllabus-study-dialog> .row,.syllabus-study-edit .row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.syllabus-study-dialog label,.syllabus-study-edit label{display:block;margin:14px 0}
.syllabus-study-dialog .field,.syllabus-study-edit .field{display:block;width:100%;box-sizing:border-box;margin-top:5px}
.syllabus-review-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:22px;margin:18px 0}
.syllabus-calendar-panel,.syllabus-proposed-panel{min-width:0}
.syllabus-calendar-nav{display:flex;align-items:center;gap:8px}
.syllabus-calendar-nav .field{flex:1;min-width:0;margin:0}
.syllabus-calendar-nav .btn{white-space:nowrap;padding-inline:10px!important}
#syllabusStudyCalendar{max-height:65vh;overflow:auto}
#syllabusStudyCalendar .service-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
#syllabusStudyCalendar .service-day{min-height:90px;border:1px solid #d6d0c6;border-radius:7px;padding:5px;display:flex;flex-direction:column;gap:4px;min-width:0}
#syllabusStudyCalendar .service-calendar-event{border:0;border-radius:6px;background:#edf1f4;color:var(--navy,#142c40);padding:5px;text-align:left;font:inherit;font-size:11px;overflow-wrap:anywhere;cursor:pointer}
.syllabus-proposed-panel>.row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.syllabus-project-scroll{max-height:65vh;overflow:auto}
.syllabus-project-row{padding:12px 0;border-bottom:1px solid var(--line);display:flex;gap:10px;align-items:flex-start}
.syllabus-project-row>div:first-child{flex:1;min-width:0;overflow-wrap:anywhere}
.syllabus-project-actions{display:flex;gap:5px;flex-shrink:0}
.syllabus-project-actions .btn{padding:5px 8px!important;font-size:11px!important;min-height:28px!important}
.syllabus-import-notices{max-height:110px;overflow:auto}
@media(max-width:1100px){html body #app .project-top-widgets{grid-template-columns:repeat(2,minmax(0,1fr))}html body #app .project-launch-widget{grid-column:1/-1}}
@media(max-width:800px){.syllabus-review-layout{grid-template-columns:1fr}.syllabus-project-scroll{max-height:340px}}
@media(max-width:560px){html body #app .project-top-widgets{grid-template-columns:1fr}.syllabus-calendar-nav{flex-wrap:wrap}.syllabus-calendar-nav .field{order:-1;flex-basis:100%}#syllabusStudyCalendar .service-day{padding:2px;min-height:65px}.syllabus-project-row{flex-wrap:wrap}}

/* Project list and view-specific course controls. */
html body #app .project-all-list{grid-template-columns:repeat(3,minmax(0,1fr))}
html body #app .project-taxonomy-actions>[hidden]{display:none!important}
html body #app .project-taxonomy-actions[data-desk-mode="pastor"]{grid-template-columns:minmax(0,1fr)}
@media(max-width:1000px){html body #app .project-all-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){html body #app .project-all-list{grid-template-columns:minmax(0,1fr)}}
