:root {
  color-scheme: dark;
  --page: #08070e;
  --panel: #11101d;
  --field: #0d0b17;
  --line: #403361;
  --text: #f6f2ff;
  --muted: #c4bbd7;
  --violet: #c9a7ff;
  --mint: #6cecc1;
  --red: #ff9ba8;
  --primary: linear-gradient(135deg, #6235af, #492884);
  --surface: linear-gradient(145deg, #151023, var(--panel) 65%);
}

body {
  background: radial-gradient(ellipse at 45% 0, #1a102c 0, transparent 530px), var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

h1 {color:var(--text);letter-spacing:-.025em;line-height:1.15}
a {color:var(--violet)}
:focus-visible {outline:3px solid var(--mint);outline-offset:3px}
input, select {background:var(--field);color:var(--text);border-color:#665384}
input::placeholder {color:var(--muted);opacity:1}
input[type=checkbox] {accent-color:#a475eb}
button, .visit-meta .visit-directions {
  background:var(--primary);
  color:var(--text);
  border:0;
  font-weight:700;
}
.secondary {background:#271d38}
.save-button {background:#175948}
.account-bar {padding:8px 0 12px;border-bottom:1px solid var(--line)}
.account-bar .small-button {min-height:44px;display:inline-flex;align-items:center}
.account-bar .history-button {background:#922a48;color:#fff}

.search-box, #searchProgress, .selection-bar, .sale, .result-filters,
.visit-week, .account-layout main, .sale-guide, .collection-panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
}
.search-box, .account-layout main {border-top:2px solid #9968ed}
.search-box {padding:14px}
.search-box > input, .search-box > select {min-width:0}
.search-box > input, .search-box > select, .search-box > button {min-height:48px}
.result-filters legend {color:var(--violet);font-weight:700}
.result-filter-controls input[type=checkbox] {accent-color:#a475eb}
#status, #progressPhase, #progressStats, .progress-details, .details,
.visit-meta, .sale-guide-card p, .sale-legend, .account-layout main > p {
  color:var(--muted);
}
#progressPercent, #etaText, #savedMessage, #tripSaveStatus {color:var(--mint)}
.progress-track {background:#201a32;border-color:var(--line)}
#progressFill {background:linear-gradient(90deg,#7651d2,#56eab6)}
#stopSearchButton {background:#922a48}
#stopSearchButton:hover {background:#a93556}
.sale {border-left:4px solid #40bd9b}
.sale.estate-sale {border-left-color:#aa79f0}
.sale.previously-visited {border-left-color:#e96379}
.sale.visited {opacity:1;background:#110f1a}
.sale .address {overflow-wrap:anywhere}
.sale .small-button, .leaflet-popup-content button {min-height:44px}
.sale .visit-control {min-height:36px}
.visit-week summary {color:var(--violet)}
.visit-week li + li {border-top-color:var(--line)}
.visit-address, .visit-address a {color:var(--red)}
.previous-visit {color:var(--red)}
.estate-label {background:#50317e;color:#f5eaff}
.garage-label {background:#193b34;color:#9bf4d5}
.sale-legend {display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.sale-legend > span {white-space:nowrap}
.legend-previous {color:var(--red)}
#map {background:var(--panel);border-color:var(--line)}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {background:#171023;color:var(--text)}
.leaflet-popup-content-wrapper {border:1px solid #665384}
.estate-pin {background:#9255e2;box-shadow:0 0 0 2px #331357}
.estate-pin.garage-pin {background:#159979;box-shadow:0 0 0 2px #103b30}
.estate-pin.previous-pin {background:#c73352;box-shadow:0 0 0 2px #4f1021}

.account-layout h1 {font-size:clamp(1.55rem, 4vw, 2rem)}
.account-layout a {color:var(--violet)}
.account-layout .password-toggle {background:transparent;color:var(--violet)}
.account-layout [role=alert] {color:var(--red)}
.sale-guide h2 {color:var(--text)}
.sale-guide-card {background:var(--field);border-color:var(--line)}
.sale-guide-card h3 {color:var(--mint)}
.collection-panel {padding:16px}
.collection-panel td, .collection-panel th {border-bottom-color:var(--line)}

@media (max-width: 520px) {
  .search-box {padding:10px}
  .account-bar {gap:8px}
  .sale .actions a, .sale .actions button {min-height:44px}
}
