html, body {
  min-height: 100vh;
}

:root {
  --site-primary: #0f4c81;
  --site-primary-rgb: 15, 76, 129;
  --site-secondary: #1f6fb2;
  --site-secondary-rgb: 31, 111, 178;
  --site-accent: #d89b2b;
  --site-accent-rgb: 216, 155, 43;
  --site-dark: #17324d;
  --site-bg: #f4f7fb;
  --site-card: #ffffff;
  --site-border: #d9e2ef;
  --site-text: #213547;
  --site-muted: #61758a;
}

body {
  display: flex;
  flex-direction: column;
  color: var(--site-text);
  background:
    radial-gradient(circle at top right, rgba(var(--site-secondary-rgb), 0.12), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--site-bg) 100%);
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--site-primary);
}

a:hover {
  color: var(--site-secondary);
}

/* ── Impersonation banner ─────────────────────────────────────────────── */
#impersonationBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1031;
  background: linear-gradient(90deg, #ffc107 0%, #ffca2c 100%);
  color: #212529;
  padding: 0.35rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 36px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

body.has-impersonation-banner {
  padding-top: 36px;
}

body.has-impersonation-banner .sticky-top {
  top: 36px;
}
/* ─────────────────────────────────────────────────────────────────────── */

.site-navbar {
  background: linear-gradient(135deg, var(--site-primary) 0%, var(--site-secondary) 100%);
  box-shadow: 0 0.75rem 2rem rgba(var(--site-primary-rgb), 0.18);
  padding-top: 0;
  /* Thin lighter edge so the header doesn't run into a hero in the same colors. Semi-transparent white
     over the header's own color, so it follows each municipality's theme. */
  border-bottom: 2px solid rgba(255, 255, 255, 0.35);
}

.site-navbar.no-gradient {
  background: var(--site-primary);
  box-shadow: 0 0.75rem 2rem rgba(var(--site-primary-rgb), 0.18);
  padding-top: 0;
  padding-bottom: 0.375rem;
}

.site-navbar .navbar-brand {
  padding-top: 0;
  padding-bottom: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.site-navbar .navbar-brand,
.site-navbar .nav-link,
.site-navbar .navbar-text,
.site-navbar .brand-subtitle {
  color: #fff !important;
}

.site-navbar .navbar-toggler {
  border: none;
  box-shadow: none;
}
.site-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C255%2C255%2C0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-navbar .nav-link {
  opacity: 0.9;
  font-weight: 500;
}

.site-navbar .nav-link.active,
.site-navbar .nav-link:hover {
  opacity: 1;
}

.brand-lockup {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 0.55rem;
  background: #fff;
  border-radius: 0 0 0.85rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.22);
  padding: 0.2rem 0.9rem 0.2rem 0.2rem;
}

.brand-badge {
  width: 3rem;
  min-width: 3rem;
  align-self: stretch;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--site-accent, #d89b2b) !important;
  font-weight: 800;
  font-size: 1.5rem;
}

.brand-title {
  line-height: 1.05;
}

.brand-title strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--site-primary, #0f4c81) !important;
}

.brand-subtitle {
  display: none;
}

.page-shell {
  padding-top: 2rem;
  padding-bottom: 6rem;
}

.hero-panel,
.surface-card,
.quick-card,
.info-panel,
.portal-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--site-border);
  border-radius: 1.4rem;
  box-shadow: 0 1rem 2.5rem rgba(23, 50, 77, 0.08);
}

.hero-panel {
  overflow: hidden;
  isolation: isolate;
}

/* A hero card that opens the page sits right under the header: no gap above it, and square top corners. */
.page-shell:has(> .container > .hero-panel:first-child) {
  padding-top: 0;
}
.page-shell > .container > .hero-panel:first-child {
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Medium / tall heroes never take more than part of the screen's height (a phone held sideways is ~375px tall). */
.hero-panel.hero-md {
  min-height: min(380px, 55vh);
  display: flex;
  flex-direction: column;
}

.hero-panel.hero-lg {
  min-height: min(580px, 70vh);
  display: flex;
  flex-direction: column;
}

.hero-panel.hero-md > .row,
.hero-panel.hero-lg > .row {
  flex: 1;
}

.hero-panel.hero-md .hero-accent,
.hero-panel.hero-lg .hero-accent {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-accent {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.30), transparent 30%),
    linear-gradient(155deg, rgba(var(--site-primary-rgb), 0.72), rgba(var(--site-secondary-rgb), 0.69));
  color: #fff;
}

.hero-chip,
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero-chip {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.section-chip {
  background: rgba(var(--site-primary-rgb), 0.08);
  color: var(--site-primary);
}

.section-chip.chip-warning {
  background: rgba(234, 136, 18, 0.12);
  color: #b45309;
}

.display-copy {
  font-size: clamp(1.85rem, 4vw, 3.1rem);
  line-height: 1.05;
  font-weight: 800;
}

.lead-copy {
  color: rgba(255, 255, 255, 0.88);
  max-width: 42rem;
}

.hero-stat {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  padding: 1rem;
}

.hero-stat .metric {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.quick-card,
.info-panel,
.portal-panel,
.surface-card {
  padding: 1.25rem;
}

.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-decoration: none;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(var(--site-primary-rgb), 0.12);
  background: rgba(var(--site-primary-rgb), 0.04);
  color: var(--site-text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.quick-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.8rem 1.4rem rgba(var(--site-primary-rgb), 0.10);
  border-color: rgba(var(--site-primary-rgb), 0.20);
}

.quick-link .quick-title {
  font-weight: 700;
}

.quick-link .quick-subtext,
.muted-copy,
.card-subtext,
.portal-note,
.list-note {
  color: var(--site-muted);
}

.stat-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-box {
  background: rgba(var(--site-secondary-rgb), 0.06);
  border: 1px solid rgba(var(--site-secondary-rgb), 0.12);
  border-radius: 1rem;
  padding: 1rem;
}

.stat-box .metric {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.news-list,
.event-list,
.feature-grid,
.portal-grid,
.module-grid,
.contact-grid,
.placeholder-grid {
  display: grid;
  gap: 1rem;
}

.feature-grid,
.portal-grid,
.module-grid,
.contact-grid,
.placeholder-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.news-card,
.event-card,
.feature-card,
.module-card,
.contact-card,
.placeholder-card,
.portal-card {
  background: var(--site-card);
  border: 1px solid var(--site-border);
  border-radius: 1.1rem;
  padding: 1rem;
  box-shadow: 0 0.75rem 1.75rem rgba(23, 50, 77, 0.06);
}

.contact-panel-table {
  table-layout: fixed;
  width: 100%;
}

.contact-panel-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-card-meta {
  line-height: 1.4;
  white-space: nowrap;
}

.news-card.card-alert {
  border-color: #f59e0b;
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.news-card h3,
.event-card h3,
.feature-card h3,
.module-card h3,
.contact-card h3,
.placeholder-card h3,
.portal-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.event-card h3 a {
  text-decoration: none;
  color: inherit;
}
.event-card-date {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.event-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--site-primary) 0%, var(--site-secondary) 100%);
  border-radius: 0.75rem;
  padding: 0.4rem 0.65rem;
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  flex-shrink: 0;
  line-height: 1;
  gap: 1px;
}
.event-date-mo {
  font-size: 0.625rem;
  font-weight: 700;
  color: rgba(255,255,255,0.78);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.event-date-day {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.event-date-time {
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.03em;
  margin-top: 3px;
  line-height: 1;
  white-space: nowrap;
}
.event-card-body {
  flex: 1;
  min-width: 0;
}
.event-card-body h3 {
  margin-bottom: 0.3rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  color: var(--site-muted);
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.feature-icon,
.portal-icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: rgba(var(--site-primary-rgb), 0.08);
  color: var(--site-primary);
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.portal-kpi {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(var(--site-secondary-rgb), 0.05);
  border: 1px solid rgba(var(--site-secondary-rgb), 0.12);
}

.portal-kpi .value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
}

.callout-panel {
  background: linear-gradient(135deg, rgba(var(--site-primary-rgb), 0.08), rgba(var(--site-accent-rgb), 0.12));
  border: 1px solid rgba(var(--site-primary-rgb), 0.14);
  border-radius: 1.4rem;
  padding: 1.25rem;
}

/* Dashboard button always sorts last in any flex button group */
.d-flex a[href="/html/admin/index.html"] {
  order: 999;
}

#siteFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.footer-shell {
  background: linear-gradient(135deg, var(--site-primary) 0%, var(--site-secondary) 100%);
  border-top: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.footer-shell.no-gradient {
  background: var(--site-primary);
}

.footer-shell a,
.footer-shell .text-secondary,
.footer-shell .small {
  color: rgba(255,255,255,0.88) !important;
}

.table-responsive {
  overflow-x: auto;
}

.wrap-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form-shell {
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--site-border);
  border-radius: 1.4rem;
  box-shadow: 0 1rem 2.5rem rgba(23, 50, 77, 0.08);
}

.form-shell .form-control,
.form-shell .form-select {
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-color: #ccd8e7;
}

.form-shell .form-control:focus,
.form-shell .form-select:focus {
  border-color: rgba(var(--site-secondary-rgb), 0.55);
  box-shadow: 0 0 0 0.25rem rgba(var(--site-secondary-rgb), 0.15);
}

/* Nav pills — follow site brand colours */
.nav-pills .nav-link {
  color: var(--site-primary);
  font-weight: 500;
}

.nav-pills .nav-link:hover {
  background: rgba(var(--site-primary-rgb), 0.08);
  color: var(--site-primary);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  background-color: var(--site-primary);
  color: #fff;
}

.btn {
  border-radius: 50rem;
}

.btn-primary {
  --bs-btn-bg: var(--site-primary);
  --bs-btn-border-color: var(--site-primary);
  --bs-btn-hover-bg: var(--site-secondary);
  --bs-btn-hover-border-color: var(--site-secondary);
  --bs-btn-active-bg: var(--site-dark);
  --bs-btn-active-border-color: var(--site-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--site-primary);
  --bs-btn-border-color: var(--site-primary);
  --bs-btn-hover-bg: var(--site-primary);
  --bs-btn-hover-border-color: var(--site-primary);
  --bs-btn-active-bg: var(--site-secondary);
  --bs-btn-active-border-color: var(--site-secondary);
}

.btn-outline-secondary {
  --bs-btn-color: var(--site-primary);
  --bs-btn-border-color: rgba(var(--site-primary-rgb), 0.35);
  --bs-btn-hover-bg: rgba(var(--site-primary-rgb), 0.07);
  --bs-btn-hover-border-color: var(--site-primary);
  --bs-btn-hover-color: var(--site-primary);
  --bs-btn-active-bg: rgba(var(--site-primary-rgb), 0.12);
  --bs-btn-active-border-color: var(--site-primary);
  --bs-btn-active-color: var(--site-primary);
}

.btn-accent {
  color: #fff;
  background: var(--site-accent);
  border-color: var(--site-accent);
}

.btn-accent:hover {
  color: #fff;
  background: #c2871d;
  border-color: #c2871d;
}

.list-clean {
  padding-left: 1rem;
  margin-bottom: 0;
}

.list-clean li + li {
  margin-top: 0.4rem;
}

.empty-state {
  padding: 2rem 1rem;
  border: 1px dashed rgba(var(--site-primary-rgb), 0.22);
  border-radius: 1rem;
  text-align: center;
  color: var(--site-muted);
  background: rgba(255,255,255,0.65);
}

/* ── Business directory ───────────────────────────────────────────────────── */
.biz-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}
.biz-logo {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  border-radius: 6px;
}
.biz-logo-placeholder {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bs-light, #f8f9fa);
  border-radius: 8px;
}
.biz-meta-link {
  font-size: 0.85rem;
  color: var(--site-primary, #0d6efd);
  text-decoration: none;
}
.biz-meta-link:hover { text-decoration: underline; }

.site-hidden {
  display: none !important;
}

@media (max-width: 991.98px) {
  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* .brand-logo canonical definition is below */

.single-column-grid {
  grid-template-columns: 1fr;
}

.submission-list {
  display: grid;
  gap: 1rem;
}

.submission-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--site-border);
  border-radius: 1.1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 0.9rem 2rem rgba(23, 50, 77, 0.06);
}

.submission-preview {
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(var(--site-primary-rgb), 0.04);
  border: 1px solid rgba(var(--site-primary-rgb), 0.10);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pending {
  background: rgba(var(--site-accent-rgb), 0.12);
  color: #8a5a00;
}

.status-approved {
  background: rgba(25, 135, 84, 0.12);
  color: #146c43;
}

.status-rejected {
  background: rgba(220, 53, 69, 0.12);
  color: #b02a37;
}

.admin-actions {
  min-width: 10rem;
}

.callout-panel ul li + li {
  margin-top: 0.35rem;
}

.empty-state {
  border: 1px dashed rgba(var(--site-primary-rgb), 0.22);
  border-radius: 1rem;
  padding: 1.1rem;
  color: var(--site-muted);
  background: rgba(var(--site-primary-rgb), 0.03);
}


.admin-table-wrap {
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  background: rgba(255,255,255,0.92);
}

.admin-table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(var(--site-primary-rgb), 0.025);
  --bs-table-hover-bg: rgba(var(--site-primary-rgb), 0.045);
  margin-bottom: 0;
}

.admin-table thead th {
  border-bottom-width: 1px;
  color: var(--site-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}


/* .brand-logo canonical definition is below */

/* ── Hero video background ────────────────────────────────────────────── */
.hero-panel.has-video {
  position: relative;
}

.hero-panel .hero-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Maintain 16:9 and always cover the panel */
  width: 177.78vh;
  height: 100%;
  min-width: 100%;
  min-height: 56.25vw;
  pointer-events: none;
  border: 0;
  z-index: 0;
}

.hero-panel.has-video .hero-accent {
  position: relative;
  z-index: 1;
  background: linear-gradient(110deg, rgba(var(--site-primary-rgb), 0.66) 0%, rgba(var(--site-secondary-rgb), 0.585) 55%, rgba(var(--site-dark-rgb, 23, 50, 77), 0.42) 100%);
}

.hero-panel.has-video.no-overlay .hero-accent {
  background: rgba(0, 0, 0, 0.25);
}
/* ─────────────────────────────────────────────────────────────────────── */

.hero-panel.has-image .hero-accent {
  background:
    linear-gradient(110deg, rgba(var(--site-primary-rgb), 0.66) 0%, rgba(var(--site-secondary-rgb), 0.585) 55%, rgba(var(--site-dark-rgb, 23, 50, 77), 0.42) 100%),
    var(--hero-image, linear-gradient(155deg, rgba(var(--site-primary-rgb), 0.72), rgba(var(--site-secondary-rgb), 0.69)));
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.hero-panel.has-image.no-overlay .hero-accent {
  background: var(--hero-image, linear-gradient(155deg, rgba(var(--site-primary-rgb), 0.72), rgba(var(--site-secondary-rgb), 0.69)));
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

/* Home page News / Events tabs (home.html, home.js): only while the two cards stack, below the xl breakpoint.
   One card shows at a time, so events don't sit below the whole news list. */
.home-tabs-wrap { display: none; }
@media (max-width: 1199.98px) {
  .home-tabs-wrap { display: block; margin-bottom: -0.5rem; }
  .home-tabs {
    display: flex;
    gap: 0.35rem;
    padding: 0.3rem;
    background: rgba(var(--site-primary-rgb), 0.08);
    border-radius: 999px;
  }
  .home-tab {
    flex: 1 1 0;
    border: 0;
    border-radius: 999px;
    padding: 0.55rem 0.75rem;
    background: transparent;
    color: var(--site-primary);
    font-weight: 600;
  }
  .home-tab.active {
    background: var(--site-primary);
    color: #fff;
    box-shadow: 0 0.25rem 0.75rem rgba(var(--site-primary-rgb), 0.25);
  }
  .home-two-column[data-home-tab="news"] .home-pane-events,
  .home-two-column[data-home-tab="events"] .home-pane-news { display: none; }
  /* The tab already names the card, so its own label chip is dropped; "View all" stays on the right. */
  .home-pane > .surface-card > .d-flex:first-child { justify-content: flex-end !important; }
  .home-pane > .surface-card > .d-flex:first-child > .section-chip { display: none; }
}

/* The phone copy of the hero button (home.html); shown only by the phone rules below. */
.hero-actions-mobile { display: none; }

/* ── Phones (upright up to large phones, or any phone held sideways) ──── */
@media (max-width: 767.98px), (max-height: 500px) {
  /* The footer is pinned to the bottom of the screen on larger screens; on a phone it would cover a third
     of it, so it sits after the page instead. */
  #siteFooter {
    position: static;
  }
  .page-shell {
    padding-bottom: 2rem;
  }

  /* Hero: full width under the header, shorter, and only the title and text inside it, sized to the screen.
     The button moves to its own row under it (.hero-actions-mobile in home.html). */
  .page-shell > .container > .hero-panel:first-child {
    margin-left: calc(var(--bs-gutter-x) * -0.5);
    margin-right: calc(var(--bs-gutter-x) * -0.5);
    border-left: 0;
    border-right: 0;
    border-radius: 0 0 1.1rem 1.1rem;
  }
  .hero-panel.mb-4 { margin-bottom: 0.85rem !important; }
  .hero-panel.hero-md { min-height: min(240px, 40vh); }
  .hero-panel.hero-lg { min-height: min(340px, 55vh); }
  .hero-accent.p-4 {
    padding: 1.5rem 1.25rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .display-copy {
    font-size: clamp(1.3rem, 6.4vw, 1.75rem);
    line-height: 1.12;
    margin-bottom: 0.5rem !important;
  }
  .lead-copy {
    font-size: clamp(0.85rem, 3.9vw, 1rem);
    margin-bottom: 0 !important;
  }
  .hero-actions { display: none !important; }
  .hero-actions-mobile {
    display: grid;
    margin-bottom: 1.5rem;
  }
  .hero-actions-mobile .btn {
    padding: 0.55rem 0.75rem;
    font-weight: 600;
  }

  /* Banner-shaped hero picture (class and shape set in app.js): the hero takes the picture's own shape so it
     shows whole, with the text over its left side. If the text needs more height, the picture is cropped
     from the left, keeping a logo on the right in view. */
  .hero-panel.has-image.wide-image .hero-accent {
    background:
      linear-gradient(90deg, rgba(var(--site-primary-rgb), 0.78) 0%, rgba(var(--site-primary-rgb), 0) 70%),
      var(--hero-image) right center / cover no-repeat,
      var(--site-primary);
  }
  .hero-panel.has-image.wide-image.no-overlay .hero-accent {
    background: var(--hero-image) right center / cover no-repeat, var(--site-primary);
  }
  .hero-panel.wide-image.hero-md,
  .hero-panel.wide-image.hero-lg { min-height: 0; }
  .hero-panel.wide-image .hero-accent.p-4 {
    aspect-ratio: var(--hero-image-aspect, 3);
    padding: 0.75rem 1rem !important;
  }
  .hero-panel.wide-image .display-copy {
    font-size: clamp(1rem, 5.4vw, 1.5rem);
    margin-bottom: 0.2rem !important;
    max-width: 60%;
  }
  .hero-panel.wide-image .lead-copy {
    font-size: clamp(0.72rem, 3.3vw, 0.9rem);
    line-height: 1.3;
    max-width: 60%;
  }
}

.surface-card.compact-card,
.module-card.compact-card {
  padding: 1rem;
}

.facility-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
}

.calendar-head,
.calendar-day {
  border-radius: 1rem;
  border: 1px solid var(--site-border);
  background: #fff;
  min-height: 4.85rem;
  padding: 0.65rem;
}

.calendar-head {
  min-height: auto;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  background: rgba(var(--site-primary-rgb), 0.05);
}

.calendar-day.muted {
  opacity: 0.45;
}

.calendar-day.available {
  background: rgba(25, 135, 84, 0.06);
  border-color: rgba(25, 135, 84, 0.18);
}

.calendar-day.reserved,
.calendar-day.blocked {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.18);
}

.calendar-day.pending {
  background: rgba(255, 193, 7, 0.16);
  border-color: rgba(255, 193, 7, 0.35);
}

.calendar-day .date-number {
  font-weight: 800;
  display: block;
  margin-bottom: 0.25rem;
}

.calendar-day .day-note {
  display: block;
  font-size: 0.78rem;
  color: var(--site-muted);
  line-height: 1.15;
}

@media (max-width: 575px) {
  .facility-calendar {
    gap: 0.25rem;
  }
  .calendar-head,
  .calendar-day {
    padding: 0.35rem 0.2rem;
    min-height: 2.8rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
  }
  .calendar-day .day-note {
    display: none;
  }
  .calendar-day .date-number {
    margin-bottom: 0;
    text-align: center;
  }
}

.file-preview-box {
  border: 1px dashed rgba(var(--site-primary-rgb), 0.24);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(var(--site-primary-rgb), 0.03);
}

.invoice-shell {
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: 1.4rem;
  box-shadow: 0 1rem 2.5rem rgba(23, 50, 77, 0.08);
  padding: 2rem 2.25rem;
}

/* ── Traditional invoice / receipt layout ────────────────────── */

.inv-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: flex-start;
}

.inv-logo {
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
  display: block;
  margin-bottom: 0.75rem;
}

.inv-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--site-primary);
  margin-bottom: 0.2rem;
}

.inv-from-line {
  font-size: 0.82rem;
  color: var(--site-muted);
  line-height: 1.55;
}

.inv-titleblock {
  text-align: right;
  min-width: 210px;
}

.inv-title {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--site-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.inv-stamp {
  display: inline-block;
  border: 3px solid;
  border-radius: 4px;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: rotate(-4deg);
  opacity: 0.85;
  margin-bottom: 0.6rem;
}
.inv-stamp-paid { border-color: #198754; color: #198754; }
.inv-stamp-void { border-color: #dc3545; color: #dc3545; }

.inv-meta {
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-left: auto;
}
.inv-meta td {
  padding: 2px 0 2px 14px;
  vertical-align: top;
}
.inv-meta td:first-child {
  color: var(--site-muted);
  white-space: nowrap;
}
.inv-meta td:last-child {
  font-weight: 600;
  text-align: right;
}

.inv-divider {
  border: none;
  border-top: 1px solid var(--site-border);
  margin: 1.25rem 0;
}

.inv-billto {
  font-size: 0.9rem;
  line-height: 1.65;
}

.inv-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--site-muted);
  margin-bottom: 0.2rem;
  display: block;
}

.invoice-grid {
  width: 100%;
  border-collapse: collapse;
}
.invoice-grid {
  font-size: 0.8rem;
}
.invoice-grid th,
.invoice-grid td {
  border: 1px solid var(--site-border);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}
.invoice-grid th {
  background: rgba(var(--site-primary-rgb), 0.06);
  font-weight: 600;
}

.inv-totals {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--site-border);
}
.inv-totals table {
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 260px;
}
.inv-totals td {
  padding: 6px 0 6px 20px;
}
.inv-totals td:first-child {
  color: var(--site-muted);
  text-align: right;
}
.inv-totals td:last-child {
  text-align: right;
  font-weight: 500;
  min-width: 110px;
  /* Line the amounts up with the line-item amounts above: same cell padding plus the 1px cell border. */
  padding-right: calc(0.75rem + 1px);
}
.inv-balance td {
  padding-top: 9px;
  border-top: 2px solid var(--site-text);
  font-weight: 700;
  font-size: 1rem;
}
.inv-balance td:first-child { color: var(--site-text); }
.inv-balance-paid td { color: #198754; border-top-color: #198754; }
.inv-balance-void td { color: var(--site-muted); }

.inv-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .inv-head,
  .inv-footer {
    grid-template-columns: 1fr;
  }
  .inv-titleblock {
    text-align: left;
    min-width: 0;
  }
  .inv-meta { margin-left: 0; }
  .inv-meta td:last-child { text-align: left; }
  .inv-totals { justify-content: stretch; }
  .inv-totals table { min-width: 0; width: 100%; }
}

.portal-mini-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.invoice-link-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.btn-slim {
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.75in;
  }

  body {
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .site-navbar, #siteHeader, #siteFooter, .no-print {
    display: none !important;
  }

  .page-shell {
    padding: 0 !important;
  }

  .container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .invoice-shell {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  /* Force coloured backgrounds to print */
  .section-chip,
  .invoice-summary-grid .summary-box,
  .invoice-grid th,
  .invoice-grid thead tr {
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }
}

@media (max-width: 991.98px) {
  .invoice-header,
  .invoice-summary-grid {
    grid-template-columns: 1fr;
  }
}


html[data-muni-theme-ready='1'] body {
  transition: background-color .15s ease, color .15s ease;
}

.home-two-column .surface-card {
  padding: 1.25rem;
}

.portal-split-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 991.98px) {
  .portal-split-grid {
    grid-template-columns: 1fr;
  }
}


.brand-logo {
  width: 3rem;
  min-width: 3rem;
  align-self: stretch;
  border-radius: 0.5rem;
  object-fit: contain;
  object-position: center;
  padding: 0.15rem;
  box-sizing: border-box;
}

.news-card .news-attachment-preview,
.news-detail-layout .news-attachment-preview {
  margin-top: 1rem;
}

.news-attachment-preview {
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(var(--site-primary-rgb), 0.03);
}

.attachment-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  background: rgba(var(--site-primary-rgb), 0.05);
  border-bottom: 1px solid var(--site-border);
}

.attachment-preview-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--site-text);
}

.attachment-inline-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--site-primary);
  text-decoration: none;
}

.attachment-inline-link:hover {
  text-decoration: underline;
}

.news-attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.attachment-pdf-object,
.news-attachment-preview iframe,
.news-attachment-preview embed {
  display: block;
  width: 100%;
  min-height: 30rem;
  border: 0;
  background: #fff;
}

.attachment-preview-fallback {
  padding: 1rem;
  color: var(--site-muted);
  background: #fff;
}

@media (max-width: 767.98px) {
  .attachment-preview-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .attachment-pdf-object,
  .news-attachment-preview iframe,
  .news-attachment-preview embed {
    min-height: 20rem;
  }
}

.news-detail-layout {
  display: grid;
  gap: 1rem;
}

.map-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.map-sidebar {
  padding: 1rem;
}

.map-canvas {
  min-height: 38rem;
  width: 100%;
  border-radius: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--site-border);
  background: linear-gradient(180deg, rgba(var(--site-primary-rgb), 0.04), rgba(var(--site-secondary-rgb), 0.08));
}

.map-list {
  display: grid;
  gap: 0.75rem;
  max-height: 30rem;
  overflow: auto;
}

.map-result-card {
  border: 1px solid var(--site-border);
  border-radius: 1rem;
  background: #fff;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
}

.map-result-card.active {
  border-color: rgba(var(--site-primary-rgb), 0.35);
  box-shadow: 0 0.8rem 1.8rem rgba(var(--site-primary-rgb), 0.12);
}

.layer-toggle-list {
  display: grid;
  gap: 0.65rem;
}

.layer-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--site-border);
  border-radius: 0.9rem;
  padding: 0.7rem 0.85rem;
  background: #fff;
}

.asset-legend-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  display: inline-block;
  margin-right: 0.5rem;
  border: 1px solid rgba(0,0,0,0.12);
}

.map-status-note {
  border: 1px dashed rgba(var(--site-primary-rgb), 0.2);
  border-radius: 1rem;
  padding: 0.85rem 0.95rem;
  background: rgba(var(--site-primary-rgb), 0.03);
  color: var(--site-muted);
}

@media (max-width: 991.98px) {
  .map-workspace {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    min-height: 26rem;
  }
}


/* ── Quill 2 rich editor ────────────────────────────────────────────────── */

.muniix-editor-wrap {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow 0.15s;
}

.muniix-editor-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(var(--site-primary-rgb, 20, 98, 84), 0.15);
  border-color: rgba(var(--site-primary-rgb, 20, 98, 84), 0.4);
}

.muniix-editor-wrap .ql-toolbar.ql-snow {
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(var(--site-primary-rgb, 20, 98, 84), 0.03);
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.muniix-editor-wrap .ql-toolbar.ql-snow .ql-formats {
  margin-right: 0.5rem;
}

.muniix-editor-wrap .ql-toolbar.ql-snow button,
.muniix-editor-wrap .ql-toolbar.ql-snow .ql-picker-label {
  border-radius: 0.375rem;
  transition: background 0.12s, color 0.12s;
}

.muniix-editor-wrap .ql-toolbar.ql-snow button:hover,
.muniix-editor-wrap .ql-toolbar.ql-snow button.ql-active,
.muniix-editor-wrap .ql-toolbar.ql-snow .ql-picker-label:hover {
  background: rgba(var(--site-primary-rgb, 20, 98, 84), 0.10);
  color: var(--site-primary, #146254);
}

.muniix-editor-wrap .ql-toolbar.ql-snow .ql-picker-label svg,
.muniix-editor-wrap .ql-toolbar.ql-snow button svg {
  pointer-events: none;
}

.muniix-editor-wrap .ql-container.ql-snow {
  border: 0;
  font-size: 1rem;
  font-family: inherit;
}

.muniix-editor-wrap .ql-editor {
  min-height: 260px;
  max-height: 520px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  line-height: 1.7;
}

.muniix-editor-wrap .ql-editor.ql-blank::before {
  color: #9ca3af;
  font-style: normal;
  left: 1.25rem;
}

/* Headings inside editor */
.muniix-editor-wrap .ql-editor h1 { font-size: 1.75rem; font-weight: 700; margin: 0.75em 0 0.4em; }
.muniix-editor-wrap .ql-editor h2 { font-size: 1.4rem;  font-weight: 700; margin: 0.75em 0 0.4em; }
.muniix-editor-wrap .ql-editor h3 { font-size: 1.15rem; font-weight: 600; margin: 0.6em 0 0.3em; }
.muniix-editor-wrap .ql-editor p  { margin: 0 0 0.75em; }
.muniix-editor-wrap .ql-editor ul,
.muniix-editor-wrap .ql-editor ol  { padding-left: 1.75rem; margin-bottom: 0.75em; }
.muniix-editor-wrap .ql-editor blockquote {
  border-left: 4px solid var(--site-primary, #146254);
  margin: 1em 0;
  padding: 0.5em 1em;
  background: rgba(var(--site-primary-rgb, 20, 98, 84), 0.04);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #374151;
}
.muniix-editor-wrap .ql-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5em 0;
  cursor: pointer;
}

/* Image tools (js/quill-image-tools.js): outline around the selected image and its size/align bar */
.ql-image-outline {
  position: absolute;
  pointer-events: none;
  border: 2px solid var(--site-primary, #146254);
  border-radius: 0.5rem;
  z-index: 4;
}
.ql-image-tools {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #1f2937;
  border-radius: 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.ql-image-tools.d-none { display: none !important; }
.ql-image-tools button {
  border: 0;
  background: transparent;
  color: #f9fafb;
  font-size: 0.75rem;
  line-height: 1;
  padding: 5px 7px;
  border-radius: 0.35rem;
  cursor: pointer;
}
.ql-image-tools button:hover,
.ql-image-tools button.active { background: rgba(255, 255, 255, 0.18); }
.ql-image-tools-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 3px;
  background: rgba(255, 255, 255, 0.25);
}
.muniix-editor-wrap .ql-editor a {
  color: var(--site-primary, #146254);
  text-decoration: underline;
}

/* Image uploading spinner overlay */
.ql-image-uploading {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Quill alignment render classes (used in saved/rendered content) ─── */
.ql-align-center    { text-align: center !important; }
.ql-align-right     { text-align: right  !important; }
.ql-align-justify   { text-align: justify !important; }
.ql-indent-1        { padding-left: 3em; }
.ql-indent-2        { padding-left: 6em; }
.ql-indent-3        { padding-left: 9em; }
.ql-indent-4        { padding-left: 12em; }

/* ── Rendered body_html display (news post view pages) ──────────────── */
.post-body { line-height: 1.75; color: #1f2937; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font-weight: 700; margin-top: 1.5em; margin-bottom: 0.5em;
}
.post-body p    { margin-bottom: 0.9em; }
.post-body ul,
.post-body ol   { padding-left: 1.75rem; margin-bottom: 0.9em; }
.post-body img  { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 0.75em 0; }
.post-body a    { color: var(--site-primary, #146254); text-decoration: underline; }
.post-body blockquote {
  border-left: 4px solid var(--site-primary, #146254);
  padding: 0.5em 1em;
  margin: 1em 0;
  background: rgba(var(--site-primary-rgb, 20, 98, 84), 0.04);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #374151;
}

.portal-card-actions,
.invoice-action-wrap,
.card-action-right {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  align-self: flex-start;
  flex: 0 0 auto;
}

.portal-card-actions .btn,
.invoice-action-wrap .btn,
.card-action-right .btn {
  width: auto;
  white-space: nowrap;
  align-self: flex-start;
}
.portal-card-actions { align-self: flex-start; }

.calendar-day.clickable {
  cursor: pointer;
}

.calendar-day.selected-range {
  background: rgba(var(--site-primary-rgb), 0.15);
  border: 1px solid var(--site-primary);
}

.calendar-day.selected-start {
  background: var(--site-primary);
  color: #fff;
  border-color: var(--site-primary);
}

.calendar-day.selected-start .day-note,
.calendar-day.selected-start .date-number {
  color: #fff;
}

#prevMonthBtn,
#nextMonthBtn {
  width: 32px;
  height: 32px;
  padding: 0;
}

/* ── Portal app — left-nav + right-content layout ────────────────────────── */

.portal-app {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.portal-sidenav {
  position: sticky;
  top: 1rem;
}

.portal-sidenav-inner {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--site-border);
  border-radius: 1.4rem;
  box-shadow: 0 1rem 2.5rem rgba(23, 50, 77, 0.08);
  padding: 0.5rem;
}

.portal-sidenav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  background: none;
  border-radius: 1rem;
  color: var(--site-text);
  font-weight: 500;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.portal-sidenav-item i {
  font-size: 1.05rem;
  flex-shrink: 0;
  color: var(--site-muted);
  transition: color 0.14s;
}

.portal-sidenav-item .nav-label {
  flex-grow: 1;
}

.portal-sidenav-item:hover {
  background: rgba(var(--site-primary-rgb), 0.07);
  color: var(--site-primary);
}

.portal-sidenav-item:hover i {
  color: var(--site-primary);
}

.portal-sidenav-item.is-active {
  background: rgba(var(--site-primary-rgb), 0.11);
  color: var(--site-primary);
  font-weight: 600;
}

.portal-sidenav-item.is-active i {
  color: var(--site-primary);
}

.portal-sidenav-divider {
  border: none;
  border-top: 1px solid var(--site-border);
  margin: 0.35rem 0.5rem;
}

.portal-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--site-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* Mobile: compact horizontal tab strip */
@media (max-width: 991.98px) {
  .portal-app {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .portal-sidenav {
    position: static;
  }

  .portal-sidenav-inner {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 1.1rem;
    padding: 0.3rem;
  }

  .portal-sidenav-inner::-webkit-scrollbar { display: none; }

  .portal-sidenav-item {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 0.85rem;
  }

  .portal-sidenav-item i {
    font-size: 1.1rem;
  }

  .portal-sidenav-divider { display: none; }
}