/* Shared two-theme control */
html[data-color-theme="command"] {
  background: #08090a;
}

html[data-color-theme="command-light"] {
  background: #f4f4f1;
}

.theme-switcher {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  padding: 2px;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: var(--surface);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.theme-switcher button {
  min-width: 46px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: background-color 150ms ease-out, color 150ms ease-out, box-shadow 150ms ease-out;
}

.theme-switcher button:hover {
  color: var(--ink);
}

.theme-switcher button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* C-light — same tool hierarchy, warm daylight materials */
body[data-theme="command-light"] {
  color-scheme: light;
  --ground: #f4f4f1;
  --surface: #fcfcfa;
  --surface-raised: #eeeeea;
  --ink: #18191c;
  --muted: #6e737e;
  --faint: rgba(20, 22, 28, 0.1);
  --accent: #5e6ad2;
  --secondary: #59606d;
  --button-ink: #ffffff;
  --shadow: 0 1px 2px rgba(20, 22, 28, 0.08);
}

body[data-theme="command-light"]::before {
  background:
    radial-gradient(circle at 72% -12%, rgba(94, 106, 210, 0.065), transparent 48%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.7), transparent 70%);
}

body[data-theme="command-light"] .wordmark-mark {
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.32);
}

body[data-theme="command-light"] .search-form {
  border-color: rgba(20, 22, 28, 0.14);
  background: rgba(252, 252, 250, 0.92);
  box-shadow: 0 18px 70px rgba(30, 32, 38, 0.08);
}

body[data-theme="command-light"] .filters-panel,
body[data-theme="command-light"] .results-region {
  background: rgba(252, 252, 250, 0.86);
}

body[data-theme="command-light"] .filter-field select,
body[data-theme="command-light"] .tag-option,
body[data-theme="command-light"] .difficulty-label,
body[data-theme="command-light"] .tag-chip,
body[data-theme="command-light"] .problem-link {
  background: var(--surface-raised);
}

body[data-theme="command-light"] .filter-option:hover {
  background: rgba(20, 22, 28, 0.035);
}

body[data-theme="command-light"] .filter-option[aria-pressed="true"] {
  border-color: rgba(94, 106, 210, 0.42);
  background: rgba(94, 106, 210, 0.1);
}

body[data-theme="command-light"] .filter-option[aria-pressed="true"] .filter-option-count {
  border-color: rgba(94, 106, 210, 0.42);
  color: #4d58b9;
}

body[data-theme="command-light"] .active-filter {
  border-color: rgba(94, 106, 210, 0.32);
  background: rgba(94, 106, 210, 0.09);
  color: #4d58b9;
}

body[data-theme="command-light"] .active-filter:hover {
  border-color: rgba(94, 106, 210, 0.58);
  background: rgba(94, 106, 210, 0.14);
}

body[data-theme="command-light"] .problem-card:hover {
  border-color: rgba(20, 22, 28, 0.17);
  background: #f8f8f5;
}

body[data-theme="command-light"] .problem-link:hover {
  border-color: rgba(20, 22, 28, 0.2);
  background: #e7e7e2;
  color: var(--ink);
}

body[data-theme="command-light"] .problem-link.hydro-link {
  border-color: rgba(94, 106, 210, 0.42);
  background: rgba(94, 106, 210, 0.09);
  color: #4d58b9;
}

body[data-theme="command-light"] .problem-link.hydro-link:hover {
  background: var(--accent);
  color: #ffffff;
}

body[data-theme="command-light"] .filter-mobile-toggle.has-filters span:last-child {
  border-color: rgba(94, 106, 210, 0.44);
  background: rgba(94, 106, 210, 0.1);
  color: #4d58b9;
}

body[data-theme="command-light"] .filters-panel,
body[data-theme="command-light"] .difficulty-options {
  scrollbar-color: rgba(20, 22, 28, 0.2) transparent;
}

@media (max-width: 850px) {
  body[data-theme="command-light"] .filters-panel {
    background: #fcfcfa;
    box-shadow: 28px 0 90px rgba(20, 22, 28, 0.18);
  }

  body[data-theme="command-light"] .filter-heading {
    background: rgba(252, 252, 250, 0.96);
  }
}

@media (max-width: 560px) {
  .theme-switcher button {
    min-width: 42px;
    padding-inline: 6px;
  }
}
