/**
 * Final UI Polish — additive only, loads ABSOLUTE LAST (public + admin).
 * Cross-cutting rhythm: spacing, cards, tables, forms, nav, dark mode.
 * Does not modify legacy app-public.css / app-admin.css.
 */

:root {
  --final-radius: 12px;
  --final-radius-lg: 16px;
  --final-border: color-mix(in srgb, var(--primary-color, #1a5f2a) 12%, #e2e8e4);
  --final-shadow: 0 4px 18px rgba(15, 31, 23, 0.06);
  --final-shadow-hover: 0 10px 28px rgba(15, 31, 23, 0.1);
  --final-muted: #5b6b62;
}

/* ── Shared typography & focus ───────────────────────────────────── */

::selection {
  background: color-mix(in srgb, var(--primary-color, #1a5f2a) 22%, transparent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary-color, #1a5f2a) !important;
  outline-offset: 2px !important;
}

/* ── PUBLIC: section rhythm & headers ──────────────────────────── */

.section-padding {
  padding-top: clamp(2.25rem, 4.5vw, 3.75rem) !important;
  padding-bottom: clamp(2.25rem, 4.5vw, 3.75rem) !important;
}

.section-header-unified {
  margin-bottom: clamp(1.25rem, 3vw, 1.85rem) !important;
}

.section-header-unified h2,
.section-header h2 {
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 0.45rem !important;
}

.section-header-unified p,
.section-header p {
  color: var(--final-muted) !important;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55 !important;
}

.section-divider {
  width: 56px !important;
  height: 3px !important;
  margin: 0.65rem auto 0.85rem !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color, #1a5f2a),
    transparent
  ) !important;
}

.breadcrumb {
  font-size: 0.875rem !important;
  margin-bottom: 0 !important;
}

.breadcrumb-item + .breadcrumb-item::before {
  opacity: 0.55;
}

/* ── PUBLIC: cards & content blocks ────────────────────────────── */

.news-card,
.notice-card,
.team-card-circular,
.service-card,
.stat-box,
.contact-card,
.download-card {
  border-radius: var(--final-radius-lg) !important;
  border: 1px solid var(--final-border) !important;
  box-shadow: var(--final-shadow) !important;
  transition: box-shadow 0.2s ease, transform 0.2s ease !important;
}

.news-card:hover,
.notice-card:hover,
.service-card:hover {
  box-shadow: var(--final-shadow-hover) !important;
}

.read-more,
.nts-read-more {
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 2px;
  border-color: var(--final-border) !important;
}

.pagination .page-item.active .page-link {
  background: var(--primary-color, #1a5f2a) !important;
  border-color: var(--primary-color, #1a5f2a) !important;
}

.empty-state {
  padding: 2.5rem 1rem !important;
  color: var(--final-muted) !important;
}

/* ── PUBLIC: forms & buttons ─────────────────────────────────────── */

.form-control,
.form-select,
textarea.form-control {
  border-radius: 10px !important;
  border-color: #d7e0db !important;
  min-height: 44px;
}

textarea.form-control {
  min-height: 120px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color, #1a5f2a) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color, #1a5f2a) 16%, transparent) !important;
}

.btn,
.btn-primary,
.btn-outline-primary,
.nts-btn-primary {
  border-radius: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

/* ── PUBLIC: compact top utility bar (desktop) ─────────────────── */

@media (min-width: 992px) {
  .pfl-top-bar .container {
    min-height: 34px !important;
    align-items: center !important;
  }

  .pfl-quick-links > li > a {
    padding: 5px 11px !important;
    font-size: 11px !important;
  }

  .pfl-top-right {
    gap: 1px !important;
    padding-left: 6px !important;
  }

  .pfl-top-right > li > a,
  .pfl-top-right .pfl-bell-btn,
  .pfl-top-right .pfl-dark-wrap > a {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 3px 7px !important;
    border-radius: 5px !important;
    font-size: 11.5px !important;
  }

  .pfl-top-right .pfl-login-toggle {
    min-height: 28px !important;
    min-width: 0 !important;
    padding: 3px 10px !important;
    font-size: 11.5px !important;
    border-radius: 5px !important;
    gap: 5px !important;
  }

  .pfl-top-right .pfl-login-caret {
    font-size: 9px !important;
  }

  .pfl-top-right .pfl-lang-wrap {
    gap: 3px !important;
    padding-left: 8px !important;
    margin-left: 2px !important;
    border-left-color: rgba(255, 255, 255, 0.22) !important;
  }

  .pfl-top-right .pfl-lang-wrap .pfl-lang-link {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 2px 6px !important;
    font-size: 10.5px !important;
    gap: 4px !important;
    border-radius: 5px !important;
  }

  .pfl-top-right .pfl-lang-wrap .pfl-lang-dot {
    width: 7px !important;
    height: 7px !important;
    border-width: 1.3px !important;
  }

  .pfl-top-right .pfl-lang-wrap .pfl-lang-divider {
    font-size: 10px !important;
    opacity: 0.55;
  }

  .pfl-top-right .pfl-bell-btn {
    padding: 3px 7px !important;
  }

  .pfl-top-right .pfl-bell-badge {
    font-size: 9px !important;
    padding: 0 4px !important;
    line-height: 1.3 !important;
    top: 0 !important;
    right: 0 !important;
  }
}

/* ── PUBLIC: org chart final centering ─────────────────────────── */

.team-org-chart-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.team-org-chart {
  width: 100%;
  max-width: 1100px;
}

.team-org-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-org-connector {
  flex-shrink: 0;
}

/* ── PUBLIC: footer & mobile chrome ────────────────────────────── */

.main-footer {
  border-top: 1px solid var(--final-border) !important;
}

.main-footer .footer-widget h4 {
  font-weight: 700 !important;
  margin-bottom: 0.85rem !important;
}

.mob-bottomnav {
  border-top: 1px solid var(--final-border) !important;
  box-shadow: 0 -6px 24px rgba(15, 31, 23, 0.08) !important;
  backdrop-filter: blur(10px);
}

.mob-bottomnav a.active,
.mob-bottomnav a[aria-current="page"] {
  color: var(--primary-color, #1a5f2a) !important;
}

/* ── ADMIN: shell, alerts, tables ──────────────────────────────── */

body[class*="admin-page-"] .main-content {
  background: linear-gradient(180deg, #f8fbf9 0%, #f4f7f5 120px, #f4f7f5 100%) !important;
}

body[class*="admin-page-"] .alert {
  border: none !important;
  border-radius: var(--final-radius) !important;
  box-shadow: 0 2px 10px rgba(15, 31, 23, 0.06) !important;
  font-size: 0.9rem !important;
}

body[class*="admin-page-"] .main-content .table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: var(--final-radius) !important;
  overflow: hidden;
}

body[class*="admin-page-"] .main-content .table thead th {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: #3d4f44 !important;
  background: #f0f6f2 !important;
  border-bottom: 2px solid color-mix(in srgb, var(--primary-color, #1a5f2a) 18%, #dde5e0) !important;
  padding: 0.7rem 0.75rem !important;
  white-space: nowrap;
}

body[class*="admin-page-"] .main-content .table tbody td {
  padding: 0.65rem 0.75rem !important;
  vertical-align: middle !important;
  border-color: #ecf1ed !important;
}

body[class*="admin-page-"] .main-content .table tbody tr:hover {
  background: #f8fcfa !important;
}

body[class*="admin-page-"] .main-content .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.65) !important;
}

body[class*="admin-page-"] .badge {
  font-weight: 600 !important;
  border-radius: 6px !important;
  padding: 0.35em 0.62em !important;
}

body[class*="admin-page-"] .main-content .admin-nav-tabs {
  border-bottom: 2px solid #e5ebe7 !important;
  gap: 0.25rem;
}

body[class*="admin-page-"] .main-content .admin-nav-tabs .nav-link {
  font-weight: 600 !important;
  color: #5b6b62 !important;
  border-radius: 10px 10px 0 0 !important;
  padding: 0.55rem 1rem !important;
}

body[class*="admin-page-"] .main-content .admin-nav-tabs .nav-link.active {
  color: var(--primary-color, #1a5f2a) !important;
  background: #fff !important;
  border-color: #e5ebe7 #e5ebe7 #fff !important;
}

body[class*="admin-page-"] .modal-content {
  border: none !important;
  border-radius: var(--final-radius-lg) !important;
  box-shadow: 0 24px 64px rgba(15, 31, 23, 0.18) !important;
}

body[class*="admin-page-"] .modal-header {
  border-bottom: 1px solid #ecf1ed !important;
  padding: 1rem 1.15rem !important;
}

body[class*="admin-page-"] .modal-footer {
  border-top: 1px solid #ecf1ed !important;
  padding: 0.85rem 1.15rem !important;
  background: #fafcfb !important;
}

body[class*="admin-page-"] .dataTables_wrapper .dataTables_info,
body[class*="admin-page-"] .dataTables_wrapper .dataTables_length label,
body[class*="admin-page-"] .dataTables_wrapper .dataTables_filter label {
  font-size: 0.85rem !important;
  color: var(--final-muted) !important;
}

body[class*="admin-page-"] .admin-bottom-nav,
body[class*="admin-page-"] .bottom-nav-admin {
  border-top: 1px solid var(--final-border) !important;
  box-shadow: 0 -6px 24px rgba(15, 31, 23, 0.08) !important;
}

/* ── ADMIN AUTH (login) ────────────────────────────────────────── */

body.admin-auth-page .auth-portal-card,
body.admin-auth-page .login-card,
body.admin-auth-page .card {
  border-radius: var(--final-radius-lg) !important;
  box-shadow: 0 16px 48px rgba(15, 31, 23, 0.12) !important;
  border: 1px solid var(--final-border) !important;
}

body.admin-auth-page .auth-portal-page {
  background: linear-gradient(160deg, #f0f7f2 0%, #e8f2eb 45%, #f5f8f6 100%) !important;
}

/* ── DARK MODE (gentle, additive) ──────────────────────────────── */

body.dark-mode .news-card,
body.dark-mode .notice-card,
body.dark-mode .team-card-circular,
body.dark-mode .service-card {
  background: #1a2420 !important;
  border-color: #2d3d35 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .section-header-unified p,
body.dark-mode .empty-state {
  color: #a8b5ad !important;
}

body.dark-mode[class*="admin-page-"] .main-content {
  background: linear-gradient(180deg, #141a17 0%, #121816 120px, #121816 100%) !important;
}

body.dark-mode[class*="admin-page-"] .main-content .table thead th {
  background: #1e2823 !important;
  color: #c5d4c8 !important;
  border-bottom-color: #2d3d35 !important;
}

body.dark-mode[class*="admin-page-"] .main-content .table tbody td {
  border-color: #2a3530 !important;
}

body.dark-mode[class*="admin-page-"] .main-content .table tbody tr:hover {
  background: #1e2823 !important;
}

@media (max-width: 575px) {
  body[class*="admin-page-"] .main-content .table thead th {
    font-size: 0.72rem !important;
  }

  .section-header-unified h2 {
    font-size: clamp(1.2rem, 5vw, 1.5rem) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-card,
  .notice-card,
  .service-card,
  body[class*="admin-page-"] .main-content .card:not(.stat-card) {
    transition: none !important;
  }
}

/* ── MEMBER PORTAL ─────────────────────────────────────────────── */

body.mem-wrapper .mem-card,
body.mem-wrapper .mp-card {
  border-radius: var(--final-radius-lg) !important;
  border-color: var(--final-border) !important;
  box-shadow: var(--final-shadow) !important;
  transition: box-shadow 0.2s ease !important;
}

body.mem-wrapper .mem-card:hover,
body.mem-wrapper .mp-card:hover {
  box-shadow: var(--final-shadow-hover) !important;
}

body.mem-wrapper .mem-card-header {
  background: linear-gradient(180deg, #fafcfb 0%, #fff 100%) !important;
}

body.mem-wrapper .mp-page-head .mem-page-title {
  letter-spacing: -0.02em !important;
}

body.mem-wrapper .mem-container .btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color, #1a5f2a),
    color-mix(in srgb, var(--primary-color, #1a5f2a) 78%, #0e9b53)
  ) !important;
  border: none !important;
  box-shadow: 0 3px 12px rgba(var(--primary-rgb, 26, 95, 42), 0.22);
}

body.mem-wrapper .mem-container .table tbody tr:hover {
  background: color-mix(in srgb, var(--primary-color, #1a5f2a) 4%, #fff) !important;
}

/* ── AUTH + VERIFY PORTALS ─────────────────────────────────────── */

body.auth-portal-page .auth-card,
body.verify-auth-page .vp-main-card,
body.verify-auth-page .vp-result-card,
body.verify-auth-page .vp-rate-card,
body.verify-auth-page .vp-programs-card {
  border-radius: var(--final-radius-lg) !important;
  border: 1px solid var(--final-border) !important;
  box-shadow: var(--final-shadow) !important;
}

body.auth-portal-page .card-title {
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

body.verify-auth-page .vp-site-name {
  letter-spacing: -0.015em !important;
}

body.verify-auth-page .vp-input {
  border-radius: 10px !important;
  min-height: 46px;
  font-size: max(16px, 0.95rem) !important;
}

body.verify-auth-page .vp-alert-error {
  border-left: 3px solid #dc2626 !important;
  border-radius: var(--final-radius) !important;
}

/* ── MINIMAL PANEL (attend, tracker-id-card) ───────────────────── */

body:has(.card > .card-top) .card {
  border-radius: var(--final-radius-lg) !important;
  border: 1px solid var(--final-border) !important;
  box-shadow: var(--final-shadow) !important;
  overflow: hidden;
}

body:has(.card > .card-top) .card-top {
  background: linear-gradient(
    135deg,
    var(--primary-color, #1a5f2a),
    color-mix(in srgb, var(--primary-color, #1a5f2a) 72%, #0e9b53)
  ) !important;
}

/* ── PUBLIC footer trust strip (subtle) ──────────────────────────── */

.site-footer,
.footer-main {
  border-top: 1px solid var(--final-border) !important;
}

.site-footer a:hover,
.footer-main a:hover {
  color: var(--primary-color, #1a5f2a) !important;
}

/* ── NOTICE POPUP — photo-only lightbox polish ─────────────────── */

.notice-popup-enhanced .popup-overlay {
  background: rgba(8, 18, 12, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

.notice-popup-enhanced .popup-dialog.popup-v3.popup-dialog--photo-only {
  max-width: min(700px, 94vw) !important;
  border-radius: 14px !important;
  box-shadow: 0 28px 72px rgba(15, 31, 23, 0.32) !important;
  background: #fff !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-top-accent {
  display: none !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-actions-top {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 12 !important;
  justify-content: flex-end !important;
  pointer-events: none;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-close-btn {
  pointer-events: auto;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #334155 !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.16) !important;
  font-size: 17px !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-close-btn:hover {
  background: #fff !important;
  color: var(--primary-color, #1a5f2a) !important;
  transform: rotate(90deg) scale(1.04) !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-carousel {
  min-height: 0 !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-photo-only-wrap {
  padding: 0 !important;
  min-height: 0 !important;
  background: #fff !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-photo-only-img,
.notice-popup-enhanced .popup-dialog--photo-only .popup-photo-only-wrap img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(82vh, 760px) !important;
  height: auto !important;
  border-radius: 14px !important;
  object-fit: contain !important;
  box-shadow: none !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-nav {
  padding: 10px 14px 12px !important;
  background: linear-gradient(180deg, #fff 0%, #f8fbf9 100%) !important;
  border-top: 1px solid #ecf1ed !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-progress {
  height: 3px !important;
  background: #ecf1ed !important;
}

.notice-popup-enhanced .popup-dialog--photo-only .popup-progress-bar {
  background: var(--primary-color, #1a5f2a) !important;
}

@media (max-width: 575px) {
  .notice-popup-enhanced {
    padding: 12px !important;
  }

  .notice-popup-enhanced .popup-dialog.popup-v3.popup-dialog--photo-only {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .notice-popup-enhanced .popup-dialog--photo-only .popup-actions-top {
    top: 8px !important;
    right: 8px !important;
  }

  .notice-popup-enhanced .popup-dialog--photo-only .popup-photo-only-img,
  .notice-popup-enhanced .popup-dialog--photo-only .popup-photo-only-wrap img {
    max-height: 78vh !important;
    border-radius: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-popup-enhanced .popup-dialog--photo-only .popup-close-btn:hover {
    transform: none !important;
  }
}

/* ── PUBLIC: CTA band — KYC button readable on white ───────────── */

.cta-section .cta-content .btn-light {
  color: var(--primary-color, #1a5f2a) !important;
  -webkit-text-fill-color: var(--primary-color, #1a5f2a) !important;
  background: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  font-weight: 700 !important;
}

.cta-section .cta-content .btn-light .lucide-icon,
.cta-section .cta-content .btn-light i,
.cta-section .cta-content .btn-light svg {
  color: var(--primary-color, #1a5f2a) !important;
  -webkit-text-fill-color: var(--primary-color, #1a5f2a) !important;
  background: transparent !important;
  border: 0 !important;
  stroke: currentColor;
}

.cta-section .cta-content .btn-light:hover {
  background: #f0fdf4 !important;
  color: var(--primary-dark, #145021) !important;
  -webkit-text-fill-color: var(--primary-dark, #145021) !important;
}

.cta-section .cta-content .btn-light:hover .lucide-icon,
.cta-section .cta-content .btn-light:hover i,
.cta-section .cta-content .btn-light:hover svg {
  color: var(--primary-dark, #145021) !important;
  -webkit-text-fill-color: var(--primary-dark, #145021) !important;
}

.cta-section .cta-content .btn-outline-light {
  border-width: 2px !important;
  font-weight: 600 !important;
}

/* ── PUBLIC: Quick-help FAB icon contrast ──────────────────────── */

.qh-fab,
.qh-fab i,
.qh-fab .fas,
.qh-fab .fa-bolt,
.qh-fab .fa-times {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

.qh-fab {
  background: var(--primary-color, #1a5f2a) !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 8px 22px rgba(15, 31, 23, 0.22) !important;
}

.qh-fab i {
  font-size: 18px !important;
  font-weight: 900 !important;
}

/* ── Admin: search filtered count — thin border, clearer (same size) ─ */
body[class*="admin-page-"] .main-content .admin-search-wrap .search-count:empty,
body[class*="admin-page-"] .main-content .tm-search-wrap .search-count:empty {
  display: none !important;
}

body[class*="admin-page-"] .main-content .admin-search-wrap .search-count:not(:empty),
body[class*="admin-page-"] .main-content .tm-search-wrap .search-count:not(:empty) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0.15rem 0.55rem !important;
  border: 1px solid #c9d5ce !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #1f2d26 !important;
  -webkit-text-fill-color: #1f2d26 !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

/* ── Institutional profile — homepage snapshot + charts page ───── */

.ip-home-snapshot {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--final-border);
  background: linear-gradient(180deg, #fafcfb 0%, #fff 100%);
  box-shadow: var(--final-shadow);
}

.ip-home-snapshot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  color: var(--primary-color, #1a5f2a);
  font-size: 0.92rem;
}

.ip-home-snapshot-head small {
  font-weight: 600;
  color: var(--final-muted);
  font-size: 0.78rem;
}

.ip-home-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.ip-home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--final-border);
  background: #fff;
  text-decoration: none !important;
  transition: box-shadow 0.15s ease, transform 0.12s ease, border-color 0.12s ease;
}

.ip-home-stat:hover {
  box-shadow: var(--final-shadow-hover);
  border-color: color-mix(in srgb, var(--primary-color, #1a5f2a) 28%, #e5e7eb);
  transform: translateY(-1px);
}

.ip-home-stat strong {
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 800;
  color: var(--primary-color, #1a5f2a);
  line-height: 1.2;
}

.ip-home-stat span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--final-muted);
}

.ip-home-snapshot-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-color, #1a5f2a);
  text-decoration: none !important;
}

.ip-home-snapshot-link:hover {
  text-decoration: underline !important;
}

@media (max-width: 767px) {
  .ip-home-snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 379px) {
  .ip-home-stat strong {
    font-size: 0.88rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE DEEP PASS (safe, additive, last-loaded)
   iOS zoom, table scroll, touch targets, safe-area, sticky bars
   ═══════════════════════════════════════════════════════════════ */

/* P0: iOS input zoom — reassert 16px after shell polish 0.94rem */
@media (max-width: 991.98px) {
  .form-control,
  .form-select,
  textarea.form-control,
  .afb-input,
  .afb-select,
  .team-filter-select,
  .field-coop,
  .mem-container .form-control,
  .mem-container .form-select,
  .mem-container textarea,
  .auth-portal-page .form-control,
  .auth-portal-page .form-select,
  .auth-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
  .auth-card select,
  .auth-card textarea,
  .vp-input,
  .vp-select,
  .admin-search-wrap .form-control,
  .admin-search-wrap input[type="search"],
  .admin-search-wrap input[type="text"] {
    font-size: 16px !important;
  }
}

/* P0: wide tables must scroll horizontally on mobile */
.v9-table-scroll,
.table-responsive,
.admin-table-card .table-responsive,
.stf-card-table-wrap .table-responsive {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* P1: sticky form submit above bottom nav */
body.has-bottomnav .coop-sticky-submit-bar,
body:has(.mob-bottomnav) .coop-sticky-submit-bar,
body:has(.mp-bottom-nav) .coop-sticky-submit-bar,
body:has(.mem-bottom-nav) .coop-sticky-submit-bar {
  bottom: calc(var(--mobile-bottom-nav-h, 64px) + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 9200 !important;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
}

.coop-sticky-submit-bar .btn,
.coop-sticky-submit-bar button[type="submit"] {
  min-height: 44px !important;
}

/* P1: sticky header safe-area (notch phones) */
.pfl-header-wrapper,
.mem-topbar,
.admin-header,
.main-header {
  top: env(safe-area-inset-top, 0px) !important;
}

html {
  scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
}

/* P1: notice popup + hero carousel touch targets */
@media (max-width: 899.98px) {
  .notice-popup-enhanced .popup-nav-btn,
  #noticePopup .popup-nav-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .notice-popup-enhanced .popup-dot,
  #noticePopup .popup-dot {
    width: 10px !important;
    height: 10px !important;
    padding: 14px !important;
    background-clip: content-box !important;
    box-sizing: content-box !important;
  }

  /* Keep touch area via min size — NEVER use content-box+padding
     (that paints a huge green disc when clip/bg cascade breaks). */
  .hero-slider .carousel-indicators [data-bs-target],
  .hero-slider .carousel-indicators button,
  .hero-indicators-modern .hero-indicator-btn {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
    padding: 0 !important;
    margin: 0 4px !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    background-clip: border-box !important;
  }

  .notice-popup-enhanced .popup-dialog.popup-v3,
  #noticePopup .popup-dialog {
    max-width: min(100%, calc(100vw - 16px)) !important;
    margin: 8px !important;
  }

  .ip-home-stat span {
    font-size: max(0.75rem, 12px) !important;
  }

  .ip-chart-canvas-wrap,
  .ip-charts-grid {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mob-bottomnav span,
  .mp-bottom-nav span,
  .mem-bottom-nav span {
    font-size: max(10px, 0.625rem) !important;
  }
}

/* P1: compact phones — stack & prevent horizontal bleed */
@media (max-width: 575.98px) {
  .modal-dialog {
    margin: 0.5rem !important;
    max-width: calc(100% - 1rem) !important;
  }

  .modal-dialog.modal-fullscreen-sm-down,
  .modal.show .modal-dialog {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .hero-slider .hero-content-modern,
  .hero-slider .slider-content {
    padding-left: max(12px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(12px, env(safe-area-inset-right, 0px)) !important;
  }

  .section-padding {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .container,
  .container-fluid {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 379px) {
  .ip-home-snapshot-grid {
    gap: 0.5rem;
  }

  .mob-bottomnav span,
  .mp-bottom-nav span,
  .mem-bottom-nav span {
    font-size: 10px !important;
  }
}

/* ── Fast first paint: don't hide above-fold behind AOS opacity:0 ── */
.hero-slider [data-aos],
.institutional-profile-section [data-aos],
.page-banner [data-aos],
.pfl-header-wrapper [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Soften AOS delays so content feels present sooner */
[data-aos][data-aos-delay] {
  transition-delay: 0ms !important;
}

/* AOS fail-safe — never leave sections permanently invisible if JS fails/slow */
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}
body.aos-safe [data-aos] {
  opacity: 1 !important;
  transform: none !important;
}

/* Loader should never block interaction after early hide */
.page-loader.loaded,
body.page-loaded .page-loader {
  display: none !important;
  pointer-events: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Theme final safe polish (additive) — gallery / banner / pagination
   Do not edit app-public.css / app-admin.css for these.
   ═══════════════════════════════════════════════════════════════════ */

/* Page banner — tighter first paint, keep brand gradient from core */
.page-banner {
  padding-block: clamp(1.35rem, 3.2vw, 2.35rem) !important;
}

.page-banner h1 {
  letter-spacing: -0.02em !important;
  line-height: 1.25 !important;
  margin-bottom: 0.35rem !important;
}

.page-banner .breadcrumb {
  opacity: 0.92;
}

/* Gallery tabs + cards — match final radius / brand */
.gallery-tabs-wrapper {
  border: 1px solid var(--final-border) !important;
  box-shadow: var(--final-shadow) !important;
  border-radius: var(--final-radius-lg) !important;
  background: color-mix(in srgb, var(--primary-color, #1a5f2a) 4%, #fff) !important;
}

.gallery-tab {
  border-radius: 10px !important;
  min-height: 44px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease !important;
}

.gallery-tab:focus-visible {
  outline: 2px solid var(--primary-color, #1a5f2a) !important;
  outline-offset: 2px !important;
}

.gallery-tab.active {
  box-shadow: 0 2px 10px color-mix(in srgb, var(--primary-color, #1a5f2a) 28%, transparent);
}

.gallery-category-filter .form-select {
  min-height: 44px;
  border-radius: 10px !important;
}

.gallery-card {
  border-radius: var(--final-radius) !important;
  border: 1px solid var(--final-border) !important;
  box-shadow: var(--final-shadow) !important;
  background: #fff;
  overflow: hidden;
}

.gallery-card img {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto !important;
  object-fit: cover;
  background: #eef3ef;
}

.gallery-caption {
  padding: 0.55rem 0.75rem !important;
  font-size: 0.875rem !important;
  color: var(--final-muted) !important;
  line-height: 1.35;
}

/* Pagination — notices / news / gallery share the same rhythm */
.pagination-nav {
  margin-top: 1.75rem !important;
}

.pagination-nav .pagination {
  gap: 0.25rem;
  flex-wrap: wrap;
}

.pagination .page-link {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 600 !important;
  color: var(--text-color, #1f2a24) !important;
}

.pagination .page-link:hover {
  background: color-mix(in srgb, var(--primary-color, #1a5f2a) 10%, #fff) !important;
  color: var(--primary-color, #1a5f2a) !important;
}

.pagination .page-item.disabled .page-link {
  opacity: 0.45;
}

/* Notice / news list cards — slightly calmer hover on touch devices */
@media (hover: hover) and (pointer: fine) {
  .gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--final-shadow-hover) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-tab,
  .news-card,
  .notice-card,
  .service-card {
    transition: none !important;
    transform: none !important;
  }
}

/* Content pages — avoid accidental horizontal scroll from wide media */
.notices-section img,
.news-section img,
.gallery-section img,
.team-section img,
.awards-section img {
  max-width: 100%;
  height: auto;
}

/* Dark mode — gallery / pagination / banner crumbs */
body.dark-mode .gallery-tabs-wrapper {
  background: color-mix(in srgb, #1a2420 92%, var(--primary-color, #1a5f2a)) !important;
  border-color: #2d3d35 !important;
}

body.dark-mode .gallery-tab {
  background: #1e2823 !important;
  color: #d5e0d8 !important;
}

body.dark-mode .gallery-tab.active {
  background: var(--primary-color, #1a5f2a) !important;
  color: var(--text-on-primary, #fff) !important;
}

body.dark-mode .gallery-card {
  background: #1a2420 !important;
  border-color: #2d3d35 !important;
}

body.dark-mode .gallery-caption {
  color: #a8b5ad !important;
}

body.dark-mode .pagination .page-link {
  background: #1a2420 !important;
  color: #d5e0d8 !important;
  border-color: #2d3d35 !important;
}

body.dark-mode .pagination .page-item.active .page-link {
  background: var(--primary-color, #1a5f2a) !important;
  border-color: var(--primary-color, #1a5f2a) !important;
  color: var(--text-on-primary, #fff) !important;
}

/* Mobile gallery — full-width tabs, larger tap targets */
@media (max-width: 767.98px) {
  .gallery-tabs {
    width: 100%;
  }

  .gallery-tab {
    flex: 1 1 0;
    justify-content: center;
    padding: 0.65rem 0.75rem !important;
    font-size: 0.9rem !important;
  }

  .gallery-card img {
    aspect-ratio: 1 / 1;
  }

  .pagination .page-link {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Print: keep banners readable, hide chrome noise */
@media print {
  .page-loader,
  .mob-bottomnav,
  .mp-bottom-nav,
  .mem-bottom-nav,
  .pagination-nav,
  .gallery-tabs-wrapper {
    display: none !important;
  }

  .page-banner {
    background: #fff !important;
    color: #000 !important;
    padding: 0.5rem 0 !important;
    box-shadow: none !important;
  }

  .page-banner h1,
  .page-banner .breadcrumb,
  .page-banner .breadcrumb-item,
  .page-banner .breadcrumb-item a {
    color: #000 !important;
  }

  .gallery-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Team photo cards — board/samiti = management size (uniform)
   Org-chart cells were ~220px while management col-lg-3 is ~280–320px.
   Force one shared card/photo footprint everywhere.
   ═══════════════════════════════════════════════════════════════════ */

.team-section,
.team-org-chart-wrap,
.committees-section {
  --team-card-w: 280px;
  --team-uniform-photo: 140px;
  --team-uniform-pad-y: 26px;
  --team-uniform-pad-x: 18px;
  --team-card-min-h: 336px;
  --team-badge-min-h: 2.75em;
  --team-name-min-h: 2.9em;
  --team-contact-min-h: 52px;
}

/* Org-chart cells (board / samiti) — same width as management cards */
.team-org-cell {
  flex: 0 1 var(--team-card-w) !important;
  width: var(--team-card-w) !important;
  max-width: var(--team-card-w) !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
}

.team-org-row-inner {
  gap: 1.25rem !important;
  justify-content: center !important;
}

/* Management / committee Bootstrap cols — don't let cards grow past shared width */
.team-section .row > [class*="col-"]:has(> .team-card-circular),
.committees-section .row > [class*="col-"]:has(> .team-card-circular) {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.team-section .row > [class*="col-lg-3"]:has(> .team-card-circular),
.team-section .row > [class*="col-md-4"]:has(> .team-card-circular),
.committees-section .row > [class*="col-lg-3"]:has(> .team-card-circular),
.committees-section .row > [class*="col-md-4"]:has(> .team-card-circular) {
  flex: 0 1 var(--team-card-w) !important;
  max-width: var(--team-card-w) !important;
  width: 100% !important;
}

.team-section .row > [class*="col-"] > .team-card-circular,
.committees-section .row > [class*="col-"] > .team-card-circular,
.team-org-cell > .team-card-circular {
  width: 100% !important;
  max-width: var(--team-card-w) !important;
  min-height: var(--team-card-min-h) !important;
  height: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: var(--team-uniform-pad-y) var(--team-uniform-pad-x) 20px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

/* Officer cards stay full column width (do not shrink like team photo cards) */
.team-section .row > [class*="col-"] > .officer-card {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
}

/* Same photo ring size for board, management, committees, featured, small */
.team-section .team-photo-circular,
.team-org-chart .team-photo-circular,
.committees-section .team-photo-circular,
.team-section .team-photo-circular.small,
.team-org-chart .team-photo-circular.small,
.committees-section .team-photo-circular.small,
.team-section .team-card-circular.featured .team-photo-circular,
.team-org-chart .team-card-circular.featured .team-photo-circular,
.committees-section .team-card-circular.featured .team-photo-circular,
#board.team-section .team-photo-circular {
  width: var(--team-uniform-photo) !important;
  height: var(--team-uniform-photo) !important;
  min-width: var(--team-uniform-photo) !important;
  min-height: var(--team-uniform-photo) !important;
  margin: 0 auto 16px !important;
  padding: 4px !important;
  flex-shrink: 0 !important;
  transform: none !important;
}

.team-section .team-photo-circular img,
.team-org-chart .team-photo-circular img,
.committees-section .team-photo-circular img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
}

.team-section .team-card-circular:hover .team-photo-circular,
.team-org-chart .team-card-circular:hover .team-photo-circular,
.committees-section .team-card-circular:hover .team-photo-circular {
  transform: none !important;
}

/* Featured = border accent only, same footprint */
.team-section .team-card-circular.featured,
.team-org-chart .team-card-circular.featured,
.committees-section .team-card-circular.featured,
.team-section .team-card-circular.small,
.team-org-chart .team-card-circular.small,
.committees-section .team-card-circular.small {
  min-height: var(--team-card-min-h) !important;
  padding: var(--team-uniform-pad-y) var(--team-uniform-pad-x) 20px !important;
  max-width: var(--team-card-w) !important;
}

.team-section .team-info-circular h5,
.team-org-chart .team-info-circular h5,
.committees-section .team-info-circular h5 {
  font-size: 1.05rem !important;
  line-height: 1.45 !important;
  min-height: var(--team-name-min-h) !important;
}

.team-section .team-position-badge,
.team-org-chart .team-position-badge,
.committees-section .team-position-badge {
  min-height: var(--team-badge-min-h) !important;
  font-size: 0.78rem !important;
}

.team-section .team-contact-circular,
.team-org-chart .team-contact-circular,
.committees-section .team-contact-circular {
  min-height: var(--team-contact-min-h) !important;
  margin-top: auto !important;
}

@media (max-width: 991.98px) {
  .team-section,
  .team-org-chart-wrap,
  .committees-section {
    --team-card-w: 250px;
    --team-uniform-photo: 128px;
    --team-card-min-h: 320px;
  }
}

@media (max-width: 575.98px) {
  .team-section,
  .team-org-chart-wrap,
  .committees-section {
    --team-card-w: min(100%, 280px);
    --team-uniform-photo: 120px;
    --team-uniform-pad-y: 22px;
    --team-uniform-pad-x: 14px;
    --team-card-min-h: 300px;
  }

  .team-org-cell,
  .team-section .row > [class*="col-lg-3"]:has(> .team-card-circular),
  .team-section .row > [class*="col-md-4"]:has(> .team-card-circular),
  .team-section .row > [class*="col-sm-6"]:has(> .team-card-circular),
  .committees-section .row > [class*="col-lg-3"]:has(> .team-card-circular),
  .committees-section .row > [class*="col-md-4"]:has(> .team-card-circular),
  .committees-section .row > [class*="col-sm-6"]:has(> .team-card-circular) {
    flex: 0 1 var(--team-card-w) !important;
    max-width: var(--team-card-w) !important;
    width: 100% !important;
  }
}

/* ── Meta date / action grey strips (same bug family) ───────────────
 * Theme “Date pill” paints .notice-date with a tinted background, but
 * display:flex made the span stretch full card width → grey bar.
 * Same look showed up on footer dates, news-detail meta, and single-CTA
 * attachment/footer slabs. Keep compact pills only where intended.
 */

/* Notices list + detail: compact pill (not a full-width bar) */
.notice-date {
  display: inline-flex !important;
  width: fit-content !important;
  max-width: 100%;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem !important;
  border-radius: 999px !important;
}

/* Footer notice dates: never a tinted bar/pill over the light footer */
.main-footer .notice-date,
.footer-notices .notice-date {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  margin-top: 0.25rem !important;
  background: transparent !important;
  border-radius: 0 !important;
  color: inherit !important;
}

/* Notice detail: drop full-width light slab behind download CTA */
.notice-detail-card .notice-attachment {
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 1.25rem !important;
}

body.dark-mode .notice-detail-card .notice-attachment {
  background: transparent !important;
}

/* News detail: .news-date is the homepage absolute badge — reset for meta line */
.news-meta .news-date,
.news-detail-header .news-date {
  position: static !important;
  top: auto !important;
  left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  width: fit-content !important;
  max-width: 100%;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  color: var(--final-muted, #5b6b62) !important;
  border-radius: 0 !important;
  text-align: left !important;
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
}

.news-meta .news-date i,
.news-detail-header .news-date i {
  color: var(--primary-color, #1a5f2a) !important;
}

/* Career detail: soft full-width slab behind action buttons → border only */
.job-detail-footer {
  background: transparent !important;
  border-top: 1px solid var(--final-border, #e2e8e4) !important;
  padding-top: 1.1rem !important;
}

body.dark-mode .job-detail-footer {
  background: transparent !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* =========================================================
   MOBILE HOME: hero / lang / logo / institutional profile
   Safe additive polish for phone viewport (screenshot fixes)
   ========================================================= */

@media (max-width: 767.98px) {
  /* 1) Kill oversized green carousel circles on hero */
  .hero-slider .carousel-control-prev,
  .hero-slider .carousel-control-next,
  #heroCarousel .carousel-control-prev,
  #heroCarousel .carousel-control-next {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  .hero-slider .carousel-indicators,
  #heroCarousel .carousel-indicators {
    bottom: 0.55rem !important;
    margin: 0 !important;
    gap: 0.35rem !important;
    z-index: 5 !important;
  }

  .hero-slider .carousel-indicators [data-bs-target],
  .hero-slider .hero-indicator-btn,
  #heroCarousel .carousel-indicators [data-bs-target] {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    max-width: 8px !important;
    max-height: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    background-clip: border-box !important;
    border: 0 !important;
    opacity: 0.55 !important;
    flex: 0 0 auto !important;
    transform: none !important;
  }

  .hero-slider .carousel-indicators .active,
  .hero-slider .hero-indicator-btn.active,
  #heroCarousel .carousel-indicators .active {
    width: 18px !important;
    max-width: 18px !important;
    min-width: 18px !important;
    height: 8px !important;
    max-height: 8px !important;
    min-height: 8px !important;
    border-radius: 999px !important;
    opacity: 1 !important;
    background: #fff !important;
    border-color: #fff !important;
    transform: none !important;
  }

  .hero-slider .carousel-caption,
  #heroCarousel .carousel-caption {
    bottom: 1.35rem !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .hero-slider .hero-btn-modern,
  #heroCarousel .hero-btn-modern {
    position: relative;
    z-index: 6;
    margin-top: 0.35rem !important;
  }

  /* 2) Institutional profile + reports: center on mobile */
  .institutional-profile-bar {
    align-items: center !important;
    text-align: center !important;
  }

  .institutional-profile-bar .profile-title-link,
  .institutional-profile-bar .profile-title {
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    text-align: center !important;
    width: fit-content !important;
    max-width: 100%;
  }

  .institutional-profile-bar .report-quick-links {
    justify-content: center !important;
    width: 100%;
  }

  /* 3) EN | NP language control — readable segmented pill (not empty circles) */
  .pfl-top-bar .pfl-top-right .pfl-lang-wrap,
  .pfl-top-bar .pfl-lang-wrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 2px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.14) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    min-height: 30px !important;
    height: auto !important;
    width: auto !important;
    overflow: hidden;
  }

  .pfl-top-bar .pfl-top-right .pfl-lang-wrap a,
  .pfl-top-bar .pfl-top-right .pfl-lang-wrap .pfl-lang-link,
  .pfl-top-bar .pfl-lang-wrap .pfl-lang-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 34px !important;
    width: auto !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 0.55rem !important;
    margin: 0 !important;
    border-radius: 999px !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
    line-height: 1 !important;
    color: rgba(255, 255, 255, 0.82) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    text-decoration: none !important;
  }

  .pfl-top-bar .pfl-top-right .pfl-lang-wrap a.active,
  .pfl-top-bar .pfl-top-right .pfl-lang-wrap .pfl-lang-link.active,
  .pfl-top-bar .pfl-lang-wrap .pfl-lang-link.active {
    background: #fff !important;
    color: #14532d !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) !important;
  }

  .pfl-top-bar .pfl-lang-wrap .pfl-lang-divider,
  .pfl-top-bar .pfl-lang-wrap .pfl-lang-dot {
    display: none !important;
  }

  .pfl-top-bar .pfl-lang-wrap .pfl-lang-link span:not(.pfl-lang-dot),
  .pfl-top-bar .pfl-lang-wrap a span:not(.pfl-lang-dot) {
    display: inline !important;
    font-size: 0.68rem !important;
    line-height: 1 !important;
    color: inherit !important;
    opacity: 1 !important;
  }

  /* 4) Logo: sharper, fuller banner on phone */
  .pfl-main-header .pfl-brand-area {
    padding: 0.35rem 0.55rem !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .pfl-main-header .pfl-brand-content.has-logo {
    max-width: calc(100vw - 4.75rem) !important;
  }

  .pfl-main-header .pfl-brand-content.has-logo .pfl-brand-logo {
    height: 46px !important;
    max-height: 50px !important;
    width: auto !important;
    max-width: min(78vw, 280px) !important;
    object-fit: contain !important;
    object-position: left center !important;
    image-rendering: -webkit-optimize-contrast;
  }

  .pfl-main-header .pfl-brand-content.no-logo .pfl-brand-logo-fallback {
    height: 40px !important;
    width: 40px !important;
  }

  /* Keep a11y FAB clear of profile/report chips + bottom nav */
  #scrollAccessibilityPanel.sa-panel {
    bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
    left: 10px !important;
    z-index: 1040 !important;
  }

  #scrollAccessibilityPanel .sa-toggle-btn {
    width: 42px !important;
    height: 42px !important;
  }

  .qh-launcher {
    bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 480px) {
  .pfl-main-header .pfl-brand-content.has-logo .pfl-brand-logo {
    height: 42px !important;
    max-height: 46px !important;
    max-width: min(72vw, 240px) !important;
  }

  .institutional-profile-bar .profile-title-link {
    font-size: 0.82rem !important;
    padding: 0.45rem 0.85rem !important;
  }

  /* Do not force report chips into circles — keep readable pills */
  .institutional-profile-bar .report-quick-link {
    border-radius: 999px !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 36px !important;
    padding: 0.4rem 0.7rem !important;
  }

  .institutional-profile-bar .report-quick-link .report-label,
  .institutional-profile-bar .report-quick-link > span {
    display: inline !important;
    font-size: 0.72rem !important;
  }
}
