/*
 * Property map - dark theme (owner, 2026-11-15: "the dashboard's dark theme on the map too; every text readable").
 * Same REALM palette as the dashboard (assets/css/hlr-panel-dark.css):
 *   page #171b24 · surface #1f2530 · raised #262d37 · field #13171f · border #363c42
 *   text #e8e8e8 / #b8c0c8 / muted #8f979f · accent blue #62a8f8 · light blue #a8d2fc · button blue #0d6cd2.
 * Two files: hlr-map-dark.gen.css (GENERATED from the map template's CSS by tools/theme/gen-map-dark.py) and this one
 * (tokens, Leaflet's own CSS, inline React styles). Everything is scoped to #hlr-dash-embed.hlr-dark, which the
 * template sets when the signed-in person chose dark in the dashboard.
 * Checked by tools/tests/map-dark-ui-test.js (WCAG contrast of every visible text, in every open panel).
 */
#hlr-dash-embed.hlr-dark {
    --bg: #171b24; --surface: #1f2530; --surface-2: #262d37; --text: #e8e8e8; --muted: #b8c0c8;
    --border: #363c42; --accent: #0d6cd2; --on-accent: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, .5); --card-hover-shadow: 0 10px 24px rgba(0, 0, 0, .55);
    --hd-field: #13171f; --hd-text: #e8e8e8; --hd-text2: #b8c0c8; --hd-muted: #8f979f; --hd-link: #62a8f8; --hd-fill: #a8d2fc;
    color-scheme: dark;
    background: var(--bg); color: var(--text);
}
#hlr-dash-embed.hlr-dark #root { background: var(--bg); }

/* Inline React / popup colours read these (template: var(--mx-*, <the light colour>)); light mode keeps its colours. */
#hlr-dash-embed.hlr-dark {
    --mx-muted: #aab2ba; --mx-blue: #62a8f8; --mx-red: #f8b0b0; --mx-green: #86d9a6; --mx-line: #363c42;
    --mx-surface: #1f2530; --mx-glass: rgba(31, 37, 48, .92);
}

/* ── The map ──────────────────────────────────────────────────────────────────────────────────────────────────────
   Tiles: the street map turned dark (every tile provider; the HTML pins are not touched). */
#hlr-dash-embed.hlr-dark .leaflet-container { background: #1b2028; }
#hlr-dash-embed.hlr-dark .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.75); }
#hlr-dash-embed.hlr-dark .boot-map { background: #1b2028; }
#hlr-dash-embed.hlr-dark .boot-logo, #hlr-dash-embed.hlr-dark .boot-chip, #hlr-dash-embed.hlr-dark .boot-filters span,
#hlr-dash-embed.hlr-dark .boot-results, #hlr-dash-embed.hlr-dark .boot-img, #hlr-dash-embed.hlr-dark .boot-meta i,
#hlr-dash-embed.hlr-dark .property-image {
    background: linear-gradient(90deg, #232a34 20%, #374150 40%, #232a34 60%); background-size: 300% 100%;
}
/* Loading spinner (photos, the map before its tiles): light ring, accent blue head; "No photo yet" readable */
#hlr-dash-embed.hlr-dark .property-image::after, #hlr-dash-embed.hlr-dark .boot-img::after, #hlr-dash-embed.hlr-dark .boot-map::after,
#hlr-dash-embed.hlr-dark .leaflet-container:not(:has(.leaflet-tile-loaded))::after { border-color: rgba(255, 255, 255, .16); border-top-color: #62a8f8; }
#hlr-dash-embed.hlr-dark .property-image:has(.card-img.errored)::after { color: #b8c0c8; }
#hlr-dash-embed.hlr-dark .property-image:has(.card-img.loaded), #hlr-dash-embed.hlr-dark .property-image:has(.card-img.errored) { background: #262d37; }

/* Price pins and clusters: the dashboard's button blue with white text (5.6:1), a dark ring so they stand off the map. */
#hlr-dash-embed.hlr-dark .price-marker { background: #0d6cd2; color: #fff; border: 2px solid #171b24; box-shadow: 0 3px 10px rgba(0, 0, 0, .55); }
#hlr-dash-embed.hlr-dark .price-marker.hl { background: #f3c97a; color: #151a21; border-color: #171b24;
    box-shadow: 0 0 0 4px rgba(243, 201, 122, .35), 0 6px 16px rgba(0, 0, 0, .5); animation: none; }
#hlr-dash-embed.hlr-dark .srv-cluster { background: #0d6cd2; color: #fff; border: 3px solid rgba(98, 168, 248, .45); background-clip: padding-box; box-shadow: 0 2px 10px rgba(0, 0, 0, .55); }
#hlr-dash-embed.hlr-dark .srv-cluster.lg { background: #0a58ab; }
#hlr-dash-embed.hlr-dark .marker-cluster-small, #hlr-dash-embed.hlr-dark .marker-cluster-medium, #hlr-dash-embed.hlr-dark .marker-cluster-large { background: rgba(98, 168, 248, .35); }
#hlr-dash-embed.hlr-dark .marker-cluster-small div, #hlr-dash-embed.hlr-dark .marker-cluster-medium div, #hlr-dash-embed.hlr-dark .marker-cluster-large div { background: #0d6cd2; color: #fff; }
#hlr-dash-embed.hlr-dark .search-pin { border-color: #171b24; }

/* Map buttons (zoom, my location, full screen, address search, reset, the drawing tools) */
#hlr-dash-embed.hlr-dark .leaflet-bar { border-color: #363c42 !important; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
#hlr-dash-embed.hlr-dark .leaflet-bar a,
#hlr-dash-embed.hlr-dark .leaflet-control-zoom a { background-color: #262d37; color: #e8e8e8; border-bottom-color: #363c42; }
#hlr-dash-embed.hlr-dark .leaflet-bar a:hover,
#hlr-dash-embed.hlr-dark .leaflet-control-zoom a:hover { background-color: #2f3742; color: #62a8f8; }
#hlr-dash-embed.hlr-dark .leaflet-bar a.leaflet-disabled { background-color: #1f2530; color: #6b737b; }
#hlr-dash-embed.hlr-dark .map-tool-btn { color: #e8e8e8; }
#hlr-dash-embed.hlr-dark .map-tool-btn:hover { color: #62a8f8; }
/* leaflet.draw's icons are a dark sprite: the button is painted in the inverse of #262d37 and inverted, so it shows
   #262d37 with light icons. */
#hlr-dash-embed.hlr-dark .leaflet-draw-toolbar a { background-color: #d9d2c8 !important; border-bottom-color: #c9c3bd !important; filter: invert(1); }
#hlr-dash-embed.hlr-dark .leaflet-draw-toolbar a.leaflet-disabled { background-color: #e0dacf !important; opacity: .55; }
#hlr-dash-embed.hlr-dark .leaflet-draw-actions a { background: #262d37; color: #e8e8e8; border-color: #363c42; }
#hlr-dash-embed.hlr-dark .leaflet-draw-actions a:hover { background: #2f3742; }
#hlr-dash-embed.hlr-dark .leaflet-draw-tooltip { background: rgba(23, 27, 36, .92); border-color: #363c42; color: #e8e8e8; }
#hlr-dash-embed.hlr-dark .leaflet-draw-tooltip:before { border-right-color: rgba(23, 27, 36, .92); }
#hlr-dash-embed.hlr-dark .leaflet-draw-tooltip-subtext { color: #b8c0c8; }
#hlr-dash-embed.hlr-dark .leaflet-control-attribution { background: rgba(23, 27, 36, .82) !important; color: #b8c0c8; }
#hlr-dash-embed.hlr-dark .leaflet-control-attribution a { color: #62a8f8; }
#hlr-dash-embed.hlr-dark .leaflet-control-scale-line { background: rgba(23, 27, 36, .82); border-color: #8f979f; color: #e8e8e8; }
#hlr-dash-embed.hlr-dark .leaflet-tooltip { background: #262d37; border-color: #363c42; color: #e8e8e8; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
#hlr-dash-embed.hlr-dark .leaflet-tooltip-top:before { border-top-color: #262d37; }
#hlr-dash-embed.hlr-dark .leaflet-tooltip-bottom:before { border-bottom-color: #262d37; }

/* Pin popups (one listing card, or the list of units at one address) */
#hlr-dash-embed.hlr-dark .leaflet-popup-content-wrapper,
#hlr-dash-embed.hlr-dark .leaflet-popup-tip { background: #1f2530; color: #e8e8e8; box-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
#hlr-dash-embed.hlr-dark .leaflet-popup-content-wrapper { border: 1px solid #363c42; }
#hlr-dash-embed.hlr-dark a.leaflet-popup-close-button { color: #e8e8e8; }
#hlr-dash-embed.hlr-dark .card-popup a.leaflet-popup-close-button { background: rgba(23, 27, 36, .9); color: #e8e8e8; }
#hlr-dash-embed.hlr-dark .leaflet-popup-content .map-card,
#hlr-dash-embed.hlr-dark .map-card-price { color: #e8e8e8; }
#hlr-dash-embed.hlr-dark .map-card-img { background: #262d37; }
#hlr-dash-embed.hlr-dark .map-card-meta { color: #b8c0c8; }
#hlr-dash-embed.hlr-dark .map-card-addr { color: #d6dbe0; }
#hlr-dash-embed.hlr-dark .map-card-cta { color: #62a8f8; }
#hlr-dash-embed.hlr-dark .stack-row { color: #e8e8e8; }
#hlr-dash-embed.hlr-dark .stack-row:hover { background: #262d37; }
#hlr-dash-embed.hlr-dark .stack-price { color: #62a8f8; }
#hlr-dash-embed.hlr-dark .stack-sub { color: #b8c0c8; }
#hlr-dash-embed.hlr-dark .stack-thumb { background: #262d37; }
#hlr-dash-embed.hlr-dark .stack-arrow { color: #8f979f; }

/* ── Listing cards ───────────────────────────────────────────────────────────────────────────────────────────────── */
/* Status tag on the photo: white text on a deeper shade of the same colour (all >= 4.5:1). */
#hlr-dash-embed.hlr-dark .property-tag { color: #fff; }
#hlr-dash-embed.hlr-dark .property-tag[data-cat="forsale"] { background: #15803d !important; }
#hlr-dash-embed.hlr-dark .property-tag[data-cat="forrent"] { background: #1d4ed8 !important; }
#hlr-dash-embed.hlr-dark .property-tag[data-cat="sold"] { background: #b91c1c !important; }
#hlr-dash-embed.hlr-dark .property-tag[data-cat="rented"] { background: #6d28d9 !important; }
/* Heart: a dark disc with a light-red heart; saved = red disc, white heart. */
#hlr-dash-embed.hlr-dark .prop-fav,
#hlr-dash-embed.hlr-dark .map-card-fav { background: rgba(23, 27, 36, .88); color: #f8b0b0; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
#hlr-dash-embed.hlr-dark .prop-fav.active,
#hlr-dash-embed.hlr-dark .map-card-fav.active { background: #b91c1c; color: #fff; }

/* ── Filter bar ──────────────────────────────────────────────────────────────────────────────────────────────────── */
/* The ▾ on each pill: full strength (at half strength it was 3.2:1 on the dark bar, 4.2:1 on an open pill). */
#hlr-dash-embed.hlr-dark .realm-caret { opacity: 1; }
/* Search chips (city / area / MLS / class): the × and the small kind label at near-full strength on the dark tint. */
#hlr-dash-embed.hlr-dark .uchip button { opacity: .9; }
#hlr-dash-embed.hlr-dark .uchip-k { opacity: .85; }

/* The price on the photo: a solid dark chip with white text, readable on any photo and on the light "Photo unavailable"
   picture (2026-11-16: the see-through chip left the price white on white). */
#hlr-dash-embed.hlr-dark .property-price { background: rgba(23, 27, 36, .9); color: #fff; }
