@layer museum-stat-reading {
 .museum-stat-dialog { box-sizing:border-box;width:min(1120px,calc(100vw - 40px));max-width:none;height:min(90dvh,1060px);max-height:94dvh;padding:0;border:1px solid rgba(255,255,255,.85);border-radius:26px;color:#143d4c;background:rgba(229,246,241,.78);-webkit-backdrop-filter:blur(32px);backdrop-filter:blur(32px);box-shadow:0 24px 80px #123e4a40;overflow:hidden; }
 .museum-stat-dialog::backdrop { background:#173e4a59;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px); }
 .museum-stat-dialog[open] { display:flex;flex-direction:column; }
 .museum-stat-header { display:flex;gap:20px;align-items:flex-start;justify-content:space-between;flex:none;padding:22px 28px 18px;border-bottom:1px solid #8bb1b15c;background:linear-gradient(115deg,#f0ffffbb,#fff4d9a6); }
 .museum-stat-header h2 { margin:6px 0 0;font-size:clamp(23px,3vw,36px);line-height:1.18;overflow-wrap:anywhere; }
 .museum-stat-header .eyebrow { font-size:10px;letter-spacing:.18em; }
 .museum-stat-content { overflow:auto;overscroll-behavior:contain;min-height:0;padding:22px 28px 32px;scroll-padding-top:16px; }
 .museum-stat-dialog button,.museum-stat-dialog select { color:#153f4e;background:linear-gradient(115deg,#e7fcf5ba,#d9f4f1b3,#fff1d4c2);border:1px solid #8fb0b8;border-radius:16px;padding:12px 16px;font:inherit;box-shadow:inset 0 1px 1px #fff; }
 .museum-stat-dialog button { cursor:pointer; }
 .museum-stat-close { flex:none;min-height:44px; }
 .museum-stat-picker { display:flex;gap:12px;align-items:center;margin-bottom:18px;font-size:13px; }
 .museum-stat-picker select { min-width:0;max-width:100%;flex:1; }
 .museum-stat-scope { padding:20px 22px;margin-bottom:20px;border:1px solid #fff;border-radius:20px;background:linear-gradient(115deg,#f4fffcc9,#e4f7f0bf,#fff8e7c7); }
 .museum-stat-scope h3 { font-size:23px;margin:0 0 12px;line-height:1.3; }
 .museum-stat-scope p { line-height:1.65;margin:8px 0;font-size:14px;overflow-wrap:anywhere; }
 .museum-stat-overlap,.museum-stat-position { font-size:12px!important;color:#355a66; }
 .museum-stat-email-list { display:grid;gap:16px; }
 .museum-stat-email { min-width:0;border:1px solid #fff;border-radius:20px;background:linear-gradient(115deg,#f5fffbcb,#e7faf5c7,#fff6e3cb);overflow:hidden; }
 .museum-stat-email>summary { cursor:pointer;padding:17px 20px;display:grid;gap:7px;list-style:none; }
 .museum-stat-email>summary:before { content:'+';float:right;justify-self:end;grid-row:1;grid-column:1; }
 .museum-stat-email[open]>summary:before {content:'−';}
 .museum-stat-email>summary strong { padding-right:25px;grid-row:1;grid-column:1;line-height:1.5;overflow-wrap:anywhere; }
 .museum-stat-email>summary span { font-size:12px;line-height:1.5; }
 .museum-stat-source { padding:0 18px 18px;min-width:0; }
 .museum-stat-source .claim-source { margin:0!important;padding:20px!important;background:rgba(249,255,252,.8)!important;border-radius:16px!important;border:1px solid #fff!important;box-shadow:none!important; }
 .museum-stat-source blockquote { white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.75; }
 .museum-stat-source :is(a,p,small) { overflow-wrap:anywhere; }
 .museum-stat-membership { padding:18px;margin:0 0 18px;border-radius:16px;background:#fff8e4c2; }
 .museum-stat-membership h4 {margin-top:0;}
 .museum-stat-sequence-body {padding:0 20px 20px;}
 .museum-stat-sequence-group {margin-top:20px;}
 .museum-stat-sequence-group>h3 {font-size:18px;}
 .museum-stat-counted-passage,.museum-stat-qualification {line-height:1.7;padding:16px;border:1px solid #fff;border-radius:14px;background:#f5fffcce;white-space:pre-wrap;}
 .museum-stat-more {width:100%;margin-top:18px;}
 .source-backed-topic { display:flex!important;flex-direction:column;align-items:flex-start;text-align:left;color:#143e4e!important;cursor:pointer;gap:7px; }
 .source-backed-topic h3 {margin:0;font:inherit;font-weight:600;font-size:17px;}
 .source-backed-topic .topic-count {font-size:32px;line-height:1.1;}
 .source-backed-topic p {font-size:12px;line-height:1.55;margin:0;}
 .source-backed-topic .museum-stat-action {margin-top:auto;padding-top:12px;font-size:12px;font-weight:700;}
 .museum-legacy-stats {margin-top:24px;padding:18px;border:1px solid #fff;border-radius:18px;background:#f1fff9ba;}
 .museum-legacy-stats summary {cursor:pointer;font-weight:600;}
 .museum-legacy-stats .historical-topics {margin-top:18px;}
 .museum-legacy-stats .topic-card {font-size:13px;}
 .museum-stat-dialog :is(button,select,summary):focus-visible {outline:3px solid #145d7a;outline-offset:3px;}
 @media(max-width:600px) {
  .museum-stat-dialog {width:calc(100vw - 14px);height:94dvh;border-radius:20px;}
  .museum-stat-header {padding:16px;gap:12px;}
  .museum-stat-header h2 {font-size:22px;}
  .museum-stat-header .eyebrow {font-size:8px;}
  .museum-stat-content {padding:16px 12px 26px;}
  .museum-stat-scope {padding:16px;}
  .museum-stat-picker {display:grid;gap:7px;}
  .museum-stat-source {padding:0 10px 12px;}
  .museum-stat-source .claim-source {padding:16px!important;}
  .museum-stat-email>summary {padding:16px;}
 }
 @media(prefers-reduced-transparency:reduce),(prefers-contrast:more) { .museum-stat-dialog,.museum-stat-scope,.museum-stat-email {background:#f0faf5;} }
 @media print { .museum-stat-dialog {background:white!important;backdrop-filter:none;} }
}

.museum-legacy-stats{grid-column:1/-1;}
.museum-stat-basis>summary{cursor:pointer;font-size:13px;font-weight:600;}
.museum-stat-evidence-dialog{width:min(1040px,calc(100vw - 36px));max-width:none;max-height:90dvh;padding:0;border:1px solid #fff;border-radius:24px;background:rgba(235,248,240,.85);color:#143f4e;backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px);overflow:hidden;}
.museum-stat-evidence-dialog[open]{display:flex;flex-direction:column;}
.museum-stat-evidence-dialog::backdrop{background:#163e4a66;backdrop-filter:blur(10px);}
.museum-stat-evidence-dialog>.museum-dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:20px 24px;border-bottom:1px solid #a4c6c6;background:linear-gradient(110deg,#eefffcd9,#fff4dcd9);}
.museum-stat-evidence-dialog h2{font-size:clamp(23px,3vw,32px);line-height:1.3;margin:0;}
.museum-stat-evidence-dialog>.museum-dialog-body{overflow:auto;overscroll-behavior:contain;padding:22px 24px;min-height:0;}
.museum-stat-evidence-dialog .museum-dialog-close,.museum-stat-source-button,.museum-stat-open{cursor:pointer;color:#143f4e;font:inherit;border:1px solid #8fafb6;border-radius:15px;background:linear-gradient(115deg,#eafff7b3,#daf7f5bf,#fff2d7ce);box-shadow:inset 0 1px 1px white;padding:10px 14px;}
.museum-stat-source-button{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;text-align:left;}
.museum-stat-source-button>span{font-size:12px;}
.museum-stat-open{min-height:44px;}
.museum-stat-evidence-dialog .museum-stat-records{list-style:none;padding:0;display:grid;gap:12px;}
.museum-stat-evidence-dialog .museum-stat-records li,.museum-stat-intervals>li{padding:16px;border:1px solid #fff;border-radius:16px;background:linear-gradient(110deg,#f3fff9c4,#e7f9f2c9,#fff8e5d4);line-height:1.65;overflow-wrap:anywhere;}
.museum-stat-evidence-dialog .museum-stat-records a{color:#134a60;text-decoration:underline;text-underline-offset:3px;}
.museum-stat-intervals{padding-left:22px;display:grid;gap:14px;}
.museum-stat-source-note,.museum-stat-source-summary{line-height:1.7;font-size:14px;}
@media(max-width:600px){.museum-stat-evidence-dialog{width:calc(100vw - 14px);max-height:94dvh;}.museum-stat-evidence-dialog>.museum-dialog-header{padding:16px;}.museum-stat-evidence-dialog>.museum-dialog-body{padding:16px 12px;}}

.museum-stat-header-total{font-size:13px;line-height:1.4;margin:9px 0 0;color:#345969;}
.museum-stat-header-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;flex:none;max-width:40%;}
.museum-stat-change{font-size:12px!important;}
@media(max-width:600px){.museum-stat-header-actions{max-width:34%;}.museum-stat-change{padding:9px 10px!important;font-size:10px!important;}.museum-stat-header-total{font-size:11px;}}

.museum-stat-evidence-dialog .membership-source{padding:18px;margin:14px 0;border:1px solid white;border-radius:18px;background:linear-gradient(115deg,#f5fffac9,#e8f9f4c9,#fff6e4cf);}
.museum-stat-evidence-dialog .membership-source h5{margin:0 0 12px;}

/* Public popup links stay secondary to the email reading. */
.museum-stat-entry-actions{display:flex;justify-content:flex-end;padding:0 18px 12px;}
.museum-stat-entry-actions button{font-size:12px;padding:8px 12px;min-height:34px;}
.museum-stat-dialog .museum-stat-header-actions{max-width:48%;gap:6px;}
.museum-stat-header-actions>button{font-size:12px!important;padding:9px 12px!important;min-height:36px;}
.museum-stat-link-notice{padding:13px 16px;border:1px solid #b9aa7e;border-radius:14px;background:#fff6df;color:#4b4b34;font-size:13px;line-height:1.6;}
body.cinema-ui #record-panel-dialog>.museum-reader-header>.museum-stat-section-share{grid-column:1;grid-row:2;justify-self:start;min-height:34px;padding:8px 12px;border:1px solid #9ab6bc;border-radius:12px;background:linear-gradient(115deg,#eafff8c9,#fff3dac9);font-size:12px;color:#173e4b;}
@media(max-width:600px){.museum-stat-dialog .museum-stat-header-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:138px;max-width:42%;}.museum-stat-header-actions>.museum-stat-change{grid-column:1/-1;}.museum-stat-header-actions>button{font-size:11px!important;padding:8px!important;}.museum-stat-entry-actions{padding:0 12px 10px;}.museum-stat-header h2{font-size:20px;}}
