:root[data-theme="ranch"] {
  color-scheme: light;
}

:root[data-theme="classic"] {
  color-scheme: light;
  --bg: #f5f9fc;
  --surface: #ffffff;
  --sidebar: #102137;
  --nav-bg: #172033;
  --text: #0f172a;
  --strong: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --control-border: #9fb5d5;
  --button: #eff6ff;
  --primary: #1d4ed8;
  --primary-border: #1e40af;
  --primary-text: #ffffff;
  --accent: #22d3ee;
  --badge: #22d3ee;
  --badge-text: #0f172a;
  --focus: #1d4ed8;
  --input: #ffffff;
  --note: #eff6ff;
  --sync-bg: #dbeafe;
  --alert-bg: #fee2e2;
  --alert-text: #991b1b;
  --good-bg: #dcfce7;
  --map-one: #8fb7d9;
  --map-two: #b8d4eb;
  --map-line: #0f172a40;
}

:root[data-theme="jobsite"] {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --sidebar: #172033;
  --nav-bg: #111827;
  --text: #172033;
  --strong: #172033;
  --muted: #5e687a;
  --border: #d6deea;
  --control-border: #8ca4c0;
  --button: #eaf1f9;
  --primary: #1d4f91;
  --primary-border: #153764;
  --primary-text: #ffffff;
  --accent: #b85c2b;
  --badge: #b85c2b;
  --badge-text: #ffffff;
  --focus: #1d4f91;
  --input: #ffffff;
  --note: #eaf1f9;
  --sync-bg: #dceafd;
  --alert-bg: #fee2d5;
  --alert-text: #7c2d12;
  --good-bg: #d9eadb;
  --map-one: #7e9ab7;
  --map-two: #c5a178;
  --map-line: #1720334a;
}

:root[data-theme="contrast"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --sidebar: #050505;
  --nav-bg: #050505;
  --text: #050505;
  --strong: #050505;
  --muted: #333333;
  --border: #6b6b6b;
  --control-border: #050505;
  --button: #eeeeee;
  --primary: #004b8d;
  --primary-border: #002b52;
  --primary-text: #ffffff;
  --accent: #8a3300;
  --badge: #8a3300;
  --badge-text: #ffffff;
  --focus: #004b8d;
  --input: #ffffff;
  --note: #eeeeee;
  --sync-bg: #e7f0ff;
  --alert-bg: #fff0eb;
  --alert-text: #8f0000;
  --good-bg: #e6f4ea;
  --map-one: #bbbbbb;
  --map-two: #eeeeee;
  --map-line: #05050580;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111816;
  --surface: #18231f;
  --sidebar: #0b1110;
  --nav-bg: #0b1110;
  --text: #f4f7f6;
  --strong: #ffffff;
  --muted: #b9c6c2;
  --border: #344640;
  --control-border: #5b736b;
  --button: #21312b;
  --primary: #4ab89c;
  --primary-border: #70d4bb;
  --primary-text: #0b1110;
  --accent: #e08b55;
  --badge: #e08b55;
  --badge-text: #111816;
  --focus: #70d4bb;
  --input: #111816;
  --note: #21312b;
  --sync-bg: #243d34;
  --alert-bg: #482018;
  --alert-text: #ffd0c2;
  --good-bg: #1f4d36;
  --map-one: #435a4e;
  --map-two: #6f5a3f;
  --map-line: #fffaf06b;
}

:root[data-theme="paper"] {
  color-scheme: light;
  --bg: #fbf7ef;
  --surface: #fffdf8;
  --sidebar: #27231d;
  --nav-bg: #3f3528;
  --text: #27231d;
  --strong: #27231d;
  --muted: #766b5e;
  --border: #ded2c2;
  --control-border: #9f8f7d;
  --button: #f1eadf;
  --primary: #5d6f3c;
  --primary-border: #3f4d28;
  --primary-text: #ffffff;
  --accent: #9b4d2f;
  --badge: #9b4d2f;
  --badge-text: #ffffff;
  --focus: #5d6f3c;
  --input: #fffdf8;
  --note: #f1eadf;
  --sync-bg: #f4e8c8;
  --alert-bg: #f8ded6;
  --alert-text: #9a3833;
  --good-bg: #e7efd8;
  --map-one: #8a956a;
  --map-two: #c4b17d;
  --map-line: #27231d50;
}

.rlp-fieldboss-themes .theme-toggle {
  display: none;
}

.rlp-theme-panel {
  display: grid;
  gap: 12px;
}

.rlp-theme-field,
.rlp-color-settings label {
  display: grid;
  gap: 6px;
  color: var(--strong);
  font-weight: 900;
}

.rlp-theme-field select {
  width: 100%;
  min-height: 52px;
  color: var(--strong);
  background: var(--input);
  border: 2px solid var(--control-border);
  padding: 10px 12px;
  font-weight: 850;
}

.rlp-color-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rlp-color-settings input[type="color"] {
  width: 100%;
  min-height: 48px;
  background: var(--input);
  border: 2px solid var(--control-border);
  padding: 4px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .rlp-color-settings {
    grid-template-columns: 1fr;
  }
}
