/* R5.3 staging overlay — mobile masthead and deliberate appearance controls.
   Additive only: does not alter the five-tab dock, front page cards, articles or desktop. */
@media (max-width: 820px) {
  html { scroll-padding-top: 110px; }
  html body .aw-header {
    display: block !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 900 !important;
    width: 100% !important;
    background: #0b1b34 !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    isolation: isolate;
  }
  html body .aw-header .aw-header-top {
    display: flex !important;
    position: relative !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 55px !important;
    height: 55px !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)) !important;
    background: #0b1b34 !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }
  html body .aw-header .aw-brand {
    display: inline-flex !important;
    visibility: visible !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 160px) !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
    overflow: hidden !important;
    text-decoration: none !important;
  }
  html body .aw-header .aw-brand-mark {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: 33px !important;
    height: 33px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  html body .aw-header .aw-brand-name {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    color: #fff !important;
    line-height: 1.08 !important;
    gap: 2px !important;
  }
  html body .aw-header .aw-brand-name strong { font-size: 12px !important; letter-spacing: .10em !important; color: #fff !important; }
  html body .aw-header .aw-brand-name small { font-size: 9px !important; letter-spacing: .19em !important; color: #d1dbef !important; }
  html body .aw-header .aw-brand-upload { display: block !important; width: auto !important; max-width: 136px !important; max-height: 35px !important; object-fit: contain !important; }
  html body .aw-header .aw-desktop-nav,
  html body .aw-header .aw-header-discover,
  html body .aw-header .aw-header-install { display: none !important; }
  html body .aw-header .aw-header-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    width: auto !important;
    margin: 0 0 0 auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    transform: none !important;
  }
  html body .aw-header .aw-header-actions .aw-search-trigger,
  html body .aw-header .aw-header-actions .aw-theme-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 9px !important;
    border: 1px solid #ffffff36 !important;
    border-radius: 12px !important;
    background: #ffffff12 !important;
    color: #fff !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer !important;
    transform: none !important;
  }
  html body .aw-header .aw-header-actions .aw-icon-button svg {
    display: block !important;
    width: 19px !important;
    height: 19px !important;
    stroke: currentColor !important;
    stroke-width: 1.9 !important;
    fill: none !important;
  }
  /* Keep In Focus below the restored masthead, not over the content. */
  html body .aw-header .aw-ticker {
    display: block !important;
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: 28px !important;
    margin: 0 !important;
    z-index: 0 !important;
  }
  html body .aw-header .aw-ticker-inner { min-height: 28px !important; }
  html body .aw-global-search { z-index: 1300 !important; }
  /* Prevent fixed header covering keyboard focus and anchor destinations. */
  html body #main-content,
  html body main,
  html body article { scroll-margin-top: 112px; }
  /* The native theme button stays functional, but R5.3 provides an explicit mode chooser. */
  html body .aw-header .aw-header-actions .aw-theme-toggle { display: none !important; }
  html body .aw-header .aw53-appearance { display: block !important; position: relative !important; flex: 0 0 auto; }
  html body .aw-header .aw53-appearance-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #ffffff36 !important;
    border-radius: 12px !important;
    background: #ffffff12 !important;
    color: #fff !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    cursor: pointer !important;
  }
  html body .aw-header .aw53-appearance-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; }
  html body .aw-header .aw53-appearance-menu {
    display: grid;
    gap: 3px;
    position: absolute;
    right: 0;
    top: calc(100% + 9px);
    z-index: 1100;
    width: 182px;
    padding: 7px;
    border: 1px solid #d7e0ee;
    border-radius: 15px;
    box-shadow: 0 18px 55px #0005;
    background: #fff;
    color: #0b1b34;
  }
  html body .aw-header .aw53-appearance-menu[hidden] { display: none !important; }
  html body .aw-header .aw53-appearance-menu button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 0;
    border-radius: 10px;
    padding: 12px;
    background: transparent;
    color: #0b1b34;
    text-align: left;
    font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.3;
    cursor: pointer;
  }
  html body .aw-header .aw53-appearance-menu button[aria-pressed="true"] { background: #e9f0ff; color: #1c4caa; }
  html body .aw-header .aw53-appearance-menu button:focus-visible,
  html body .aw-header .aw53-appearance-toggle:focus-visible { outline: 2px solid #63a3ff !important; outline-offset: 2px !important; }
  /* Override only fundamental palette variables; keep existing editorial component styling. */
  html[data-aw53-resolved="light"] {
    color-scheme: light;
    --bg: #f6f8fc;
    --surface: #fff;
    --surface2: #f0f4fa;
    --ink: #0b1b34;
    --muted: #5b6c86;
    --line: #dce4ed;
    --paper: #fff;
    --text: #0b1b34;
  }
  html[data-aw53-resolved="dark"] {
    color-scheme: dark;
    --bg: #09182e;
    --surface: #122541;
    --surface2: #1a3151;
    --ink: #f3f6fd;
    --muted: #b5c4da;
    --line: #334761;
    --paper: #122541;
    --text: #f3f6fd;
  }
  html[data-aw53-resolved="light"] body { background-color: #f6f8fc !important; }
  html[data-aw53-resolved="light"] body main h1,
  html[data-aw53-resolved="light"] body main > p,
  html[data-aw53-resolved="light"] body main > section > p,
  html[data-aw53-resolved="light"] body main :is(.aw-home-lead, .aw-hero-lede, .aw-hero-copy > p, .aw-home-hero > p, .aw-home-intro > p) { color: #0b1b34 !important; }
  html[data-aw53-resolved="dark"] body { background-color: #09182e !important; }
  html[data-aw53-resolved="light"] body :is(.aw-global-search-panel, .aw-global-search-form input) {
    color: #0b1b34 !important;
  }
  html[data-aw53-resolved="dark"] body :is(.aw-global-search-panel, .aw-global-search-form input) {
    background: var(--surface) !important;
    color: #f3f6fd !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .aw53-appearance-menu, .aw53-appearance-toggle { transition: none !important; animation: none !important; }
}


/* R5.3 v2: guarantee appearance colours across the mobile masthead and tab dock.
   No global header, theme or post source is overwritten. */
@media (max-width: 820px) {
  html body { padding-top: 0 !important; margin-top: 0 !important; }
  html body > header.aw-header { margin-top: 0 !important; }
  html[data-aw53-resolved="light"] body .aw-header,
  html[data-aw53-resolved="light"] body .aw-header .aw-header-top {
    background: #fff !important;
    color: #0b1b34 !important;
    border-color: #e1e7f1 !important;
  }
  html[data-aw53-resolved="light"] body .aw-header .aw-brand-name,
  html[data-aw53-resolved="light"] body .aw-header .aw-brand-name strong,
  html[data-aw53-resolved="light"] body .aw-header .aw-brand-name small {
    color: #10233e !important;
  }
  html[data-aw53-resolved="light"] body .aw-header .aw-header-actions .aw-search-trigger,
  html[data-aw53-resolved="light"] body .aw-header .aw53-appearance-toggle {
    color: #0b1b34 !important;
    background: #f1f4f9 !important;
    border-color: #cfd9e7 !important;
  }
  html[data-aw53-resolved="light"] body .aw-header .aw-ticker {
    background: #f9fafc !important;
    color: #10233e !important;
    border-color: #e2e8ef !important;
  }
  html[data-aw53-resolved="light"] body .aw-header .aw-ticker :is(a,span,strong) { color: inherit; }
  html[data-aw53-resolved="dark"] body .aw-header,
  html[data-aw53-resolved="dark"] body .aw-header .aw-header-top {
    background: #0b1b34 !important;
    color: #f8fafc !important;
    border-color: #213a5c !important;
  }
  html[data-aw53-resolved="dark"] body .aw-header .aw-ticker {
    background: #152946 !important;
    color: #f1f5ff !important;
    border-color: #2b4161 !important;
  }
  html[data-aw53-resolved="dark"] body .aw-header .aw-ticker :is(a,span,strong) { color: inherit; }
  html[data-aw53-resolved="dark"] body .aw-header .aw53-appearance-menu {
    background: #182d4a !important;
    color: #f5f8ff !important;
    border-color: #334b6a !important;
  }
  html[data-aw53-resolved="dark"] body .aw-header .aw53-appearance-menu button {
    background: transparent; color: #f5f8ff !important;
  }
  html[data-aw53-resolved="dark"] body .aw-header .aw53-appearance-menu button[aria-pressed="true"] {
    background: #284363 !important; color: #b8d5ff !important;
  }
  /* The mobile tab dock in successive Airwaves theme rounds has used multiple
     class aliases. Restrict this to specifically named navigation surfaces. */
  html[data-aw53-resolved="dark"] body :is(
    .aw-mobile-nav, .aw-mobile-dock, .aw-mobile-tabs, .aw-bottom-nav,
    .aw-bottom-dock, .aw-tab-bar, .aw-app-dock, .aw-app-nav, .aw-pwa-nav,
    nav[aria-label="Mobile navigation"], nav[aria-label="Mobile app navigation"]
  ) {
    background: #132740 !important;
    background-image: none !important;
    border-color: #2e4563 !important;
    color: #e7edf8 !important;
    box-shadow: 0 -7px 24px #0003 !important;
  }
  html[data-aw53-resolved="dark"] body :is(
    .aw-mobile-nav, .aw-mobile-dock, .aw-mobile-tabs, .aw-bottom-nav,
    .aw-bottom-dock, .aw-tab-bar, .aw-app-dock, .aw-app-nav, .aw-pwa-nav,
    nav[aria-label="Mobile navigation"], nav[aria-label="Mobile app navigation"]
  ) :is(a, button, span, svg) { color: #d4e1f4; }
  html[data-aw53-resolved="light"] body :is(
    .aw-mobile-nav, .aw-mobile-dock, .aw-mobile-tabs, .aw-bottom-nav,
    .aw-bottom-dock, .aw-tab-bar, .aw-app-dock, .aw-app-nav, .aw-pwa-nav,
    nav[aria-label="Mobile navigation"], nav[aria-label="Mobile app navigation"]
  ) {
    background: #fff !important;
    background-image: none !important;
    color: #445571 !important;
    border-color: #e1e7f1 !important;
  }
  html[data-aw53-resolved="dark"] body :is(.aw-site-footer, .aw-footer, footer.site-footer, body > footer) {
    background-color: #10233b !important;
    color: #e7edf7 !important;
  }
  html[data-aw53-resolved="light"] body :is(.aw-site-footer, .aw-footer, footer.site-footer, body > footer) {
    background-color: #f6f8fc !important;
    color: #152941 !important;
  }
  /* In standalone mode the transparent status bar sits on top of the page.
     Place actual controls *below* the hardware safe area without a fake white gap. */
  @media (display-mode: standalone) {
    html body .aw-header .aw-header-top {
      box-sizing: border-box !important;
      padding-top: env(safe-area-inset-top, 0px) !important;
      min-height: calc(55px + env(safe-area-inset-top, 0px)) !important;
      height: calc(55px + env(safe-area-inset-top, 0px)) !important;
    }
  }
}
/* About page ID 121 — only the title/intro banner is flattened; the rest of
   the About content and existing orange editorial CTA retain their styling. */
body.page-id-121 :is(
  .aw-about-hero, .aw-about-header, .aw-about-banner, .aw-page-hero,
  .aw-page-banner, .aw-info-hero, .aw-info-page-hero, .aw-about-intro,
  main > header
) {
  background-color: #10243f !important;
  background-image: none !important;
}

/* R5.4: one-tap two-state mobile theme switch; no dropdown or system mode. */
@media (max-width:820px) {
  html body .aw-header .aw53-appearance-menu {display:none !important;}
  html body .aw-header .aw53-appearance-toggle {touch-action:manipulation;}
  html body .aw-header .aw53-appearance-toggle:focus-visible {outline:2px solid #579ce9 !important;outline-offset:2px !important;}
  /* Browser-only installation action is reachable from the mobile masthead and footer. */
  html body.aw54-ios-browser-install .aw-header .aw-header-install.aw54-install-visible {
    display:inline-flex !important;align-items:center !important;justify-content:center !important;
    flex:0 0 38px !important;width:38px !important;height:40px !important;min-width:38px !important;
    margin:0 !important;padding:9px !important;border-radius:12px !important;
    color:inherit !important;border:1px solid currentColor !important;background:transparent !important;
    visibility:visible !important;opacity:1 !important;cursor:pointer !important;
  }
  html body.aw54-ios-browser-install .aw-header .aw-header-install.aw54-install-visible svg {
    display:block !important;width:18px !important;height:18px !important;stroke:currentColor !important;
  }
  html body.aw54-ios-browser-install .aw-header .aw-header-install.aw54-install-visible span {display:none !important;}
  html body.aw54-ios-browser-install .aw-install-trigger.aw54-install-visible:not(.aw-header-install) {
    display:inline-flex !important;visibility:visible !important;opacity:1 !important;
  }
  html body.aw54-in-app .aw-install-trigger, html body.aw54-in-app [data-aw-install] {display:none !important;}
  html[data-aw53-resolved="light"] body.aw54-ios-browser-install .aw-header .aw-header-install {background:#f1f4f9 !important;border-color:#cfd9e7 !important;color:#0b1b34 !important;}
  html[data-aw53-resolved="dark"] body.aw54-ios-browser-install .aw-header .aw-header-install {background:#ffffff12 !important;border-color:#ffffff36 !important;color:#fff !important;}
}
.aw54-install-help {box-sizing:border-box;width:min(420px,calc(100vw - 30px));max-width:420px;max-height:calc(100dvh - 32px);overflow:auto;
  border:1px solid #dce4ee;border-radius:22px;padding:0;margin:auto;background:#fff;color:#0b1b34;box-shadow:0 22px 70px #0007;}
.aw54-install-help::backdrop {background:#0b1b34aa;}
.aw54-install-help-inner {position:relative;padding:30px 24px 24px;font-family:inherit;text-align:left;}
.aw54-install-help h2 {font-size:22px;line-height:1.2;letter-spacing:-.02em;margin:12px 0;color:#0b1b34;}
.aw54-install-help p {font-size:15px;line-height:1.65;color:#4b5a70;}
.aw54-help-kicker {font-size:11px;letter-spacing:.16em;font-weight:700;color:#e24b53;}
.aw54-install-close {position:absolute;right:12px;top:12px;background:#eef2f7;border:0;border-radius:100%;width:34px;height:34px;font-size:22px;cursor:pointer;color:#0b1b34;}
.aw54-install-done {display:block;width:100%;background:#0b1b34;color:#fff;border:0;border-radius:13px;padding:13px;font-size:15px;font-weight:650;cursor:pointer;margin-top:18px;}
.aw54-install-close:focus-visible,.aw54-install-done:focus-visible {outline:2px solid #377fe2;outline-offset:2px;}
@media(prefers-reduced-motion:reduce){.aw53-appearance-toggle,.aw54-install-help {transition:none!important;animation:none!important;}}
