/* Dark theme — variables first, then per-component overrides generated from the page styles. */
html[data-theme="dark"] {
  color-scheme: dark;
  --warm-white: #141414;
  --cream: #1b1b1b;
  --light-border: rgba(255,255,255,0.12);
  --dk-surface: #212121;
  --dk-surface2: #2a2a2a;
  --dk-text: #ececec;
  --dk-mid: #b4b4b4;
  --dk-accent: #e58ba8;
  --dk-border: rgba(255,255,255,0.13);
}
html[data-theme="dark"] body { background: var(--warm-white); color: var(--dk-text); }
html[data-theme="dark"] ::selection { background: #670626; color: #fff; }
html[data-theme="dark"] img:not([src$=".svg"]) { filter: brightness(0.92); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background-color: var(--dk-surface2); color: var(--dk-text); border-color: var(--dk-border); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #8a8a8a; }
/* OpenStreetMap tiles → dark */
html[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.7); }
html[data-theme="dark"] .leaflet-popup-content-wrapper, html[data-theme="dark"] .leaflet-popup-tip { background: var(--dk-surface); color: var(--dk-text); }
html[data-theme="dark"] .leaflet-control-zoom a { background: var(--dk-surface); color: var(--dk-text); border-color: var(--dk-border); }
html[data-theme="dark"] .leaflet-control-attribution { background: rgba(20,20,20,0.7) !important; color: #aaa !important; }
html[data-theme="dark"] .leaflet-control-attribution a { color: #ccc !important; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .25s ease, color .25s ease, border-color .25s ease !important; }


/* ── shared components (footer, chat widgets) ── */
html[data-theme="dark"] footer.site-footer .sf-social-btn { background:rgba(24,24,24,0.08); }
html[data-theme="dark"] .fw-top { background:var(--dk-surface); }
html[data-theme="dark"] .cb-panel { background:var(--dk-surface); }
html[data-theme="dark"] .cb-header-avatar { background:rgba(24,24,24,0.15); }
html[data-theme="dark"] .cb-msg.bot { background:var(--dk-surface); border-color:var(--dk-border); }
html[data-theme="dark"] .cb-msg.agent { background:var(--dk-surface); }
html[data-theme="dark"] .cb-msg.agent .cb-agent-label { color:var(--dk-accent); }
html[data-theme="dark"] .cb-quick-btn { background:var(--dk-surface); color:var(--dk-accent); }
html[data-theme="dark"] .cb-lead-form { background:var(--dk-surface); border-color:var(--dk-border); }
html[data-theme="dark"] .cb-input-row { background:var(--dk-surface); border-top-color:var(--dk-border); }
html[data-theme="dark"] .cb-typing { background:var(--dk-surface); border-color:var(--dk-border); }

/* ── manual contrast fixes ── */
html[data-theme="dark"] .prop-location svg, html[data-theme="dark"] .prop-meta-item svg,
html[data-theme="dark"] .grid-loc svg, html[data-theme="dark"] .detail-loc svg { stroke: var(--dk-accent) !important; }
html[data-theme="dark"] .similar-dot, html[data-theme="dark"] .reviews-dot { background: rgba(255,255,255,0.28); }
html[data-theme="dark"] .similar-dot.active, html[data-theme="dark"] .reviews-dot.active { background: var(--dk-accent); }
html[data-theme="dark"] .unit-enquire { color: var(--dk-accent); }
html[data-theme="dark"] .detail-gallery-thumbs { background: rgba(255,255,255,0.06); }
html[data-theme="dark"] .fw-top { background: #fff !important; border-color: rgba(103,6,38,0.35) !important; }
html[data-theme="dark"] .fw-top svg { stroke: #670626 !important; }
