html.mpe-reader-open { overflow: hidden; }
.mpe-reader, .mpe-reader * { box-sizing: border-box; }
.mpe-reader:not([open]) { display: none !important; }
.mpe-reader[open] {
  display: flex; flex-direction: column; gap: 0;
  width: min(1120px, calc(100% - 40px)); max-width: none;
  height: calc(100vh - 40px); height: calc(100dvh - 40px); max-height: none;
  margin: auto; padding: 0; overflow: hidden;
  border: 1px solid #eadfcb; border-radius: 22px;
  background: #fff; color: #40392f;
  box-shadow: 0 18px 65px #241d2940;
}
.mpe-reader::backdrop { background: #2623298c; }
.mpe-reader__bar {
  display: flex; align-items: center; justify-content: space-between;
  flex: 0 0 auto; gap: 16px; padding: 14px 22px;
  background: linear-gradient(105deg, #fff, #fffbee); border-bottom: 1px solid #eee6d7;
}
.mpe-reader__bar h2 { margin: 0; font: 600 20px/1.3 Georgia, serif; color: inherit; }
.mpe-reader__close {
  display: inline-flex; align-items: center; justify-content: center; gap: 18px;
  min-height: 44px; margin: 0; padding: 8px 16px; flex-shrink: 0;
  border: 1px solid #e7b200; border-radius: 999px; background: #fff;
  color: #514638; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.mpe-reader__close span { font-size: 24px; line-height: 1; }
.mpe-reader__close:hover { background: #fff7dc; color: #322d26; }
.mpe-reader__close:focus-visible, .mpe-reader a:focus-visible { outline: 3px solid #c79900; outline-offset: 3px; }
/* Keep Kadence's global focused/active button colours out of this control. */
.mpe-reader button.mpe-reader__close,
.mpe-reader button.mpe-reader__close:is(:hover, :focus, :active) {
  background: #fff !important; color: #514638 !important;
  border: 1px solid #e7b200 !important; box-shadow: none !important;
}
.mpe-reader button.mpe-reader__close:focus:not(:focus-visible) { outline: none; }
.mpe-reader button.mpe-reader__close:focus-visible { outline: 2px solid #c79900; outline-offset: 3px; }
.mpe-reader__music { flex: 0 0 auto; padding: 7px 22px; border-bottom: 1px solid #eee6d7; }
.mpe-reader .mpe-music--story { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0; padding: 0; border: 0; background: transparent; }
.mpe-reader .mpe-music__visual { display: none; }
.mpe-reader .mpe-music__button { width: auto; min-height: 40px; padding: 6px 12px; }
.mpe-reader .mpe-music__label { position: static; transform: none; opacity: 1; }
.mpe-reader .mpe-music__volume { margin: 0; }
.mpe-reader [hidden] { display: none !important; }
.mpe-reader__loading, .mpe-reader__error { margin: 0; padding: 18px 24px; flex-shrink: 0; }
.mpe-reader__error a { color: #675129; text-decoration: underline; }
.mpe-reader__frame { flex: 1 1 auto; min-height: 0; }
.mpe-reader__frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
body.mpe-reader-document { margin: 0; padding: 0; background: #fff; }
html:has(body.mpe-reader-document) { margin-top: 0 !important; }
body.mpe-reader-document #wpadminbar { display: none; }
.mpe-reader-document__content { box-sizing: border-box; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px; overflow-wrap: anywhere; }
.mpe-reader-document__content .mpe-v1-story-espresso-stories { margin: 12px auto; padding: 0; }
@media(max-width:767px){.mpe-reader .mpe-reader__music{display:none!important}}
@media (max-width: 600px) {
  .mpe-reader[open] { width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
  .mpe-reader__bar { padding: 10px 12px; gap: 8px; padding-top: max(10px, env(safe-area-inset-top)); }
  .mpe-reader__bar h2 { font-size: 16px; }
  .mpe-reader__close { padding: 8px 12px; font-size: 14px; gap: 8px; }
  .mpe-reader__music { padding: 6px 12px; }
  .mpe-reader .mpe-music--story { gap: 4px 12px; }
  .mpe-reader-document__content { padding: 16px 12px; }
}

.mpe-palette-default{--mpe-story-tint:#fffbed;--mpe-story-soft:#f8f5f2;--mpe-story-edge:#ebe5db;--mpe-story-label:#fff9e7}
.mpe-palette-peach{--mpe-story-tint:#fff3ea;--mpe-story-soft:#fffaf6;--mpe-story-edge:#eaded5;--mpe-story-label:#fff0e4}
.mpe-palette-rose{--mpe-story-tint:#fff0f3;--mpe-story-soft:#fffafb;--mpe-story-edge:#eadde1;--mpe-story-label:#fceef1}
.mpe-palette-lavender{--mpe-story-tint:#f3effc;--mpe-story-soft:#fcfaff;--mpe-story-edge:#e3deeb;--mpe-story-label:#f0ecf8}
.mpe-palette-pearl{--mpe-story-tint:#f0f2f5;--mpe-story-soft:#fafbfc;--mpe-story-edge:#dfe3e8;--mpe-story-label:#eef1f4}
.mpe-palette-vanilla{--mpe-story-tint:#fff8df;--mpe-story-soft:#fffdf6;--mpe-story-edge:#eae2c9;--mpe-story-label:#fff5d7}
.mpe-palette-sand{--mpe-story-tint:#f8f1e6;--mpe-story-soft:#fdfbf7;--mpe-story-edge:#e6ddcf;--mpe-story-label:#f4ecdf}
.mpe-palette-apricot{--mpe-story-tint:#fff0de;--mpe-story-soft:#fffaf4;--mpe-story-edge:#eadbc9;--mpe-story-label:#ffecd5}
.mpe-palette-coral{--mpe-story-tint:#ffefeb;--mpe-story-soft:#fffaf8;--mpe-story-edge:#eadbd5;--mpe-story-label:#ffe9e3}
.mpe-palette-blush{--mpe-story-tint:#fbedf2;--mpe-story-soft:#fff9fc;--mpe-story-edge:#e8d9e1;--mpe-story-label:#f9e8ef}
.mpe-palette-lilac{--mpe-story-tint:#f6edfa;--mpe-story-soft:#fdfaff;--mpe-story-edge:#e5d9ea;--mpe-story-label:#f2e6f7}
.mpe-palette-blue{--mpe-story-tint:#edf5fc;--mpe-story-soft:#f9fcff;--mpe-story-edge:#d9e3ec;--mpe-story-label:#e7f1fa}
.mpe-palette-ice{--mpe-story-tint:#edf8fa;--mpe-story-soft:#f9fdfe;--mpe-story-edge:#d8e6e9;--mpe-story-label:#e7f4f7}
.mpe-palette-mint{--mpe-story-tint:#eef8f3;--mpe-story-soft:#fafffc;--mpe-story-edge:#dae7df;--mpe-story-label:#e8f4ed}
.mpe-palette-sage{--mpe-story-tint:#f1f5ed;--mpe-story-soft:#fcfdf9;--mpe-story-edge:#dfe5d8;--mpe-story-label:#ebf1e5}
.mpe-palette-snow{--mpe-story-tint:#fafbfc;--mpe-story-soft:#ffffff;--mpe-story-edge:#e8eaed;--mpe-story-label:#f7f8fa}
.mpe-palette-silver{--mpe-story-tint:#eef0f2;--mpe-story-soft:#fdfdfd;--mpe-story-edge:#dde1e5;--mpe-story-label:#f0f2f4}
.mpe-palette-ivory{--mpe-story-tint:#fffbed;--mpe-story-soft:#fffefb;--mpe-story-edge:#eae5d9;--mpe-story-label:#fff9e9}
.mpe-palette-porcelain{--mpe-story-tint:#f4f5fc;--mpe-story-soft:#fefeff;--mpe-story-edge:#e3e5ef;--mpe-story-label:#f2f3fa}
.mpe-palette-linen{--mpe-story-tint:#f6f3ed;--mpe-story-soft:#fdfcfb;--mpe-story-edge:#e4e0d7;--mpe-story-label:#f4f0e8}
body.mpe-story-themed :is(.mp-story-card,.mpe-v1-story-story-card){background:radial-gradient(ellipse at 100% 0%,var(--mpe-story-tint) 0%,transparent 65%),#fff!important;border-color:var(--mpe-story-edge)!important}
body.mpe-story-themed :is(.mp-story-card,.mpe-v1-story-story-card):nth-child(2){background:radial-gradient(ellipse at 100% 0%,var(--mpe-story-soft) 0%,transparent 55%),#fff!important}
body.mpe-story-themed :is(.mp-story-card,.mpe-v1-story-story-card):nth-child(3){background:radial-gradient(ellipse at 100% 0%,var(--mpe-story-label) 0%,transparent 58%),#fff!important}
body.mpe-story-themed :is(.mp-story-card,.mpe-v1-story-story-card):nth-child(4){background:radial-gradient(ellipse at 100% 0%,var(--mpe-story-tint) 0%,transparent 40%),#fff!important}
body.mpe-story-themed :is(.mp-espresso-summary,.mpe-v1-story-espresso-summary){background:linear-gradient(120deg,#fff,var(--mpe-story-tint))!important;border-color:var(--mpe-story-edge)!important}
.mpe-reader.mpe-story-themed .mpe-reader__bar{background:linear-gradient(110deg,#fff,var(--mpe-story-tint))!important;border-color:var(--mpe-story-edge)!important}
.mpe-reader.mpe-story-themed button.mpe-reader__close,.mpe-reader.mpe-story-themed button.mpe-reader__close:is(:hover,:focus,:active){background:var(--mpe-story-label)!important}
