/* Shared Carnivore Project light/dark theme controls. */
:root {
  color-scheme: dark;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f4ec;
  --bar: rgba(250, 247, 239, .95);
  --bar-bg: rgba(250, 247, 239, .95);
  --panel: rgba(255, 252, 244, .94);
  --panel-bg: rgba(255, 252, 244, .94);
  --card: rgba(255, 253, 247, .98);
  --card-bg: rgba(255, 253, 247, .98);
  --field: rgba(255, 255, 255, .86);
  --field-bg: rgba(255, 255, 255, .86);
  --border: rgba(57, 69, 55, .16);
  --border-soft: rgba(57, 69, 55, .10);
  --border-hi: rgba(57, 69, 55, .24);
  --gold: #9b6f2d;
  --gold-dim: rgba(155, 111, 45, .12);
  --gold-soft: rgba(155, 111, 45, .20);
  --ember: #a45f25;
  --rust: #9f3f36;
  --moss: #23794f;
  --text: #18231c;
  --text-dim: #3f4d41;
  --text-mono: #304333;
  --muted: #304333;
  --dim: #3f4d41;
}

html[data-theme='light'] body {
  background: var(--bg);
}

html[data-theme='light'] .bg {
  opacity: 1;
  background:
    radial-gradient(ellipse at top, rgba(155,111,45,.10), transparent 58%),
    radial-gradient(ellipse at bottom right, rgba(35,121,79,.08), transparent 52%);
}

html[data-theme='light'] .section,
html[data-theme='light'] .card,
html[data-theme='light'] .confirm-card,
html[data-theme='light'] .login-card,
html[data-theme='light'] .panel,
html[data-theme='light'] .detail-card,
html[data-theme='light'] .drawer,
html[data-theme='light'] .accounts-panel,
html[data-theme='light'] .rec-card,
html[data-theme='light'] .iv-panel {
  box-shadow: 0 18px 44px rgba(61, 45, 23, .12);
}

html[data-theme='light'] .queue-col,
html[data-theme='light'] .choice,
html[data-theme='light'] .media-card,
html[data-theme='light'] .rec-detail td {
  background: rgba(255, 253, 247, .72);
}

html[data-theme='light'] .media-preview,
html[data-theme='light'] .media-preview img,
html[data-theme='light'] .media-preview video {
  background: #eee8dc;
}

html[data-theme='light'] .address-results,
html[data-theme='light'] .legend,
html[data-theme='light'] .map-hint,
html[data-theme='light'] .clear-pin,
html[data-theme='light'] .rec-column-menu,
html[data-theme='light'] .rec-card-foot {
  background: rgba(255, 253, 247, .96);
  color: var(--text-mono);
}

html[data-theme='light'] .accounts-overlay,
html[data-theme='light'] .rec-card-overlay,
html[data-theme='light'] .iv-overlay {
  background: rgba(44, 36, 24, .32);
}

html[data-theme='light'] .rec-card-head {
  background: linear-gradient(135deg, rgba(155,111,45,.12), rgba(255,253,247,.88));
}

html[data-theme='light'] .alert.err,
html[data-theme='light'] .error {
  border-color: #8f2f28;
  background: rgba(143, 47, 40, .10);
  color: #6f211c;
}

html[data-theme='light'] .alert.ok {
  border-color: #1f6f49;
  background: rgba(31, 111, 73, .10);
  color: #185639;
}

html[data-theme='light'] .alert.warn,
html[data-theme='light'] .alert.info {
  border-color: #8f541f;
  background: rgba(143, 84, 31, .12);
  color: #6f3f15;
}

html[data-theme='light'] .map-wrap,
html[data-theme='light'] .detail-map {
  background: #e7e1d4;
}

html[data-theme='light'] input,
html[data-theme='light'] select,
html[data-theme='light'] textarea,
html[data-theme='light'] input[type=date],
html[data-theme='light'] input[type=time],
html[data-theme='light'] input[type=datetime-local],
html[data-theme='light'] .rec-table td.editable input[type=datetime-local] {
  color-scheme: light;
}

html[data-theme='light'] .maplibregl-ctrl-icon {
  filter: none !important;
}

html[data-theme='light'] .maplibregl-ctrl-attrib {
  background: rgba(255,253,247,.82) !important;
  color: var(--text-dim) !important;
}

html[data-theme='light'] .maplibregl-popup-content {
  box-shadow: 0 8px 32px rgba(61, 45, 23, .18) !important;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  background: var(--panel-bg, var(--panel));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.theme-switch-label {
  margin-right: 6px;
  color: var(--text-dim, var(--dim));
  font: 600 8px/1 'IBM Plex Mono', monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.theme-choice {
  border: 0;
  border-radius: 999px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text-mono, var(--muted));
  cursor: pointer;
  font: 600 8px/1 'IBM Plex Mono', monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.theme-choice:hover,
.theme-choice[aria-pressed='true'] {
  background: var(--gold-dim);
  color: var(--gold);
}

.theme-choice:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.page-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .theme-switch-label {
    display: none;
  }

  .theme-choice {
    padding: 6px;
    font-size: 7px;
  }
}
