/* Fox AI brand layer. Kept outside the application image for upgrade safety. */
:root,
:root [data-theme-preset],
:host {
  --background: #fffafb !important;
  --foreground: #261e23 !important;
  --card: #ffffff !important;
  --card-foreground: #261e23 !important;
  --popover: #ffffff !important;
  --popover-foreground: #261e23 !important;
  --primary: #cc356d !important;
  --primary-foreground: #ffffff !important;
  --secondary: #f2eafe !important;
  --secondary-foreground: #4b3268 !important;
  --muted: #f8eef2 !important;
  --muted-foreground: #776971 !important;
  --accent: #fbe8ef !important;
  --accent-foreground: #742d49 !important;
  --border: #ecdde4 !important;
  --input: #9f8592 !important;
  --ring: #cc356d !important;
  --chart-1: #cc356d !important;
  --chart-2: #8b5cf6 !important;
  --chart-3: #0891b2 !important;
  --chart-4: #d99235 !important;
  --chart-5: #22c55e !important;
  --sidebar: #fff7fa !important;
  --sidebar-foreground: #261e23 !important;
  --sidebar-primary: #cc356d !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #fbe8ef !important;
  --sidebar-accent-foreground: #742d49 !important;
  --sidebar-border: #ecdde4 !important;
  --sidebar-ring: #cc356d !important;
  --radius: 0.8125rem !important;
}

.dark,
.dark [data-theme-preset],
:host-context(.dark) {
  --background: #140f13 !important;
  --foreground: #fff7fa !important;
  --card: #21181f !important;
  --card-foreground: #fff7fa !important;
  --popover: #241a22 !important;
  --popover-foreground: #fff7fa !important;
  --primary: #ff8fba !important;
  --primary-foreground: #351020 !important;
  --secondary: #34263f !important;
  --secondary-foreground: #f4e9ff !important;
  --muted: #30242b !important;
  --muted-foreground: #c8bac2 !important;
  --accent: #3b2430 !important;
  --accent-foreground: #ffc6db !important;
  --border: #49343f !important;
  --input: #765a69 !important;
  --ring: #ff8fba !important;
  --sidebar: #191218 !important;
  --sidebar-foreground: #fff7fa !important;
  --sidebar-primary: #ff8fba !important;
  --sidebar-primary-foreground: #351020 !important;
  --sidebar-accent: #34242d !important;
  --sidebar-accent-foreground: #ffc6db !important;
  --sidebar-border: #49343f !important;
  --sidebar-ring: #ff8fba !important;
}

body {
  background-image: linear-gradient(180deg, rgb(220 71 125 / 0.035), transparent 24rem);
  background-attachment: fixed;
}

.dark body {
  background-image: linear-gradient(180deg, rgb(255 143 186 / 0.055), transparent 24rem);
}

::selection {
  color: #fff;
  background: #cc356d;
}

a,
button,
[role="button"] {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover,
[role="button"]:hover {
  box-shadow: 0 8px 22px rgb(173 45 94 / 0.12);
}

:where(a, button, input, textarea, select, [role="button"]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

label a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

[data-slot="card"] {
  box-shadow: 0 1px 2px rgb(91 43 62 / 0.025), 0 12px 30px rgb(91 43 62 / 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

[data-slot="card"]:hover {
  border-color: rgb(220 71 125 / 0.28);
  box-shadow: 0 14px 34px rgb(135 44 79 / 0.075);
  transform: translateY(-1px);
}

img[src*="fox-ai"] {
  filter: drop-shadow(0 4px 10px rgb(220 71 125 / 0.11));
}

/* The current New API home content is rendered inside a shadow root. */
.fox-home {
  background: linear-gradient(180deg, #fffafb 0%, #fff8fb 60%, #ffffff 100%) !important;
}

.fox-gradient {
  color: #cc356d !important;
  background: none !important;
  -webkit-text-fill-color: currentColor;
}

.fox-primary {
  background: #cc356d !important;
  box-shadow: 0 10px 24px rgb(173 45 94 / 0.16) !important;
}

.fox-primary:hover {
  box-shadow: 0 12px 28px rgb(173 45 94 / 0.2) !important;
}

.fox-secondary {
  border-color: #ecdde4 !important;
  background: #ffffff !important;
}

.fox-kicker {
  color: #cc356d !important;
  border-color: #f3bfd1 !important;
  background: #fff2f7 !important;
}

.fox-terminal {
  border-color: #ecdde4 !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 20px 54px rgb(91 43 62 / 0.1) !important;
}

.fox-card {
  border-color: #ecdde4 !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgb(91 43 62 / 0.04);
  backdrop-filter: none !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.fox-card:hover {
  border-color: rgb(220 71 125 / 0.28) !important;
  box-shadow: 0 12px 30px rgb(135 44 79 / 0.07);
  transform: translateY(-1px);
}

.fox-icon {
  color: #cc356d !important;
  background: #fcebf1 !important;
}

:host-context(.dark) .fox-home {
  background: linear-gradient(180deg, #140f13 0%, #181116 62%, #140f13 100%) !important;
}

:host-context(.dark) .fox-secondary,
:host-context(.dark) .fox-terminal,
:host-context(.dark) .fox-card {
  border-color: #49343f !important;
  background: #21181f !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Floating (scrolled) header: this fork adds the service-status and QQ-group
   chips, so the 52rem pill is too narrow and nav labels wrap onto two lines.
   Widen the pill and forbid wrapping inside it. */
header.fixed.top-0 > .pointer-events-auto.max-w-\[52rem\] {
  max-width: 68rem !important;
}

header.fixed.top-0 nav a,
header.fixed.top-0 nav button,
header.fixed.top-0 nav span {
  white-space: nowrap;
}

header.fixed.top-0 nav > div {
  flex-wrap: nowrap;
}
