/* Shared dark surfaces. Keep the map's cartography and the white login logo badge intact. */
:root[data-theme="dark"] {
  --card: #172337;
  --surface: #172337;
  --dark-field: #1d2b40;
  --dark-secondary: #a9bad2;
  --dark-link: #a8c6ff;
}

[data-theme="dark"] body {
  background: #0e1726;
  color: #e5edf8;
}
[data-theme="dark"] .boot .logo text,
[data-theme="dark"] .pv-live .pv-header .logo text {
  fill: #e5edf8;
}
[data-theme="dark"] .boot p,
[data-theme="dark"] .login-foot {
  color: var(--dark-secondary);
}
[data-theme="dark"] .tabs span {
  background: #283f64;
  color: #c6dcff;
}
[data-theme="dark"] .list-bottom {
  background: #172337;
  color: var(--dark-secondary);
  border-color: var(--line);
}
[data-theme="dark"] .refresh-strip button,
[data-theme="dark"] .d1-capacity-ok {
  color: var(--dark-link);
}

/* Native fields, disabled actions and focus rings stay legible in every dialog. */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #a9bad2;
  opacity: 1;
}
[data-theme="dark"] :is(input, textarea, select):focus {
  border-color: #91b5ff;
  box-shadow: 0 0 0 3px #729fff38;
}
[data-theme="dark"] :is(button, a, summary):focus-visible {
  outline: 2px solid #a8c6ff;
  outline-offset: 3px;
}
[data-theme="dark"] :is(button, input, select, textarea):disabled {
  opacity: 1;
  color: #a0aec3;
  -webkit-text-fill-color: #a0aec3;
  background-color: #243145;
  border-color: #41516a;
  cursor: not-allowed;
  box-shadow: none;
}
[data-theme="dark"] progress {
  accent-color: #729fff;
  background: #2b3b50;
  color: #729fff;
}
[data-theme="dark"] progress::-webkit-progress-bar {
  background: #2b3b50;
}
[data-theme="dark"] progress::-webkit-progress-value {
  background: #729fff;
}
[data-theme="dark"] progress::-moz-progress-bar {
  background: #729fff;
}

/* The production AI wizard shares the pv-live components with the script reader. */
[data-theme="dark"] .pv-live :is(
  .pv-hint, .pv-note, .pv-eyebrow, .pv-skip, .pv-extra,
  .pv-option small, .pv-product-choice small, .pv-tip small,
  .pv-review small, .pv-product small, .pv-appointment legend small,
  .pv-industry-pages, .pv-search-results, .pv-result-controls p,
  .pv-menu > p, .pv-menu-grid small, .pv-result-tags span
) {
  color: var(--dark-secondary);
}
[data-theme="dark"] .pv-live :is(.pv-link, .pv-back, .pv-product-choice) {
  color: var(--dark-link);
}
[data-theme="dark"] .pv-live .pv-progress span {
  color: #b3c4dd;
}
[data-theme="dark"] .pv-live .pv-progress b {
  background: #2b3b50;
  color: #d4e3f9;
  box-shadow: none;
}
[data-theme="dark"] .pv-live .pv-progress .done {
  color: #b6d3ff;
}
[data-theme="dark"] .pv-live .pv-progress .active {
  background: #283f64;
  color: #c6dcff;
  box-shadow: inset 0 0 0 1px #567fc2;
}
[data-theme="dark"] .pv-live .pv-progress .active b {
  background: #396de4;
  color: #fff;
}
[data-theme="dark"] .pv-live :is(.pv-product, .pv-option):hover {
  background: #263b59;
  border-color: #729fff;
}
[data-theme="dark"] .pv-live .pv-product-choice:hover {
  background: transparent;
}
[data-theme="dark"] .pv-live .pv-option[aria-pressed="true"] {
  background: #283f64;
  border-color: #729fff;
  color: #e5edf8;
}
[data-theme="dark"] .pv-live :is(.pv-search-clear, .pv-result-tags span) {
  background: #283f64;
  color: #c6dcff;
}
[data-theme="dark"] .pv-live .pv-header {
  background: #172337;
  border-color: var(--line);
}
[data-theme="dark"] .call-support {
  background: #283f64;
  color: #c6dcff !important;
}

/* Map controls use dark surfaces; tiles, pins and coordinates are unchanged. */
[data-theme="dark"] :is(.map-settings-open, .map-expand-button, .map-place-submit, .map-locate-button) {
  background: #243c61;
  color: #d6e5ff;
  border-color: #577db2;
}
[data-theme="dark"] .maplibregl-popup-tip {
  border-top-color: #172337;
}
[data-theme="dark"] :is(.maplibregl-popup-anchor-top, .maplibregl-popup-anchor-top-left, .maplibregl-popup-anchor-top-right) .maplibregl-popup-tip {
  border-top-color: transparent;
  border-bottom-color: #172337;
}
[data-theme="dark"] .maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-top-color: transparent;
  border-right-color: #172337;
}
[data-theme="dark"] .maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-top-color: transparent;
  border-left-color: #172337;
}
[data-theme="dark"] .maplibregl-popup-content {
  background: #172337;
  border: 1px solid #526984;
  color: #e5edf8;
}
[data-theme="dark"] .maplibregl-popup-content :is(p, strong) {
  color: #e5edf8;
}
[data-theme="dark"] .maplibregl-popup-close-button {
  background: #172337;
  color: #e5edf8;
}
[data-theme="dark"] .maplibregl-popup-content .map-popup-action {
  background: #396de4;
  color: #fff;
}
[data-theme="dark"] .maplibregl-popup-close-button:hover {
  background: #283f64;
}
