/*
  Historical Results standardization
  Scope: /historical-results/
  Goal: align page rhythm, shell, hero, header, cards, filters, and cycle list with the current homepage design.
*/

body.cmep-historical-page{
  --home-bg:#f3f5f8;
  --home-bg-soft:#eef2f7;
  --home-surface:#ffffff;
  --home-surface-2:#f8fafc;
  --home-surface-3:#eef2f7;
  --home-border:#d8dee8;
  --home-border-strong:#b9c3d1;
  --home-text:#172033;
  --home-strong:#08111f;
  --home-muted:#5d6b7f;
  --home-subtle:#7b8798;
  --home-shadow:0 18px 38px rgba(15,23,42,.08);
  --home-shadow-soft:0 8px 20px rgba(15,23,42,.06);
  --home-radius:22px;
  --home-radius-lg:32px;
  --home-radius-sm:16px;
  --home-shell:1360px;

  --bg-page:var(--home-bg);
  --bg-card:var(--home-surface);
  --bg-card-subtle:var(--home-surface-2);
  --border-subtle:var(--home-border);
  --text-main:var(--home-text);
  --text-muted:var(--home-muted);
  --text-strong:var(--home-strong);
  --shadow-soft:var(--home-shadow);
  --shadow-subtle:var(--home-shadow-soft);

  margin:0 !important;
  padding-top:var(--header-offset,0px) !important;
  background:
    radial-gradient(circle at 12% 18%, rgba(100,116,139,.12), transparent 28rem),
    linear-gradient(180deg,var(--home-bg),var(--home-bg-soft)) !important;
  color:var(--home-text) !important;
  color-scheme:light;
}

@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]):not(.light) body.cmep-historical-page:not(.light):not(.light-mode){
    --home-bg:#050b16;
    --home-bg-soft:#020617;
    --home-surface:#0c1422;
    --home-surface-2:#111b2a;
    --home-surface-3:#162235;
    --home-border:#263347;
    --home-border-strong:#384861;
    --home-text:#d9e3f0;
    --home-strong:#f8fafc;
    --home-muted:#aeb9c8;
    --home-subtle:#8fa0b5;
    --home-shadow:0 22px 50px rgba(0,0,0,.34);
    --home-shadow-soft:0 12px 26px rgba(0,0,0,.26);
    background:
      radial-gradient(circle at 12% 18%, rgba(148,163,184,.12), transparent 32rem),
      linear-gradient(180deg,var(--home-bg),var(--home-bg-soft)) !important;
    color-scheme:dark;
  }
}
html[data-theme="dark"] body.cmep-historical-page,
html.dark body.cmep-historical-page,
body.cmep-historical-page.dark,
body.cmep-historical-page.dark-mode{
  --home-bg:#050b16;
  --home-bg-soft:#020617;
  --home-surface:#0c1422;
  --home-surface-2:#111b2a;
  --home-surface-3:#162235;
  --home-border:#263347;
  --home-border-strong:#384861;
  --home-text:#d9e3f0;
  --home-strong:#f8fafc;
  --home-muted:#aeb9c8;
  --home-subtle:#8fa0b5;
  --home-shadow:0 22px 50px rgba(0,0,0,.34);
  --home-shadow-soft:0 12px 26px rgba(0,0,0,.26);
  background:
    radial-gradient(circle at 12% 18%, rgba(148,163,184,.12), transparent 32rem),
    linear-gradient(180deg,var(--home-bg),var(--home-bg-soft)) !important;
  color-scheme:dark;
}
html[data-theme="light"] body.cmep-historical-page,
html.light body.cmep-historical-page,
body.cmep-historical-page.light,
body.cmep-historical-page.light-mode{
  --home-bg:#f3f5f8;
  --home-bg-soft:#eef2f7;
  --home-surface:#ffffff;
  --home-surface-2:#f8fafc;
  --home-surface-3:#eef2f7;
  --home-border:#d8dee8;
  --home-border-strong:#b9c3d1;
  --home-text:#172033;
  --home-strong:#08111f;
  --home-muted:#5d6b7f;
  --home-subtle:#7b8798;
  --home-shadow:0 18px 38px rgba(15,23,42,.08);
  --home-shadow-soft:0 8px 20px rgba(15,23,42,.06);
  background:
    radial-gradient(circle at 12% 18%, rgba(100,116,139,.12), transparent 28rem),
    linear-gradient(180deg,var(--home-bg),var(--home-bg-soft)) !important;
  color-scheme:light;
}

body.cmep-historical-page *,
body.cmep-historical-page *::before,
body.cmep-historical-page *::after{box-sizing:border-box;}

body.cmep-historical-page a{text-decoration:none;}
body.cmep-historical-page a:hover{text-decoration:none;}

/* Homepage header treatment. */
body.cmep-historical-page #cm-header,
body.cmep-historical-page .cm-header,
body.cmep-historical-page .cm-header header,
body.cmep-historical-page header.cm-header{
  position:sticky !important;
  top:0 !important;
  z-index:50 !important;
  background:rgba(255,255,255,.88) !important;
  border-bottom:1px solid var(--home-border) !important;
  backdrop-filter:blur(18px) saturate(130%) !important;
  -webkit-backdrop-filter:blur(18px) saturate(130%) !important;
  color:var(--home-text) !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]):not(.light) body.cmep-historical-page:not(.light):not(.light-mode) #cm-header,
  html:not([data-theme="light"]):not(.light) body.cmep-historical-page:not(.light):not(.light-mode) .cm-header,
  html:not([data-theme="light"]):not(.light) body.cmep-historical-page:not(.light):not(.light-mode) .cm-header header,
  html:not([data-theme="light"]):not(.light) body.cmep-historical-page:not(.light):not(.light-mode) header.cm-header{background:rgba(5,11,22,.88) !important;}
}
html[data-theme="dark"] body.cmep-historical-page #cm-header,
html.dark body.cmep-historical-page #cm-header,
body.cmep-historical-page.dark #cm-header,
body.cmep-historical-page.dark-mode #cm-header,
html[data-theme="dark"] body.cmep-historical-page .cm-header,
html.dark body.cmep-historical-page .cm-header,
body.cmep-historical-page.dark .cm-header,
body.cmep-historical-page.dark-mode .cm-header{background:rgba(5,11,22,.88) !important;}
body.cmep-historical-page .header-inner{
  max-width:var(--home-shell) !important;
  padding:.72rem clamp(12px,2.1vw,28px) .78rem !important;
  gap:.5rem !important;
}
body.cmep-historical-page .logo-link,
body.cmep-historical-page .site-title,
body.cmep-historical-page #cm-header a{color:var(--home-strong) !important;}
body.cmep-historical-page #cm-nav{
  gap:.18rem !important;
  padding:.18rem !important;
  border:1px solid var(--home-border) !important;
  border-radius:999px !important;
  background:var(--home-surface-2) !important;
}
body.cmep-historical-page #cm-nav a{
  color:var(--home-muted) !important;
  border-radius:999px !important;
  padding:.38rem .72rem !important;
  background:transparent !important;
  font-weight:750 !important;
}
body.cmep-historical-page #cm-nav a:hover,
body.cmep-historical-page #cm-nav a.active,
body.cmep-historical-page #cm-nav a[aria-current="page"]{
  background:var(--home-surface) !important;
  color:var(--home-strong) !important;
  box-shadow:0 1px 4px rgba(15,23,42,.10) !important;
}

body.cmep-historical-page .historical-main,
body.cmep-historical-page .page-shell{
  width:min(100%,var(--home-shell)) !important;
  max-width:var(--home-shell) !important;
  margin:0 auto !important;
  padding:clamp(14px,2.2vw,30px) clamp(12px,2.4vw,34px) clamp(30px,4vw,56px) !important;
}

body.cmep-historical-page .cm-card{
  background:var(--home-surface) !important;
  border:1px solid var(--home-border) !important;
  border-radius:var(--home-radius) !important;
  box-shadow:var(--home-shadow) !important;
  color:var(--home-text) !important;
  margin:0 0 clamp(16px,2vw,24px) !important;
  padding:clamp(18px,2.2vw,28px) !important;
}

body.cmep-historical-page .historical-hero,
body.cmep-historical-page .title-card{
  margin:0 auto clamp(18px,2vw,28px) !important;
  padding:clamp(22px,3vw,44px) clamp(18px,4vw,54px) !important;
  border:1px solid var(--home-border) !important;
  border-radius:clamp(22px,2.4vw,34px) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(148,163,184,.16), transparent 34rem),
    linear-gradient(180deg,var(--home-surface),var(--home-surface-2)) !important;
  box-shadow:var(--home-shadow) !important;
  text-align:center !important;
  overflow:hidden !important;
}
body.cmep-historical-page .historical-hero h1,
body.cmep-historical-page .cm-h1{
  margin:0 !important;
  color:var(--home-strong) !important;
  font-size:clamp(2.1rem,4.4vw,4rem) !important;
  line-height:.96 !important;
  letter-spacing:-.065em !important;
  font-weight:1000 !important;
  text-wrap:balance;
}
body.cmep-historical-page .historical-hero .cm-lede,
body.cmep-historical-page .cm-lede{
  max-width:780px !important;
  margin:.82rem auto 0 !important;
  color:var(--home-muted) !important;
  font-size:clamp(.95rem,1.42vw,1.1rem) !important;
  line-height:1.43 !important;
  font-weight:700 !important;
  text-wrap:balance;
}

body.cmep-historical-page .cm-card-header,
body.cmep-historical-page .historical-card-header{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  text-align:center !important;
  margin:0 auto .9rem !important;
}
body.cmep-historical-page .cm-h2{
  margin:0 !important;
  color:var(--home-strong) !important;
  font-size:clamp(1.35rem,2.2vw,2rem) !important;
  line-height:1.02 !important;
  letter-spacing:-.045em !important;
  font-weight:1000 !important;
  text-wrap:balance;
}
body.cmep-historical-page .cm-card-body{margin-top:0 !important;}

/* Accuracy summary as homepage cards. */
body.cmep-historical-page .historical-summary-card .cm-card-body{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.9rem;
}
body.cmep-historical-page .cm-progress-group{
  margin:0 !important;
  padding:.95rem !important;
  border:1px solid var(--home-border) !important;
  border-radius:18px !important;
  background:var(--home-surface-2) !important;
  box-shadow:var(--home-shadow-soft) !important;
}
body.cmep-historical-page .cm-progress-label{
  color:var(--home-strong) !important;
  font-size:.88rem !important;
  font-weight:900 !important;
  letter-spacing:-.01em !important;
}
body.cmep-historical-page .cm-progress-label span:last-child{color:var(--home-muted) !important;}
body.cmep-historical-page .cm-progress-track{
  height:12px !important;
  margin-top:.58rem !important;
  border:1px solid var(--home-border) !important;
  border-radius:999px !important;
  background:var(--home-surface) !important;
  overflow:hidden !important;
}
body.cmep-historical-page .cm-progress-bar{
  background:linear-gradient(90deg,#64c466,#86efac) !important;
  border-radius:inherit !important;
}

/* Toolbar */
body.cmep-historical-page .historical-toolbar-card,
body.cmep-historical-page .cm-toolbar{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  gap:.75rem !important;
  padding:clamp(16px,2vw,22px) !important;
  background:var(--home-surface) !important;
  border:1px solid var(--home-border) !important;
  border-radius:var(--home-radius) !important;
  box-shadow:var(--home-shadow) !important;
}
body.cmep-historical-page .toolbar-row{
  width:100% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:.75rem !important;
}
body.cmep-historical-page .toolbar-row--wrap{align-items:center !important;}
body.cmep-historical-page .toolbar-title{
  color:var(--home-strong) !important;
  font-size:clamp(1.05rem,1.8vw,1.3rem) !important;
  line-height:1 !important;
  letter-spacing:-.035em !important;
  font-weight:1000 !important;
}
body.cmep-historical-page .toolbar-group{
  display:flex !important;
  align-items:center !important;
  gap:.46rem !important;
  flex-wrap:wrap !important;
}
body.cmep-historical-page .cm-btn,
body.cmep-historical-page .cm-select,
body.cmep-historical-page .filter-chip{
  min-height:2.25rem !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:.45rem !important;
  padding:.58rem .86rem !important;
  border:1px solid var(--home-border) !important;
  border-radius:999px !important;
  background:var(--home-surface-2) !important;
  color:var(--home-muted) !important;
  box-shadow:none !important;
  text-decoration:none !important;
  font-size:.82rem !important;
  line-height:1.05 !important;
  font-weight:850 !important;
  letter-spacing:-.01em !important;
  cursor:pointer !important;
}
body.cmep-historical-page .cm-btn:hover,
body.cmep-historical-page .filter-chip:hover{
  transform:translateY(-1px) !important;
  background:var(--home-surface) !important;
  color:var(--home-strong) !important;
  border-color:var(--home-border-strong) !important;
  box-shadow:var(--home-shadow-soft) !important;
}
body.cmep-historical-page .cm-btn--ghost{background:transparent !important;}
body.cmep-historical-page .cm-select{
  appearance:none !important;
  -webkit-appearance:none !important;
  padding-right:2.1rem !important;
  background-image:linear-gradient(45deg,transparent 50%,var(--home-muted) 50%),linear-gradient(135deg,var(--home-muted) 50%,transparent 50%) !important;
  background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50% !important;
  background-size:5px 5px,5px 5px !important;
  background-repeat:no-repeat !important;
}
body.cmep-historical-page .filter-chip input{accent-color:var(--home-strong);}
body.cmep-historical-page .cm-label{
  color:var(--home-muted) !important;
  font-size:.72rem !important;
  line-height:1 !important;
  font-weight:950 !important;
  letter-spacing:.16em !important;
  text-transform:uppercase !important;
}

/* Cycle list and accordions */
body.cmep-historical-page .historical-cycle-list{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(12px,1.6vw,18px);
  align-items:start;
}
body.cmep-historical-page .year-collapsible{
  margin:0 !important;
  min-width:0;
}
body.cmep-historical-page .year-collapsible:has(.collapsible-content.open){
  grid-column:1/-1;
}
body.cmep-historical-page .collapsible{
  min-height:4.6rem !important;
  width:100% !important;
  padding:1rem 1.05rem !important;
  border:1px solid var(--home-border) !important;
  border-radius:var(--home-radius) !important;
  background:var(--home-surface) !important;
  color:var(--home-text) !important;
  box-shadow:var(--home-shadow-soft) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:1rem !important;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease !important;
}
body.cmep-historical-page .collapsible:hover,
body.cmep-historical-page .collapsible.active{
  transform:translateY(-1px) !important;
  border-color:var(--home-border-strong) !important;
  box-shadow:var(--home-shadow) !important;
  background:linear-gradient(180deg,var(--home-surface),var(--home-surface-2)) !important;
}
body.cmep-historical-page .year-label{gap:.25rem !important;}
body.cmep-historical-page .year-label .cycle-word{
  color:var(--home-muted) !important;
  font-size:.7rem !important;
  line-height:1 !important;
  letter-spacing:.16em !important;
  font-weight:950 !important;
  text-transform:uppercase !important;
}
body.cmep-historical-page .year-label .cycle-year{
  color:var(--home-strong) !important;
  font-size:clamp(1.5rem,2.4vw,2rem) !important;
  line-height:.95 !important;
  letter-spacing:-.05em !important;
  font-weight:1000 !important;
}
body.cmep-historical-page .arrow{
  width:2.15rem !important;
  height:2.15rem !important;
  flex:0 0 2.15rem !important;
  display:grid !important;
  place-items:center !important;
  border:1px solid var(--home-border) !important;
  border-radius:999px !important;
  background:var(--home-surface-2) !important;
  color:var(--home-muted) !important;
  font-size:.78rem !important;
  box-shadow:none !important;
}
body.cmep-historical-page .collapsible.active .arrow{
  background:var(--home-surface) !important;
  color:var(--home-strong) !important;
}
body.cmep-historical-page .collapsible-content{
  padding:0 !important;
  border:0 !important;
}
body.cmep-historical-page .collapsible-content.open{
  padding:.85rem 0 0 !important;
}
body.cmep-historical-page .section-block{
  margin:0 0 .85rem !important;
  padding:clamp(14px,1.7vw,20px) !important;
  border:1px solid var(--home-border) !important;
  border-radius:18px !important;
  background:var(--home-surface) !important;
  box-shadow:var(--home-shadow-soft) !important;
}
body.cmep-historical-page .section-title{
  color:var(--home-strong) !important;
  font-size:1.05rem !important;
  line-height:1.1 !important;
  letter-spacing:-.035em !important;
  font-weight:1000 !important;
  margin:0 0 .55rem !important;
}
body.cmep-historical-page .kv-list-wrapper{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:.9rem !important;
}
body.cmep-historical-page .kv-list{
  margin:.4rem 0 0 !important;
  padding:0 !important;
}
body.cmep-historical-page .kv-list li{
  padding:.4rem 0 !important;
  border-bottom:1px solid color-mix(in srgb,var(--home-border) 75%, transparent) !important;
  color:var(--home-text) !important;
  font-weight:700 !important;
}
body.cmep-historical-page .kv-list li:last-child{border-bottom:0 !important;}
body.cmep-historical-page strong{color:var(--home-strong);}

body.cmep-historical-page .cm-pill{
  min-height:1.45rem !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:999px !important;
  padding:.28rem .66rem !important;
  color:#fff !important;
  font-size:.73rem !important;
  line-height:1 !important;
  font-weight:950 !important;
  letter-spacing:-.01em !important;
  white-space:nowrap !important;
}

body.cmep-historical-page .accuracy-inline{
  display:grid !important;
  grid-template-columns:auto minmax(180px,1fr) auto !important;
  align-items:center !important;
  gap:.8rem !important;
  padding:.78rem .9rem !important;
  border:1px solid var(--home-border) !important;
  border-radius:16px !important;
  background:var(--home-surface-2) !important;
}
body.cmep-historical-page .accuracy-inline .cm-progress-track{margin:0 !important;}
body.cmep-historical-page .accuracy-inline span{
  color:var(--home-muted) !important;
  font-weight:950 !important;
}

body.cmep-historical-page .gov-grid{
  grid-template-columns:repeat(auto-fit,minmax(250px,1fr)) !important;
  gap:.75rem !important;
}
body.cmep-historical-page .gov-item{
  padding:.78rem .85rem !important;
  border:1px solid var(--home-border) !important;
  border-radius:16px !important;
  background:var(--home-surface-2) !important;
  box-shadow:none !important;
}
body.cmep-historical-page .gov-item-header{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:.75rem !important;
  color:var(--home-strong) !important;
  font-weight:950 !important;
}
body.cmep-historical-page .gov-meta{color:var(--home-muted) !important;}

@media (max-width:980px){
  body.cmep-historical-page .historical-summary-card .cm-card-body{grid-template-columns:repeat(2,minmax(0,1fr));}
  body.cmep-historical-page .historical-cycle-list{grid-template-columns:1fr;}
}
@media (max-width:720px){
  body.cmep-historical-page .historical-main,
  body.cmep-historical-page .page-shell{padding:12px 10px 32px !important;}
  body.cmep-historical-page .historical-summary-card .cm-card-body{grid-template-columns:1fr;}
  body.cmep-historical-page .toolbar-row,
  body.cmep-historical-page .toolbar-row--wrap{
    align-items:stretch !important;
    flex-direction:column !important;
  }
  body.cmep-historical-page .toolbar-group{width:100% !important;}
  body.cmep-historical-page .cm-btn,
  body.cmep-historical-page .cm-select,
  body.cmep-historical-page .filter-chip{flex:1 1 auto !important;}
  body.cmep-historical-page .kv-list-wrapper{grid-template-columns:1fr !important;}
  body.cmep-historical-page .accuracy-inline{grid-template-columns:1fr !important;}
}

/* 2026-06-30: Match the shared forecast/state injected header, not the earlier homepage pill header. */
body.cmep-historical-page .cm-header,
body.cmep-historical-page .cm-header header,
body.cmep-historical-page header.cm-header,
body.cmep-historical-page #cm-header{
  position:sticky !important;
  top:0 !important;
  z-index:50 !important;
  background:var(--home-surface) !important;
  border-bottom:1px solid var(--home-border) !important;
  box-shadow:none !important;
  color:var(--home-text) !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
body.cmep-historical-page .header-inner{
  max-width:1150px !important;
  padding:.8rem 1rem 1rem !important;
  gap:.55rem !important;
}
body.cmep-historical-page .logo-link,
body.cmep-historical-page .site-title,
body.cmep-historical-page #cm-header a{
  color:var(--home-strong) !important;
}
body.cmep-historical-page #cm-nav{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  padding:0 !important;
  gap:.45rem !important;
}
body.cmep-historical-page #cm-nav a{
  background:transparent !important;
  color:var(--home-muted) !important;
  border:0 !important;
  border-radius:999px !important;
  padding:.42rem .85rem !important;
  font-size:.92rem !important;
  line-height:1.1 !important;
  font-weight:800 !important;
  box-shadow:none !important;
}
body.cmep-historical-page #cm-nav a:hover,
body.cmep-historical-page #cm-nav a.active,
body.cmep-historical-page #cm-nav a.is-active,
body.cmep-historical-page #cm-nav a.selected,
body.cmep-historical-page #cm-nav a.current,
body.cmep-historical-page #cm-nav a[aria-current="page"]{
  background:var(--home-surface-3) !important;
  color:var(--home-strong) !important;
  box-shadow:none !important;
}

/* Keep the Cycle label neutral so it does not read as an off-color badge. */
body.cmep-historical-page .year-label .cm-label,
body.cmep-historical-page .year-label .cycle-word{
  display:inline !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:var(--home-muted) !important;
}

@media (max-width:760px){
  body.cmep-historical-page .header-inner{
    padding:.58rem .45rem .72rem !important;
    gap:.42rem !important;
  }
  body.cmep-historical-page #cm-nav{gap:.22rem !important;}
  body.cmep-historical-page #cm-nav a{
    padding:.38rem .58rem !important;
    font-size:.82rem !important;
  }
}

/* Patch: remove the off-color wrapper surface behind each historical cycle button. */
body.cmep-historical-page .historical-cycle-list > .year-collapsible{
  background:transparent !important;
  background-color:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:0 !important;
  padding:0 !important;
}
body.cmep-historical-page .historical-cycle-list > .year-collapsible::before,
body.cmep-historical-page .historical-cycle-list > .year-collapsible::after{
  display:none !important;
  content:none !important;
  background:transparent !important;
  box-shadow:none !important;
}
