:root {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

.casn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(67, 71, 79, 0.25);
  background: rgba(255, 255, 255, 0.98);
  color: #1f2937;
  padding: 0.45rem 0.75rem;
  border-radius: 9999px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.casn-theme-toggle-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.5rem;
}

.casn-theme-toggle:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.casn-theme-icon {
  font-size: 1rem;
}

@media (max-width: 640px) {
  .casn-theme-toggle {
    padding: 0.45rem;
  }

  .casn-theme-toggle .casn-theme-label {
    display: none;
  }
}

html.dark .casn-theme-toggle {
  background: rgba(17, 24, 39, 0.98);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.35);
}

html.dark body {
  background-color: #0b1220 !important;
  color: #e5e7eb !important;
}

html.dark body[class*="bg-gradient"] {
  background-image: none !important;
}

html.dark .bg-background,
html.dark .bg-surface,
html.dark .bg-surface-bright {
  background-color: #0b1220 !important;
}

html.dark .bg-white,
html.dark .bg-surface-container-lowest,
html.dark .bg-surface-container-low,
html.dark .bg-surface-container,
html.dark .bg-surface-container-high,
html.dark .bg-surface-container-highest {
  background-color: #111827 !important;
}

html.dark .bg-primary-fixed {
  background-color: rgba(37, 99, 235, 0.28) !important;
}

html.dark .bg-secondary-fixed {
  background-color: rgba(99, 102, 241, 0.28) !important;
}

html.dark .bg-tertiary-fixed {
  background-color: rgba(245, 158, 11, 0.28) !important;
}

html.dark [class*="bg-white/"],
html.dark [class*="bg-surface-container-low/"],
html.dark [class*="bg-surface-container/"],
html.dark [class*="bg-primary-fixed/"] {
  background-color: rgba(17, 24, 39, 0.85) !important;
}

html.dark [class*="bg-secondary-fixed/"] {
  background-color: rgba(67, 56, 202, 0.38) !important;
}

html.dark [class*="bg-tertiary-fixed/"] {
  background-color: rgba(180, 83, 9, 0.38) !important;
}

html.dark .text-on-surface,
html.dark .text-on-background,
html.dark .text-on-primary-fixed-variant,
html.dark .text-on-secondary-container,
html.dark .text-on-primary-fixed {
  color: #e5e7eb !important;
}

html.dark .text-on-surface-variant {
  color: #cbd5e1 !important;
}

html.dark .text-on-secondary-fixed-variant {
  color: #d8b4fe !important;
}

html.dark .text-on-tertiary-fixed-variant {
  color: #fdba74 !important;
}

html.dark [class*="text-slate-"],
html.dark [class*="text-gray-"] {
  color: #cbd5e1 !important;
}

html.dark .text-slate-400,
html.dark .text-slate-500,
html.dark .text-gray-400,
html.dark .text-gray-500 {
  color: #94a3b8 !important;
}

html.dark .text-red-500,
html.dark .text-red-600,
html.dark .text-red-700 {
  color: #f87171 !important;
}

html.dark .text-green-600,
html.dark .text-green-700,
html.dark .text-green-800 {
  color: #4ade80 !important;
}

html.dark .text-blue-600,
html.dark .text-blue-700,
html.dark .text-blue-800,
html.dark .text-blue-900 {
  color: #93c5fd !important;
}

html.dark .text-purple-600,
html.dark .text-purple-700 {
  color: #c4b5fd !important;
}

html.dark .text-orange-600,
html.dark .text-orange-700,
html.dark .text-orange-800 {
  color: #fdba74 !important;
}

html.dark .text-amber-500,
html.dark .text-amber-600,
html.dark .text-amber-700,
html.dark .text-amber-800,
html.dark .text-amber-900,
html.dark .text-yellow-500,
html.dark .text-yellow-600,
html.dark .text-yellow-700,
html.dark .text-yellow-800 {
  color: #fcd34d !important;
}

html.dark .text-primary {
  color: #93c5fd !important;
}

html.dark .text-secondary {
  color: #c4b5fd !important;
}

html.dark .text-tertiary {
  color: #fbbf24 !important;
}

html.dark .text-surface-tint {
  color: #93c5fd !important;
}

html.dark .bg-primary {
  background-color: #2563eb !important;
}

html.dark .bg-secondary {
  background-color: #7c3aed !important;
}

html.dark .bg-tertiary {
  background-color: #f59e0b !important;
}

html.dark .bg-gray-50,
html.dark .bg-gray-100,
html.dark .bg-slate-100,
html.dark .bg-slate-200 {
  background-color: rgba(148, 163, 184, 0.14) !important;
}

html.dark .bg-gray-800,
html.dark .bg-gray-900,
html.dark .bg-slate-900 {
  background-color: #0f172a !important;
}

html.dark .bg-blue-50,
html.dark .bg-blue-100 {
  background-color: rgba(59, 130, 246, 0.2) !important;
}

html.dark .bg-green-50,
html.dark .bg-green-100 {
  background-color: rgba(34, 197, 94, 0.2) !important;
}

html.dark .bg-red-50,
html.dark .bg-red-100 {
  background-color: rgba(239, 68, 68, 0.2) !important;
}

html.dark .bg-purple-50,
html.dark .bg-purple-100 {
  background-color: rgba(139, 92, 246, 0.22) !important;
}

html.dark .bg-orange-100,
html.dark .bg-amber-50,
html.dark .bg-amber-100,
html.dark .bg-yellow-50,
html.dark .bg-yellow-100,
html.dark .bg-yellow-200 {
  background-color: rgba(245, 158, 11, 0.24) !important;
}

html.dark .bg-blue-500,
html.dark .bg-blue-600 {
  background-color: #1d4ed8 !important;
}

html.dark .bg-green-500,
html.dark .bg-green-600 {
  background-color: #15803d !important;
}

html.dark .bg-red-500,
html.dark .bg-red-600 {
  background-color: #b91c1c !important;
}

html.dark .bg-purple-500,
html.dark .bg-purple-600 {
  background-color: #6d28d9 !important;
}

html.dark .bg-yellow-500 {
  background-color: #b45309 !important;
}

html.dark [class*="border-outline-variant"],
html.dark [class*="border-outline"],
html.dark [class*="border-surface-container"],
html.dark .border {
  border-color: rgba(148, 163, 184, 0.3) !important;
}

html.dark .border-blue-200,
html.dark .border-blue-500 {
  border-color: rgba(96, 165, 250, 0.5) !important;
}

html.dark .border-primary,
html.dark .border-primary-container,
html.dark .border-surface-tint {
  border-color: rgba(96, 165, 250, 0.55) !important;
}

html.dark .border-green-100,
html.dark .border-green-200,
html.dark .border-green-300,
html.dark .border-green-500 {
  border-color: rgba(74, 222, 128, 0.5) !important;
}

html.dark .border-red-200,
html.dark .border-red-300 {
  border-color: rgba(248, 113, 113, 0.45) !important;
}

html.dark .border-purple-500 {
  border-color: rgba(196, 181, 253, 0.5) !important;
}

html.dark .border-tertiary {
  border-color: rgba(251, 191, 36, 0.55) !important;
}

html.dark .border-orange-300,
html.dark .border-amber-200,
html.dark .border-amber-500,
html.dark .border-yellow-200,
html.dark .border-yellow-300,
html.dark .border-yellow-400,
html.dark .border-yellow-500 {
  border-color: rgba(251, 191, 36, 0.5) !important;
}

html.dark .border-gray-300,
html.dark .border-slate-300 {
  border-color: rgba(148, 163, 184, 0.35) !important;
}

html.dark [class*="shadow"] {
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.45) !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background-color: #0f172a !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  color: #e5e7eb !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #94a3b8 !important;
}

html.dark .ui-select {
  background-color: #0f172a !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M6%208L1%203h10z%22/%3E%3C/svg%3E") !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  color: #e5e7eb !important;
}

html.dark .ui-select:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25) !important;
}

html.dark .option-card:hover,
html.dark .option-card.selected,
html.dark .rank-row:hover,
html.dark .table-row:hover,
html.dark .table-row:nth-child(even),
html.dark .table-row:nth-child(even):hover {
  background: #1f2937 !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
}

html.dark .tab-active {
  border-bottom-color: #93c5fd !important;
  color: #93c5fd !important;
}

html.dark .podium-1 {
  background: linear-gradient(135deg, #854d0e 0%, #a16207 100%) !important;
}

html.dark .podium-2 {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%) !important;
}

html.dark .podium-3 {
  background: linear-gradient(135deg, #7c2d12 0%, #9a3412 100%) !important;
}

html.dark .from-slate-50 {
  --tw-gradient-from: #1e293b var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(30 41 59 / 0) var(--tw-gradient-to-position) !important;
}

html.dark .to-gray-50 {
  --tw-gradient-to: #111827 var(--tw-gradient-to-position) !important;
}

html.dark .to-indigo-50 {
  --tw-gradient-to: #0f172a var(--tw-gradient-to-position) !important;
}

html.dark .via-blue-50 {
  --tw-gradient-stops: var(--tw-gradient-from), rgba(37, 99, 235, 0.2) var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

html.dark .from-yellow-50 {
  --tw-gradient-from: rgba(146, 64, 14, 0.6) var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(146 64 14 / 0) var(--tw-gradient-to-position) !important;
}

html.dark .from-orange-50 {
  --tw-gradient-from: rgba(124, 45, 18, 0.65) var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(124 45 18 / 0) var(--tw-gradient-to-position) !important;
}

html.dark .to-amber-50 {
  --tw-gradient-to: rgba(120, 53, 15, 0.7) var(--tw-gradient-to-position) !important;
}

html.dark .from-amber-100 {
  --tw-gradient-from: rgba(146, 64, 14, 0.55) var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(146 64 14 / 0) var(--tw-gradient-to-position) !important;
}

html.dark .to-yellow-100 {
  --tw-gradient-to: rgba(146, 64, 14, 0.6) var(--tw-gradient-to-position) !important;
}
