/* M5 PWA PREMIUM 1.0.0 — namespaced to avoid FarmingPro/MEDIA5 collisions */
#m5pwa-root[hidden], #m5pwa-root [hidden] { display: none !important; }
#m5pwa-root { position: relative; z-index: 2147480000; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
#m5pwa-banner { box-sizing: border-box; position: fixed; z-index: 2147480001; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); display:flex; align-items:center; gap:12px; max-width:560px; margin-inline:auto; padding:14px; border:1px solid rgba(142,201,255,.35); border-radius:20px; background:linear-gradient(120deg,#0a213b,#123c66); box-shadow:0 16px 55px rgba(0,0,0,.38); color:#fff; }
#m5pwa-banner img { width:48px; height:48px; border-radius:13px; flex-shrink:0; object-fit:cover; }
#m5pwa-banner .m5pwa-banner-copy { display:flex; flex:1; flex-direction:column; min-width:0; gap:2px; }
#m5pwa-banner .m5pwa-banner-copy strong { font-size:16px; font-weight:750; letter-spacing:.1px; color:#fff; }
#m5pwa-banner .m5pwa-banner-copy span { font-size:12px; color:#c6dcf2; line-height:1.35; }
#m5pwa-root button { font:inherit; cursor:pointer; touch-action:manipulation; }
#m5pwa-root .m5pwa-primary { padding:11px 14px; background:linear-gradient(135deg,#55b9ff,#1a77d0); color:#081c30; font-size:13px; font-weight:800; border:0; border-radius:12px; white-space:nowrap; }
#m5pwa-root .m5pwa-primary:focus-visible, #m5pwa-root button:focus-visible { outline:3px solid #fff; outline-offset:3px; }
#m5pwa-root .m5pwa-dismiss { display:grid; place-items:center; align-self:flex-start; padding:2px 6px; border:0; border-radius:8px; background:transparent; color:#d7e9fa; font-size:24px; line-height:1; }
#m5pwa-backdrop { position:fixed; z-index:2147480002; inset:0; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(2,10,23,.78); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
#m5pwa-dialog { box-sizing:border-box; width:min(100%,460px); max-height:calc(100dvh - 40px); overflow:auto; position:relative; padding:32px 26px 25px; border:1px solid rgba(132,184,240,.28); border-radius:24px; color:#f5faff; background:linear-gradient(145deg,#102f52,#08182f); box-shadow:0 30px 100px rgba(0,0,0,.55); text-align:center; }
#m5pwa-root .m5pwa-dialog-close { position:absolute; right:14px; top:10px; padding:4px 9px; border:0; background:transparent; color:#d4e6f7; font-size:30px; }
#m5pwa-dialog .m5pwa-dialog-mark { display:grid; place-items:center; margin-bottom:13px; }
#m5pwa-dialog .m5pwa-dialog-mark img { width:72px; height:72px; border-radius:19px; }
#m5pwa-heading { margin:8px 0 7px; font-size:24px; color:#fff; font-weight:800; line-height:1.16; }
#m5pwa-description { margin:0 0 22px; font-size:14px; line-height:1.55; color:#cadcf0; }
#m5pwa-instructions { list-style:none; text-align:left; margin:0 0 25px; padding:0; counter-reset:pwa; }
#m5pwa-instructions li { display:flex; align-items:baseline; gap:14px; margin:0 0 12px; padding:12px 14px; border:1px solid #2a5177; border-radius:13px; background:rgba(255,255,255,.045); color:#ebf6ff; font-size:14px; line-height:1.4; }
#m5pwa-instructions li::before { counter-increment:pwa; content:counter(pwa); display:grid; place-items:center; width:26px; height:26px; min-width:26px; border-radius:50%; background:#328ddd; color:#fff; font-size:12px; font-weight:800; }
#m5pwa-root .m5pwa-full { display:block; width:100%; padding:14px 18px; font-size:15px; }
@media (max-width:420px) { #m5pwa-banner { gap:9px; padding:11px; } #m5pwa-banner img { width:40px;height:40px; } #m5pwa-root .m5pwa-primary { padding:10px; font-size:12px; } #m5pwa-banner .m5pwa-banner-copy span { font-size:11px; } #m5pwa-dialog { padding:27px 17px 19px; } }
@media (prefers-reduced-motion: reduce) { #m5pwa-root * { animation:none !important; transition:none !important; } }

/* M5 PWA PREMIUM 1.2: layout scoped to the standalone NEWS landing only. */
.m5news-page.m5pwa-home-applied > .m5pwa-home-stack {
    display:flex; flex-direction:column; gap:14px; min-width:0; width:100%;
}
.m5news-page.m5pwa-home-applied > .m5pwa-home-stack > * {
    flex:0 0 auto; min-width:0; width:100%; max-width:100%; box-sizing:border-box;
    margin:0;
}
.m5news-page.m5pwa-home-applied .m5pwa-home-hidden { display:none !important; }
.m5news-page.m5pwa-home-applied .m5news-layout.m5pwa-home-empty-columns {display:none !important;}
.m5news-page.m5pwa-home-applied > .m5pwa-home-stack > .m5fb-feed-section { margin-top:0; }
.m5news-page.m5pwa-home-applied > .m5pwa-home-stack > .m5news-head-banner { min-height:0; }

/* Front Site guest standalone PWA. The login hero is never hidden. */
#m5fs-front-site.m5pwa-guest-home-applied > .m5pwa-home-stack {
    display:flex; flex-direction:column; gap:14px; width:100%; min-width:0;
}
#m5fs-front-site.m5pwa-guest-home-applied > .m5pwa-home-stack > * {
    width:100%; min-width:0; max-width:100%; box-sizing:border-box; flex:0 0 auto;
    margin:0;
}
#m5fs-front-site.m5pwa-guest-home-applied .m5pwa-home-hidden {display:none!important;}
#m5fs-front-site.m5pwa-guest-home-applied .m5fs-lower.m5pwa-home-empty-columns {display:none!important;}
#m5fs-front-site.m5pwa-guest-home-applied > .m5pwa-home-stack > .m5fs-panel {margin:0 auto;max-width:1450px;}
#m5fs-front-site.m5pwa-guest-home-applied > .m5pwa-home-stack > .m5fs-benefits {max-width:1450px;margin-left:auto;margin-right:auto;}

body:has(#m5fs-front-site.m5pwa-guest-home-applied) .m5f-frontsite-home-wrap.m5pwa-home-empty-columns {display:none!important;}

#m5pwa-push-consent{max-width:680px;margin:12px auto;padding:14px;border:1px solid #3c7eac;border-radius:14px;background:#102b49;color:#fff;display:flex;align-items:center;flex-wrap:wrap;gap:10px}
#m5pwa-push-consent[hidden]{display:none!important}
#m5pwa-push-consent .m5pwa-consent-copy {flex:1 1 270px;min-width:0;display:flex;flex-direction:column;gap:6px}
#m5pwa-push-consent strong{font-size:15px;line-height:1.4}
#m5pwa-push-consent .m5pwa-consent-copy small{font-size:12px;line-height:1.45;color:#d6ecff}
#m5pwa-push-consent > #m5pwa-push-status{flex-basis:100%;font-size:12px;color:#d6ecff}
#m5pwa-push-consent .m5pwa-primary{min-height:42px}


/* M5 PWA PREMIUM 1.3.19 — professional bottom navigation for standalone mode */
#m5pwa-bottomnav[hidden]{display:none!important}
.m5pwa-bottomnav{position:fixed;left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));bottom:calc(10px + env(safe-area-inset-bottom));z-index:2147480001;display:flex;align-items:stretch;justify-content:space-between;gap:4px;padding:10px 8px 8px;border:1px solid rgba(16,43,73,.10);border-radius:24px;background:rgba(255,255,255,.96);box-shadow:0 16px 50px rgba(8,24,47,.18);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.m5pwa-bottomnav-item{position:relative;flex:1 1 20%;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:8px 4px 7px;border-radius:16px;color:#707785;text-decoration:none;transition:background .18s ease,color .18s ease,transform .18s ease}
.m5pwa-bottomnav-item:active{transform:translateY(1px)}
.m5pwa-bottomnav-item.is-active{background:rgba(33,86,152,.08);color:#102b49}
.m5pwa-bottomnav-item:focus-visible{outline:3px solid rgba(26,119,208,.35);outline-offset:2px}
.m5pwa-nav-icon{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center}
.m5pwa-nav-icon svg{width:24px;height:24px;display:block}
.m5pwa-nav-label{display:block;max-width:100%;font-size:11px;line-height:1.2;font-weight:700;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.m5pwa-has-bottomnav{padding-bottom:calc(104px + env(safe-area-inset-bottom))!important}
body.m5pwa-has-bottomnav #page-footer,body.m5pwa-has-bottomnav .copyright{padding-bottom:12px}
/* M5 PWA 1.3.34: the bottom dock must never cover playable games, including fullscreen and APK. */
body.m5pwa-game-screen #m5pwa-bottomnav{display:none!important}
body.m5pwa-game-screen{padding-bottom:0!important}

.m5pwa-notifications-page{max-width:920px;margin:0 auto;padding:8px 0 26px}
.m5pwa-notifications-head{margin:0 0 18px;padding:18px 18px 10px;border-radius:22px;background:linear-gradient(135deg,#102b49,#163f69);color:#fff;box-shadow:0 16px 50px rgba(8,24,47,.12)}
.m5pwa-notifications-head h1{margin:0 0 6px;font-size:28px;line-height:1.1;color:#fff}
.m5pwa-notifications-head p{margin:0;color:#d6ebff;line-height:1.5}
.m5pwa-notification-list{display:flex;flex-direction:column;gap:12px}
.m5pwa-notification-card{padding:16px 18px;border:1px solid rgba(16,43,73,.10);border-radius:18px;background:#fff;box-shadow:0 10px 28px rgba(8,24,47,.06)}
.m5pwa-notification-card.is-unread{border-color:rgba(26,119,208,.35);box-shadow:0 12px 30px rgba(26,119,208,.10)}
.m5pwa-notification-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin:0 0 8px}
.m5pwa-notification-top strong{font-size:16px;line-height:1.35;color:#102b49}
.m5pwa-notification-meta{font-size:13px;line-height:1.45;color:#5b6472}
.m5pwa-pill{display:inline-flex;align-items:center;justify-content:center;height:24px;padding:0 10px;border-radius:999px;background:#e53935;color:#fff;font-size:11px;font-weight:800;letter-spacing:.2px}
.m5pwa-notification-empty{text-align:center}
@media (min-width: 1025px){.m5pwa-bottomnav{max-width:820px;margin:0 auto}}
@media (max-width: 560px){.m5pwa-bottomnav{left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));bottom:calc(8px + env(safe-area-inset-bottom));padding:8px 5px 6px;border-radius:22px}.m5pwa-bottomnav-item{padding:8px 2px 7px}.m5pwa-nav-label{font-size:10px}}


/* M5 PWA PREMIUM 1.3.35 — fixed top bar and docked bottom navigation
   Only the installed shell (iOS PWA / Android APK) is affected. */
html body.m5pwa-installed-shell {
  --m5pwa-topbar-height: 58px;
  --m5pwa-bottomdock-height: 84px;
  padding-top: calc(var(--m5pwa-topbar-height) + env(safe-area-inset-top)) !important;
}
html body.m5pwa-installed-shell #m5navbar.m5navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  margin-top: 0 !important;
  min-height: calc(var(--m5pwa-topbar-height) + env(safe-area-inset-top)) !important;
  padding-top: env(safe-area-inset-top) !important;
  z-index: 2147480003 !important;
}
html body.m5pwa-installed-shell #wrap,
html body.m5pwa-installed-shell #page-body,
html body.m5pwa-installed-shell #content-forum,
html body.m5pwa-installed-shell #page-header {
  margin-top: 0 !important;
}
html body.m5pwa-has-bottomnav {
  padding-bottom: calc(var(--m5pwa-bottomdock-height) + env(safe-area-inset-bottom)) !important;
}
/* M5 PWA 1.3.37 — tighter 56px dock, preserve device gesture safe-area. */
html body.m5pwa-has-bottomnav {
  --m5pwa-bottomdock-height: 56px;
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
}
html body.m5pwa-has-bottomnav #m5pwa-bottomnav.m5pwa-bottomnav {
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  max-width: none !important;
  min-height: 0 !important;
  height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  max-height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box !important;
  align-items: flex-start !important;
  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  padding: 2px 6px env(safe-area-inset-bottom, 0px) !important;
}
html body.m5pwa-has-bottomnav #m5pwa-bottomnav .m5pwa-bottomnav-item {
  min-height: 0 !important;
  height: 52px !important;
  max-height: 52px !important;
  flex: 1 1 0 !important;
  gap: 2px !important;
  padding: 2px 2px !important;
  box-sizing: border-box !important;
}
html body.m5pwa-has-bottomnav #m5pwa-bottomnav .m5pwa-nav-icon,
html body.m5pwa-has-bottomnav #m5pwa-bottomnav .m5pwa-nav-icon svg {
  width: 23px !important;
  height: 23px !important;
}
html body.m5pwa-has-bottomnav #m5pwa-bottomnav .m5pwa-nav-label {
  line-height: 1.1 !important;
  margin: 0 !important;
  font-size: 11px !important;
}
@media (max-width: 560px) {
  html body.m5pwa-has-bottomnav { --m5pwa-bottomdock-height: 56px; }
}
