.page-community {
  min-height: 100vh;
  background: var(--paper);
}

.community-header {
  position: sticky;
  z-index: 1200;
  top: 0;
  min-height: 66px;
  padding-inline: max(24px, calc((100vw - 1180px) / 2));
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.community-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.community-header__label,
.community-lede,
.section-heading p,
.community-footer,
.empty-copy,
.map-empty-hint {
  color: var(--muted);
}

.community-header__label { font-size: 0.77rem; }
.workspace-picker { min-width: 180px; max-width: min(46vw, 280px); min-height: 38px; padding: 7px 34px 7px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); font-size: 0.82rem; }

.community-main { padding-top: 32px; padding-bottom: 28px; }
.community-state { display: flex; min-height: 90px; align-items: center; gap: 12px; padding: 22px 25px; border-radius: 16px; }
.community-state p { margin: 0; color: var(--muted); }
.community-state--error { display: block; max-width: 620px; margin: 8vh auto; padding: 34px; }
.community-state--error h1 { margin-bottom: 9px; font-size: 1.45rem; }
.community-state--error p { margin-bottom: 18px; }

.community-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.community-intro .eyebrow { margin-bottom: 8px; letter-spacing: 0.04em; }
.community-intro h1 { margin: 0 0 5px; font-size: clamp(1.7rem, 3vw, 2.25rem); }
.community-lede { margin: 0; font-size: 0.9rem; }
.community-intro__actions { display: flex; align-items: center; gap: 12px; }
.year-chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--green-strong); background: var(--surface); font-size: 0.76rem; white-space: nowrap; }
.community-intro .button { min-height: 44px; white-space: nowrap; }

.community-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr); align-items: start; gap: 20px; }
.community-map-card, .community-list-card { padding: 20px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 1.05rem; }
.section-heading p { margin: 4px 0 0; font-size: 0.73rem; }
.section-heading--compact { margin-bottom: 12px; }
.result-count { padding: 4px 9px; border-radius: 999px; color: var(--green); background: var(--teal); font-size: 0.72rem; white-space: nowrap; }

.community-map { height: min(62vh, 620px); min-height: 380px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #edf3f3; touch-action: pan-x pan-y; }
.community-map .leaflet-control-zoom a { color: var(--ink); }
.community-map-status { min-height: 0; margin: 0; color: var(--danger); font-size: 0.75rem; }
.community-map-status:empty { display: none; }
.community-map + .map-tile-status { margin: 7px 0 0; padding: 0; border: 0; color: var(--danger); background: transparent; font-size: 0.75rem; }
.map-empty-hint { margin: 10px 0 0; font-size: 0.76rem; }
.map-legend { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: 0.72rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-line { width: 20px; height: 0; border-top: 4px solid #2d7392; border-radius: 4px; }
.legend-dot { display: inline-block; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #18796a; }
.legend-dot--report { background: #18796a; }

.community-side { display: grid; gap: 16px; }
.community-list-card { padding: 18px; }
.community-items { display: grid; gap: 8px; }
.community-item { display: flex; width: 100%; align-items: flex-start; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; transition: border-color 150ms ease, background 150ms ease, transform 150ms ease; }
.community-item:hover { transform: translateY(-1px); border-color: #9cb8c9; background: #f8fbfc; }
.community-item:focus-visible { outline: 3px solid #5a88ad; outline-offset: 2px; }
.community-item:disabled { cursor: default; opacity: 0.78; }
.community-item__marker { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 9px; color: var(--green); background: var(--teal); font-size: 0.72rem; font-weight: 800; }
.community-item__marker--report { border-radius: 50%; color: #fff; background: #18796a; }
.community-item__body { min-width: 0; flex: 1; }
.community-item__title { display: block; margin: 0 0 3px; font-size: 0.83rem; font-weight: 750; line-height: 1.4; }
.community-item__description { display: block; color: var(--muted); font-size: 0.7rem; line-height: 1.55; }
.community-item__meta { display: block; margin-top: 5px; color: #74828c; font-size: 0.65rem; }
.empty-copy { margin: 0; padding: 15px 12px 7px; font-size: 0.77rem; line-height: 1.65; }

.community-empty { max-width: 640px; margin: 7vh auto; padding: clamp(26px, 5vw, 48px); text-align: center; }
.community-empty__mark { display: block; width: 64px; height: 64px; margin: 0 auto 17px; overflow: hidden; border-radius: 25%; }
.community-empty .eyebrow { justify-content: center; margin-bottom: 7px; }
.community-empty h1 { margin-bottom: 8px; font-size: 1.65rem; }
.community-empty > p:not(.eyebrow) { max-width: 480px; margin: 0 auto 22px; color: var(--muted); font-size: 0.86rem; }
.community-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.community-footer { display: flex; justify-content: space-between; gap: 18px; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.68rem; }
.community-footer p { margin: 0; }

.route47-community-pin { display: grid; width: 27px; height: 27px; place-items: center; border: 2px solid #fff; border-radius: 50% 50% 50% 3px; transform: rotate(-45deg); color: #fff; background: #18796a; box-shadow: 0 2px 7px rgb(14 40 54 / 25%); }
.route47-community-pin span { transform: rotate(45deg); font-size: 0.67rem; font-weight: 800; }
.community-popup { min-width: 170px; }
.community-popup b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 0.82rem; }
.community-popup span { display: block; color: var(--muted); font-size: 0.71rem; line-height: 1.45; }

@media (max-width: 900px) {
  .community-main { width: min(100% - 36px, 760px); padding-top: 22px; }
  .community-layout { grid-template-columns: 1fr; }
  .community-map { height: 52vh; min-height: 340px; }
  .community-side { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (max-width: 560px) {
  .community-header { min-height: 58px; padding-inline: 14px; }
  .community-header .brand-name { font-size: 0.98rem; }
  .community-header__right { gap: 8px; }
  .community-header__label { display: none; }
  .workspace-picker { min-width: 125px; max-width: 48vw; min-height: 36px; padding: 6px 26px 6px 9px; font-size: 0.7rem; }
  .community-main { width: calc(100% - 28px); padding-top: 17px; }
  .community-intro { display: block; margin-bottom: 15px; }
  .community-intro .eyebrow { font-size: 0.7rem; }
  .community-intro h1 { font-size: 1.45rem; }
  .community-lede { font-size: 0.77rem; }
  .community-intro__actions { justify-content: space-between; margin-top: 12px; }
  .community-intro .button { min-height: 42px; padding-inline: 13px; font-size: 0.78rem; }
  .community-map-card, .community-list-card { padding: 14px; border-radius: 16px; }
  .community-map { height: 47vh; min-height: 290px; max-height: 440px; border-radius: 12px; }
  .section-heading h2 { font-size: 0.94rem; }
  .section-heading p { font-size: 0.66rem; }
  .community-side { grid-template-columns: 1fr; gap: 12px; }
  .community-post-card { grid-column: auto; padding: 15px; }
  .community-footer { display: grid; gap: 5px; margin-top: 16px; font-size: 0.63rem; }
  .community-empty { margin: 8vh auto; padding: 27px 20px; }
  .community-empty h1 { font-size: 1.35rem; }
  .community-empty > p:not(.eyebrow) { font-size: 0.79rem; }
  .community-empty__actions { display: grid; }
}
