/* Xianfeng · warm neutral UI, 2026-11-27.
   Load after the existing mascot/community styles. Layout, data and state
   classes remain owned by the application; this sheet changes presentation. */
html:root,
html:root[data-mascot] {
  --background: #f7f5f0 !important;
  --foreground: #302e28 !important;
  --card: #fffefa !important;
  --card-foreground: #302e28 !important;
  --popover: #fffefa !important;
  --popover-foreground: #302e28 !important;
  --primary: #383229 !important;
  --primary-foreground: #fffdf8 !important;
  --secondary: #eee9df !important;
  --secondary-foreground: #504535 !important;
  --accent: #eee8dc !important;
  --accent-foreground: #5b4830 !important;
  --muted: #f0ede6 !important;
  --muted-foreground: #756f63 !important;
  --border: #e4dfd4 !important;
  --input: #d8d1c5 !important;
  --ring: #947449 !important;
  --sidebar: #f5f2eb !important;
  --sidebar-foreground: #4d473d !important;
  --sidebar-primary: #383229 !important;
  --sidebar-primary-foreground: #fffdf8 !important;
  --sidebar-accent: #eae3d6 !important;
  --sidebar-accent-foreground: #493a26 !important;
  --sidebar-border: #e4dfd4 !important;
  --sidebar-ring: #947449 !important;
  --chart-1: #93734a !important;
  --chart-2: #738575 !important;
  --chart-3: #767d90 !important;
  --chart-4: #b08b64 !important;
  --chart-5: #9d7678 !important;
  --overview-accent-1: #93734a !important;
  --overview-accent-2: #738575 !important;
  --overview-accent-3: #a08b70 !important;
  --xf-ui-shadow: 0 2px 8px rgb(55 45 28 / 3%);
  --xf-ui-elevated: 0 12px 36px rgb(55 45 28 / 10%);
}

html:root.dark,
html:root.dark[data-mascot] {
  --background: #1d1c19 !important;
  --foreground: #eee9de !important;
  --card: #25231f !important;
  --card-foreground: #eee9de !important;
  --popover: #2b2823 !important;
  --popover-foreground: #eee9de !important;
  --primary: #dfc7a0 !important;
  --primary-foreground: #2b241a !important;
  --secondary: #353027 !important;
  --secondary-foreground: #e5d5bd !important;
  --accent: #3b3328 !important;
  --accent-foreground: #ebd2ad !important;
  --muted: #2d2a24 !important;
  --muted-foreground: #b2a99a !important;
  --border: #403a31 !important;
  --input: #534a3e !important;
  --ring: #c5a474 !important;
  --sidebar: #211f1b !important;
  --sidebar-foreground: #dbd3c5 !important;
  --sidebar-primary: #dfc7a0 !important;
  --sidebar-primary-foreground: #2b241a !important;
  --sidebar-accent: #3b3328 !important;
  --sidebar-accent-foreground: #ebd2ad !important;
  --sidebar-border: #403a31 !important;
  --sidebar-ring: #c5a474 !important;
  --chart-1: #d6b27f !important;
  --chart-2: #a2b6a3 !important;
  --chart-3: #a8b0c9 !important;
  --chart-4: #c99f77 !important;
  --chart-5: #bd9699 !important;
  --overview-accent-1: #c4a374 !important;
  --overview-accent-2: #96ac98 !important;
  --overview-accent-3: #b7a186 !important;
  --xf-ui-shadow: 0 2px 8px rgb(0 0 0 / 8%);
  --xf-ui-elevated: 0 12px 36px rgb(0 0 0 / 24%);
}

body { -webkit-font-smoothing: antialiased; }
/* Restore the application's own navigation symbols. The companion remains
   available; menu icons no longer repeat animated character artwork. */
html:root svg[data-mascot-icon],
html:root svg[data-mascot-icon].is-awake {
  background: none !important;
  box-shadow: none !important;
  filter: none !important;
  animation: none !important;
  scale: 1 !important;
  rotate: 0deg !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  max-width: 24px;
  max-height: 24px;
  overflow: hidden !important;
  pointer-events: none !important;
  will-change: auto;
}
html:root svg[data-mascot-icon] :is(path, circle, rect, line, polyline, polygon, ellipse, use, image) {
  stroke: currentColor !important;
  fill: none !important;
  opacity: 1 !important;
}
html:root svg[data-mascot-icon] [fill="currentColor"] { fill: currentColor !important; }
html header.sticky {
  background: color-mix(in srgb, var(--background) 96%, transparent) !important;
  border-bottom-color: var(--border) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
html[data-mascot="skip"] header a[href="/"] {
  color: var(--foreground) !important;
  text-shadow: none;
}
html [data-sidebar="sidebar"] {
  background: var(--sidebar) !important;
  border-color: var(--sidebar-border) !important;
}
html [data-sidebar="menu-button"].active,
html [data-sidebar="menu-button"][data-active="true"] {
  box-shadow: inset 2px 0 0 var(--ring);
}
html button.bg-primary,
html a.bg-primary,
html [data-slot="button"].bg-primary {
  box-shadow: none;
}
html .bg-card.rounded-2xl {
  border-color: var(--border);
  border-radius: 16px;
  box-shadow: var(--xf-ui-shadow);
}
html [data-slot="table-header"] {
  background: var(--muted);
}
html [data-slot="table-head"] {
  color: var(--muted-foreground);
  font-weight: 600;
}
html [data-slot="input"],
html [data-slot="textarea"],
html [data-slot="select-trigger"] {
  border-color: var(--input);
  box-shadow: none;
}
html [data-slot="dialog-content"],
html [data-slot="dropdown-menu-content"],
html [data-slot="popover-content"] {
  box-shadow: var(--xf-ui-elevated);
}
/* The public model gallery paints its decorative glow with inline colors. */
html .pointer-events-none.absolute.inset-x-0[aria-hidden="true"][style*="radial-gradient"] {
  background: radial-gradient(60% 55% at 50% 0%, color-mix(in srgb, var(--ring) 28%, transparent), transparent 80%) !important;
}

/* Existing community controls retain their mobile placement and QR behavior. */
html:root .xf-community-link,
html:root .xf-model-shortcut {
  color: var(--foreground);
  border-color: var(--border);
  background: var(--card);
  font-weight: 550;
}
html:root .xf-community-link:hover,
html:root .xf-model-shortcut:hover {
  background: var(--accent);
  border-color: var(--input);
}
html:root .xf-community-link:focus-visible,
html:root .xf-model-shortcut:focus-visible,
html:root .xf-telegram-qr-close:focus-visible,
html:root .xf-telegram-qr-save:focus-visible {
  outline-color: var(--ring);
}
html:root .xf-telegram-qr {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--xf-ui-elevated);
}
html:root .xf-telegram-qr::backdrop { background: rgb(34 29 22 / 55%); }
html:root .xf-telegram-qr-hint { color: var(--muted-foreground); }
html:root .xf-telegram-qr-close { background: var(--muted); color: var(--foreground); }
html:root .xf-telegram-qr-close:hover { background: var(--accent); }
html:root .xf-telegram-qr-save { background: var(--primary); color: var(--primary-foreground); }
html:root .xf-telegram-qr-save:hover { background: color-mix(in srgb, var(--primary) 87%, var(--card)); }
html .mascot-switcher__btn {
  background: var(--card);
  border-color: var(--border);
  box-shadow: none;
}
html .mascot-switcher__btn:hover {
  background: var(--accent);
  border-color: var(--input);
  box-shadow: var(--xf-ui-shadow);
}

/* The static documentation uses a separate token vocabulary. data-char is
   its existing root marker; these rules never change the React token types. */
html:root[data-char] {
  --bg: #f7f5f0;
  --surface: #fffefa;
  --surface-2: #f4f0e8;
  --ink: #302e28;
  --ink-2: #565044;
  --muted: #756f63 !important;
  --line: #e4dfd4;
  --line-2: #d8d1c5;
  --accent: #796141 !important;
  --accent-2: #4f4030;
  --accent-text: #715a3a;
  --accent-soft: #eee8dc;
  --accent-line: #dacdb8;
  --grad: linear-gradient(135deg, #92754c, #51432f);
  --code-bg: #292720;
  --code-ink: #eee9df;
  --shadow: var(--xf-ui-shadow);
  --r: 14px;
  --r-lg: 18px;
}
html:root.dark[data-char] {
  --bg: #1d1c19;
  --surface: #25231f;
  --surface-2: #2d2922;
  --ink: #eee9de;
  --ink-2: #d0c6b5;
  --muted: #b2a99a !important;
  --line: #403a31;
  --line-2: #534a3e;
  --accent: #c8a778 !important;
  --accent-2: #b79565;
  --accent-text: #dfc7a0;
  --accent-soft: #3b3328;
  --accent-line: #68553a;
  --grad: linear-gradient(135deg, #dfc7a0, #b79565);
  --code-bg: #171613;
  --code-ink: #eee9df;
}
html[data-char] .hero { background: var(--surface); }
html[data-char] .topbar {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}
html[data-char] .copy-docs-banner {
  border-width: 1px;
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
html[data-char] .copy-docs-button {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: none;
}
html[data-char] .copy-docs-button:hover {
  background: color-mix(in srgb, var(--primary) 87%, var(--surface));
}
html[data-char] .copy-docs-button:focus-visible,
html[data-char] .copy-docs-dialog button:focus-visible,
html[data-char] .copy-docs-dialog textarea:focus-visible { outline-color: var(--ring); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
