/* Shared page hierarchy: editorial headings and open sections. */
:root{--page-heading-font:"Noto Serif TC","Songti TC","PMingLiU",serif;--page-title-size:clamp(28px,4vw,40px);--page-section-size:clamp(21px,2.6vw,28px);--page-section-gap:clamp(24px,4vw,40px);}
html body :is(#resultsHeading,#sourcesHeading,#eventsHeading,#commentsFeedHeading,#statsHeading,#cluesHeading,.terms-heading h2,#adminWorkspaceTitle,.missing-heading h2){font-family:var(--page-heading-font);font-size:var(--page-title-size);font-weight:600;line-height:1.45;letter-spacing:.035em;margin:0;color:var(--text);overflow-wrap:anywhere;}
html body :is(.stats-group-heading h2,.stats-panel-heading h3,.event-section-heading h3,.source-part-heading h3,.clue-heading h3,.terms-section h3,.terms-toc-heading h3,#sourceDirectoryHeading){font-family:var(--page-heading-font);font-size:var(--page-section-size);font-weight:600;line-height:1.5;letter-spacing:.025em;}
html body :is(.event-detail-heading h2,.source-timeline-header h2){font-family:var(--page-heading-font);font-size:var(--page-title-size);font-weight:600;line-height:1.45;letter-spacing:.035em;}
/* Remove ornamental outer boxes, keeping controls and individual records intact. */
html body :is(.events-portal,.event-detail-article,.stats-hero,.stats-panel,.comments-feed-panel,.terms-card,.terms-toc,.sources-hero,.sources-workspace,.source-timeline,.source-timeline-header,.source-calendar-results,.clue-hub-page){border:0;border-radius:0;box-shadow:none;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;}
html body :is(.events-portal,.event-detail-article,.comments-feed-panel,.stats-hero,.sources-hero,.sources-workspace,.source-timeline){padding-inline:0;}
html body :is(.stats-panel,.terms-toc){padding:20px 0;border-top:1px solid var(--line);}
html body .terms-card{padding:0;}
html body .clue-hub-page{padding:0;}
html body :is(.events-main,.comments-main,.stats-main,.terms-main,.sources-main){padding-top:24px;padding-bottom:48px;}
html body :is(.events-heading,.comments-feed-heading,.terms-heading,.stats-hero,.sources-hero,.clue-hub-heading){padding-block:0 20px;margin-block:0 24px;border-bottom:1px solid var(--line);gap:16px;}
html body :is(.stats-group,.event-composition,.terms-section+.terms-section){margin-top:var(--page-section-gap);}
html body .source-timeline-header{padding:0 0 24px;margin-bottom:24px;border-bottom:1px solid var(--line);}
html body .clue-hub-page .clue-hub-list{background:transparent;border-radius:0;}
@media(max-width:600px){html body :is(.events-heading,.stats-hero,.sources-hero,.comments-feed-heading){flex-wrap:wrap;align-items:flex-start;}html body :is(.stats-hero>p,.events-heading>p){width:100%;max-width:none;margin:0;}}

/* One page frame for every public landing page. Explicit scope defeats legacy nested insets. */
:root{--page-width:1220px;--page-gutter:20px;--page-top:24px;}
html body main.site-page-main{box-sizing:border-box;display:block;width:min(var(--page-width),calc(100% - var(--page-gutter) * 2));max-width:none;min-width:0;margin:0 auto;padding:var(--page-top) 0 48px;}
html body main.site-page-main>.page-heading{box-sizing:border-box;display:block;min-width:0;margin:0 0 24px;padding:0 0 24px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;box-shadow:none;}
html body main.site-page-main>.page-heading>.page-eyebrow{display:block!important;margin:0 0 8px;padding:0;color:var(--gold);font-family:"Noto Sans TC",sans-serif;font-size:12px;font-weight:700;line-height:1.5;letter-spacing:.16em;}
html body main.site-page-main>.page-heading>.page-title{display:block;margin:0;padding:0;font-family:var(--page-heading-font);font-size:var(--page-title-size);font-weight:600;line-height:1.45;letter-spacing:.035em;color:var(--text);}
html body main.site-page-main>.page-heading>.page-description{display:block;max-width:62em;margin:10px 0 0;padding:0;color:var(--muted);font-size:14px;line-height:1.75;}
html body main.site-page-main :is(.sources-workspace,.sources-hero,.source-directory,.source-detail-pane,.source-timeline,.events-portal,.event-detail-article,.comments-feed-panel,.stats-hero,.terms-card){box-sizing:border-box;width:100%;max-width:none;margin-inline:0;padding-inline:0;border-radius:0;box-shadow:none;}
html body main.site-page-main :is(.sources-workspace,.sources-hero,.events-portal,.comments-feed-panel,.stats-hero,.terms-card){margin-top:0;padding-top:0;}
html body main.site-page-main :is(.sources-hero,.comments-feed-heading,.results-heading){margin:0 0 20px;padding:0;border:0;}
html body main.site-page-main .sources-hero{display:block;}
html body main.site-page-main .sources-hero .source-statistics{border:0;padding:0;}
html body main.site-page-main .source-directory{border:0;background:transparent;}
html body main.site-page-main .source-directory-heading{padding:0 0 12px;}
html body main.site-page-main .source-directory ol{padding:0;}
html body main.site-page-main .stats-hero{display:block;padding-bottom:24px;}
html body main.site-page-main .terms-heading{margin:0 0 24px;padding:0 0 20px;}
html body main.site-page-main .results-section{margin-top:0;padding-top:0;}
html body main.site-page-main .results-heading{display:flex;flex-wrap:wrap;align-items:center;gap:12px;}
html body main.site-page-main .results-heading .catalog-admin-actions:empty{display:none;}
html body main.site-page-main .results-heading .result-count{margin:0;}
html body main.site-page-main .source-calendar-results{padding-inline:0;}
@media(max-width:700px){:root{--page-gutter:12px;--page-top:20px;}html body main.site-page-main>.page-heading{margin-bottom:20px;padding-bottom:20px;}}

html body main.site-page-main .missing-hero{padding:0 0 20px;margin:0 0 24px;border:0;border-radius:0;background:transparent;box-shadow:none;}
html body main.site-page-main .source-calendar-disclosure{margin-inline:0;border:0;border-radius:0;background:transparent;}
html body main.site-page-main .source-calendar-disclosure .source-calendar-layout{padding-inline:0;}

html body .admin-dashboard-heading.page-heading{margin:0 0 24px;padding:0 0 24px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;box-shadow:none;}
html body .admin-dashboard-heading .page-eyebrow{display:block;margin:0 0 8px;color:var(--gold);font:700 12px/1.5 "Noto Sans TC",sans-serif;letter-spacing:.16em;}
html body .admin-dashboard-heading .page-description{margin:10px 0 0;font-size:14px;line-height:1.75;color:var(--muted);}

/* Statistics tabs retain the shared totals above each panel. */
.stats-section-nav[role=tablist]{display:flex;gap:8px;flex-wrap:wrap}
.stats-section-nav [role=tab]{flex:1 1 120px;min-height:44px;padding:10px 14px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface-strong);color:var(--text);font:inherit;cursor:pointer}
.stats-section-nav [role=tab][aria-selected=true]{background:var(--gold-soft);border-color:var(--gold);color:var(--gold);font-weight:700}
.stats-section-nav [role=tab]:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
#statsMain [role=tabpanel][hidden]{display:none!important}
