/* The title and its initial task occupy the same reading column as the page. */
/* Old loaders briefly prepend these rows. The controller assigns their reading positions. */
html[data-header-correction] body>:is(.mwi-context,.mwi-related,.epw-breadcrumb):has(~#mg-site) {
  display:none!important;
}
html[data-header-correction] :where(.hc-context,.hc-primary-context) {
  box-sizing:border-box;
  max-inline-size:100%;
  margin:.35rem 0;
  color:var(--md-secondary,#515648);
  font:600 .84rem/1.45 system-ui,sans-serif;
}
html[data-header-correction] .hc-primary-context a,
html[data-header-correction] .hc-context a {
  color:var(--md-link,#624329)!important;
  text-decoration:underline;
  text-underline-offset:.2em;
}
html[data-header-correction] :is(.hc-secondary,[data-hc-chronology-tools]>details) {
  box-sizing:border-box;
  max-inline-size:100%;
  min-inline-size:0;
  width:fit-content;
  margin:.45rem 0;
  border:1px solid var(--md-line,#a39f87);
  border-radius:.3rem;
  background:var(--md-panel,#faf9f4);
  color:var(--md-ink,#262923);
}
html[data-header-correction] :is(.hc-secondary,[data-hc-chronology-tools]>details)>summary {
  padding:.4rem .65rem;
  min-block-size:2.25rem;
  box-sizing:border-box;
  color:var(--md-link,#624329);
  font:600 .84rem/1.6 system-ui,sans-serif;
  cursor:pointer;
}
html[data-header-correction] :is(.hc-secondary,[data-hc-reference-content]) .mwi-related {
  flex-wrap:wrap;
  overflow:visible;
  padding:.15rem .65rem .45rem;
  margin:0;
  border:0;
}
html[data-header-correction] :is(.hc-secondary,[data-hc-reference-content]) .mwi-related :is(a,.mwi-current-page) {
  min-inline-size:0;
  max-inline-size:100%;
  white-space:normal;
  overflow-wrap:anywhere;
}
html[data-header-correction] .hc-secondary .epw-breadcrumb {
  padding:.15rem .65rem;
}

html[data-header-correction] body>header.hc-chronology-title {
  box-sizing:border-box;
  max-inline-size:78rem;
  margin-inline:auto;
  padding:clamp(.65rem,2vw,1.05rem) clamp(.75rem,3vw,1.75rem);
  border:0;
  background:var(--md-panel,#faf9f4)!important;
}
html[data-header-correction] .hc-chronology-title h1 {
  margin:.18rem 0 .25rem;
  font-size:clamp(1.65rem,3.3vw,2.8rem);
  line-height:1.15;
}
html[data-header-correction] .hc-chronology-title h1 span { color:var(--md-secondary,#515648)!important; }
html[data-header-correction] .hc-chronology-lead {
  margin:.3rem 0 0;
  max-inline-size:74ch;
  color:var(--md-ink,#262923);
  font:.94rem/1.48 system-ui,sans-serif;
}
html[data-header-correction] :is(.hc-chronology-lead,.hc-tool-label) [lang|=zh] { display:none; }
html[lang|=zh][data-header-correction] :is(.hc-chronology-lead,.hc-tool-label) [lang|=zh],
html[data-header-correction] body[data-lang=zh] :is(.hc-chronology-lead,.hc-tool-label) [lang|=zh],
html[data-header-correction] body[data-lang=both] :is(.hc-chronology-lead,.hc-tool-label) [lang|=zh] { display:inline; }
html[lang|=zh][data-header-correction] :is(.hc-chronology-lead,.hc-tool-label) [lang=en],
html[data-header-correction] body[data-lang=zh] :is(.hc-chronology-lead,.hc-tool-label) [lang=en] { display:none; }
html[data-header-correction] body[data-lang=both] .hc-tool-label [lang|=zh]::before {content:" · ";}
html[data-header-correction] .hc-primary-context+h1 { color:var(--md-ink,#262923); }
html[data-header-correction] #legend:has([data-hc-chronology-tools]) {
  box-sizing:border-box;
  gap:.35rem .85rem;
  padding:.4rem clamp(.6rem,3vw,1.75rem);
  border-color:var(--md-line,#a39f87);
  background:var(--md-panel,#faf9f4);
  color:var(--md-ink,#262923);
}
html[data-header-correction] #legend:has([data-hc-chronology-tools])>.grp {
  flex-wrap:wrap;
  padding-inline:0;
}
html[data-header-correction] [data-hc-chronology-tools] {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:.35rem .6rem;
  min-inline-size:0;
}
html[data-header-correction] [data-hc-chronology-tools]>details { margin:0; }
html[data-header-correction] [data-hc-chronology-tools]>details[open] { max-inline-size:min(38rem,100%); }
html[data-header-correction] :is([data-hc-filter-content],[data-hc-reference-content]) {
  box-sizing:border-box;
  padding:.25rem .7rem .65rem;
  color:var(--md-ink,#262923);
  font:.85rem/1.55 system-ui,sans-serif;
}
html[data-header-correction] #legend [data-hc-filter-content] {
  display:grid;
  gap:.5rem;
  max-height:min(45vh,19rem);
  overflow-y:auto;
}
html[data-header-correction] #legend [data-hc-filter-content] .grp { flex-wrap:wrap; height:auto; }
html[data-header-correction] [data-hc-reference-content] p { margin:.3rem 0; }
html[data-header-correction] [data-hc-reference-content] a { color:var(--md-link,#624329); }

@media(max-width:600px) {
  html[data-header-correction] #legend:has([data-hc-chronology-tools]) { gap:.35rem; }
  html[data-header-correction] [data-hc-chronology-tools] { flex:1 1 100%; }
}
@media(max-width:840px) {
  html[data-header-correction] body[data-cw-suite]:has(>#mg-site) { padding-top:0!important; }
  html[data-header-correction] body[data-cw-suite]:has(>#mg-site)>#cws-toggle {
    position:sticky!important;
    inset:0 auto auto auto!important;
    width:auto!important;
    margin:.25rem .65rem;
    padding:.35rem .65rem;
    min-height:2.5rem;
    border:1px solid var(--md-line,#a39f87)!important;
    border-radius:.3rem;
  }
}
