/*
 * M5 PREMIUM THEME 2.0.0 – POL.FAN
 * A restrained, contrast-first design system. Unlike v1, this stylesheet
 * never repaints all .panel/.post/.bg* containers or all descendants at once.
 * Feature-specific rules preserve legacy contrast outside audited screens.
 * No JavaScript, backend logic, database or permission changes.
 */
:root {
  --m5p-night: #0c102d;
  --m5p-night-2: #12163d;
  --m5p-indigo: #1b2354;
  --m5p-raised: #252a60;
  --m5p-purple: #963de7;
  --m5p-magenta: #d32be6;
  --m5p-blue: #6ac6ff;
  --m5p-white: #f9f7ff;
  --m5p-soft-text: #d0d5ed;
  --m5p-border: rgba(175, 142, 255, .36);
  --m5p-light: #fbfaff;
  --m5p-light-ink: #202a50;
  --m5p-light-muted: #536487;
  --m5p-light-line: #d9dcf1;
  --m5p-purple-button: linear-gradient(110deg, #ac24df 0%, #6e43db 100%);
  --m5p-shadow: 0 16px 42px rgba(4, 7, 35, .28);
}

/* Site chrome – dark wallpaper with a contrasting, safe content surface. */
body:not(.m5fs-front-site):not(.m5reg-embedded) {
  background:
    radial-gradient(ellipse 40% 42% at 0% 15%, rgba(149,40,206,.23), transparent 80%),
    radial-gradient(ellipse 48% 42% at 100% 5%, rgba(67,59,172,.20), transparent 74%),
    var(--m5p-night) !important;
}
/* Legacy content stays LIGHT unless a page has its own audited dark rules. */
body:not(.m5fs-front-site):not(.m5reg-embedded) #page-body {
  border-radius: 16px;
  background: #f7f7ff !important; /* safe fallback for not-yet-audited modules */
  color: var(--m5p-light-ink);
}
body:not(.m5fs-front-site):not(.m5reg-embedded) :is(.inputbox, input:not([type="checkbox"]):not([type="radio"]), textarea, select):focus-visible {
  outline: 2px solid #ac57e9;
  outline-offset: 2px;
}
body:not(.m5fs-front-site):not(.m5reg-embedded) :is(a, button):focus-visible {
  outline: 2px solid #b274f5;
  outline-offset: 2px;
}

/* Navbar: scoped to the actual extension, not phpBB global .navbar. */
body:not(.m5fs-front-site):not(.m5reg-embedded) #m5navbar.m5navbar {
  background: linear-gradient(102deg, #231347 0%, #0f2146 50%, #271352 100%) !important;
  border-bottom: 2px solid #9e4bd9 !important;
  box-shadow: 0 6px 23px rgba(87,26,156,.30) !important;
}
body:not(.m5fs-front-site) #m5navbar :is(a, button, .m5navbar-icon, .m5navbar-label) {
  color: #fff !important;
}
body:not(.m5fs-front-site) #m5navbar :is(a,button):hover {
  background-color: rgba(167, 85, 233, .18);
}
body:not(.m5fs-front-site) #m5navbar :is(.m5navbar-search,.m5navbar-tokens,.m5navbar-checkin) {
  border-color: rgba(196,145,255,.44) !important;
}
/* Dropdown contents should retain a readable contrast, no blanket span overrides. */
body:not(.m5fs-front-site) :is(#m5navbar-profile-menu,#m5navbar-notify-menu) {
  background: #fcfaff !important;
  color: #17254a !important;
  border: 1px solid #d7cdf2 !important;
  box-shadow: 0 18px 38px rgba(10,9,44,.26);
}
body:not(.m5fs-front-site) :is(#m5navbar-profile-menu,#m5navbar-notify-menu) :is(a,span,strong,small) {
  color: #17254a !important;
}
body:not(.m5fs-front-site) :is(#m5navbar-profile-menu,#m5navbar-notify-menu) a:hover {
  background: #eee5ff !important;
}


/* Only audited screens expose the dark wallpaper inside the main content area. */
@supports selector(body:has(*)) {
  body:not(.m5fs-front-site):has(.m5news-standalone) #page-body,
  body:not(.m5fs-front-site):has(.m5g-wrap) #page-body,
  body:not(.m5fs-front-site):has(.media5-userprofile) #page-body {
    background: transparent !important;
  }
}

/* Public theme is managed by FRONT SITE itself and remains unchanged. */
body.m5fs-front-site .m5fs-premium { color: #fff; }

/* ---------- START / M5 NEWS: solid contrast, clear content panels ---------- */
body:not(.m5fs-front-site) :is(.m5news-standalone,.m5news-page) {
  --m5p-card: #171b43;
  --m5p-card-line: #5a4c96;
  color: #f9f7ff;
}
body:not(.m5fs-front-site) .m5news-standalone {
  border-radius: 20px;
}
body:not(.m5fs-front-site) .m5news-standalone :is(.m5news-section,.m5news-side,.m5fb-feed-section,.m5home-events,.m5f-home-recommendations) {
  background: linear-gradient(155deg,#1e2152,#131b3f) !important;
  border: 1px solid var(--m5p-card-line) !important;
  color: #f8f7ff !important;
  border-radius: 18px;
  box-shadow: var(--m5p-shadow);
}
body:not(.m5fs-front-site) .m5news-standalone :is(.m5news-section-title,.m5fb-feed-heading,.m5home-events-heading,.m5f-section-title) :is(h1,h2,h3,strong) {
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5news-standalone :is(.m5news-section-title,.m5fb-feed-heading,.m5home-events-heading,.m5f-section-title) :is(small,p,span) {
  color: #d4d5f2 !important;
}
body:not(.m5fs-front-site) .m5news-standalone :is(.m5news-section-title,.m5fb-feed-heading,.m5home-events-heading,.m5f-section-title) a {
  color: #a7e3ff !important;
}
/* Sidebar widgets are now actual dark widgets, not navy legacy text on navy. */
body:not(.m5fs-front-site) .m5news-standalone .m5news-side > h3 {
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5news-standalone .m5news-side > p,
body:not(.m5fs-front-site) .m5news-standalone .m5news-side .m5news-ad small {
  color: #d3d7f0 !important;
}
body:not(.m5fs-front-site) .m5news-standalone .m5news-side .m5news-forum-row {
  background: #252957 !important;
  color: #fff !important;
  border: 1px solid #55558d !important;
  border-radius: 10px;
  padding: 11px 12px;
  margin: 7px 0;
}
body:not(.m5fs-front-site) .m5news-standalone .m5news-side .m5news-forum-row b {
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5news-standalone .m5news-side .m5news-forum-row small {
  color: #d1d5ee !important;
}
body:not(.m5fs-front-site) .m5news-standalone .m5news-side .m5news-side-btn {
  background: #e9ddff !important;
  color: #372179 !important;
  border: 1px solid #aa8cde;
}
body:not(.m5fs-front-site) .m5news-standalone .m5news-side .m5news-side-cats a {
  background: #f8f5ff !important;
  color: #343172 !important;
  border-color: #c7bce7 !important;
}

/* Feed cards and user posts stay bright (do not make pale legacy text disappear). */
body:not(.m5fs-front-site) .m5news-standalone :is(.m5fb-post,.m5news-forum-row,.m5news-opinion-body,.m5news-best-row) {
  background: #fbfaff !important;
  border: 1px solid #dddaf0 !important;
  border-radius: 16px;
  color: #1b2850 !important;
  box-shadow: 0 8px 24px rgba(5,8,42,.16);
}
body:not(.m5fs-front-site) .m5news-standalone .m5fb-post :is(.m5fb-post-text,.m5fb-post-author,.m5fb-post-author strong,.m5fb-post-main,.m5fb-post-wall-owner) {
  color: #1a2956 !important;
}
body:not(.m5fs-front-site) .m5news-standalone .m5fb-post :is(.m5fb-post-context,.m5fb-post-stats,.m5fb-post-stats *,time) {
  color: #566489 !important;
}
body:not(.m5fs-front-site) .m5news-standalone .m5fb-post a { color: #3b3d9b; }
body:not(.m5fs-front-site) .m5news-standalone .m5fb-comments-preview .m5fb-comment-row {
  background: #f1f3fd !important;
  color: #27345e !important;
  border: 1px solid #e1e3f5;
  border-radius: 12px;
}
body:not(.m5fs-front-site) .m5news-standalone .m5fb-comment-row :is(strong,span,p,small,.m5fb-comment-text,.m5fb-comment-person) {
  color: #26345d !important;
}
body:not(.m5fs-front-site) .m5news-standalone :is(.m5fb-feed-tabs button,.m5fb-post-actions button,.m5fb-comment-form button,.m5fb-load-more) {
  border-radius: 10px;
}
body:not(.m5fs-front-site) .m5news-standalone :is(.m5fb-feed-tabs button.is-active,.m5fb-post-actions button.active,.m5fb-comment-form button[type="submit"],.m5fb-load-more) {
  background: var(--m5p-purple-button) !important;
  border-color: #ae7deb !important;
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5news-standalone :is(.m5fb-post,.m5fb-comment-form) :is(input[type="text"],textarea) {
  background: #fff !important;
  color: #1c2b56 !important;
  border: 1px solid #cfd1ed !important;
}

/* Legacy M5 USERPROFILE topbar can live OUTSIDE .media5-userprofile. */
body:not(.m5fs-front-site) .m5up-topbar {
  background: linear-gradient(110deg,#28154e,#12234b 58%,#2b1655) !important;
  border-bottom-color: #b75be9 !important;
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5up-topbar :is(.m5up-brand,.m5up-brand strong,.m5up-brand small,.m5up-topnav a,.m5up-toptools .m5up-token-label) {
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5up-topbar .m5up-topnav a:hover {
  background: rgba(194, 101, 247, .24) !important;
}

/* ---------- PROFILE: readable light content with violet navigation ---------- */
body:not(.m5fs-front-site) .media5-userprofile {
  color: var(--m5p-light-ink);
  --m5p-profile-card-border: #dcd7f0;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-profile-card,.m5up-side-box,.m5up-profile-view,.m5up-post,.m5up-board,.m5up-post-empty,.m5up-activity-chart-card,.m5up-activity-summary,.m5up-activity-item) {
  background: #fbfaff !important;
  border: 1px solid var(--m5p-profile-card-border) !important;
  color: #243257 !important;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(9,12,42,.16);
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-post p,.m5up-post-text,.m5up-board-body,.m5up-side-box p,.m5up-profile-details,.m5up-profile-view p) {
  color: #27365b !important;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-side-title,.m5up-post-author strong,.m5up-profile-view-head h2,.m5up-profile-card h1) {
  color: #212b57 !important;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-rank,.m5up-motto,.m5up-post-rank,.m5up-post-actions,.m5up-post-author time,.m5up-profile-view-head p) {
  color: #53628b !important;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-topbar,.m5up-topnav,.m5up-tabs) {
  background: linear-gradient(113deg,#25205b,#171c48 63%,#251454) !important;
  color: #f7f5ff !important;
  border: 1px solid #7060bd !important;
  border-radius: 13px;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-topnav,.m5up-tabs) a {
  color: #f0ebff !important;
  border-radius: 10px;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-topnav,.m5up-tabs) a:hover {
  color: #fff !important;
  background: rgba(178,102,242,.28) !important;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-topnav,.m5up-tabs) a.active {
  background: var(--m5p-purple-button) !important;
  box-shadow: 0 4px 13px rgba(170,42,220,.26);
  border-color: #cb85f4 !important;
  color: #fff !important;
}
body:not(.m5fs-front-site) .media5-userprofile .m5up-profile-view-head {
  border-color: #ddd9ef !important;
}
body:not(.m5fs-front-site) .media5-userprofile .m5up-post-actions :is(a,button) {
  color: #46409d;
}
body:not(.m5fs-front-site) .media5-userprofile .m5up-board :is(input,textarea),
body:not(.m5fs-front-site) .media5-userprofile .m5up-post-edit-form textarea {
  background: #fff !important;
  color: #202c54 !important;
  border: 1px solid #cbccea !important;
}
body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-board-actions .publish,.m5up-edit,.m5up-profile-view-back,.m5up-streak-checkin:not(:disabled)) {
  background: var(--m5p-purple-button) !important;
  border-color: #aa65e4 !important;
  color: #fff !important;
}
body:not(.m5fs-front-site) .media5-userprofile .m5up-post-menu,
body:not(.m5fs-front-site) .media5-userprofile .m5up-post-menu button {
  background: #fff !important;
  color: #202c54 !important;
}

/* ---------- ACHIEVEMENTS: intentionally fully re-skinned, no inherited pale text ---------- */
body:not(.m5fs-front-site) .media5-userprofile .m5up-profile-view.m5up-achievements-profile-view {
  background: linear-gradient(155deg,#191b4b,#121a3c) !important;
  border: 1px solid #6451a7 !important;
  color: #f7f6ff !important;
  border-radius: 22px;
  box-shadow: var(--m5p-shadow);
}
body:not(.m5fs-front-site) .media5-userprofile .m5up-achievements-profile-view .m5up-profile-view-head {
  border-bottom: 1px solid #5d4e9a !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-profile-view-head :is(h2,p),
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-section-kicker {
  color: #f4f0ff !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-section-kicker {
  color: #c9a3ff !important;
  letter-spacing: .10em;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-profile-view-icon {
  background: #342665 !important;
  border: 1px solid #6959a7 !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-overview {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 14px;
  margin-top: 21px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-overview-card {
  background: linear-gradient(150deg,#282b64,#20234c) !important;
  border: 1px solid #6759a7 !important;
  color: #f8f6ff !important;
  min-height: 112px;
  padding: 15px !important;
  align-items: flex-start;
  border-radius: 16px !important;
  box-shadow: 0 7px 24px rgba(3,5,30,.20);
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-overview-icon {
  background: #3c3470 !important;
  border: 1px solid #6c59a6;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-overview-card strong {
  color: #fff !important;
  font-size: 17px !important;
  line-height: 1.25;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-overview-card :is(small,em) {
  color: #d5d5f2 !important;
  font-size: 11px !important;
  line-height: 1.5;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view :is(.m5up-streak-checkin,.m5up-points-info-button) {
  font-size: 11px !important;
  padding: 7px 11px !important;
  border-radius: 8px !important;
  border: 1px solid #9c77e8 !important;
  background: #e4d7ff !important;
  color: #2c2365 !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-streak-checkin.is-done,
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-streak-checkin:disabled {
  background: #47486a !important;
  color: #ececf8 !important;
  border-color: #6c6b91 !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-streak-checkin-message {
  color: #d2d5f0 !important;
  font-size: 10px !important;
  line-height: 1.5 !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-streak-record {
  background: #171d45 !important;
  border: 1px solid #625a9b !important;
  margin-top: 10px !important;
  padding: 9px 10px !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-streak-record :is(.m5up-streak-record-label,strong) {
  color: #e8e8ff !important;
  font-size: 10px !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-next {
  background: linear-gradient(110deg,#3a295a,#25285d) !important;
  border: 1px solid #c17cec !important;
  border-radius: 16px;
  padding: 18px;
  margin-top: 18px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-next-icon {
  background: #573b70 !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-next-kicker {
  color: #ffe3a0 !important;
  font-size: 11px !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-next-body :is(strong,span,small) {
  color: #f5f2ff !important;
  font-size: 12px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-next-body strong {
  font-size: 16px !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-section-title :is(h3,small) {
  color: #f8f6ff !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-section-title h3 {
  font-size: 19px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-grid {
  gap: 14px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card,
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card.locked {
  background: #21264e !important;
  border: 1px solid #514a85 !important;
  color: #f8f7ff !important;
  border-radius: 15px !important;
  opacity: 1 !important;
  padding: 16px !important;
  box-shadow: 0 8px 24px rgba(2,5,27,.16);
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card.locked {
  background: #1c2148 !important;
  border-color: #4b4d77 !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card-icon {
  background: #383463 !important;
  border: 1px solid #63589a;
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card-title {
  flex-wrap: wrap;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card-title strong {
  color: #fff !important;
  font-size: 13px !important;
  line-height: 1.35;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card-title span {
  color: #b9f6d5 !important;
  font-size: 11px !important;
  background: rgba(41,145,98,.19);
  border: 1px solid rgba(137,233,182,.28);
  border-radius: 7px;
  padding: 3px 6px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card.locked .m5up-achievement-card-title span {
  background: #38395e;
  color: #dbdef2 !important;
  border-color: #5d5c89;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card p {
  color: #d4d5ef !important;
  font-size: 13px !important;
  line-height: 1.5;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card small {
  color: #d4d6f0 !important;
  font-size: 11px !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-progress {
  background: #45466b !important;
  height: 8px;
  border-radius: 999px;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-progress span {
  background: linear-gradient(90deg,#9d69ef,#25d8ff) !important;
}
body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-note {
  background: #24274c !important;
  border-color: #554b87 !important;
  color: #d0d3ec !important;
  font-size: 12px !important;
}
/* Points modal remains light for readability; it is intentionally NOT recolored dark. */
body:not(.m5fs-front-site) .m5up-points-info-dialog {
  background: #fff !important;
  color: #202a50 !important;
}
body:not(.m5fs-front-site) .m5up-points-info-dialog :is(h3,strong,small,p) {
  color: #243357 !important;
}
body:not(.m5fs-front-site) .m5up-points-info-dialog button {
  color: #243357;
}

/* ---------- GROUPS: no invisible navy-on-navy titles ---------- */
body:not(.m5fs-front-site) .m5g-wrap {
  color: #f7f5ff !important;
  max-width: 1330px;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-hero {
  background: linear-gradient(105deg,#48206d,#1a2352 64%,#31205e) !important;
  border: 1px solid #9062d0 !important;
  border-radius: 19px;
  color: #fff !important;
  box-shadow: var(--m5p-shadow);
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-hero :is(h1,p) {
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-section,.m5g-panel,.m5g-topic-table,.m5g-access-panel) {
  background: linear-gradient(155deg,#1c214d,#141a3f) !important;
  color: #f8f6ff !important;
  border: 1px solid #605399 !important;
  border-radius: 18px;
  box-shadow: var(--m5p-shadow);
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-section-title {
  background: linear-gradient(112deg,#262456,#1c204e) !important;
  border-bottom: 1px solid #6256a1 !important;
  padding: 16px 20px;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-section-title strong {
  color: #fff !important;
  font-size: 20px;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-section-title small {
  color: #d3d5f0 !important;
  font-size: 12px;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-grid {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
  padding: 18px;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card {
  background: linear-gradient(140deg,#262a5d,#1c244e) !important;
  color: #f8f6ff !important;
  border: 1px solid #7061a9 !important;
  border-radius: 15px;
  grid-template-columns: 160px minmax(0,1fr);
  min-height: 177px;
  box-shadow: 0 10px 26px rgba(2,4,24,.17);
  transition: transform .16s ease,border-color .16s ease;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card:hover {
  transform: translateY(-2px);
  border-color: #ac84f0 !important;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card-img {
  background: #28325f !important;
  color: #e4c7ff !important;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card h3,
body:not(.m5fs-front-site) .m5g-wrap .m5g-card h3 a {
  color: #fff !important;
  font-size: 17px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card h3 a:hover {
  color: #caaeff !important;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card :is(.m5g-members,p) {
  color: #d4d7f2 !important;
  font-size: 13px;
  line-height: 1.5;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card-body {
  padding: 17px;
  align-items: flex-start;
  min-width: 0;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-card-body .m5g-btn {
  margin-top: auto;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-btn-blue,.m5g-btn-green,.m5g-new-topic-btn) {
  background: var(--m5p-purple-button) !important;
  color: #fff !important;
  border: 1px solid #be82f2 !important;
  border-radius: 9px;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-btn-outline,.m5g-btn-light,.m5g-topic-back) {
  background: #e7d9ff !important;
  color: #2b2267 !important;
  border: 1px solid #b69ce1 !important;
  border-radius: 9px;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-groups-nav,.m5g-tabs,.m5g-manage-nav) {
  background: #232552 !important;
  border: 1px solid #62569a !important;
  color: #fff !important;
  border-radius: 12px;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-groups-nav,.m5g-tabs,.m5g-manage-nav) a {
  color: #e7ddff !important;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-groups-nav a {
  color: #f4f0ff !important;
  background: #302961 !important;
  border: 1px solid #6a60a6 !important;
  border-radius: 8px;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-groups-nav,.m5g-tabs,.m5g-manage-nav) a:hover,
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-tabs,.m5g-manage-nav) a.active {
  background: #4d3489 !important;
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-topic-row,.m5g-topic-head,.m5g-member-row,.m5g-member-head,.m5g-post) {
  color: #fff !important;
  background: #202651 !important;
  border-color: #55528b !important;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-topic-row strong,.m5g-topic-title h1,.m5g-panel h2,.m5g-post-body,.m5g-access-panel h2) {
  color: #fff !important;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-topic-row small,.m5g-last,.m5g-post aside span,.m5g-access-panel p,.m5g-member-row small) {
  color: #d3d6f0 !important;
}
body:not(.m5fs-front-site) .m5g-wrap .m5g-post aside {
  background: #282856 !important;
  color: #fff !important;
  border-color: #5b5489 !important;
}
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-form input,.m5g-form textarea,.m5g-new-topic input,.m5g-new-topic textarea,.m5g-search,.m5g-reply-form textarea) {
  background: #fefcff !important;
  color: #17274b !important;
  border: 1px solid #bfc0dd !important;
}
/* Alerts retain semantic warning/success/error contrast. */
body:not(.m5fs-front-site) .m5g-wrap :is(.m5g-notice,.m5g-error,.m5g-transfer-pending,.m5g-security-danger) {
  color: #29264f !important;
}

/* ---------- OTHER MODULES: palette accents ONLY, preserving their light cards. ---------- */
body:not(.m5fs-front-site) :is(#m5b-root,.m5f-wrap,.m5op,.m5chat-app,.m5games-page,.m5s-wrap) {
  --m5p-action: #883cd4;
}
body:not(.m5fs-front-site) #m5b-root :is(.m5b-btn-primary,.m5b-primary,.m5b-btn:not(.m5b-btn-danger)) {
  background: var(--m5p-purple-button);
  color: #fff;
}
body:not(.m5fs-front-site) .m5f-wrap :is(.m5f-btn-primary,.m5f-button-primary) {
  background: var(--m5p-purple-button);
  color: #fff;
}
/* Do not recolor data grids, light input cards, game boards or the white message bubbles. */

@media (max-width:1140px) {
  body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-overview {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width:820px) {
  body:not(.m5fs-front-site) .m5g-wrap .m5g-grid {
    grid-template-columns:1fr;
  }
  body:not(.m5fs-front-site) .m5g-wrap .m5g-card {
    grid-template-columns:130px minmax(0,1fr);
  }
}
@media (max-width:640px) {
  body:not(.m5fs-front-site) .m5g-wrap .m5g-hero { padding:17px; flex-wrap:wrap; }
  body:not(.m5fs-front-site) .m5g-wrap .m5g-card { grid-template-columns:110px minmax(0,1fr); min-height:150px; }
  body:not(.m5fs-front-site) .m5g-wrap .m5g-card-body { padding:12px; }
  body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievements-overview {
    grid-template-columns:1fr;
  }
  body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card {
    padding:12px !important;
  }
  body:not(.m5fs-front-site) .m5up-achievements-profile-view .m5up-achievement-card-title {align-items:start;flex-direction:column;}
  body:not(.m5fs-front-site) .media5-userprofile :is(.m5up-topnav,.m5up-tabs) {overflow-x:auto;}
}
@media (prefers-reduced-motion:reduce) {
  body:not(.m5fs-front-site) .m5g-wrap .m5g-card { transition:none; }
}


/* M5 PREMIUM THEME 2.0.1 | PWA standalone navigation repair.
   These selectors are intentionally limited to the real PWA-only activation
   classes. Desktop web and mobile browsers (not installed PWA) are unchanged.
   M5 NAVBAR 2.0.21 and PWA 1.3.25 markup preserved. */
@media (max-width: 1150px) {
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-pwa-toggle {
    background: linear-gradient(120deg, #44216f, #26174e) !important;
    border: 1px solid #9168df !important;
    color: #fff !important;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(211, 94, 255, .09);
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-pwa-toggle:focus-visible {
    outline: 3px solid #f093ff !important;
    outline-offset: 2px;
  }
  /* The PWA drawer used to be white while the main theme forced every nav
     link to white text, making all entries invisible. Dark surface + visible
     links restores every item without altering navigation or event handlers. */
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links {
    background: linear-gradient(159deg, #211746 0%, #121737 60%, #1c1245 100%) !important;
    border: 1px solid rgba(174, 112, 255, .65) !important;
    color: #f8f5ff !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 48px rgba(3, 4, 23, .58), inset 0 1px rgba(255,255,255,.07) !important;
    padding: 10px !important;
    top: calc(100% + 3px) !important;
    left: 8px !important;
    width: min(340px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: min(73dvh, 640px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    grid-template-columns: minmax(0,1fr) !important;
    align-content: start !important;
    gap: 5px !important;
    scrollbar-width: thin;
    scrollbar-color: #a963f3 #211641;
    -webkit-overflow-scrolling: touch;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links > a {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 auto !important;
    min-height: 46px !important;
    max-height: none !important;
    background: rgba(127, 86, 213, .10) !important;
    border: 1px solid rgba(169, 133, 244, .17) !important;
    border-radius: 11px !important;
    color: #f9f6ff !important;
    font-size: 14px !important;
    font-weight: 650;
    padding: 10px 12px !important;
    white-space: normal !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links > a :is(span,i,svg) {
    color: #f9f6ff !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: #f9f6ff !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links > a i {
    color: #cc91ff !important;
    -webkit-text-fill-color: #cc91ff !important;
    width: 24px !important;
    flex: 0 0 24px !important;
    font-size: 18px !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links > a span {
    font-size: 14px !important;
    line-height: 1.35 !important;
    text-align: left !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links > a:is(:hover,:focus-visible,:active) {
    background: rgba(168, 63, 223, .33) !important;
    border-color: #bc7fff !important;
    box-shadow: inset 3px 0 #ef61f5;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links .m5navbar-pwa-checkin-item {
    display: flex !important;
    background: linear-gradient(110deg, #322255, #221b51) !important;
    border: 1px solid #7250af !important;
    color: #fff !important;
    min-height: 64px !important;
    margin-bottom: 7px !important;
    border-radius: 13px !important;
    box-shadow: 0 4px 14px rgba(3,4,29,.23);
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-pwa-checkin-item .m5navbar-checkin-count {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-weight: 800;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-pwa-checkin-item .m5navbar-checkin-info small {
    color: #d9c9f2 !important;
    -webkit-text-fill-color: #d9c9f2 !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-pwa-checkin-item .m5navbar-checkin-button {
    background: linear-gradient(110deg, #b32bea, #713fd6) !important;
    color: #fff !important;
    font-size: 11px !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-pwa-checkin-item .m5navbar-checkin-button:disabled {
    background: #443959 !important;
    color: #e3d8f6 !important;
    opacity: 1 !important;
  }
  /* User dropdown and notification popover also match the PWA palette. */
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active :is(.m5navbar-menu,.m5navbar-notify),
  html body.m5pwa-has-bottomnav :is(#m5navbar-profile-menu,#m5navbar-notify-menu) {
    background: linear-gradient(150deg, #251744, #141735) !important;
    border-color: #8055c2 !important;
    color: #fff !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active :is(.m5navbar-menu,.m5navbar-notify) :is(a,span,strong,small,em),
  html body.m5pwa-has-bottomnav :is(#m5navbar-profile-menu,#m5navbar-notify-menu) :is(a,span,strong,small,em) {
    color: #f8f4ff !important;
    -webkit-text-fill-color: #f8f4ff !important;
  }
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active :is(.m5navbar-menu,.m5navbar-notify) a:hover,
  html body.m5pwa-has-bottomnav :is(#m5navbar-profile-menu,#m5navbar-notify-menu) a:hover {
    background: rgba(189, 93, 252, .23) !important;
  }
}
/* Dark PWA bottom navigation: enabled by PWA JavaScript ONLY in standalone. */
html body.m5pwa-has-bottomnav .m5pwa-bottomnav {
  background: rgba(25, 18, 58, .97) !important;
  border: 1px solid rgba(168, 109, 255, .56) !important;
  box-shadow: 0 12px 35px rgba(5,4,27,.48), inset 0 1px rgba(255,255,255,.06) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #e4d7ff !important;
}
html body.m5pwa-has-bottomnav .m5pwa-bottomnav-item,
html body.m5pwa-has-bottomnav .m5pwa-bottomnav-item :is(svg,span) {
  color: #d5caeb !important;
  -webkit-text-fill-color: #d5caeb !important;
}
html body.m5pwa-has-bottomnav .m5pwa-bottomnav-item.is-active {
  background: linear-gradient(160deg, rgba(167,61,230,.37), rgba(110,57,214,.23)) !important;
  box-shadow: inset 0 -2px #d955fb;
  color: #fff !important;
}
html body.m5pwa-has-bottomnav .m5pwa-bottomnav-item.is-active :is(svg,span) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html body.m5pwa-has-bottomnav .m5pwa-bottomnav-item:focus-visible {
  outline: 2px solid #f095ff !important;
  outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
  html body:not(.m5fs-front-site) #m5navbar.m5navbar-pwa-active .m5navbar-links > a,
  html body.m5pwa-has-bottomnav .m5pwa-bottomnav-item {transition: none !important;}
}


/* M5 PREMIUM THEME 2.0.2 — page START canvas */
/* Match the quiet pale-lavender surface of M5 Katalog Firm (#F7F7FF).
   Only page-level START wrappers are changed. Cards, forms, header,
   user menu and other routes keep their own backgrounds. */
@supports selector(body:has(.m5news-standalone)) {
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #wrap,
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-body,
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #maincontent,
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) .m5news-standalone,
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) .m5news-page {
    background: #f7f7ff !important;
  }
}

/* M5 PREMIUM THEME 2.0.3 — START width aligned with Profile canvas */
/* The START page used a much wider content canvas than Mój profil.
   This normalizes the central width so the dark side gutters match visually. */
@supports selector(body:has(.m5news-standalone)) {
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-body,
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #maincontent,
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) .m5news-standalone,
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) .m5news-page {
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #maincontent {
    width: 100% !important;
  }
}


/* M5 PREMIUM THEME 2.0.4 — FIX: outer START background and effective canvas width.
   Unlike the previous fix, this intentionally leaves #wrap at full width, so
   the site navbar is unaffected. Only the START content surface is centered.
   The outer #wrap must be transparent; 2.0.2 had painted it lavender, which
   left oversized light gutters even when the children were narrowed. */
@supports selector(body:has(.m5news-standalone)) {
  html body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #wrap {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
  }
  html body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-body {
    box-sizing: border-box !important;
    width: min(1360px, calc(100% - 24px)) !important;
    max-width: 1360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    background: #f7f7ff !important;
    border-radius: 0 !important;
  }
  html body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #maincontent {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: transparent !important;
  }
  html body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) .m5news-standalone {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
  }
  html body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) .m5news-page {
    max-width: 1280px !important;
    margin-inline: auto !important;
    background: transparent !important;
  }
}
@media (max-width: 760px) {
  @supports selector(body:has(.m5news-standalone)) {
    html body:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-body {
      width: 100% !important;
      max-width: 100% !important;
    }
  }
}

/* ===========================================================================
   M5 PREMIUM THEME 2.0.9 — ONE CONSISTENT FOOTER / NO WHITE GUTTERS
   Real DOM (phpBB 3.3.18 / FarmingPro / M5 USERPROFILE):
     body#phpbb > #wrap.wrap > #page-body + #page-footer.page-footer
     body#phpbb > div.m5legal-footer-links   [injected after #wrap]
   Copyright and legal links are separate nodes, not parent and child.
   Consequently the link bar MUST be styled independently of #page-footer.
   These rules replace the contradictory footer overrides from 2.0.5–2.0.8.
   Keep FRONT SITE and embedded registration untouched.
   =========================================================================== */

/* Remove FarmingPro white canvas in the outer wrapper. Dark side gutters
   remain outside #wrap; the START wrapper is handled separately below. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #wrap.wrap {
  background: #f3f1ff !important;
  background-image: none !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  padding-bottom: 0 !important;
}
/* On START the wrapper intentionally fills the screen. The lavender area is
   the centered #page-body, so the outer wrapper must stay transparent. */
@supports selector(body:has(.m5news-standalone)) {
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #wrap.wrap {
    background: transparent !important;
    background-image: none !important;
  }
}

/* Internal canvas: no extra white bands on Groups, Events, E-books, Bazar,
   Firmy, profile, etc. Preserve all module cards and controls as authored. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-body.page-body {
  background: #f3f1ff !important;
  background-image: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Native phpBB footer: ONLY copyright + administrator link on lavender.
   Do not turn every .footer-row into a dark legal-link strip: it is inside
   the copyright element, NOT the custom legal bar. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #f3f1ff !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  color: #29375b !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer :is(.copyright,.footer-row,.footer-copyright,.footer-info,.navbar,.inner) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #29375b !important;
  opacity: 1 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .copyright {
  display: block !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 12px 16px 14px !important;
  text-align: center !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .footer-row {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.55 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer :is(.footer-copyright,.footer-info,.footer-link,.footer-link-text,a,strong,span) {
  color: #29375b !important;
  -webkit-text-fill-color: #29375b !important;
  text-shadow: none !important;
  opacity: 1 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer a:hover {
  color: #693cb9 !important;
  -webkit-text-fill-color: #693cb9 !important;
}
/* M5 PREMIUM THEME 2.0.11 — START footer alignment.
   START content (#page-body) deliberately stays limited to 1360px, but the
   footer must span the #wrap container like it does on other portal pages.
   Previously the more specific :has(.m5news-standalone) rule constrained it
   to 1360px and overrode the general 2.0.10 full-width footer rule. */
@supports selector(body:has(.m5news-standalone)) {
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.page-footer {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Custom legal links are injected by M5 USERPROFILE at the VERY END of body,
   as a sibling following the #wrap. Style their REAL class, not #page-footer. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links {
  box-sizing: border-box !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px 21px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 13px 16px 15px !important;
  background: #111034 !important;
  background-image: none !important;
  color: #f9f5ff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: center !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links a {
  color: #f9f5ff !important;
  -webkit-text-fill-color: #f9f5ff !important;
  font-weight: 650 !important;
  text-decoration: none !important;
  opacity: 1 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links a:hover,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links a:focus-visible {
  color: #ecb1ff !important;
  -webkit-text-fill-color: #ecb1ff !important;
  text-decoration: underline !important;
}
@media (max-width: 640px) {
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links {
    padding: 13px 12px 20px !important;
    gap: 8px 15px !important;
  }
}

/* Mobile START: #page-footer uses the same container width as #page-body. */
@media (max-width: 760px) {
  @supports selector(body:has(.m5news-standalone)) {
    html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.page-footer {
      width: 100% !important;
      max-width: 100% !important;
    }
  }
}


/* -------------------------------------------------------------------------
   M5 PREMIUM THEME 2.0.10 — exact profile cover and footer compatibility.
   Save covers: profile-cover photo comes from UP_COVER_URL (inline style).
   Never override that inline background-image for .m5up-cover-custom.
   The default graphic is restored only when no uploaded cover is available.
   ------------------------------------------------------------------------- */
body#phpbb.section-memberlist:not(.m5fs-front-site) .media5-userprofile .m5up-cover:not(.m5up-cover-custom) {
  background-color: #0a2746 !important;
  background-image: linear-gradient(90deg,rgba(4,22,49,.78),rgba(20,65,122,.22)),url('../../../../userprofile/styles/all/theme/images/profile-cover.jpg') !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: center center, center center !important;
  background-size: cover, cover !important;
}
body#phpbb.section-memberlist:not(.m5fs-front-site) .media5-userprofile .m5up-cover.m5up-cover-custom {
  /* Intentionally no background or background-image shorthand here. */
  background-color: #0a2746 !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: 100% 100% !important;
}

/* Footer copyright is physically inside #page-footer, while legal bar is
   supplied by M5 USERPROFILE outside #wrap. Footer hook places it directly
   after copyright without duplicating its links or editing USERPROFILE. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #wrap.wrap {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  padding-bottom: 0 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-body.page-body {
  margin-bottom: 0 !important;
  border-bottom: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  box-shadow: none !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #f3f1ff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .copyright {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 10px 16px 12px !important;
  background: #f3f1ff !important;
  background-color: #f3f1ff !important;
  background-image: none !important;
  color: #29375b !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: center !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .copyright .footer-row {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #29375b !important;
  text-shadow: none !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .copyright :is(.footer-copyright,.footer-info,.footer-link,.footer-link-text,a,span,strong) {
  color: #29375b !important;
  -webkit-text-fill-color: #29375b !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
/* After the element is moved INSIDE #page-footer, earlier general footer link
   rules must not override its white-on-purple text. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer > .m5legal-footer-links,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links {
  display: flex !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px 20px !important;
  flex-wrap: wrap !important;
  background: #111034 !important;
  background-color: #111034 !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #fff !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .m5legal-footer-links a,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links a {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-decoration: none !important;
  opacity: 1 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .m5legal-footer-links a:hover,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) .m5legal-footer-links a:hover {
  color: #f3baff !important;
  -webkit-text-fill-color: #f3baff !important;
}
@media (max-width: 640px) {
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer .m5legal-footer-links {
    gap: 8px 14px !important;
    padding: 14px 12px max(16px,env(safe-area-inset-bottom)) !important;
  }
}


/* M5 PREMIUM THEME 2.0.12 — START: keep both footer bands in ONE container.
 * M5 USERPROFILE injects .m5legal-footer-links outside #wrap. The companion
 * footer event relocates that existing element into #page-footer without
 * copying links. 2.0.11 fixed only the light band width, not that DOM issue.
 * This override deliberately applies only to the logged-in NEWS/START page.
 */
@supports selector(body:has(.m5news-standalone)) {
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.page-footer {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #f3f1ff !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
  }
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.page-footer > .m5legal-footer-links {
    box-sizing: border-box !important;
    display: flex !important;
    position: static !important;
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    margin: 0 10px !important;
    padding: 12px 16px !important;
    background: #111034 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px 20px !important;
    flex-wrap: wrap !important;
  }
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.page-footer > .m5legal-footer-links a {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
}
@media (max-width: 600px) {
  @supports selector(body:has(.m5news-standalone)) {
    html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.page-footer > .m5legal-footer-links {
      width: 100% !important;
      max-width: 100% !important;
      margin: 0 !important;
      gap: 8px 12px !important;
    }
  }
}

/* M5 PREMIUM THEME 2.0.13 — START footer: align copyright and legal bar
   with the real page-body canvas. CSS vars are set by the footer event.
   Overrides older 1360px, calc(100%-20px) and full-width rules. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.m5premium-start-footer-aligned {
  box-sizing:border-box!important;
  width:var(--m5-start-footer-width)!important;
  max-width:100%!important;
  min-width:0!important;
  margin-left:var(--m5-start-footer-offset)!important;
  margin-right:0!important;
  background:#f3f1ff!important;
  border:0!important;
  padding:0!important;
  overflow:hidden!important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.m5premium-start-footer-aligned > .m5legal-footer-links {
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:wrap!important;
  width:calc(100% - 20px)!important;
  max-width:calc(100% - 20px)!important;
  box-sizing:border-box!important;
  margin:0 10px!important;
  padding:12px 16px!important;
  background:#111034!important;
  gap:10px 20px!important;
  min-height:44px!important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.m5premium-start-footer-aligned .copyright {
  padding:15px 16px!important;
  min-height:54px!important;
}
@media(max-width:600px){
 html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.m5premium-start-footer-aligned > .m5legal-footer-links {
   width:100%!important;max-width:100%!important;margin:0!important;
 }
}


/* M5 PREMIUM THEME 2.0.14 — ONE FOOTER CANVAS, no asymmetric side strips.
   Inline dimensions on #page-footer are calculated by the footer event from
   #page-body (the actual page canvas), never from unrelated width rules. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.page-footer.m5premium-footer-214,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.page-footer.m5premium-footer-214 {
  display: block !important;
  position: relative !important;
  float: none !important;
  clear: both !important;
  box-sizing: border-box !important;
  width: var(--m5-footer-214-width, 100%) !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 0 0 var(--m5-footer-214-offset, 0px) !important;
  padding: 0 !important;
  background: #f3f1ff !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .trzcianka-footer-white-zone,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 .copyright {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  background: #f3f1ff !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .trzcianka-footer-white-zone {
  padding: 0 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 .copyright {
  padding: 12px 16px !important;
  text-align: center !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .m5legal-footer-links,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone) #page-footer.m5premium-footer-214 > .m5legal-footer-links {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom)) !important;
  gap: 8px 20px !important;
  background: #111034 !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #fff !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .m5legal-footer-links :is(a,span),
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .m5legal-footer-links button {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .m5legal-footer-links button {
  border: 1px solid #a6c7fb !important;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  background: #254876 !important;
  cursor: pointer !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .m5legal-footer-links button:focus-visible {
  outline: 2px solid #7ecbff !important;
  outline-offset: 2px !important;
}
@media(max-width:600px){
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded) #page-footer.m5premium-footer-214 > .m5legal-footer-links {
    gap: 10px 14px !important;
    padding: 12px 10px max(16px,env(safe-area-inset-bottom)) !important;
  }
}


/* M5 PREMIUM THEME 2.0.15 — POL.FAN START, light modules matching BAZAR.
   Intentionally scoped to .m5news-page. Does not recolor dark game UIs,
   user profiles, or text overlays on news photographs. */
html body#phpbb:not(.m5fs-front-site) .m5news-standalone .m5news-page {
  --m5p-card: #fff;
  --m5p-card-line: #d4e3f7;
  color: #163253 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page :is(
 .m5news-section,.m5news-side,.m5fb-feed-section,.m5home-events,.m5f-home-recommendations
) {
  background: #fff !important;
  background-image: none !important;
  border: 1px solid #d5e3f4 !important;
  color: #213a59 !important;
  border-radius: 17px !important;
  box-shadow: 0 8px 22px rgba(28,68,126,.065) !important;
  overflow: hidden;
}
/* Legible, light headers and restrained blue accent; image overlays unaffected. */
html body#phpbb:not(.m5fs-front-site) .m5news-page :is(
 .m5news-section-title,.m5fb-feed-heading,.m5home-events-heading,.m5f-section-title
) {
  background: linear-gradient(115deg,#eff7ff,#fff 85%) !important;
  border-bottom: 1px solid #e5eef8 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page :is(
 .m5news-section-title,.m5fb-feed-heading,.m5home-events-heading,.m5f-section-title
) :is(h1,h2,h3,strong) { color: #163b66 !important; text-shadow: none !important; }
html body#phpbb:not(.m5fs-front-site) .m5news-page :is(
 .m5news-section-title,.m5fb-feed-heading,.m5home-events-heading,.m5f-section-title
) :is(p,small) { color: #667d9b !important; }
html body#phpbb:not(.m5fs-front-site) .m5news-page :is(
 .m5news-section-title,.m5fb-feed-heading,.m5home-events-heading,.m5f-section-title
) a { color: #086bcc !important; }
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-side > h3 {
  color: #173d69 !important;
  border-bottom: 1px solid #dbe9f7 !important;
  padding-bottom: 12px !important;
  text-shadow: none !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-side :is(p,small) {
  color: #607b98 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-side .m5news-forum-row {
  background: #f5f9ff !important; color:#183a60 !important;
  border: 1px solid #dce9f8 !important;
  border-radius: 11px !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-side .m5news-forum-row :is(b,small) {
  color: #234567 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-side .m5news-side-btn,
html body#phpbb:not(.m5fs-front-site) .m5news-page :is(.m5fb-load-more,.m5fb-feed-tabs button.is-active) {
  background: linear-gradient(120deg,#0878d6,#095bb4) !important;
  border: 1px solid #0867bf !important;
  color: #fff !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5fb-feed-tabs button:not(.is-active) {
  background: #f7fbff !important; color: #1d507b !important;
  border: 1px solid #cadff3 !important;
  box-shadow: none !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5fb-feed-tabs button:hover {
  border-color: #5ba6e8 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5fb-feed-icon {
  background: #e5f1ff !important;
  color: #18559a !important;
  border-radius: 10px !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5fb-post {
  box-shadow: 0 4px 14px rgba(25,61,119,.06) !important;
  border:1px solid #e0ebf6 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-chat > strong {
  color: #1c5081 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-side .m5news-ad :is(b,small) {
  color: #285175 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page #m5news-last-opinion.m5news-last-opinion-v108 {
  background: #fff !important;
  background-image: none !important;
  border:1px solid #d5e3f4 !important;
  color: #183a62 !important;
  box-shadow: 0 8px 22px rgba(28,68,126,.065) !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page #m5news-last-opinion .m5news-opinion-widget-head {
  border-bottom:1px solid #dbe9f7 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page #m5news-last-opinion .m5news-opinion-widget-head h3 {
  color:#173d69 !important;
}
html body#phpbb:not(.m5fs-front-site) .m5news-page #m5news-last-opinion .m5news-opinion-empty {
  color:#5d7491 !important;
}
/* News photos KEEP dark gradients and white caption text for accessibility. */
html body#phpbb:not(.m5fs-front-site) .m5news-page .m5news-card :is(h3,h3 a,.m5news-meta) {
  color:#fff !important;
  -webkit-text-fill-color: #fff !important;
}
/* Restrict to START/NEWS only: footer is a child of the actual #page-body
   canvas, so no bounding-box-derived offset or 8-12px sideways drift. */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone)
 #page-body.page-body > #page-footer.page-footer.m5premium-footer-215 {
  box-sizing:border-box !important;
  display:block !important;
  position:relative !important;
  clear:both !important;
  float:none !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  overflow:visible !important;
  background:#f3f1ff !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone)
 #page-body.page-body > #page-footer.m5premium-footer-215 .copyright {
  box-sizing:border-box !important;
  width:100% !important;
  margin:0 !important;
  padding:16px 12px !important;
  background:#f3f1ff !important;
  color:#385170 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone)
 #page-body.page-body > #page-footer.m5premium-footer-215 > .m5legal-footer-links {
  box-sizing:border-box !important;
  display:flex !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 !important;
  padding:14px 18px !important;
  gap:12px 20px !important;
  justify-content:center !important;
  background:#dfecfc !important;
  color:#194772 !important;
  border-top:1px solid #c9dcf3 !important;
  border-radius:0 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone)
 #page-body.page-body > #page-footer.m5premium-footer-215 > .m5legal-footer-links :is(a,span,button) {
  color:#194772 !important;
  -webkit-text-fill-color:#194772 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded):has(.m5news-standalone)
 #page-body.page-body > #page-footer.m5premium-footer-215 > .m5legal-footer-links button {
  background:#fff !important;
  border-color:#a8c9ed !important;
  color:#194772 !important;
}
@media(max-width:600px){
 html body#phpbb:not(.m5fs-front-site) .m5news-page :is(.m5news-section,.m5news-side,.m5fb-feed-section) {
   border-radius:13px !important;
 }
 html body#phpbb:not(.m5fs-front-site) .m5news-page :is(.m5news-section-title,.m5fb-feed-heading) {
   padding:13px !important;
 }
}

/* ========================================================================
   M5 PREMIUM THEME 2.0.16 — unified footer on ALL content pages.
   Reuse exactly the START structure: copyright on lavender, legal/privacy
   band on light blue. Do not recolor FRONT SITE or embedded registration.
   Keep selectors scoped to the actual native footer; never style modal
   footers (BAZAR, GROUPS, chat, etc.).
   ======================================================================== */
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
  #page-body.page-body > #page-footer.page-footer.m5premium-footer-216 {
  display:block !important;
  box-sizing:border-box !important;
  position:relative !important;
  float:none !important;
  clear:both !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:#f3f1ff !important;
  box-shadow:none !important;
  overflow:visible !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
  #page-body.page-body > #page-footer.m5premium-footer-216 .copyright,
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
  #page-body.page-body > #page-footer.m5premium-footer-216 > .trzcianka-footer-white-zone {
  display:block !important;
  box-sizing:border-box !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 !important;
  padding:14px 16px !important;
  border:0 !important;
  border-radius:0 !important;
  background:#f3f1ff !important;
  background-image:none !important;
  text-align:center !important;
  color:#385170 !important;
  box-shadow:none !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
  #page-body.page-body > #page-footer.m5premium-footer-216 > .m5legal-footer-links {
  display:flex !important;
  position:static !important;
  box-sizing:border-box !important;
  align-items:center !important;
  justify-content:center !important;
  flex-wrap:wrap !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  padding:13px 18px max(13px, env(safe-area-inset-bottom)) !important;
  gap:10px 18px !important;
  background:#dfecfc !important;
  background-image:none !important;
  border:0 !important;
  border-top:1px solid #c9dcf3 !important;
  border-radius:0 !important;
  color:#194772 !important;
  box-shadow:none !important;
  text-align:center !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
  #page-body.page-body > #page-footer.m5premium-footer-216 > .m5legal-footer-links :is(a,span,button) {
  color:#194772 !important;
  -webkit-text-fill-color:#194772 !important;
  font-size:12px !important;
  line-height:1.5 !important;
  opacity:1 !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
  #page-body.page-body > #page-footer.m5premium-footer-216 > .m5legal-footer-links a:hover {
  color:#075bb6 !important;
  -webkit-text-fill-color:#075bb6 !important;
  text-decoration:underline !important;
}
html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
  #page-body.page-body > #page-footer.m5premium-footer-216 > .m5legal-footer-links button {
  box-sizing:border-box !important;
  padding:3px 10px !important;
  border:1px solid #a8c9ed !important;
  border-radius:6px !important;
  background:#fff !important;
  cursor:pointer !important;
}
@media(max-width:600px) {
  html body#phpbb:not(.m5fs-front-site):not(.m5reg-embedded)
    #page-body.page-body > #page-footer.m5premium-footer-216 > .m5legal-footer-links {
    gap:9px 13px !important;
    padding:12px 12px max(16px, env(safe-area-inset-bottom)) !important;
  }
}
