.community-atlas {
    --atlas-ink: #193451;
    --atlas-gold: #a87c35;
    --atlas-line: #e3d7bf;
    display: grid;
    grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 32px);
    align-items: start;
}
.community-atlas [hidden] { display: none !important; }
.community-atlas :is(a, button, summary, input, select):focus-visible {
    outline: 3px solid #1e4e8c;
    outline-offset: 3px;
}
.community-map {
    align-self: start;
    margin: 0;
    scroll-margin-top: 62px;
    container-type: inline-size;
}
.community-map-image {
    position: relative;
    border: 1px solid #b9a27a;
    border-radius: 8px;
    background: #ecdcb9;
}
.community-map-background { display: block; width: 100%; height: auto; border-radius: inherit; }
.community-map figcaption { margin-top: 7px; font-size: .85rem; color: #544938; }
.community-leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.community-leaders line { stroke: #68583b; stroke-width: 2; }
.community-leaders circle { fill: #6c4d28; stroke: #f8efd9; stroke-width: 1.5; }
.community-leaders-narrow { display: none; }
.community-marker {
    position: absolute;
    left: var(--wide-x);
    top: var(--wide-y);
    transform: translate(-50%, -50%);
    width: clamp(36px, 7.8cqw, 44px);
    height: clamp(36px, 7.8cqw, 44px);
    border: 1px solid #b9a27a;
    border-radius: 50%;
    background: #fffbef;
    display: grid;
    place-items: center;
    padding: 3px;
    box-shadow: 0 2px 6px #37291455;
    text-decoration: none;
}
.community-marker img { width: 100%; height: 100%; object-fit: contain; }
.community-marker span {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    width: max-content;
    max-width: 105px;
    padding: 1px 4px;
    border: 1px solid #b9a27a;
    border-radius: 3px;
    background: #fff8e6;
    color: var(--atlas-ink);
    text-align: center;
    font-size: .75rem;
    line-height: 1.15;
    pointer-events: none;
}
.community-marker:is(:focus-visible, [aria-expanded="true"]) { z-index: 2; }
.community-marker:is(:focus-visible, [aria-expanded="true"]) span { display: block; }
.community-marker[aria-expanded="true"] { outline: 3px solid #1e4e8c; outline-offset: 1px; }
@media (hover: hover) {
    .community-marker:hover { z-index: 2; }
    .community-marker:hover span { display: block; }
}
@media (max-width: 740px) {
    .community-marker { touch-action: manipulation; }
    .community-marker.is-previewed { z-index: 3; }
    .community-marker.is-previewed span { display: block; }
    .community-map-image:has(.is-previewed) .community-marker:not(.is-previewed) span { display: none; }
}
@container (width < 520px) {
    .community-marker {
        left: var(--narrow-x);
        top: var(--narrow-y);
        width: min(44px, 15.8cqw);
        height: min(44px, 15.8cqw);
    }
    .community-leaders-wide { display: none; }
    .community-leaders-narrow { display: block; }
}
.community-atlas-tools {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.community-search-jump { display: none; }
.community-offer-filter { min-width: 0; max-width: 100%; }
.community-offer-filter summary {
    min-height: 44px;
    padding: 9px 13px;
    border: 1px solid var(--atlas-line);
    border-radius: 5px;
    background: #fffdf8;
    color: var(--atlas-ink);
    cursor: pointer;
    font-weight: 600;
}
.community-active-offer { display: block; font-size: .85rem; font-weight: 400; }
.community-offer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding-top: 8px;
    font-size: .9rem;
}
.community-offer-controls select {
    max-width: 100%;
    min-height: 44px;
    padding: 6px 9px;
    border: 1px solid #b9aa90;
    border-radius: 5px;
    background: #fffdf8;
    color: var(--atlas-ink);
    font: inherit;
}
.community-filter-reset {
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #1e4e8c;
    text-decoration: underline;
    font: inherit;
    cursor: pointer;
}
.community-filter-count { padding: 10px 0; color: var(--atlas-ink); font-size: .9rem; }
.community-search { margin-bottom: 12px; scroll-margin-top: 112px; }
.community-search label { display: block; font-size: .9rem; }
.community-search input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #b9aa90;
    border-radius: 5px;
    background: #fffdf8;
    color: var(--atlas-ink);
    font: inherit;
}
.community-entry {
    margin-bottom: 8px;
    border: 1px solid var(--atlas-line);
    border-radius: 6px;
    background: #fffdf8;
    color: var(--atlas-ink);
    scroll-margin-top: 112px;
}
.community-entry[open] { border-color: var(--atlas-gold); }
.community-entry summary {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.community-entry summary::-webkit-details-marker { display: none; }
.community-entry summary::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: auto;
    margin-right: 4px;
    border: solid #1e4e8c;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.community-entry[open] summary::after { transform: rotate(225deg); }
.community-entry summary img { width: 30px; height: 33px; object-fit: contain; }
.community-profile { border-top: 1px solid var(--atlas-line); padding: 14px 15px 17px; }
.community-profile-head { display: flex; align-items: center; gap: 12px; }
.community-profile-head img { width: 60px; height: 66px; object-fit: contain; }
.community-profile h3 { margin: 0; }
.community-profile p { margin: 10px 0; }
.community-form { color: #544938; font-size: .88rem; }
.community-guild-tree { position: relative; margin: 12px 0 14px; padding-top: 27px; }
.community-guild-crown { position: absolute; top: 0; left: 0; width: 52px; height: 31px; }
.community-pole { list-style: none; padding: 0; margin: 0; position: relative; }
.community-pole::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 9px;
    width: 6px;
    border: 1px solid #684a31;
    border-radius: 0 0 2px 2px;
    background: linear-gradient(90deg, #86603d, #c1995c 40%, #715035);
}
.community-pole li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    margin: 0;
}
.community-pole svg { width: 68px; height: 46px; flex: none; }
.community-more { margin-top: 4px; }
.community-back {
    display: none;
    position: fixed;
    z-index: 50;
    top: calc(56px + env(safe-area-inset-top, 0px));
    right: 12px;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 7px 13px;
    border: 0;
    border-radius: 5px;
    background: #1e4e8c;
    color: white;
    box-shadow: 0 2px 8px #0004;
    font: inherit;
    cursor: pointer;
}
.community-back svg { width: 23px; height: 22px; }
@media (max-width: 740px) {
    .community-atlas { grid-template-columns: minmax(0, 1fr); }
    .community-search-jump {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        font-weight: 600;
        text-underline-offset: 3px;
    }
}

.community-back:not([hidden]) { display: inline-flex; }


@media (max-width: 740px) {
    .community-marker.is-previewed { outline: 2px solid #1e4e8c; outline-offset: 1px; }
    .community-marker.is-previewed span {
        pointer-events: auto;
        width: max-content;
        max-width: 118px;
        padding: 5px 7px;
        overflow-wrap: anywhere;
        left: 50%;
        transform: translateX(-50%);
    }
    .community-marker.is-previewed[data-preview-edge="left"] span { left: 0; transform: none; }
    .community-marker.is-previewed[data-preview-edge="right"] span { left: auto; right: 0; transform: none; }
    .community-marker.is-previewed[data-preview-vertical="up"] span { top: auto; bottom: calc(100% + 4px); }
}
.community-report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.community-report-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.community-report-card .fdgr-card-body { padding: 16px; }
.community-report-card h3 { margin: 5px 0 8px; }
.community-report-card .community-report-date { margin: 0; font-size: .9rem; }
@media (max-width: 740px) {
    .community-report-grid { grid-template-columns: 1fr; }
}

.community-organisations { margin-top: 25px; scroll-margin-top: 68px; }
.community-organisations h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); margin-bottom: 12px; }
