html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (max-width: 1024px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

html.dark {
  color-scheme: dark;
}

html.dark body {
  background-color: #0b1220;
  color: #e8eef7;
}

html.dark .bg-white,
html.dark .bg-white\/90,
html.dark [class*="bg-white/"] {
  background-color: #151c2c !important;
}

html.dark .bg-gray-50,
html.dark .hover\:bg-gray-50:hover,
html.dark .bg-slate-50,
html.dark .hover\:bg-slate-50:hover {
  background-color: #0b1220 !important;
}

html.dark .hover\:bg-white:hover {
  background-color: #1c2436 !important;
}

html.dark .bg-gray-100,
html.dark .bg-slate-100,
html.dark .hover\:bg-gray-100:hover,
html.dark .hover\:bg-slate-100:hover,
html.dark .hover\:bg-slate-200:hover {
  background-color: #1c2436 !important;
}

html.dark .bg-gray-200,
html.dark .bg-slate-200 {
  background-color: #243044 !important;
}

html.dark .text-gray-900,
html.dark .text-slate-900,
html.dark .text-gray-800,
html.dark .text-slate-800 {
  color: #f1f5f9 !important;
}

html.dark .text-gray-700,
html.dark .text-slate-700 {
  color: #d5deea !important;
}

html.dark .text-gray-600,
html.dark .text-slate-600,
html.dark .text-gray-500,
html.dark .text-slate-500 {
  color: #9aa6b8 !important;
}

html.dark .text-gray-400,
html.dark .text-slate-400,
html.dark .text-slate-500,
html.dark .hover\:text-gray-600:hover,
html.dark .hover\:text-gray-700:hover {
  color: #7d8a9c !important;
}

html.dark [class*="text-[#104878]"] {
  color: #ffffff !important;
}

html.dark img[src*="/static/logo"] {
  filter: brightness(0) invert(1);
}

html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300,
html.dark .border-slate-200,
html.dark .border-slate-300,
html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #2a3448 !important;
}

html.dark .border-indigo-100,
html.dark .border-indigo-200,
html.dark .border-emerald-100,
html.dark .border-emerald-200 {
  border-color: #312e81 !important;
}

html.dark .border-emerald-100,
html.dark .border-emerald-200 {
  border-color: #14532d !important;
}

html.dark .bg-indigo-50,
html.dark .hover\:bg-indigo-50:hover,
html.dark .hover\:bg-indigo-100:hover {
  background-color: #1e1b4b !important;
}

html.dark .text-indigo-600,
html.dark .text-indigo-700,
html.dark .text-indigo-800,
html.dark .text-indigo-900,
html.dark .hover\:text-indigo-600:hover,
html.dark .hover\:text-indigo-700:hover {
  color: #c7d2fe !important;
}

html.dark .bg-emerald-50,
html.dark .hover\:bg-emerald-50:hover,
html.dark .hover\:bg-emerald-100:hover {
  background-color: #052e24 !important;
}

html.dark .text-emerald-600,
html.dark .text-emerald-700,
html.dark .text-emerald-800,
html.dark .hover\:text-emerald-700:hover,
html.dark .hover\:text-emerald-800:hover {
  color: #6ee7b7 !important;
}

html.dark .bg-amber-50,
html.dark .hover\:bg-amber-50:hover,
html.dark .hover\:bg-amber-100:hover {
  background-color: #3b2508 !important;
}

html.dark .text-amber-700 {
  color: #fcd34d !important;
}

html.dark .bg-rose-50,
html.dark .hover\:bg-rose-50:hover,
html.dark .hover\:bg-rose-100:hover {
  background-color: #3f1219 !important;
}

html.dark .text-rose-500,
html.dark .text-rose-600 {
  color: #fda4af !important;
}

html.dark .border-rose-100 {
  border-color: #7f1d1d !important;
}

html.dark .bg-blue-50,
html.dark .bg-indigo-100 {
  background-color: #172554 !important;
}

html.dark .text-blue-600,
html.dark .text-blue-700,
html.dark .text-blue-800,
html.dark .hover\:text-blue-700:hover {
  color: #93c5fd !important;
}

html.dark .bg-red-50,
html.dark .hover\:bg-red-100:hover {
  background-color: #3f1219 !important;
}

html.dark .bg-green-50 {
  background-color: #052e1c !important;
}

html.dark .text-red-800,
html.dark .text-red-700,
html.dark .text-green-700 {
  color: #fecaca !important;
}

html.dark .text-green-700,
html.dark .text-green-800 {
  color: #86efac !important;
}

html.dark .text-indigo-500 {
  color: #a5b4fc !important;
}

html.dark .border-amber-100,
html.dark .border-amber-200 {
  border-color: #7c4a12 !important;
}

html.dark .border-green-200 {
  border-color: #14532d !important;
}

html.dark .border-red-200,
html.dark .border-blue-200 {
  border-color: #3f3f6e !important;
}

html.dark input:not([type="checkbox"]):not([type="radio"]),
html.dark textarea,
html.dark select {
  background-color: #1c2436 !important;
  color: #e8eef7 !important;
  border-color: #2a3448 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #7d8a9c !important;
}

html.dark .shadow-sm,
html.dark .shadow-lg,
html.dark .shadow-2xl {
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.35) !important;
}

html.dark .prose {
  color: #c9d4e3;
}

html.dark .theme-toggle {
  background: #1c2436;
  color: #e8eef7;
  border: 1px solid #2a3448;
}

.theme-toggle {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.16);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.theme-toggle.is-spin svg {
  animation: theme-icon-spin 0.45s ease;
}

@keyframes theme-icon-spin {
  from {
    transform: rotate(-80deg) scale(0.55);
    opacity: 0.35;
  }
  to {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
  isolation: isolate;
}

::view-transition-old(root) {
  animation: none;
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
  animation: theme-page-reveal 1s cubic-bezier(0.37, 0.02, 0.18, 1) both;
}

@keyframes theme-page-reveal {
  from {
    clip-path: circle(0% at calc(100% - 2.375rem) calc(100% - 2.375rem));
  }
  to {
    clip-path: circle(160% at calc(100% - 2.375rem) calc(100% - 2.375rem));
  }
}

.master-menu {
  position: relative;
  isolation: isolate;
  background-color: #ffffff !important;
}

.master-menu > * {
  position: relative;
  z-index: 1;
}

.master-menu::before,
.master-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.master-menu::before {
  background: linear-gradient(to bottom right, #e0e7ff 0%, #ffffff 48%, #d1fae5 100%);
  opacity: 1;
}

.master-menu::after {
  background:
    radial-gradient(120% 90% at 0% 0%, rgb(99 102 241 / 0.7) 0%, transparent 58%),
    radial-gradient(110% 80% at 100% 120%, rgb(16 185 129 / 0.58) 0%, transparent 52%),
    linear-gradient(to bottom right, #312e81 0%, #1e293b 46%, #065f46 100%);
  opacity: 0;
}

.master-menu-head {
  background: none;
}

html.dark .master-menu {
  background-color: #1e293b !important;
}

html.dark .master-menu::before {
  opacity: 0;
}

html.dark .master-menu::after {
  opacity: 1;
}

html.theme-settle,
html.theme-settle body,
html.theme-settle header,
html.theme-settle section,
html.theme-settle article,
html.theme-settle main,
html.theme-settle input,
html.theme-settle textarea,
html.theme-settle select,
html.theme-settle button,
html.theme-settle a,
html.theme-settle .theme-toggle,
html.theme-settle .category-card,
html.theme-settle .category-card .category-name,
html.theme-settle .category-card .category-icon,
html.theme-settle .master-menu,
html.theme-settle .master-menu a,
html.theme-settle .master-menu button {
  transition:
    background-color 1s cubic-bezier(0.37, 0.02, 0.18, 1),
    color 1s cubic-bezier(0.37, 0.02, 0.18, 1),
    border-color 1s cubic-bezier(0.37, 0.02, 0.18, 1),
    box-shadow 1s cubic-bezier(0.37, 0.02, 0.18, 1) !important;
}

html.theme-settle .master-menu::before,
html.theme-settle .master-menu::after {
  transition: opacity 1s cubic-bezier(0.37, 0.02, 0.18, 1) !important;
}

html.theme-settle img[src*="/static/logo"] {
  transition: filter 1s cubic-bezier(0.37, 0.02, 0.18, 1) !important;
}

html.dark .category-card {
  --sec-soft: color-mix(in srgb, var(--sec) 28%, #151c2c);
  --sec-mid: color-mix(in srgb, var(--sec) 14%, #151c2c);
  background:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--sec) 34%, #151c2c) 0%, transparent 58%),
    linear-gradient(165deg, var(--sec-soft) 0%, var(--sec-mid) 42%, #151c2c 100%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 18%, var(--sec)),
    0 1px 2px rgb(0 0 0 / 0.25);
}

html.dark .category-card::before {
  background: radial-gradient(80% 55% at 50% 38%, rgb(255 255 255 / 0.08) 0%, transparent 70%);
}

html.dark .category-card .category-name {
  color: #e8eef7;
}

html.dark .category-card .category-icon {
  background:
    radial-gradient(circle at 35% 30%, color-mix(in srgb, #fff 18%, #1c2436) 0%, color-mix(in srgb, var(--sec) 22%, #1c2436) 100%);
}

html.dark .from-indigo-50 {
  --tw-gradient-from: #1e1b4b var(--tw-gradient-from-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
html.dark .via-white {
  --tw-gradient-stops: var(--tw-gradient-from), #151c2c var(--tw-gradient-via-position), var(--tw-gradient-to);
}
html.dark .to-emerald-50 {
  --tw-gradient-to: #052e24 var(--tw-gradient-to-position);
}

html.dark .from-amber-50 {
  --tw-gradient-from: #3b2508 var(--tw-gradient-from-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
html.dark .to-orange-50 {
  --tw-gradient-to: #3b1c0a var(--tw-gradient-to-position);
}
html.dark .from-purple-50 {
  --tw-gradient-from: #2e1065 var(--tw-gradient-from-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
html.dark .to-violet-50 {
  --tw-gradient-to: #1e1b4b var(--tw-gradient-to-position);
}

html.dark .text-amber-900,
html.dark .text-amber-800,
html.dark .text-amber-600 {
  color: #fcd34d !important;
}

html.dark .text-purple-900,
html.dark .text-purple-800,
html.dark .text-violet-800 {
  color: #ddd6fe !important;
}

html.dark .border-amber-400,
html.dark .border-amber-300 {
  border-color: #d97706 !important;
}

html.dark .border-purple-300 {
  border-color: #7c3aed !important;
}

html.dark .hover\:text-indigo-600:hover,
html.dark .hover\:text-blue-800:hover {
  color: #c7d2fe !important;
}

html.dark .support-shell {
  background: #151c2c !important;
}

html.dark #chat-messages-container .bg-gray-100 {
  background-color: #243044 !important;
}
