/* Touch controls share the desktop outline and chapter data. */
.mf-guide-mobile-nav, .mf-guide-mobile-sheet { display: none; }
@media (max-width: 1100px) {
  body.mf-has-mobile-guide-nav { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px) + var(--mf-guide-ad-bottom, 0px)); }
  .mf-guide-mobile-nav:not([hidden]) {
    position: fixed; z-index: 10020; left: 50%; transform: translateX(-50%);
    bottom: calc(10px + env(safe-area-inset-bottom, 0px) + var(--mf-guide-ad-bottom, 0px));
    display: flex; align-items: stretch; width: max-content; max-width: calc(100% - 24px);
    padding: 5px; gap: 3px; background: #fff; border: 1px solid #d3e2ec; border-radius: 15px;
    box-shadow: 0 5px 26px #132f4d26; box-sizing: border-box;
  }
  .mf-guide-mobile-nav *, .mf-guide-mobile-sheet * { box-sizing: border-box; }
  .mf-guide-mobile-nav :where(a, button) {
    flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 46px; padding: 8px 15px; border: 0; border-radius: 10px; background: transparent;
    font: 700 14px/1.3 system-ui, sans-serif; color: #205879; text-decoration: none; white-space: nowrap; cursor: pointer;
  }
  .mf-guide-mobile-nav a { background: #edf5fa; }
  .mf-guide-mobile-nav button[hidden] { display: none; }
  .mf-guide-mobile-nav button:hover, .mf-guide-mobile-nav button[aria-expanded="true"] { background: #edf5fa; }
  .mf-guide-mobile-nav :where(a, button):focus-visible, .mf-guide-mobile-sheet :where(a, button):focus-visible { outline: 3px solid #0874b0; outline-offset: 2px; }
  .mf-guide-mobile-sheet[open] {
    display: flex; flex-direction: column; position: fixed; inset: auto 12px calc(82px + env(safe-area-inset-bottom, 0px) + var(--mf-guide-ad-bottom, 0px));
    margin: 0 auto; width: min(480px, calc(100% - 24px)); max-width: none;
    max-height: min(66dvh, calc(100dvh - 110px - var(--mf-guide-ad-bottom, 0px)));
    padding: 0; border: 1px solid #d3e2ec; border-radius: 19px; background: #fff; color: #142d43;
    box-shadow: 0 12px 42px #0c244d40; overflow: hidden; box-sizing: border-box;
  }
  .mf-guide-mobile-sheet::backdrop { background: #10263b55; }
  .mf-guide-mobile-sheet-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; border-bottom: 1px solid #e3ebf1; flex: 0 0 auto; }
  .mf-guide-mobile-sheet-head h2 { margin: 0; flex: 1; font: 750 18px/1.3 system-ui, sans-serif; color: #142d43; }
  .mf-guide-mobile-sheet-head button { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 10px; background: #edf5fa; color: #205879; font: 400 26px/1 system-ui, sans-serif; cursor: pointer; }
  .mf-guide-mobile-sheet-body { padding: 10px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .mf-guide-mobile-sheet-body :where(ol,li) { list-style: none; margin: 0; padding: 0; border: 0; }
  .mf-guide-mobile-sheet-body ol ol a { padding-left: 28px; font-size: 14px; }
  .mf-guide-mobile-sheet-body a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; border-radius: 10px; font: 600 15px/1.4 system-ui, sans-serif; color: #205879; text-decoration: none; box-sizing: border-box; }
  .mf-guide-mobile-sheet-body a:hover, .mf-guide-mobile-sheet-body a[aria-current] { background: #edf5fa; color: #07507c; }
  .mf-guide-mobile-sheet-body .mf-guide-chapter-number { flex: 0 0 25px; text-align: center; font-size: 12px; background: #e1edf5; border-radius: 6px; padding: 4px; }
  body.mf-guide-mobile-keyboard .mf-guide-mobile-nav { display: none; }
}
@media (max-width: 360px) { .mf-guide-mobile-nav :where(a, button) { padding-inline: 11px; font-size: 13px; } }

@media print { .mf-guide-mobile-nav, .mf-guide-mobile-sheet { display: none !important; } body.mf-has-mobile-guide-nav { padding-bottom: 0; } }

/* Keep Google's collapsed badge clear of the floating reading controls. */
@media (max-width:1100px) {
  body.mf-has-mobile-guide-nav:has(.mf-guide-mobile-nav:not([hidden])) .grecaptcha-badge {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px) + var(--mf-guide-ad-bottom, 0px)) !important;
  }
}
