/* compound.care — shared theme tokens (dark default, light via html[data-theme="light"]). */
:root {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #172033;
  --text: #e2e8f0;
  --dim: #94a3b8;
  --accent: #3b82f6;
  --accent2: #2563eb;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --border: #334155;
  --row: #1b2740;
  --topbar-bg: rgba(15, 23, 42, 0.85);
  --card-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  --chip-bg: rgba(59, 130, 246, 0.14);
  --chip-border: rgba(59, 130, 246, 0.4);
  --chip-text: #bfdbfe;
  --msg-ok-bg: rgba(16, 185, 129, 0.12);
  --msg-ok-text: #a7f3d0;
  --msg-err-bg: rgba(239, 68, 68, 0.12);
  --msg-err-text: #fecaca;
  --msg-warn-bg: rgba(245, 158, 11, 0.12);
  --msg-warn-text: #fde68a;
  --msg-info-bg: rgba(59, 130, 246, 0.1);
  --msg-info-text: #bfdbfe;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --text: #0f172a;
  --dim: #64748b;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --border: #e2e8f0;
  --row: #f1f5f9;
  --topbar-bg: rgba(248, 250, 252, 0.92);
  --card-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --chip-bg: rgba(37, 99, 235, 0.08);
  --chip-border: rgba(37, 99, 235, 0.25);
  --chip-text: #1d4ed8;
  --msg-ok-bg: rgba(5, 150, 105, 0.08);
  --msg-ok-text: #047857;
  --msg-err-bg: rgba(220, 38, 38, 0.08);
  --msg-err-text: #b91c1c;
  --msg-warn-bg: rgba(217, 119, 6, 0.1);
  --msg-warn-text: #b45309;
  --msg-info-bg: rgba(37, 99, 235, 0.08);
  --msg-info-text: #1d4ed8;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--dim);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}
.theme-toggle .theme-icon {
  font-size: 0.95rem;
  line-height: 1;
}
.theme-toggle .theme-label {
  font-weight: 500;
}
.theme-toggle-floating {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

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

[data-theme="light"] .b-gray { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
[data-theme="light"] .b-blue { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; border-color: #3b82f6; }
[data-theme="light"] .b-purple { background: rgba(126, 34, 206, 0.08); color: #7e22ce; border-color: #a855f7; }
[data-theme="light"] .b-amber { background: rgba(217, 119, 6, 0.1); color: #b45309; border-color: #f59e0b; }
[data-theme="light"] .b-green { background: rgba(5, 150, 105, 0.1); color: #047857; border-color: #10b981; }
[data-theme="light"] .b-red { background: rgba(220, 38, 38, 0.08); color: #b91c1c; border-color: #ef4444; }

[data-theme="light"] .msg.ok,
[data-theme="light"] .err.ok { background: var(--msg-ok-bg); color: var(--msg-ok-text); }
[data-theme="light"] .msg.err,
[data-theme="light"] .err { background: var(--msg-err-bg); color: var(--msg-err-text); }
[data-theme="light"] .msg.warn { background: var(--msg-warn-bg); color: var(--msg-warn-text); }
[data-theme="light"] .msg.info,
[data-theme="light"] .note { background: var(--msg-info-bg); color: var(--msg-info-text); }

[data-theme="light"] .navgrp.haspage .grphead { color: #2563eb; }
[data-theme="light"] .navgrp.nav-major.haspage .grphead { color: #0f172a; }
[data-theme="light"] .chip { background: var(--chip-bg); border-color: var(--chip-border); color: var(--chip-text); }
[data-theme="light"] .chip:hover { background: rgba(37, 99, 235, 0.16); color: #1e40af; }
[data-theme="light"] .btn-danger { color: #b91c1c; }
[data-theme="light"] .avail-ok { color: #047857; }
[data-theme="light"] .avail-no { color: #b91c1c; }
[data-theme="light"] .pill { color: var(--dim); }
