/* One browsing task per screen, on both mobile and desktop. */
html body .sources-browser{display:block!important}
html body .sources-workspace:not(.is-showing-source) .source-detail-pane,
html body .sources-workspace.is-showing-source .source-directory,
html body .sources-workspace.is-showing-source :is(.sources-toolbar,.source-view-switch,.source-calendar-disclosure,.source-management,.source-create-top,.source-create-inline,#sourceSongFilter),
html body .sources-workspace.is-calendar-view .source-directory{display:none!important}
html body .sources-workspace.is-showing-source .source-detail-pane{display:block!important}
html body .source-calendar-disclosure>summary{display:none!important}
html body .sources-workspace.is-calendar-view:not(.is-showing-source) .source-calendar-disclosure{display:block!important}
html body .source-view-switch{display:flex!important;gap:8px;margin:0 0 16px;order:-1}
html body .source-view-switch button{flex:1;min-height:44px;font:inherit;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--menu-bg);color:var(--text)}
html body .source-view-switch button[aria-pressed=true]{border-color:var(--gold);font-weight:700;background:var(--gold-soft)}
html body .source-detail-navigation{display:flex;gap:10px;justify-content:space-between;align-items:center;margin-bottom:14px}
html body .source-detail-navigation button,#sourceDirectoryPagination:not(.shared-pagination) button{min-height:44px;padding:8px 14px;border:1px solid var(--line);border-radius:10px;background:var(--menu-bg);color:var(--text);font:inherit}
html body #sourceDirectoryPagination:not(.shared-pagination){display:flex;align-items:center;justify-content:center;gap:14px;margin-top:18px}
html body #sourceDirectoryPagination:not(.shared-pagination)[hidden]{display:none}
html body .source-directory{width:100%;max-height:none!important;overflow:visible!important}
html body .sources-main:has(.sources-workspace.is-showing-source)>:is(.page-heading,.sources-hero),body.source-detail-screen .archive-section-nav,body.source-detail-screen .site-header>.sources-toolbar{display:none!important}
body:not(.source-edit-screen) #sourceTimeline :is(.site-admin-tools,.moment-admin-action,.social-card-editor){display:none!important}
html:not(.site-admin-active) :is(.source-management,.source-create-top){display:none!important}
body .source-detail-navigation [hidden]{display:none!important}
@media(max-width:700px){html body .source-calendar-layout{display:block!important}html body .sources-workspace{padding:12px}html body .source-directory{padding:0}html body .source-detail-navigation{flex-wrap:wrap}html body .sources-toolbar{position:static!important}}

/* Paginated directory uses document scrolling, never a nested scroll trap. */
html body .sources-main .source-directory ol{max-height:none;overflow:visible;overscroll-behavior:auto}

/* Direct status saves are management actions, separate from navigation. */
html:not(.site-admin-active) .source-review-toggle,html.site-admin-preview .source-review-toggle{display:none!important}
html body .source-review-toggle{box-sizing:border-box;min-height:44px;padding:8px 12px;margin-top:6px;border:1px solid var(--line-strong);border-radius:10px;background:var(--menu-bg);color:var(--text);font:inherit;font-size:13px;white-space:normal;max-width:100%;width:auto;cursor:pointer}
html body .source-review-toggle[aria-pressed=true]{background:var(--gold-soft);border-color:var(--gold)}
html body .source-review-toggle:disabled{opacity:.6;cursor:wait}
.source-review-feedback{display:block;flex-basis:100%;font-size:13px;line-height:1.5;overflow-wrap:anywhere;color:var(--text);margin-block:6px}
.source-timeline-header{flex-wrap:wrap}

/* Keep navigation, record identity, and management actions in distinct rows. */
html body .source-detail-navigation{justify-content:flex-start;gap:8px;margin-bottom:16px}
html body .source-detail-navigation .source-back-directory{margin:0}
.source-detail-pane:has(.source-detail-admin) .source-detail-navigation [data-source-edit-screen]{display:none!important}
html body .sources-main .source-timeline-header{display:flex;align-items:center;gap:8px 12px}
html body .sources-main .source-timeline-header>div:first-child{flex:1 1 100%;margin:0}
html body .sources-main .source-timeline-header h2{margin:4px 0 8px}
html body .source-admin-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;flex:1 1 100%;min-width:0;margin:8px 0 0}
html:not(.site-admin-active) .source-admin-actions,html.site-admin-preview .source-admin-actions{display:none!important}
html body .source-admin-actions :is(button,summary){box-sizing:border-box;min-height:44px;padding:8px 12px;margin:0;border:1px solid var(--line);border-radius:10px;background:var(--menu-bg);color:var(--text);font:inherit;font-size:13px;line-height:1.4;cursor:pointer;white-space:normal;width:auto;max-width:100%}
html body .source-admin-actions .source-review-toggle[aria-pressed=true]{background:var(--gold-soft);border-color:var(--gold)}
html body .source-admin-more{position:relative;margin:0;padding:0;border:0;background:none;flex:0 0 auto}
html body .source-admin-more>summary{list-style:none;display:flex;align-items:center;gap:6px}
.source-admin-more>summary::-webkit-details-marker{display:none}
.source-admin-more>summary::after{content:'⌄'}
html body .source-admin-more-items{position:absolute;inset:auto 0 auto auto;top:calc(100% + 6px);z-index:25;min-width:140px;padding:6px;border:1px solid var(--line);border-radius:10px;background:var(--menu-bg);box-shadow:0 6px 20px #0002}
body:not(.source-edit-screen) .source-edit-end,body.source-edit-screen .source-edit-start{display:none}
html body .source-admin-actions .source-review-feedback{width:100%;margin:0}
html body .source-admin-actions .source-admin-more{margin-inline-start:auto}
/* Links and actions share one menu-item treatment, including native buttons. */
html body .source-admin-actions .source-admin-more-items>:is(a,button){display:flex;align-items:center;box-sizing:border-box;width:100%;max-width:100%;min-height:44px;margin:0;padding:10px 12px;border:0;border-radius:7px;background:transparent;box-shadow:none;color:var(--text);font:inherit;font-size:13px;font-weight:400;line-height:1.4;letter-spacing:normal;text-align:left;text-decoration:none;white-space:nowrap;cursor:pointer;appearance:none}
html body .source-admin-actions .source-admin-more-items>.record-trash-action{color:var(--red,#a34040)}
html body .source-admin-actions .source-admin-more-items>:is(a,button):not(:disabled):hover{background:var(--surface-soft,var(--gold-soft))}
html body .source-admin-actions .source-admin-more-items>:is(a,button):focus-visible{outline:2px solid var(--focus,var(--gold));outline-offset:1px}
html body .source-admin-actions .source-admin-more-items>button:disabled{opacity:.55;cursor:wait}

/* One status control, followed by one shared row of record utilities. */
html.site-admin-active:not(.site-admin-preview) .source-detail-pane .source-public-status{display:none}
html body .source-title-row .source-review-status{border-radius:999px;min-width:0;background:var(--accent-soft);color:var(--accent-text);font-weight:700}
html body .source-title-row .source-review-status[aria-pressed=true]{background:var(--gold-soft);color:var(--highlight-text)}
html body .source-detail-utilities{display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex:1 1 100%;margin:4px 0 0}
html body .source-detail-utilities>.source-timeline-actions{display:contents}
html body .source-detail-utilities button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:0;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--menu-bg);color:var(--text);font:inherit;font-size:13px;line-height:1.4;cursor:pointer}
html body .source-detail-utilities button:hover{background:var(--surface-soft)}
html body .source-detail-utilities button:focus-visible{outline:2px solid var(--focus,var(--gold));outline-offset:2px}

/* Identity and utility rows stay separate in both public and admin views. */
html body .sources-main .source-timeline-header:has(.source-title-row){display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
html body .sources-main .source-title-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;min-width:0}
html body .sources-main .source-title-row h2{margin:0;min-width:0;max-width:100%;overflow-wrap:anywhere}
html body .source-title-row :is(.source-review-status,.source-public-status){flex:0 0 auto;box-sizing:border-box;min-height:36px;margin:0;padding:6px 10px;font-size:12px;line-height:1.4;border-radius:999px}
html body .source-title-row .source-review-feedback{flex:1 1 100%;font-size:13px}
html body .sources-main .source-timeline-header>.source-detail-utilities{width:100%;margin:0}

html body .source-title-row :is(.source-public-status.is-complete,.source-review-status[aria-pressed=true]){background:#e5f2e8;color:#24633b;border-color:#82ad8f}
html[data-theme="night"] body .source-title-row :is(.source-public-status.is-complete,.source-review-status[aria-pressed=true]){background:#203d2c;color:#b4e3c1;border-color:#649875}

/* Review progress belongs to the editing view, not the public social feed. */
html:not(.site-admin-active) .social-review-summary,html.site-admin-preview .social-review-summary{display:none!important}

/* Calendar replaces the directory; its empty shell must not reserve 560px. */
html body .sources-workspace.is-calendar-view:not(.is-showing-source) .sources-browser{display:none!important;min-height:0;margin:0}
