html[data-mi-reading-system="active"] [data-mi-reading-root] { isolation: isolate; }
html[data-mi-reading-system="active"] [data-mi-reading-position="relative"] { position: relative; }
[data-mi-reading-shades] {
  display: none;
  position: absolute;
  inset: 0;
  z-index: -1;
  mix-blend-mode: normal;
  overflow: clip;
  pointer-events: none;
}
/* Dock the existing panel to the inner perimeter instead of the header bottom. */
html[data-mi-reading-system="active"] body header.site-header .mobile-menu[data-refined-menu][open] > nav[data-refined-panel],
html[data-mi-reading-system="active"] body header.site-header .mobile-menu[open] > nav[data-mi-menu-plain] {
  position: fixed !important;
  top: max(var(--mi-menu-frame-top,8px),env(safe-area-inset-top)) !important;
  right: max(var(--mi-menu-frame-right,8px),env(safe-area-inset-right)) !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0 !important;
  max-width: calc(100% - var(--mi-menu-frame-left,8px) - var(--mi-menu-frame-right,8px)) !important;
  max-height: calc(100dvh - var(--mi-menu-frame-top,8px) - max(var(--mi-menu-frame-bottom,8px),env(safe-area-inset-bottom))) !important;
  z-index: 1 !important;
}
html[data-mi-reading-system="active"] body header.site-header .mobile-menu[open] > nav[data-mi-menu-plain] {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 12px;
  box-sizing: border-box;
  width: 300px;
  overflow-y: auto;
}
.mi-menu-plain-topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.mi-menu-plain-topbar > span { font-size:22px; }
[data-mi-menu-close] { display:grid; place-items:center; width:32px; height:32px; min-height:32px; padding:0; box-sizing:border-box; background:transparent; color:inherit; font:22px/1 Arial,sans-serif; cursor:pointer; }
/* The normal panel reuses its existing close control when covering the header. */
html[data-mi-reading-system="active"]:not([data-season="slate-drips"]) .mobile-menu[data-refined-menu][open] > nav[data-refined-panel] {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto minmax(0,1fr) auto;
  width: 360px;
  gap: 12px;
}
html[data-mi-reading-system="active"]:not([data-season="slate-drips"]) .mobile-menu[data-refined-menu] .rm-topbar {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 32px;
  align-items: center;
  gap: 8px;
}
html[data-mi-reading-system="active"]:not([data-season="slate-drips"]) .mobile-menu[data-refined-menu] .rm-title { display: block; font-size: 22px; }
html[data-mi-reading-system="active"]:not([data-season="slate-drips"]) .mobile-menu[data-refined-menu] .rm-languages { display: block; grid-column: auto; order: 0; }
html[data-mi-reading-system="active"]:not([data-season="slate-drips"]) .mobile-menu[data-refined-menu] .rm-languages .language-switcher { margin: 0; }
html[data-mi-reading-system="active"]:not([data-season="slate-drips"]) .mobile-menu[data-refined-menu] .rm-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  color: inherit;
  background: transparent;
  box-sizing: border-box;
  font: 22px/1 Arial,sans-serif;
  cursor: pointer;
}
html[data-mi-reading-system="active"]:not([data-season="slate-drips"]) .mobile-menu[data-refined-menu] .rm-list {
  display: grid;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
html[data-mi-reading-system="active"] [data-mi-reading-shades] { display: block; }
[data-mi-reading-shades] > i {
  display: block;
  position: absolute;
  border-radius: 16px;
  background: rgba(11,9,7,.86);
  filter: blur(clamp(18px,1.4vw,28px));
  pointer-events: none;
}
/* A lighter halo around news thumbnails; the image and its crop stay intact. */
[data-mi-reading-shades] > i[data-kind="media"] {
  border-radius: 12px;
  background: rgba(11,9,7,.58);
  filter: blur(clamp(14px,1.15vw,22px));
}

/* Keep the original Philosophy layer until the replacement was actually measured. */
html[data-mi-reading-system="active"][data-mi-philosophy-ready="true"] [data-philosophy-shades] { visibility:hidden !important; }
@media (forced-colors: none) {
  html[data-mi-reading-system="active"] [data-mi-reading-unframed="true"] { border-color:transparent !important; background:transparent !important; box-shadow:none !important; }
  html[data-mi-reading-system="active"] .philosophy-article :is(#magazin,#tattoo-elite,#top-magazin-film,.philosophy-columns,.philosophy-columns>div) { background:transparent !important; }
}
@media (forced-colors: active) { [data-mi-reading-shades] { display:none !important; } }

/* Close controls: no decorative rectangle in normal colours. */
@media (forced-colors: none) {
  html[data-mi-reading-system="active"] body header.site-header .mobile-menu[open] > nav :is(.rm-close,[data-mi-menu-close]) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
  }
  html[data-mi-reading-system="active"] body header.site-header .mobile-menu[open] > nav :is(.rm-close,[data-mi-menu-close]):focus-visible {
    text-decoration-line: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
    text-shadow: 0 0 6px currentColor;
  }
}
/* In system high-contrast mode retain a native-colour keyboard focus ring. */
@media (forced-colors: active) {
  html[data-mi-reading-system="active"] body header.site-header .mobile-menu[open] > nav :is(.rm-close,[data-mi-menu-close]):focus-visible {
    outline: 2px solid Highlight !important;
    outline-offset: 2px !important;
  }
}

/* Privacy controls: remove only the decorative rectangle in normal colours. */
@media (forced-colors: none) {
  html body #analytics-panel#analytics-panel button { border: 0 !important; outline: 0 !important; }
  html body #analytics-panel#analytics-panel button:focus-visible {
    text-decoration-line: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
  }
}
