/* WebCrafters Area Data. Uses the theme's colour tokens when present. */
.wcad, .wcad-map { --wcad-green: var(--green, #1B4927); --wcad-gold: var(--yellow, #F7D04C); --wcad-ink: var(--ink, #14201A); --wcad-muted: var(--muted, #5A6660); --wcad-line: var(--line, #E4E8E5); --wcad-tint: var(--bg-tint, #F4F7F5); --wcad-r: var(--radius-lg, 20px); }
.wcad-empty { padding: 16px 20px; border-radius: 12px; background: #FFF7E0; color: #6B5300; }

/* Key numbers */
.wcad-stats { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wcad-stats li { display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 20px; border-radius: var(--wcad-r); background: #fff; border: 1px solid var(--wcad-line); position: relative; overflow: hidden; }
.wcad-stats li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--wcad-gold); }
.wcad-stats span { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--wcad-muted); }
.wcad-stats b { font-size: clamp(28px, 2.6vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--wcad-ink); }
.wcad-stats small { font-size: 13.5px; color: var(--wcad-muted); }
.wcad-stats__split { display: flex; gap: 18px; flex-wrap: wrap; }
.wcad-stats__split em { font-style: normal; display: flex; flex-direction: column; }
.wcad-stats__split i { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--wcad-muted); letter-spacing: 0; }

/* Cards */
.wcad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wcad-card { padding: clamp(22px, 2.4vw, 30px); border-radius: var(--wcad-r); background: #fff; border: 1px solid var(--wcad-line); min-width: 0; }
.wcad-card h3 { margin: 0 0 16px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--wcad-ink); }
.wcad-sub { margin: -8px 0 14px; font-size: 14px; color: var(--wcad-muted); }

.wcad-homes { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; align-items: center; }
.wcad-donut { position: relative; height: 190px; }
.wcad-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.wcad-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; font-size: 14.5px; color: var(--wcad-ink); }
.wcad-legend i { width: 12px; height: 12px; border-radius: 4px; }
.wcad-legend b { font-weight: 800; }
.wcad-legend small { grid-column: 2 / 4; font-size: 12.5px; color: var(--wcad-muted); }

.wcad-big { margin: 0 0 18px; font-size: 16px; color: #4A5650; }
.wcad-big b { display: block; font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--wcad-green); }
.wcad-split { margin-bottom: 14px; }
.wcad-split__name { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; color: var(--wcad-ink); }
.wcad-split__bar { display: flex; height: 38px; border-radius: 10px; overflow: hidden; background: var(--wcad-tint); }
.wcad-split__bar span { display: flex; align-items: center; padding: 0 12px; font-size: 13.5px; font-weight: 800; white-space: nowrap; min-width: 0; }
.wcad-split__bar .is-own { background: var(--wcad-green); color: #fff; }
.wcad-split__bar .is-rent { background: var(--wcad-gold); color: var(--wcad-ink); justify-content: flex-end; }

.wcad-bars-chart { position: relative; height: 260px; }

.wcad-compare { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.wcad-compare li { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 52px; column-gap: 12px; align-items: center; font-size: 14.5px; color: var(--wcad-ink); }
.wcad-compare__track { position: relative; height: 12px; border-radius: 999px; background: var(--wcad-tint); }
.wcad-compare__track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--wcad-green); }
.wcad-compare__track em { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #D08C12; }
.wcad-compare b { text-align: right; font-weight: 800; }
.wcad-compare small { grid-column: 2 / 4; margin-top: 2px; font-size: 12.5px; color: var(--wcad-muted); }

.wcad-key { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0 0; font-size: 13px; color: var(--wcad-muted); }
.wcad-key span { display: inline-flex; align-items: center; gap: 7px; }
.wcad-key i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.wcad-key .is-own, .wcad-key .is-area { background: var(--wcad-green); }
.wcad-key .is-rent { background: var(--wcad-gold); }
.wcad-key .is-cmp { width: 3px; height: 14px; border-radius: 2px; background: #D08C12; }

.wcad-foot { margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.wcad-foot p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--wcad-muted); }
.wcad-source { font-weight: 700; }

/* Map */
.wcad-map__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.wcad-map__filter { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid var(--wcad-line); background: #fff; color: var(--wcad-ink); font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; opacity: .55; transition: opacity .2s, border-color .2s; }
.wcad-map__filter svg { width: 18px; height: 18px; color: var(--c); }
.wcad-map__filter[aria-pressed="true"] { opacity: 1; border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.wcad-map__filter:focus-visible { outline: 3px solid var(--wcad-gold); outline-offset: 2px; }
.wcad-map__canvas { width: 100%; border-radius: var(--wcad-r); overflow: hidden; border: 1px solid var(--wcad-line); background: #E8EEEA; z-index: 0; }
.wcad-map .leaflet-tile-pane { filter: saturate(.55) brightness(1.03); }
.wcad-map .leaflet-container { font: inherit; }
.wcad-map .leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 32, 26, .18); }
.wcad-map .leaflet-popup-content { margin: 12px 16px; font-size: 14px; line-height: 1.5; color: var(--wcad-ink); }
.wcad-pin { background: none; border: 0; }
.wcad-pin span { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--c); box-shadow: 0 6px 14px rgba(20, 32, 26, .28); border: 2px solid #fff; }
.wcad-pin svg { width: 18px; height: 18px; color: #fff; transform: rotate(45deg); }
.wcad-map__list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wcad-map__list li[hidden] { display: none; }
.wcad-map__list button { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px 12px 16px; border-radius: 12px; border: 1px solid var(--wcad-line); border-left: 4px solid var(--c); background: #fff; font: inherit; cursor: pointer; transition: background .2s; }
.wcad-map__list button:hover { background: var(--wcad-tint); }
.wcad-map__list button:focus-visible { outline: 3px solid var(--wcad-gold); outline-offset: 2px; }
.wcad-map__list b { font-size: 15px; font-weight: 800; color: var(--wcad-ink); }
.wcad-map__list span { font-size: 13px; line-height: 1.45; color: var(--wcad-muted); }

@media (max-width: 1000px) {
	.wcad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wcad-grid { grid-template-columns: minmax(0, 1fr); }
	.wcad-map__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
	.wcad-stats { grid-template-columns: minmax(0, 1fr); }
	.wcad-homes { grid-template-columns: minmax(0, 1fr); }
	.wcad-donut { height: 200px; }
	.wcad-compare li { grid-template-columns: minmax(0, 1fr) 52px; }
	.wcad-compare__track { grid-column: 1 / 3; grid-row: 2; margin-top: 6px; }
	.wcad-compare small { grid-column: 1 / 3; }
	.wcad-map__list { grid-template-columns: minmax(0, 1fr); }
	.wcad-map__filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.wcad-map__filter { flex: none; }
}
.wcad-stats b.wcad-stats__split { flex-direction: row; flex-wrap: nowrap; gap: 16px; font-size: clamp(24px, 2.1vw, 30px); }
.wcad-stats__split i { margin-top: 2px; line-height: 1.3; }
@media (max-width: 560px) {
	.wcad-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.wcad-stats li { padding: 16px 14px 14px 18px; }
	.wcad-stats b { font-size: 26px; }
	.wcad-stats .wcad-stats__wide { grid-column: 1 / -1; }
	.wcad-stats span { font-size: 11.5px; }
}
@media (max-width: 560px) { .wcad-stats li:nth-child(3):nth-last-child(2) { grid-column: 1 / -1; } }
/* Compare switcher */
.wcad-compare-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; padding: 14px 16px 14px 20px; border-radius: 16px; background: #fff; border: 1px solid var(--wcad-line); }
.wcad-compare-pick label { font-size: 15px; font-weight: 800; color: var(--wcad-ink); }
.wcad-select { position: relative; display: inline-flex; }
.wcad-select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--wcad-ink); border-bottom: 2px solid var(--wcad-ink); transform: rotate(45deg); pointer-events: none; }
.wcad-select select { appearance: none; -webkit-appearance: none; min-height: 46px; min-width: 240px; padding: 0 44px 0 16px; border-radius: 999px; border: 1px solid var(--wcad-line); background: var(--wcad-tint); color: var(--wcad-ink); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.wcad-select select:focus-visible { outline: 3px solid var(--wcad-gold); outline-offset: 2px; }
.wcad [hidden] { display: none !important; }
@media (max-width: 560px) { .wcad-select, .wcad-select select { width: 100%; min-width: 0; } }
/* Map: clusters, small pins, counts, popups */
.wcad-map__count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: var(--wcad-tint); font-size: 12px; font-weight: 800; color: var(--wcad-ink); }
.wcad-pin span { width: 30px; height: 30px; border-width: 2px; }
.wcad-pin span svg { width: 15px; height: 15px; }
.wcad-pin span.is-big { width: 38px; height: 38px; }
.wcad-pin span.is-big svg { width: 18px; height: 18px; }
.wcad-cluster { background: none; }
.wcad-cluster span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--wcad-green); color: #fff; font-size: 14px; font-weight: 800; border: 3px solid #fff; box-shadow: 0 0 0 5px rgba(27, 73, 39, .22), 0 6px 14px rgba(20, 32, 26, .25); }
.wcad-map .leaflet-popup-content b { display: block; font-size: 15px; }
.wcad-pop__type { display: block; margin-top: 2px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.wcad-pop__text { display: block; margin-top: 4px; color: var(--wcad-muted); }
.wcad-pop__link { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--wcad-green); }
.wcad-map__list-title { margin: 20px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--wcad-muted); }
.wcad-map__list-title + .wcad-map__list { margin-top: 10px; }
/* Province and city menus, loading state */
.wcad-compare-pick__label { font-size: 15px; font-weight: 800; color: var(--wcad-ink); margin-right: 4px; }
.wcad-compare-pick .wcad-select select { min-width: 210px; }
.wcad-compare-pick__status { font-size: 13.5px; color: var(--wcad-muted); }
.wcad .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wcad.is-loading .wcad-stats, .wcad.is-loading .wcad-grid { opacity: .45; transition: opacity .2s; pointer-events: none; }
.wcad.is-loading .wcad-compare-pick__status::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; border: 2px solid var(--wcad-line); border-top-color: var(--wcad-green); animation: wcad-spin .8s linear infinite; }
@keyframes wcad-spin { to { transform: rotate(360deg); } }


/* ===== Map v2: full width, floating panel, softer tiles ===== */
.wcad-map { position: relative; }
.wcad-map--full { width: 100vw; margin-left: calc(50% - 50vw); }
.wcad-map__stage { position: relative; }
.wcad-map .wcad-map__canvas { height: var(--map-h, 620px); border-radius: var(--wcad-r); border: 0; box-shadow: 0 0 0 1px var(--wcad-line); background: #EEF1EC; }
.wcad-map--full .wcad-map__canvas { border-radius: 0; box-shadow: inset 0 1px 0 var(--wcad-line), inset 0 -1px 0 var(--wcad-line); }
.wcad-map .leaflet-tile-pane { filter: grayscale(.92) sepia(.12) contrast(.92) brightness(1.06); }
.wcad-map .leaflet-control-zoom { border: 0; box-shadow: 0 8px 24px rgba(20, 32, 26, .16); border-radius: 12px; overflow: hidden; margin: 0 24px 28px 0 !important; }
.wcad-map .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; color: var(--wcad-ink); font-size: 20px; }
.wcad-map .leaflet-control-attribution { background: rgba(255, 255, 255, .85); padding: 2px 8px; border-radius: 8px 0 0 0; font-size: 11px; }

/* Floating panel */
.wcad-map__panel { position: absolute; z-index: 500; top: 24px; bottom: 24px; left: 24px; width: 300px; display: flex; flex-direction: column; gap: 10px; padding: 18px; background: rgba(255, 255, 255, .97); border-radius: 20px; box-shadow: 0 18px 50px rgba(20, 32, 26, .16); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.wcad-map--full .wcad-map__panel { left: max(24px, calc((100vw - var(--container, 1240px)) / 2)); }
.wcad-map__panel-title { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--wcad-muted); }
.wcad-map .wcad-map__list-title { margin-top: 8px; }
.wcad-map .wcad-map__filters { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.wcad-map .wcad-map__filter { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 30px; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px 6px 6px; border: 0; border-radius: 12px; background: transparent; box-shadow: none; opacity: 1; text-align: left; font: inherit; font-size: 14.5px; font-weight: 700; color: var(--wcad-ink); cursor: pointer; transition: background .2s; }
.wcad-map .wcad-map__filter:hover { background: var(--wcad-tint); }
.wcad-map__dot { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--c); color: #fff; transition: background .2s, color .2s; }
.wcad-map__dot svg { width: 17px; height: 17px; }
.wcad-map .wcad-map__count { background: var(--wcad-tint); color: var(--wcad-muted); }
.wcad-map__switch { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--c); transition: background .2s; }
.wcad-map__switch::after { content: ""; position: absolute; top: 2px; left: 14px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .2s; }
.wcad-map .wcad-map__filter[aria-pressed="false"] { color: var(--wcad-muted); }
.wcad-map .wcad-map__filter[aria-pressed="false"] .wcad-map__dot { background: var(--wcad-tint); color: var(--c); }
.wcad-map .wcad-map__filter[aria-pressed="false"] .wcad-map__switch { background: #D5DBD7; }
.wcad-map .wcad-map__filter[aria-pressed="false"] .wcad-map__switch::after { left: 2px; }
.wcad-map .wcad-map__list { display: flex; flex-direction: column; gap: 6px; margin: 0; grid-template-columns: none; }
.wcad-map .wcad-map__list button { padding: 10px 12px 10px 14px; border-radius: 12px; border: 1px solid var(--wcad-line); border-left: 4px solid var(--c); }
.wcad-map .wcad-map__list button.is-active { background: var(--wcad-tint); }
.wcad-map .wcad-map__list b { font-size: 14px; }
.wcad-map .wcad-map__list span { font-size: 12.5px; }

/* Pins and clusters */
.wcad-pin span { box-shadow: 0 4px 10px rgba(20, 32, 26, .3); transition: transform .15s; }
.wcad-pin:hover span { transform: rotate(-45deg) scale(1.12); }
.wcad-cluster span { background: var(--wcad-green); box-shadow: 0 0 0 6px rgba(247, 208, 76, .55), 0 6px 14px rgba(20, 32, 26, .25); }
.wcad-map .leaflet-popup-content-wrapper { border-radius: 14px; }
.wcad-map .leaflet-popup-content { margin: 14px 18px; }

@media (max-width: 900px) {
	.wcad-map__stage { display: flex; flex-direction: column; gap: 14px; }
	.wcad-map .wcad-map__canvas { height: min(var(--map-h, 620px), 70vh); }
	.wcad-map__panel, .wcad-map--full .wcad-map__panel { position: static; order: -1; width: auto; margin: 0 var(--gutter, 16px); padding: 0; background: none; box-shadow: none; overflow: visible; }
	.wcad-map:not(.wcad-map--full) .wcad-map__panel { margin: 0; }
	.wcad-map .wcad-map__filters { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 8px; margin: 0 calc(-1 * var(--gutter, 16px)); padding: 0 var(--gutter, 16px); }
	.wcad-map .wcad-map__filter { flex: none; width: auto; grid-template-columns: 26px auto auto; min-height: 42px; padding: 6px 12px 6px 6px; border: 1px solid var(--wcad-line); border-radius: 999px; background: #fff; }
	.wcad-map__dot { width: 26px; height: 26px; border-radius: 50%; }
	.wcad-map__dot svg { width: 14px; height: 14px; }
	.wcad-map__switch { display: none; }
	.wcad-map__list-title, .wcad-map .wcad-map__list { display: none; }
}
.wcad-map__stage { isolation: isolate; z-index: 0; }

/* Compare menus with Select2, styled like the pill selects */
.wcad-select.is-enhanced { min-width: 230px; }
.wcad-select.is-enhanced::after { display: none; }
.wcad-compare-pick .select2-container .select2-selection--single { height: 46px; border-radius: 999px; border: 1px solid var(--wcad-line); background: var(--wcad-tint); transition: border-color .2s, box-shadow .2s; }
.wcad-compare-pick .select2-container .select2-selection--single .select2-selection__rendered { padding: 0 44px 0 18px; line-height: 44px; font-size: 15px; font-weight: 700; color: var(--wcad-ink); }
.wcad-compare-pick .select2-container .select2-selection--single .select2-selection__arrow { top: 0; right: 14px; width: 20px; height: 44px; }
.wcad-compare-pick .select2-container .select2-selection--single .select2-selection__arrow b { left: 50%; top: 50%; width: 8px; height: 8px; margin: -6px 0 0 -4px; border: 0; border-right: 2px solid var(--wcad-ink); border-bottom: 2px solid var(--wcad-ink); transform: rotate(45deg); transition: transform .2s; }
.wcad-compare-pick .select2-container--open .select2-selection--single .select2-selection__arrow b { transform: rotate(-135deg); margin-top: -2px; border-color: var(--wcad-ink); border-width: 0 2px 2px 0; }
.wcad-compare-pick .select2-container--focus .select2-selection--single, .wcad-compare-pick .select2-container--open .select2-selection--single { border-color: var(--wcad-green, #1B4927); box-shadow: 0 0 0 3px rgba(247, 208, 76, .45); }
.wcad-compare-pick .select2-container--disabled .select2-selection--single { opacity: .6; cursor: progress; }
.wcad-compare-pick .select2-dropdown { margin-top: 6px; border: 1px solid var(--wcad-line); border-radius: 16px !important; overflow: hidden; box-shadow: 0 18px 40px rgba(20, 32, 26, .16); }
.wcad-compare-pick .select2-container--open .select2-dropdown--above { margin-top: -6px; }
.wcad-compare-pick .select2-search--dropdown { padding: 10px; }
.wcad-compare-pick .select2-search--dropdown .select2-search__field { height: 40px; padding: 0 12px; border: 1px solid var(--wcad-line); border-radius: 10px; font: inherit; font-size: 15px; outline: none; }
.wcad-compare-pick .select2-search--dropdown .select2-search__field:focus { border-color: var(--wcad-green, #1B4927); }
.wcad-compare-pick .select2-results > .select2-results__options { max-height: 280px; padding: 6px; }
.wcad-compare-pick .select2-results__option { padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--wcad-ink); }
.wcad-compare-pick .select2-results__option--highlighted.select2-results__option--selectable { background: var(--wcad-tint); color: var(--wcad-ink); }
.wcad-compare-pick .select2-results__option--selected { background: var(--wcad-green, #1B4927) !important; color: #fff !important; }
@media (max-width: 560px) { .wcad-select.is-enhanced { width: 100%; min-width: 0; } }

/* Source credits under the charts and the map */
.wcad-source b { font-weight: 800; }
.wcad-source a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.wcad-source a:hover { color: var(--green, #1B4927); }
