/* ==========================================================================
   Harris Chamber Team Maps
   ========================================================================== */

:root {
    --ink: #1a0d2e;
    --brand: #1a0d2e;
    --brand-2: #4b2c7a;
    --accent: #f4b942;
    --accent-ink: #3d2a00;
    --paper: #f7f5fa;
    --card: #ffffff;
    --line: #e6e1ec;
    --line-2: #d3cbe0;
    --muted: #685e78;
    --danger: #b3261e;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(26, 13, 46, .06), 0 1px 1px rgba(26, 13, 46, .04);
    --shadow: 0 10px 30px -12px rgba(26, 13, 46, .25), 0 2px 6px rgba(26, 13, 46, .06);
    --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --display: "Bricolage Grotesque", var(--font);
    --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 16px/1.55 var(--font);
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }
.hero :focus-visible, .lightbox :focus-visible { outline-color: var(--accent); }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------- Buttons, chips, tags ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 1px solid transparent; border-radius: 999px;
    background: var(--brand); color: #fff;
    font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: #fff; border-color: var(--ink); }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #8f1d17; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--sm .icon { width: 16px; height: 16px; }

.chip {
    display: inline-flex; align-items: center; gap: 8px; flex: none;
    min-height: 40px; padding: 0 16px;
    border: 1px solid var(--line-2); border-radius: 999px;
    background: #fff; color: var(--ink);
    font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip__count { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.chip.is-active .chip__count { background: var(--accent); color: var(--accent-ink); }
.chip--sm { min-height: 34px; padding: 0 13px; font-size: 13px; }

.tag {
    display: inline-block; padding: 1px 7px; border-radius: 6px;
    background: var(--paper); border: 1px solid var(--line);
    font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
}

.eyebrow {
    margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--accent);
}

/* ---------- Header / footer ---------- */

.site-header {
    position: sticky; top: 0; z-index: 30;
    height: var(--header-h);
    background: rgba(246, 245, 240, .88);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__logo { height: 40px; width: auto; }
.brand__mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--brand); color: var(--accent);
}
.brand__mark svg { width: 20px; height: 20px; }
.brand__text { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand__text em { font-style: normal; color: var(--brand-2); font-weight: 500; }

.back-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
    border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 14px; color: var(--muted);
}
.back-link:hover { color: var(--ink); background: #fff; }

.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- Home: hero ---------- */

.hero {
    position: relative; overflow: hidden;
    background: var(--brand); color: #fff;
    padding: 72px 0 64px;
}
/* Background: the printed chamber map publication, faded into the brand green on the
   left so the headline stays readable. */
.hero__topo {
    position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(90deg, var(--brand) 0%, rgba(26, 13, 46, .94) 34%, rgba(26, 13, 46, .55) 62%, rgba(26, 13, 46, .15) 100%),
        linear-gradient(0deg, rgba(26, 13, 46, .55), transparent 35%),
        image-set(url("../img/hero-map-md.webp") type("image/webp"), url("../img/hero-map-md.jpg") type("image/jpeg")) right 30% / cover no-repeat;
}
@media (min-width: 1400px) {
    .hero__topo {
        background:
            linear-gradient(90deg, var(--brand) 0%, rgba(26, 13, 46, .94) 34%, rgba(26, 13, 46, .55) 62%, rgba(26, 13, 46, .15) 100%),
            linear-gradient(0deg, rgba(26, 13, 46, .55), transparent 35%),
            image-set(url("../img/hero-map.webp") type("image/webp"), url("../img/hero-map.jpg") type("image/jpeg")) right 30% / cover no-repeat;
    }
}
@media (max-width: 760px) {
    /* Narrow screens: the text spans the full width, so dim the whole image. */
    .hero__topo {
        background:
            linear-gradient(rgba(26, 13, 46, .86), rgba(26, 13, 46, .92)),
            image-set(url("../img/hero-map-md.webp") type("image/webp"), url("../img/hero-map-md.jpg") type("image/jpeg")) 60% 30% / cover no-repeat;
    }
}
.hero { padding: 96px 0 84px; }
.hero__inner { position: relative; }
.hero__title {
    margin: 0; max-width: 20ch;
    font-family: var(--display); font-weight: 700;
    font-size: clamp(36px, 6vw, 64px); line-height: 1.02; letter-spacing: -.025em;
}
.hero__lead { margin: 20px 0 32px; max-width: 56ch; font-size: 18px; color: rgba(255, 255, 255, .78); }

.hero__search {
    position: relative; max-width: 560px;
}
.hero__search .icon { position: absolute; left: 20px; top: 50%; translate: 0 -50%; color: var(--muted); width: 20px; height: 20px; }
.hero__search input {
    width: 100%; height: 58px; padding: 0 20px 0 52px;
    border: 0; border-radius: 999px; background: #fff; color: var(--ink);
    font-size: 17px; box-shadow: var(--shadow);
}
.hero__search input::placeholder { color: #8e859b; }

.hero__stats { display: flex; gap: 40px; margin: 40px 0 0; padding: 0; }
.hero__stats div { display: flex; flex-direction: column-reverse; }
.hero__stats dt { font-size: 13px; color: rgba(255, 255, 255, .6); text-transform: uppercase; letter-spacing: .1em; }
.hero__stats dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.1; }

/* ---------- Home: state filter + grid ---------- */

.state-bar {
    position: sticky; top: var(--header-h); z-index: 20;
    background: var(--paper); border-bottom: 1px solid var(--line);
}
.state-bar__inner {
    display: flex; gap: 8px; padding: 14px 0;
    overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
}
.state-bar__inner::-webkit-scrollbar { display: none; }
.state-bar .chip { scroll-snap-align: start; }

.directory { padding-top: 32px; }
.state-group { padding: 8px 0 28px; }
.state-group__title {
    display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px;
    font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.015em;
}
.state-group__title span { font: 500 14px var(--font); color: var(--muted); }

.chamber-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.chamber-card__link {
    display: flex; align-items: center; gap: 16px; height: 100%;
    padding: 14px 18px 14px 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none; box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .2s, transform .2s;
}
.chamber-card__link:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.chamber-card__logo {
    display: grid; place-items: center; flex: none;
    width: 76px; height: 76px; padding: 8px;
    border-radius: 11px; background: #fff; border: 1px solid var(--line);
}
.chamber-card__logo img { max-height: 100%; width: auto; object-fit: contain; }
.chamber-card__initials { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--brand-2); }
.chamber-card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.chamber-card__name { font-weight: 600; line-height: 1.3; }
.chamber-card__meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.chamber-card__arrow { color: var(--line-2); transition: color .15s, translate .2s; }
.chamber-card__link:hover .chamber-card__arrow { color: var(--brand-2); translate: 3px 0; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 16px; text-align: center; color: var(--muted); }
.empty .icon { width: 32px; height: 32px; }
.empty p { margin: 0; }

/* ---------- Chamber map page ---------- */

.page-map { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.page-map main { flex: 1; min-height: 0; }

.mapview { display: grid; grid-template-columns: minmax(360px, 420px) 1fr; height: 100%; }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--line); }
.panel__head { padding: 20px 20px 12px; border-bottom: 1px solid var(--line); background: var(--paper); }

.chamber-id { display: flex; align-items: center; gap: 14px; }
.chamber-id__logo { width: 64px; height: 64px; object-fit: contain; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; flex: none; }
.chamber-id__name { margin: 0; font-family: var(--display); font-size: 21px; line-height: 1.15; letter-spacing: -.015em; }
.chamber-id__meta { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.chamber-id__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.search-field { position: relative; margin-top: 16px; }
.search-field .icon { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); }
.search-field input {
    width: 100%; height: 46px; padding: 0 14px 0 42px;
    border: 1px solid var(--line-2); border-radius: 12px; background: #fff;
}
.search-field input:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 0 0 3px rgba(244, 185, 66, .45); }

.cat-scroller { display: flex; gap: 6px; margin: 12px -20px 0; padding: 0 20px 4px; overflow-x: auto; scrollbar-width: none; }
.cat-scroller::-webkit-scrollbar { display: none; }
.result-count { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.listings { list-style: none; margin: 0; padding: 4px 12px 96px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.listings ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.listings__heading {
    position: sticky; top: 0; z-index: 1;
    margin: 0; padding: 14px 8px 8px;
    font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
    background: linear-gradient(var(--paper) 70%, transparent);
}

.listing {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .2s;
}
.listing:hover { border-color: var(--line-2); }
.listing.is-active { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(244, 185, 66, .45); }
.listing__main {
    display: flex; align-items: flex-start; gap: 12px; width: 100%;
    padding: 12px 12px 8px; background: none; border: 0; text-align: left; cursor: pointer; border-radius: var(--radius) var(--radius) 0 0;
}
.listing__main:disabled { cursor: default; }
.listing__thumb {
    display: grid; place-items: center; flex: none; overflow: hidden;
    width: 52px; height: 52px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); color: var(--muted);
}
.listing__thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.listing__name { font-weight: 600; line-height: 1.3; }
.listing__addr { font-size: 14px; color: var(--muted); line-height: 1.4; }
/* Service-area listings: no storefront, so no pin; this badge stands in for the street address. */
.area-badge {
    display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; padding: 2px 9px 2px 7px;
    border-radius: 999px; background: #f3ecfb; color: var(--brand-2); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.area-badge .icon { width: 13px; height: 13px; }
.detail__addr .area-badge { font-size: 13px; }
.listing__actions { display: flex; flex-wrap: wrap; padding: 0 4px 8px 64px; }
.act {
    display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 8px;
    border-radius: 999px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--brand-2);
}
.act:hover { background: var(--paper); }
.act .icon { width: 15px; height: 15px; }

.map-wrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; background: #ece8f1; }
/* Mute the OpenStreetMap fallback so the purple/gold pins carry the color. Satellite stays full color. */
.map:not(.is-satellite) .leaflet-tile-pane { filter: saturate(.45) brightness(1.03); }

/* Map pins (shared by Google + Leaflet) */
.pin { width: 32px; height: 40px; cursor: pointer; transform-origin: 50% 100%; transition: transform .15s; filter: drop-shadow(0 3px 4px rgba(26, 13, 46, .35)); }
.pin svg { width: 100%; height: 100%; display: block; }
.pin path { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.pin circle { fill: var(--accent); }
.pin:hover, .pin.is-active, .is-active > .pin { transform: scale(1.25); }
.pin.is-active path, .is-active > .pin path { fill: var(--ink); }

/* Popup content */
.pop { display: flex; flex-direction: column; font: 14px/1.45 var(--font); color: var(--ink); }
.pop__img { width: 100%; height: 96px; object-fit: contain; background: var(--paper); border-radius: 8px; margin-bottom: 10px; }
.pop__body { display: flex; flex-direction: column; gap: 3px; }
.pop__cat { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pop__name { font-size: 16px; }
.pop__addr { color: var(--muted); }
.pop__links { display: flex; gap: 14px; margin-top: 8px; }
.pop__links a { color: var(--brand-2); font-weight: 600; text-decoration: none; }
.pop__links a:hover { text-decoration: underline; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 14px; }
.leaflet-marker-icon { background: none; border: 0; }

.view-toggle { display: none; }

/* Chamber intro */
.intro { margin-top: 12px; font-size: 14px; }
.intro summary { cursor: pointer; font-weight: 600; color: var(--brand-2); width: fit-content; }
.intro p { margin: 8px 0 0; color: var(--muted); }

.chip__count { margin-left: 2px; }
.chip--sm .chip__count { font-size: 11px; padding: 0 6px; }

/* ---------- Detail panel ---------- */

.panel[data-mode="detail"] > .panel__head,
.panel[data-mode="detail"] > .listings,
.panel[data-mode="detail"] > .empty { display: none !important; }

.detail { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--card); }
.detail__bar {
    display: flex; align-items: center; gap: 6px; padding: 10px 12px;
    border-bottom: 1px solid var(--line); background: var(--paper);
}
.detail__avatar {
    display: grid; place-items: center; width: 36px; height: 36px; overflow: hidden; flex: none;
    border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.detail__avatar img { width: 100%; height: 100%; object-fit: contain; }
.detail__spacer { flex: 1; }
.detail__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 96px; }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
    border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer;
    text-decoration: none;
}
.icon-btn:hover { background: #fff; }
.icon-btn:disabled { color: var(--line-2); cursor: default; background: none; }
.icon-btn--ring { width: 34px; height: 34px; border: 1.5px solid var(--brand-2); border-radius: 50%; color: var(--brand-2); }
.icon-btn--ring:hover { background: var(--brand-2); color: #fff; }

.pager { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.pager .icon-btn { width: 36px; height: 36px; }
.pager__pos { min-width: 36px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.share { position: relative; }
.share__menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 190px; padding: 6px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.share__menu a, .share__menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px;
    border: 0; border-radius: 8px; background: none; text-align: left; text-decoration: none; font-size: 14px; cursor: pointer;
}
.share__menu a:hover, .share__menu button:hover { background: var(--paper); }

.detail__media { background: var(--paper); }
.detail__hero { display: block; width: 100%; padding: 0; border: 0; background: #1a0d2e; cursor: zoom-in; }
.detail__hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.detail__hero.is-logo { background: var(--paper); }
.detail__hero.is-logo img { object-fit: contain; padding: 28px; aspect-ratio: 16 / 8; }
.detail__thumbs { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; scrollbar-width: thin; }
.detail__thumb {
    flex: none; width: 72px; height: 56px; padding: 0; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; border-radius: 8px; background: none; opacity: .7; transition: opacity .15s, border-color .15s;
}
.detail__thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail__thumb:hover { opacity: 1; }
.detail__thumb.is-active { border-color: var(--brand-2); opacity: 1; }

.detail__body { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.detail__cat { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.detail__name { margin: -6px 0 0; font-family: var(--display); font-size: 26px; line-height: 1.15; letter-spacing: -.015em; }
.detail__addr { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.detail__contact { display: flex; flex-direction: column; gap: 6px; }
.detail__contact a { display: inline-flex; align-items: center; gap: 10px; width: fit-content; color: var(--brand-2); font-weight: 600; text-decoration: none; word-break: break-all; }
.detail__contact a:hover { text-decoration: underline; }
.detail__desc { white-space: pre-line; font-size: 15.5px; line-height: 1.65; }
.detail__socials { display: flex; flex-wrap: wrap; gap: 8px; }
.social {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
    color: #fff; background: var(--ink); transition: transform .15s;
}
.social:hover { transform: translateY(-2px); }
.social .icon { width: 20px; height: 20px; }
.social--facebook { background: #1877f2; }
.social--instagram { background: #c13584; }
.social--youtube { background: #e00000; }
.social--linkedin { background: #0a66c2; }
.social--x, .social--tiktok, .social--threads { background: #111; }
.social--pinterest { background: #e60023; }
.social--yelp { background: #d32323; }
.social--google { background: #4285f4; }
.social--nextdoor { background: #1b8d4b; }
/* Custom links: neutral tile; the uploaded icon fills the same 20px box as the built-in glyphs. */
.social--custom { background: #fff; color: var(--brand-2); border: 1px solid var(--line-2); }
/* Never squeeze the tiles: on narrow screens they wrap to a new row instead. */
.detail__socials .social { flex: none; }
.social__img { width: 20px; height: 20px; object-fit: contain; display: block; }
.detail__fax { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.detail__buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cta {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px;
    border-radius: 10px; font-weight: 600; text-decoration: none; text-align: center;
    transition: filter .15s, transform .1s;
}
.cta:hover { filter: brightness(1.08); }
.cta:active { transform: translateY(1px); }
.cta--site { background: var(--accent); color: var(--accent-ink); }

/* ---------- Map tools ---------- */

.map-tools { position: absolute; top: 14px; right: 14px; z-index: 500; display: flex; gap: 8px; }
.map-tool {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.map-tool:hover { border-color: var(--ink); }
.map-tool.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.map-tool.is-busy .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.me-dot {
    display: block; width: 18px; height: 18px; border-radius: 50%;
    background: #2f7ef5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 126, 245, .25);
}

.panel-toggle {
    position: absolute; left: 0; top: 14px; z-index: 500;
    display: grid; place-items: center; width: 28px; height: 48px;
    border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0;
    background: #fff; box-shadow: var(--shadow-sm); cursor: pointer;
}
.panel-toggle .icon { transition: rotate .2s; }
.mapview { transition: grid-template-columns .25s ease; }
.mapview.is-collapsed { grid-template-columns: 0 1fr; }
.mapview.is-collapsed .panel { visibility: hidden; }
.mapview.is-collapsed .panel-toggle .icon { rotate: 180deg; }

/* Google's own zoom control sits bottom-right; keep our tools clear of its fullscreen button. */
.gm-fullscreen-control { top: 62px !important; }

/* ---------- Lightbox ---------- */

.lightbox {
    position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
    background: rgba(10, 16, 13, .92); padding: 56px 64px;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox .icon-btn { position: absolute; color: #fff; background: rgba(255, 255, 255, .1); width: 48px; height: 48px; border-radius: 50%; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .22); }
.lightbox__close { top: 14px; right: 14px; }
.lightbox__nav--prev { left: 14px; top: 50%; translate: 0 -50%; }
.lightbox__nav--next { right: 14px; top: 50%; translate: 0 -50%; }
.lightbox.is-single .lightbox__nav, .lightbox.is-single .lightbox__count { display: none; }
.lightbox__count { position: absolute; bottom: 18px; left: 50%; translate: -50% 0; color: rgba(255, 255, 255, .8); font-size: 14px; }

/* ---------- Map loader ---------- */

.map-loader {
    position: absolute; inset: 0; z-index: 700;
    display: grid; place-content: center; justify-items: center; gap: 6px;
    background:
        radial-gradient(circle at 50% 45%, rgba(246, 245, 240, 0) 0, var(--paper) 70%),
        repeating-linear-gradient(0deg, transparent 0 39px, rgba(26, 13, 46, .06) 39px 40px),
        repeating-linear-gradient(90deg, transparent 0 39px, rgba(26, 13, 46, .06) 39px 40px),
        var(--paper);
    transition: opacity .45s ease, visibility .45s;
}
.map-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.map-loader__art { width: 104px; height: auto; overflow: visible; }
.map-loader__text { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .02em; color: var(--brand-2); }
.map-loader__text span { animation: ml-dot 1.2s infinite; }
.map-loader__text span:nth-child(2) { animation-delay: .2s; }
.map-loader__text span:nth-child(3) { animation-delay: .4s; }

.ml-pin {
    fill: var(--brand); fill-opacity: 0; stroke: var(--brand); stroke-width: 4; stroke-linejoin: round;
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: ml-draw 1s ease-in-out forwards, ml-fill .5s .85s ease forwards;
}
.ml-h {
    fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round;
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: ml-draw .8s 1.05s ease-in-out forwards;
}
.ml-node {
    fill: #fff; stroke: var(--accent); stroke-width: 2.5;
    transform-box: fill-box; transform-origin: center; transform: scale(0);
    animation: ml-pop .35s cubic-bezier(.3, 1.6, .5, 1) forwards;
}
.ml-node--1 { animation-delay: 1.45s; }
.ml-node--2 { animation-delay: 1.55s; }
.ml-node--3 { animation-delay: 1.65s; }
.ml-node--4 { animation-delay: 1.75s; }
.ml-float { animation: ml-bob 1.8s 2s ease-in-out infinite; }
.ml-shadow { fill: rgba(26, 13, 46, .2); transform-box: fill-box; transform-origin: center; animation: ml-shadow 1.8s 2s ease-in-out infinite; }
.ml-ring {
    fill: none; stroke: var(--brand-2); stroke-width: 1.5; opacity: 0;
    transform-box: fill-box; transform-origin: center;
    animation: ml-ring 2.4s ease-out infinite;
}
.ml-ring--2 { animation-delay: 1.2s; }

@keyframes ml-draw { to { stroke-dashoffset: 0; } }
@keyframes ml-fill { to { fill-opacity: 1; } }
@keyframes ml-pop { to { transform: scale(1); } }
@keyframes ml-bob { 50% { transform: translateY(-8px); } }
@keyframes ml-shadow { 50% { transform: scale(.7); opacity: .6; } }
@keyframes ml-ring { 0% { transform: scale(.4); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes ml-dot { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .ml-pin, .ml-h, .ml-node, .ml-float, .ml-shadow, .ml-ring, .map-loader__text span { animation: none !important; }
    .ml-pin { stroke-dashoffset: 0; fill-opacity: 1; }
    .ml-h { stroke-dashoffset: 0; }
    .ml-node { transform: none; }
}

.sheet-handle { display: none; }

/* ---------- Horizontal chip rows (scroller.js) ---------- */

.hscroll { position: relative; }
.hscroll [data-hscroll] { cursor: grab; }
.hscroll [data-hscroll].is-dragging { cursor: grabbing; user-select: none; }
.hscroll [data-hscroll].is-dragging .chip { pointer-events: none; }
.hscroll.can-right [data-hscroll] { mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.hscroll.can-left [data-hscroll] { mask-image: linear-gradient(90deg, transparent, #000 56px); }
.hscroll.can-left.can-right [data-hscroll] { mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.hscroll__btn {
    position: absolute; top: 50%; z-index: 2; translate: 0 -50%;
    display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border: 1px solid var(--line-2); border-radius: 50%; background: #fff; color: var(--ink);
    box-shadow: var(--shadow-sm); cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity .15s, border-color .15s;
}
.hscroll__btn:hover { border-color: var(--ink); }
.hscroll__btn .icon { width: 16px; height: 16px; }
.hscroll__btn--prev { left: 0; }
.hscroll__btn--next { right: 0; }
.hscroll.can-left .hscroll__btn--prev,
.hscroll.can-right .hscroll__btn--next { opacity: 1; pointer-events: auto; }
.hscroll--cats .hscroll__btn--prev { left: 4px; }
.hscroll--cats .hscroll__btn--next { right: 4px; }
.hscroll--cats .hscroll__btn { top: calc(50% + 6px); } /* .cat-scroller has a 12px top margin */
/* Phones swipe; arrows would just cover chips. */
@media (pointer: coarse) { .hscroll__btn { display: none; } }

/* Touch screens: every tappable chip and action gets a 44px target. */
@media (pointer: coarse) {
    .chip, .chip--sm, .act, .btn--sm { min-height: 44px; }
}

h1, h2, h3, .chamber-id__name, .detail__name { text-wrap: balance; }

/* ---------- Header actions + mobile drawer ---------- */

.site-header__actions { display: flex; align-items: center; gap: 8px; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: #e9aa2f; }
.menu-btn { display: none; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

.drawer { position: fixed; inset: 0; z-index: 1200; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(26, 13, 46, .5); opacity: 0; transition: opacity .25s; }
.drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 88vw);
    display: flex; flex-direction: column; background: var(--card);
    box-shadow: -16px 0 40px -12px rgba(26, 13, 46, .35);
    transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .85, .25, 1);
}
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer__title { font-family: var(--display); font-weight: 700; font-size: 18px; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0; }
.drawer__link { display: block; padding: 12px 20px; font-weight: 600; text-decoration: none; color: var(--brand-2); }
.drawer__state { border-bottom: 1px solid var(--line); }
.drawer__state summary {
    display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px 0 20px;
    font-weight: 600; cursor: pointer; list-style: none;
}
.drawer__state summary::-webkit-details-marker { display: none; }
.drawer__state summary > span:first-child { flex: 1; }
.drawer__count { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.drawer__chev { color: var(--muted); transition: rotate .2s; }
.drawer__state[open] .drawer__chev { rotate: 90deg; }
.drawer__state[open] summary { color: var(--brand-2); }
.drawer__state ul { list-style: none; margin: 0; padding: 0 0 10px; }
.drawer__state li a {
    display: block; padding: 10px 20px 10px 32px; font-size: 15px; text-decoration: none; color: var(--ink);
    border-left: 3px solid transparent;
}
.drawer__state li a:hover { background: var(--paper); }
.drawer__state li a[aria-current="page"] { border-left-color: var(--accent); background: var(--paper); font-weight: 600; }
.drawer__foot { display: flex; flex-direction: column; gap: 12px; align-items: center; padding: 16px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.drawer__cta { width: 100%; background: var(--accent); color: var(--accent-ink); }
.drawer__cta:hover { background: #e9aa2f; }

@media (max-width: 899px) {
    .menu-btn { display: inline-grid; }
    .header-cta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .drawer__panel, .drawer__backdrop { transition: none; }
}

/* ---------- Advertise page ---------- */

.adv-hero { background: var(--brand); color: #fff; padding: 64px 0 72px; }
.adv-hero__inner { display: grid; grid-template-columns: 1fr minmax(0, 480px); gap: 48px; align-items: start; }
.adv-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(32px, 4.5vw, 50px); line-height: 1.05; letter-spacing: -.02em; }
.adv-hero__lead { margin: 18px 0 26px; font-size: 17px; color: rgba(255, 255, 255, .78); max-width: 52ch; }
.adv-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.adv-points li { display: flex; gap: 12px; align-items: flex-start; color: rgba(255, 255, 255, .85); }
.adv-points .icon { color: var(--accent); margin-top: 3px; }
.adv-points strong { color: #fff; }
.adv-form { color: var(--ink); padding: 24px; box-shadow: var(--shadow); }
.adv-form h2 { margin: 0 0 16px; font-family: var(--display); font-size: 22px; }
.adv-form .opt { font-weight: 400; color: var(--muted); }
.adv-form .btn { width: 100%; }
.adv-sent { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px; text-align: center; }
.adv-sent .icon { width: 40px; height: 40px; color: var(--brand-2); }
.adv-sent h2 { margin: 4px 0 0; }
.adv-sent p { margin: 0 0 12px; color: var(--muted); }
.adv-sent .btn { width: auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 899px) {
    .adv-hero { padding: 40px 0 48px; }
    .adv-hero__inner { grid-template-columns: 1fr; gap: 28px; }
}

.flash--warn { background: #fff8ea; border-color: #f2d699; color: #6b4a00; }
.flash--warn a { color: inherit; font-weight: 700; }

/* Avatars + profile */
.avatar {
    display: inline-grid; place-items: center; flex: none; overflow: hidden;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--brand); color: #fff; font-weight: 700; font-size: 13px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 72px; height: 72px; font-size: 24px; }
.profile-top { display: flex; align-items: center; gap: 18px; }
.profile-top__name { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.admin-me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--paper); text-decoration: none; }
.admin-me:hover { background: #efeaf6; }
.admin-me__name { display: block; font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.2; }
.admin-me__role { display: block; font-size: 12px; color: var(--muted); }

/* Role pills + assignment pickers */
.role-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.role-pill--admin { background: var(--brand); color: #fff; }
.role-pill--chamber_manager { background: #ece3f8; color: var(--brand-2); }
.role-pill--advertiser { background: #fff3d6; color: #6b4a00; }
.picker-filter { width: 100%; height: 40px; padding: 0 12px; margin: 4px 0 10px; border: 1px solid var(--line-2); border-radius: 10px; }
.picker { max-height: 280px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; padding: 4px 2px; }
.picker--tall { max-height: 420px; display: block; }
.picker__group { border: 0; margin: 0 0 10px; padding: 0; }
.picker__group legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.picker--tall .picker__item { display: flex; padding: 3px 0; }
.picker__item { font-weight: 400; }

/* Advertiser portal + approvals */
.listing-card { display: flex; align-items: center; gap: 16px; }
.listing-card__thumb { display: grid; place-items: center; flex: none; width: 64px; height: 64px; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.listing-card__thumb img { width: 100%; height: 100%; object-fit: contain; }
.listing-card__body { flex: 1; min-width: 0; }
.listing-card__body h2 { margin: 0; }
.listing-card__body .hint { margin: 2px 0 0; }
.listing-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.req { margin: 8px 0 0; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.req--pending { background: #fff8ea; color: #6b4a00; }
.req--ok { background: #f3ecfb; color: var(--brand-2); }
.req--no { background: #fbeceb; color: var(--danger); }
.diff-table th[scope="row"] { width: 120px; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink); background: none; }
.diff-table td { white-space: pre-line; vertical-align: top; width: 44%; }
.diff-old { color: var(--muted); }
.diff-new { color: var(--brand-2); font-weight: 600; background: #faf6ff; }
.preview-img--removed { opacity: .45; outline: 2px solid var(--danger); }
@media (max-width: 640px) { .listing-card { flex-wrap: wrap; } }

.tag--warn { margin-left: 6px; background: #fff3d6; border-color: #f2d699; color: #6b4a00; text-decoration: none; }

/* Import / export */
.import-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.import-steps a { color: var(--brand-2); font-weight: 600; }
.field-label { font-size: 14px; font-weight: 600; }
.imp { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.imp--create { background: #e9f6ec; color: #1d6b34; }
.imp--update { background: #ece3f8; color: var(--brand-2); }
.imp--skip { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.imp--error { background: #fbeceb; color: var(--danger); }
.imp-msg { font-size: 13px; color: var(--muted); }
.imp-msg + .imp-msg { margin-top: 3px; }
.imp-msg--error { color: var(--danger); font-weight: 600; }
.imp-msg--warn { color: #7a5a00; }
.import-table td { vertical-align: top; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* Trash */
.trash-actions { display: flex; gap: 6px; justify-content: flex-end; }
.days-left { font-weight: 600; font-variant-numeric: tabular-nums; }
.days-left--soon { color: var(--danger); }

/* Social links editor */
.social-row { display: grid; grid-template-columns: 180px 1fr; gap: 10px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.social-row:first-of-type { border-top: 0; }
.social-row [data-custom-only] { grid-column: span 1; }
.social-row.is-empty .social-row__url { opacity: .55; }
.social-row__icon { display: flex; align-items: center; gap: 10px; }
.social-row__icon .social { flex: none; }
@media (max-width: 640px) { .social-row { grid-template-columns: 1fr; } }

/* States */
.state-add { display: grid; grid-template-columns: 1fr 120px auto; gap: 12px; align-items: end; }
.state-add .btn { height: 44px; }
.switch { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.switch__knob { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.switch__knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch.is-on { color: var(--brand-2); }
.switch.is-on .switch__knob { background: var(--brand-2); }
.switch.is-on .switch__knob::after { transform: translateX(16px); }
@media (max-width: 640px) { .state-add { grid-template-columns: 1fr; } }

/* History / activity */
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2 { margin: 0; }
.history { list-style: none; margin: 0; padding: 0; }
.history__item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.history__item:first-child { border-top: 0; padding-top: 0; }
.history__avatar {
    display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
    background: var(--paper); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--brand-2);
}
.history__body { min-width: 0; }
.history__line { margin: 0; line-height: 1.5; }
.history__line time { margin-left: 4px; }
.history__subject { font-weight: 600; color: var(--brand-2); }
.history__changes { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; display: grid; gap: 3px; }
.history__field { display: inline-block; min-width: 90px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.history__changes del { color: #a3343a; text-decoration-thickness: 1px; word-break: break-word; }
.history__changes ins { color: var(--brand-2); text-decoration: none; font-weight: 600; word-break: break-word; }
.stat--link { text-decoration: none; transition: border-color .15s; }
.stat--link:hover { border-color: var(--brand-2); }
.stat--alert { border-color: var(--accent); background: #fff8ea; }

.count-pill { margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); vertical-align: middle; }
.cleanup-preview { max-height: 420px; overflow: auto; }
.table .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; word-break: break-all; }
.table .old { color: var(--muted); }
.table .new { color: var(--brand-2); font-weight: 600; }
.cleanup-table td:first-child { width: 36px; }
.cleanup-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.fix-input { width: 100%; min-width: 220px; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.ai-note { display: flex; gap: 6px; align-items: baseline; margin-top: 6px; font-size: 13px; color: var(--muted); }
.ai-badge { flex: none; padding: 0 6px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.key-status { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.key-status--on { background: #f3ecfb; border-color: #d9c8ef; }
.key-list { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; }
.key-list__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; }
.key-list__row + .key-list__row { border-top: 1px solid var(--line); }
.key-list dt { flex: 0 0 210px; font-weight: 600; }
.key-list dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.inline-form { display: inline; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; text-align: center; }
.inquiry { display: grid; grid-template-columns: 140px 1fr; gap: 12px 20px; margin: 0; }
.inquiry dt { font-weight: 600; color: var(--muted); }
.inquiry dd { margin: 0; }
.inquiry__msg { white-space: pre-line; }
@media (max-width: 640px) { .inquiry { grid-template-columns: 1fr; gap: 4px; } .inquiry dd { margin-bottom: 10px; } }

/* ---------- Credit ---------- */

.credit { font-size: 13px; color: var(--muted); }
.credit a { color: var(--brand-2); font-weight: 600; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.listings__credit { padding: 20px 8px 8px; text-align: center; }
.admin-credit { margin-top: 20px; padding: 0 12px; }
.login .credit { margin-top: 16px; text-align: center; }

/* ---------- Mobile: full-screen map + draggable bottom sheet ---------- */

@media (max-width: 899px) {
    .mapview {
        --peek: 172px;          /* sheet height when collapsed */
        display: block; position: relative; height: 100%; overflow: hidden;
    }
    /* The map stops just above the collapsed sheet so Google/OSM attribution and zoom stay visible. */
    .map-wrap { position: absolute; inset: 0 0 calc(var(--peek) - 20px) 0; z-index: 0; }
    .panel {
        position: absolute; left: 0; right: 0; top: 8px; bottom: 0; z-index: 5;
        border-right: 0; border-radius: 20px 20px 0 0; overflow: hidden;
        background: var(--paper);
        box-shadow: 0 -10px 30px -8px rgba(26, 13, 46, .28);
        transform: translate3d(0, var(--sheet-y, calc(100% - var(--peek))), 0);
        transition: transform .34s cubic-bezier(.2, .85, .25, 1);
        will-change: transform;
    }
    .panel.is-dragging { transition: none; }

    .sheet-handle {
        display: flex; justify-content: center; flex: none;
        width: 100%; height: 24px; padding: 9px 0 0; border: 0; background: none;
        cursor: grab; touch-action: none;
    }
    .sheet-handle span { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); }
    .panel.is-dragging .sheet-handle { cursor: grabbing; }
    /* Dragging also works from the header strip, not just the grip. */
    .chamber-id, .detail__bar { touch-action: none; }

    /* Order the header so the search box is visible in the collapsed sheet. */
    .panel__head { display: flex; flex-direction: column; padding: 4px 16px 10px; }
    .chamber-id { order: 1; }
    .search-field { order: 2; margin-top: 12px; }
    .hscroll--cats { order: 3; }
    .cat-scroller { margin-inline: -16px; padding-inline: 16px; }
    .result-count { order: 4; }
    .intro { order: 5; }
    .chamber-id__actions { order: 6; }
    .chamber-id__logo { width: 44px; height: 44px; border-radius: 10px; padding: 4px; }
    .chamber-id__name { font-size: 18px; }
    .chamber-id__meta { font-size: 13px; margin-top: 2px; }

    /* Keep the last items reachable when part of the sheet is below the screen edge. */
    .listings, .detail__scroll { padding-bottom: calc(var(--sheet-hidden, 0px) + 32px); }
    .listings { padding-inline: 8px; }
    .detail__bar { padding: 2px 10px 8px; background: var(--card); }

    .panel-toggle { display: none; }
    .mapview.is-collapsed { grid-template-columns: none; }
    .map-tools { top: 10px; right: 10px; }

    .view-toggle {
        display: none; align-items: center; gap: 8px;
        position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 20;
        min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
        background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow); cursor: pointer;
    }
    .mapview[data-sheet="full"] .view-toggle { display: inline-flex; }

    .lightbox { padding: 64px 8px; }
    .lightbox__nav--prev, .lightbox__nav--next { top: auto; bottom: 10px; translate: none; }
    .detail__name { font-size: 23px; }
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
    .panel { transition: none; }
}

@media (max-width: 640px) {
    .hero { padding: 48px 0 44px; }
    .hero__lead { font-size: 16px; }
    .hero__stats { gap: 28px; }
    .hero__stats dd { font-size: 28px; }
    .brand__text { font-size: 16px; }
    .back-link span { display: none; }
    .chamber-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Admin
   ========================================================================== */

.admin { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100dvh - var(--header-h)); }
.admin-nav { padding: 20px 12px; border-right: 1px solid var(--line); background: #fff; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; margin-bottom: 2px;
    border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--muted);
}
.admin-nav a:hover { background: var(--paper); color: var(--ink); }
.admin-nav a.is-active { background: var(--brand); color: #fff; }
.admin-nav form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.admin-nav button { width: 100%; justify-content: flex-start; }
.admin-main { padding: 28px 32px 64px; min-width: 0; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.admin-head h1 { margin: 0; font-family: var(--display); font-size: 28px; letter-spacing: -.015em; }

.flash { padding: 12px 16px; margin-bottom: 20px; border-radius: 10px; background: #f3ecfb; border: 1px solid #d9c8ef; color: var(--brand-2); font-weight: 500; }
.flash--error { background: #fbeceb; border-color: #efc2bf; color: var(--danger); }
.flash a { color: inherit; font-weight: 700; text-decoration: underline; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { margin: 0 0 14px; font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat strong { font-family: var(--display); font-size: 30px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #faf8fc; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); }
.status--off { color: var(--muted); }
.status--off::before { background: var(--line-2); }
.status--warn { margin-left: 8px; color: #8a5a00; font-size: 12px; }
.status--warn::before { background: #d98e04; }
.geo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; }
.geo-bar form { display: inline; }
.geo-misses { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.geo-misses a { color: inherit; font-weight: 600; }
.table .check { width: 36px; padding-right: 0; }
.table .check input { width: 18px; height: 18px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar input, .toolbar select { height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.toolbar input { min-width: 240px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 0 0 3px rgba(244, 185, 66, .45); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--danger); font-weight: 500; }
.field input[type="file"] { padding: 8px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.form-actions .spacer { flex: 1; }
.preview-img { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; }

.field textarea { resize: vertical; line-height: 1.5; }
.field input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }
.btn-row { display: grid; grid-template-columns: 1fr 1.6fr 80px; gap: 12px; }
.btn-row + .btn-row { margin-top: 10px; }
.gallery-edit { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.gallery-edit__item { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.gallery-edit__item img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.loc { position: relative; padding: 16px; border: 1px dashed var(--line-2); border-radius: 12px; background: #faf8fc; }
.loc + .loc { margin-top: 12px; }
.loc__remove { position: absolute; top: 10px; right: 10px; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-size: 14px; }
.pagination .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .is-disabled { color: var(--line-2); }

.login { min-height: calc(100dvh - var(--header-h)); display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: min(400px, 100%); padding: 28px; }
.login h1 { margin: 0 0 20px; font-family: var(--display); font-size: 26px; }
.login .field + .field { margin-top: 14px; }

@media (max-width: 899px) {
    .admin { grid-template-columns: 1fr; }
    .admin-nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
    .admin-nav a { flex: none; margin: 0; }
    .admin-nav form { margin: 0 0 0 auto; padding: 0; border: 0; }
    .admin-main { padding: 20px 16px 48px; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Events ---------- */

.opt { font-weight: 400; color: var(--muted); }
.thumb--cover { object-fit: cover; }
.preview-img--wide { width: 240px; height: 135px; object-fit: cover; padding: 0; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; }
.seg__btn { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active { background: var(--ink); color: #fff; }

/* Calendar-page date tile: gold month strip over a big day number. */
.ev-date {
    display: inline-flex; flex-direction: column; align-items: center; flex: none;
    width: 52px; overflow: hidden; border-radius: 10px;
    background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
    font-variant-numeric: tabular-nums; line-height: 1;
}
.ev-date__mon { width: 100%; padding: 4px 0 3px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.ev-date__day { padding: 6px 0 7px; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); }
.ev-date--sm { width: 42px; border-radius: 8px; }
.ev-date--sm .ev-date__mon { font-size: 10px; padding: 3px 0 2px; }
.ev-date--sm .ev-date__day { font-size: 17px; padding: 4px 0 5px; }
.ev-date--lg { width: 72px; border-radius: 14px; }
.ev-date--lg .ev-date__mon { font-size: 13px; padding: 6px 0 5px; }
.ev-date--lg .ev-date__day { font-size: 32px; padding: 8px 0 10px; }

/* Map panel teaser */
.next-event {
    display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 12px; background: #fbf9fd; text-decoration: none;
    transition: border-color .15s, background .15s;
}
.next-event:hover { border-color: var(--brand-2); background: #fff; }
.next-event > .icon { color: var(--muted); margin-left: auto; }
.next-event__text { display: flex; flex-direction: column; min-width: 0; }
.next-event__label { font-size: 12px; font-weight: 600; color: var(--brand-2); }
.next-event__title { font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Events list page */
.ev-hero { background: var(--brand); color: #fff; padding: 48px 0 52px; }
.ev-hero__inner { display: flex; align-items: center; gap: 24px; }
.ev-hero__logo { width: 88px; height: 88px; flex: none; object-fit: contain; padding: 8px; border-radius: 16px; background: #fff; }
.ev-hero h1 { margin: 0; font-family: var(--display); font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }
.ev-hero__lead { margin: 12px 0 0; max-width: 60ch; color: rgba(255, 255, 255, .78); }
.ev-hero .eyebrow { margin-bottom: 10px; }
.ev-page { padding-top: 36px; }
.ev-section-title { margin: 0 0 16px; font-family: var(--display); font-size: 22px; letter-spacing: -.01em; }
.ev-section-title--past { margin-top: 48px; font-size: 18px; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ev-empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }

.ev-card {
    display: flex; flex-direction: column; overflow: hidden; text-decoration: none;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ev-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.ev-card__media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #2a1748, var(--brand)); color: rgba(255, 255, 255, .35); }
.ev-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev-card__media > .icon { width: 44px; height: 44px; }
.ev-card__media .ev-date { position: absolute; left: 14px; bottom: -18px; }
.ev-card__body { display: flex; flex-direction: column; gap: 6px; padding: 28px 18px 18px; }
.ev-card__title { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.ev-card__meta { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--muted); }
.ev-card__meta .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--brand-2); }
.ev-past { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ev-past li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ev-past a { font-weight: 600; text-decoration: none; }
.ev-past a:hover { text-decoration: underline; }

/* Single event page */
.ev-detail { padding-top: 24px; }
.ev-detail__crumb { display: flex; align-items: center; gap: 6px; margin: 0 0 20px; font-size: 14px; color: var(--muted); }
.ev-detail__crumb a { text-decoration: none; }
.ev-detail__crumb a:hover { color: var(--ink); text-decoration: underline; }
.ev-detail__crumb .icon { width: 14px; height: 14px; }
.ev-detail .flash { margin-bottom: 20px; }
.ev-detail__head { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.ev-detail__head h1 { margin: 0; font-family: var(--display); font-size: clamp(28px, 4.2vw, 46px); line-height: 1.05; letter-spacing: -.02em; text-wrap: balance; }
.ev-detail__org { margin: 8px 0 0; color: var(--muted); }
.ev-detail__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.ev-detail__media { margin: 0 0 28px; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.ev-detail__media img { width: 100%; max-height: 560px; object-fit: contain; }
.ev-block { margin-bottom: 28px; }
.ev-block h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-family: var(--display); font-size: 22px; letter-spacing: -.01em; }
.ev-block h2 .icon { width: 24px; height: 24px; color: var(--brand-2); }
.ev-prose { font-size: 17px; line-height: 1.65; max-width: 68ch; }
.ev-block--directions { padding: 22px; border-radius: var(--radius); background: #fff8ea; border: 1px solid #f2d699; }
.ev-block--directions .ev-prose { margin-bottom: 18px; }
.ev-side { position: sticky; top: calc(var(--header-h) + 20px); padding: 22px; }
.ev-facts { margin: 0 0 20px; display: grid; gap: 16px; }
.ev-facts > div { display: flex; gap: 14px; }
.ev-facts dt { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #f3ecfb; color: var(--brand-2); }
.ev-facts dd { margin: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 6px; font-weight: 500; }
.ev-facts__addr { color: var(--muted); font-weight: 400; }
.ev-facts__link { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--brand-2); }
.ev-actions { display: grid; gap: 10px; }
.ev-actions > .btn { width: 100%; }
.ev-actions__cal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ev-actions__cal .btn { padding: 0 10px; gap: 6px; font-size: 13px; white-space: nowrap; }
.ev-more { margin-top: 24px; padding-top: 32px; border-top: 1px solid var(--line); }

@media (max-width: 899px) {
    .next-event { order: 7; }
    .ev-hero { padding: 32px 0 36px; }
    .ev-hero__logo { width: 64px; height: 64px; }
    .ev-detail__grid { grid-template-columns: 1fr; gap: 0; }
    /* Facts and buttons come right after the title on phones, before the long text. */
    .ev-side { position: static; order: -1; margin-bottom: 28px; }
    .ev-detail__main { display: contents; }
    .ev-detail__head { gap: 14px; }
    .ev-date--lg { width: 60px; }
    .ev-date--lg .ev-date__day { font-size: 26px; }
}
@media (max-width: 420px) {
    .ev-actions__cal { grid-template-columns: 1fr; }
    .ev-hero__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* Custom code boxes (Settings, chamber page) */
.code-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.5; tab-size: 2; white-space: pre; overflow-x: auto; }

