/* ============================================================
   New API · 桌面伙伴主题
   Injected site-wide through nginx sub_filter.
   ============================================================ */

html[data-mascot="deepseek"] {
  --primary: #1e63ff !important;
  --primary-foreground: #ffffff !important;
  --secondary: #e6efff !important;
  --secondary-foreground: #0e4aa8 !important;
  --accent: #dbe9ff !important;
  --accent-foreground: #0b3f9e !important;
  --background: #f4f8ff !important;
  --foreground: #081a33 !important;
  --card: #ffffff !important;
  --card-foreground: #081a33 !important;
  --popover: #ffffff !important;
  --popover-foreground: #081a33 !important;
  --muted: #eaf2ff !important;
  --muted-foreground: #5a6f8f !important;
  --border: #d5e3f7 !important;
  --input: #d5e3f7 !important;
  --ring: #2f7cf6 !important;
  --sidebar: #f8fbff !important;
  --sidebar-foreground: #081a33 !important;
  --sidebar-primary: #1e63ff !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #e3efff !important;
  --sidebar-accent-foreground: #0b3f9e !important;
  --sidebar-border: #d5e3f7 !important;
  --sidebar-ring: #2f7cf6 !important;
  --chart-1: #2f7cf6 !important;
  --chart-2: #18b6c9 !important;
  --chart-3: #6d8cff !important;
  --chart-4: #9b7bff !important;
  --chart-5: #1fae72 !important;
  --overview-accent-1: #2f7cf6 !important;
  --overview-accent-2: #18b6c9 !important;
  --overview-accent-3: #6d8cff !important;
  --mascot-primary: #1e63ff;
  --mascot-soft: #dbe9ff;
  --mascot-glow: rgba(30, 99, 255, 0.42);
  --mascot-bubble-bg: rgba(7, 23, 48, 0.95);
  --mascot-bubble-fg: #eaf3ff;
  --mascot-bubble-border: rgba(120, 180, 255, 0.4);
  --mascot-static: url("/art/mascot/static_deepseek.webp");
  --mascot-action: url("/art/mascot/action_deepseek_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_deepseek.webp");
}

html.dark[data-mascot="deepseek"] {
  --primary: #5b93ff !important;
  --primary-foreground: #06122a !important;
  --secondary: #10233d !important;
  --secondary-foreground: #bcd6ff !important;
  --accent: #12305a !important;
  --accent-foreground: #dbe9ff !important;
  --background: #06101f !important;
  --foreground: #e8f2ff !important;
  --card: #0b1a30 !important;
  --card-foreground: #e8f2ff !important;
  --popover: #0b1a30 !important;
  --popover-foreground: #e8f2ff !important;
  --muted: #10233d !important;
  --muted-foreground: #94a9c6 !important;
  --border: #1b3352 !important;
  --input: #1b3352 !important;
  --ring: #5b93ff !important;
  --sidebar: #081426 !important;
  --sidebar-foreground: #e8f2ff !important;
  --sidebar-primary: #5b93ff !important;
  --sidebar-primary-foreground: #06122a !important;
  --sidebar-accent: #11305a !important;
  --sidebar-accent-foreground: #dbe9ff !important;
  --sidebar-border: #1b3352 !important;
  --sidebar-ring: #5b93ff !important;
  --chart-1: #6ea4ff !important;
  --chart-2: #34d3e0 !important;
  --chart-3: #8fa8ff !important;
  --chart-4: #b69cff !important;
  --chart-5: #4ade80 !important;
  --overview-accent-1: #6ea4ff !important;
  --overview-accent-2: #34d3e0 !important;
  --overview-accent-3: #8fa8ff !important;
  --mascot-primary: #5b93ff;
  --mascot-soft: #12305a;
  --mascot-glow: rgba(91, 147, 255, 0.55);
  --mascot-bubble-bg: rgba(8, 24, 48, 0.96);
  --mascot-bubble-fg: #eaf3ff;
  --mascot-bubble-border: rgba(110, 164, 255, 0.45);
  --mascot-static: url("/art/mascot/static_deepseek.webp");
  --mascot-action: url("/art/mascot/action_deepseek_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_deepseek.webp");
}

html[data-mascot="qwen"] {
  --primary: #6a5af9 !important;
  --primary-foreground: #ffffff !important;
  --secondary: #ece8ff !important;
  --secondary-foreground: #4b3fbf !important;
  --accent: #e4dfff !important;
  --accent-foreground: #4b3fbf !important;
  --background: #f7f6ff !important;
  --foreground: #16132e !important;
  --card: #ffffff !important;
  --card-foreground: #16132e !important;
  --popover: #ffffff !important;
  --popover-foreground: #16132e !important;
  --muted: #f0edff !important;
  --muted-foreground: #6b6588 !important;
  --border: #e1dcf7 !important;
  --input: #e1dcf7 !important;
  --ring: #7b6bff !important;
  --sidebar: #faf9ff !important;
  --sidebar-foreground: #16132e !important;
  --sidebar-primary: #6a5af9 !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #e8e3ff !important;
  --sidebar-accent-foreground: #4b3fbf !important;
  --sidebar-border: #e1dcf7 !important;
  --sidebar-ring: #7b6bff !important;
  --chart-1: #6a5af9 !important;
  --chart-2: #8f6bff !important;
  --chart-3: #b06bff !important;
  --chart-4: #d17bff !important;
  --chart-5: #3fb6ff !important;
  --overview-accent-1: #6a5af9 !important;
  --overview-accent-2: #8f6bff !important;
  --overview-accent-3: #b06bff !important;
  --mascot-primary: #6a5af9;
  --mascot-soft: #e4dfff;
  --mascot-glow: rgba(106, 90, 249, 0.42);
  --mascot-bubble-bg: rgba(22, 16, 54, 0.95);
  --mascot-bubble-fg: #f2efff;
  --mascot-bubble-border: rgba(155, 140, 255, 0.45);
  --mascot-static: url("/art/mascot/static_qwen.webp");
  --mascot-action: url("/art/mascot/action_qwen_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_qwen.webp");
}

html.dark[data-mascot="qwen"] {
  --primary: #9b8cff !important;
  --primary-foreground: #140f2e !important;
  --secondary: #1c1838 !important;
  --secondary-foreground: #d8d0ff !important;
  --accent: #241d4a !important;
  --accent-foreground: #e8e2ff !important;
  --background: #0b0918 !important;
  --foreground: #f0edff !important;
  --card: #14112a !important;
  --card-foreground: #f0edff !important;
  --popover: #14112a !important;
  --popover-foreground: #f0edff !important;
  --muted: #1c1838 !important;
  --muted-foreground: #a9a1c9 !important;
  --border: #2b2552 !important;
  --input: #2b2552 !important;
  --ring: #9b8cff !important;
  --sidebar: #0e0b20 !important;
  --sidebar-foreground: #f0edff !important;
  --sidebar-primary: #9b8cff !important;
  --sidebar-primary-foreground: #140f2e !important;
  --sidebar-accent: #241d4a !important;
  --sidebar-accent-foreground: #e8e2ff !important;
  --sidebar-border: #2b2552 !important;
  --sidebar-ring: #9b8cff !important;
  --chart-1: #9b8cff !important;
  --chart-2: #c084fc !important;
  --chart-3: #f0abfc !important;
  --chart-4: #7dd3fc !important;
  --chart-5: #34d399 !important;
  --overview-accent-1: #9b8cff !important;
  --overview-accent-2: #c084fc !important;
  --overview-accent-3: #7dd3fc !important;
  --mascot-primary: #9b8cff;
  --mascot-soft: #241d4a;
  --mascot-glow: rgba(155, 140, 255, 0.55);
  --mascot-bubble-bg: rgba(20, 16, 44, 0.96);
  --mascot-bubble-fg: #f2efff;
  --mascot-bubble-border: rgba(155, 140, 255, 0.5);
  --mascot-static: url("/art/mascot/static_qwen.webp");
  --mascot-action: url("/art/mascot/action_qwen_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_qwen.webp");
}

html[data-mascot="gpt"] {
  --primary: #7c68c9 !important;
  --primary-foreground: #ffffff !important;
  --secondary: #eeeaf7 !important;
  --secondary-foreground: #5b4a9c !important;
  --accent: #e9e3f7 !important;
  --accent-foreground: #5b4a9c !important;
  --background: #f8f7fb !important;
  --foreground: #1c1826 !important;
  --card: #ffffff !important;
  --card-foreground: #1c1826 !important;
  --popover: #ffffff !important;
  --popover-foreground: #1c1826 !important;
  --muted: #f1eff6 !important;
  --muted-foreground: #6f6a7d !important;
  --border: #e5e1ee !important;
  --input: #e5e1ee !important;
  --ring: #8f7bd8 !important;
  --sidebar: #faf9fd !important;
  --sidebar-foreground: #1c1826 !important;
  --sidebar-primary: #7c68c9 !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #ede7f8 !important;
  --sidebar-accent-foreground: #5b4a9c !important;
  --sidebar-border: #e5e1ee !important;
  --sidebar-ring: #8f7bd8 !important;
  --chart-1: #8f7bd8 !important;
  --chart-2: #b9a7f0 !important;
  --chart-3: #d8c7ff !important;
  --chart-4: #9aa7c7 !important;
  --chart-5: #c0c8d8 !important;
  --overview-accent-1: #8f7bd8 !important;
  --overview-accent-2: #b9a7f0 !important;
  --overview-accent-3: #9aa7c7 !important;
  --mascot-primary: #7c68c9;
  --mascot-soft: #e9e3f7;
  --mascot-glow: rgba(124, 104, 201, 0.42);
  --mascot-outline: rgba(72, 48, 118, 0.72);
  --mascot-bubble-bg: rgba(32, 26, 52, 0.95);
  --mascot-bubble-fg: #f6f2ff;
  --mascot-bubble-border: rgba(185, 167, 240, 0.55);
  --mascot-static: url("/art/mascot/static_gpt.webp");
  --mascot-action: url("/art/mascot/action_gpt_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_gpt.webp");
}

html.dark[data-mascot="gpt"] {
  --primary: #c4b5fd !important;
  --primary-foreground: #1a1528 !important;
  --secondary: #221e2c !important;
  --secondary-foreground: #e3dcf7 !important;
  --accent: #2a2438 !important;
  --accent-foreground: #f0e9ff !important;
  --background: #0f0d14 !important;
  --foreground: #f4f1fa !important;
  --card: #18151f !important;
  --card-foreground: #f4f1fa !important;
  --popover: #18151f !important;
  --popover-foreground: #f4f1fa !important;
  --muted: #221e2c !important;
  --muted-foreground: #b0a8bf !important;
  --border: #332c44 !important;
  --input: #332c44 !important;
  --ring: #c4b5fd !important;
  --sidebar: #121016 !important;
  --sidebar-foreground: #f4f1fa !important;
  --sidebar-primary: #c4b5fd !important;
  --sidebar-primary-foreground: #1a1528 !important;
  --sidebar-accent: #2a2438 !important;
  --sidebar-accent-foreground: #f0e9ff !important;
  --sidebar-border: #332c44 !important;
  --sidebar-ring: #c4b5fd !important;
  --chart-1: #c4b5fd !important;
  --chart-2: #a78bfa !important;
  --chart-3: #f0abfc !important;
  --chart-4: #93c5fd !important;
  --chart-5: #d1d5db !important;
  --overview-accent-1: #c4b5fd !important;
  --overview-accent-2: #a78bfa !important;
  --overview-accent-3: #93c5fd !important;
  --mascot-primary: #c4b5fd;
  --mascot-soft: #2a2438;
  --mascot-glow: rgba(196, 181, 253, 0.55);
  --mascot-outline: rgba(255, 255, 255, 0.58);
  --mascot-bubble-bg: rgba(28, 23, 40, 0.96);
  --mascot-bubble-fg: #f6f2ff;
  --mascot-bubble-border: rgba(196, 181, 253, 0.55);
  --mascot-static: url("/art/mascot/static_gpt.webp");
  --mascot-action: url("/art/mascot/action_gpt_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_gpt.webp");
}

html[data-mascot="h3"] {
  --primary: #e85d7f !important;
  --primary-foreground: #ffffff !important;
  --secondary: #ffe8e6 !important;
  --secondary-foreground: #b23a58 !important;
  --accent: #ffe3de !important;
  --accent-foreground: #a83250 !important;
  --background: #fff8f7 !important;
  --foreground: #2a1218 !important;
  --card: #ffffff !important;
  --card-foreground: #2a1218 !important;
  --popover: #ffffff !important;
  --popover-foreground: #2a1218 !important;
  --muted: #fff0ef !important;
  --muted-foreground: #8a6b70 !important;
  --border: #f4dde1 !important;
  --input: #f4dde1 !important;
  --ring: #f06a8a !important;
  --sidebar: #fffafa !important;
  --sidebar-foreground: #2a1218 !important;
  --sidebar-primary: #e85d7f !important;
  --sidebar-primary-foreground: #ffffff !important;
  --sidebar-accent: #ffe7e3 !important;
  --sidebar-accent-foreground: #a83250 !important;
  --sidebar-border: #f4dde1 !important;
  --sidebar-ring: #f06a8a !important;
  --chart-1: #f06a8a !important;
  --chart-2: #ff9a62 !important;
  --chart-3: #ffb86b !important;
  --chart-4: #ff7aa2 !important;
  --chart-5: #ffd166 !important;
  --overview-accent-1: #f06a8a !important;
  --overview-accent-2: #ff9a62 !important;
  --overview-accent-3: #ffb86b !important;
  --mascot-primary: #e85d7f;
  --mascot-soft: #ffe3de;
  --mascot-glow: rgba(232, 93, 127, 0.42);
  --mascot-bubble-bg: rgba(52, 18, 28, 0.95);
  --mascot-bubble-fg: #fff1f4;
  --mascot-bubble-border: rgba(255, 154, 180, 0.48);
  --mascot-static: url("/art/mascot/static_h3.webp");
  --mascot-action: url("/art/mascot/action_h3_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_h3.webp");
}

html.dark[data-mascot="h3"] {
  --primary: #ff8fa8 !important;
  --primary-foreground: #2a0d16 !important;
  --secondary: #321b23 !important;
  --secondary-foreground: #ffd6df !important;
  --accent: #3d2029 !important;
  --accent-foreground: #ffe3e9 !important;
  --background: #1a0e12 !important;
  --foreground: #ffeef2 !important;
  --card: #24141a !important;
  --card-foreground: #ffeef2 !important;
  --popover: #24141a !important;
  --popover-foreground: #ffeef2 !important;
  --muted: #321b23 !important;
  --muted-foreground: #c9a1aa !important;
  --border: #4a2834 !important;
  --input: #4a2834 !important;
  --ring: #ff8fa8 !important;
  --sidebar: #1d1015 !important;
  --sidebar-foreground: #ffeef2 !important;
  --sidebar-primary: #ff8fa8 !important;
  --sidebar-primary-foreground: #2a0d16 !important;
  --sidebar-accent: #3d2029 !important;
  --sidebar-accent-foreground: #ffe3e9 !important;
  --sidebar-border: #4a2834 !important;
  --sidebar-ring: #ff8fa8 !important;
  --chart-1: #ff8fa8 !important;
  --chart-2: #ffb07a !important;
  --chart-3: #ffd166 !important;
  --chart-4: #ff6b9d !important;
  --chart-5: #ff9f68 !important;
  --overview-accent-1: #ff8fa8 !important;
  --overview-accent-2: #ffb07a !important;
  --overview-accent-3: #ffd166 !important;
  --mascot-primary: #ff8fa8;
  --mascot-soft: #3d2029;
  --mascot-glow: rgba(255, 143, 168, 0.55);
  --mascot-bubble-bg: rgba(48, 18, 28, 0.96);
  --mascot-bubble-fg: #fff1f4;
  --mascot-bubble-border: rgba(255, 143, 168, 0.55);
  --mascot-static: url("/art/mascot/static_h3.webp");
  --mascot-action: url("/art/mascot/action_h3_1.webp");
  --mascot-avatar: url("/art/mascot/head_static_h3.webp");
}

/* ---------- global chrome ---------- */

html[data-mascot] {
  --mascot-outline: rgba(18, 24, 52, 0.42);
}

html.dark[data-mascot] {
  --mascot-outline: rgba(255, 255, 255, 0.34);
}

::selection {
  background: color-mix(in oklab, var(--primary) 32%, transparent);
}

html {
  scrollbar-color: color-mix(in oklab, var(--primary) 55%, transparent) transparent;
}

body {
  background-color: var(--background) !important;
}

header.sticky {
  background: color-mix(in oklab, var(--background) 78%, transparent) !important;
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border-bottom: 1px solid color-mix(in oklab, var(--primary) 14%, var(--border)) !important;
}

[data-sidebar="sidebar"] {
  background:
    linear-gradient(
      180deg,
      color-mix(in oklab, var(--sidebar) 88%, var(--primary) 12%) 0%,
      var(--sidebar) 42%,
      var(--sidebar) 100%
    ) !important;
  border-right: 1px solid var(--sidebar-border) !important;
}

[data-sidebar="menu-button"].active,
[data-sidebar="menu-button"][data-active="true"] {
  background: var(--sidebar-accent) !important;
  color: var(--sidebar-accent-foreground) !important;
  box-shadow: inset 3px 0 0 var(--primary);
}

button.bg-primary,
a.bg-primary,
[data-slot="button"].bg-primary {
  box-shadow: 0 6px 18px color-mix(in oklab, var(--primary) 24%, transparent);
}

/* ---------- mascot icons ---------- */

svg[data-mascot-icon] {
  background-image:
    var(--mascot-static),
    radial-gradient(
      circle at 50% 45%,
      color-mix(in oklab, var(--mascot-primary) 18%, transparent),
      transparent 76%
    );
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: contain, 100% 100%;
  width: 1.8em !important;
  height: 1.8em !important;
  min-width: 22px;
  min-height: 22px;
  max-width: 38px;
  max-height: 38px;
  overflow: visible !important;
  flex: 0 0 auto;
  pointer-events: auto !important;
  cursor: pointer;
  rotate: 0deg !important;
  scale: 1 !important;
  transform-origin: 50% 80%;
  transition:
    scale 0.42s cubic-bezier(0.18, 1.45, 0.36, 1),
    filter 0.3s ease,
    opacity 0.3s ease;
  filter:
    drop-shadow(0 0 1.3px var(--mascot-outline))
    drop-shadow(0 2px 3px rgba(8, 20, 40, 0.22))
    saturate(0.94)
    brightness(1.02);
  animation: mascot-breathe 4.6s ease-in-out infinite;
  will-change: scale;
}

svg[data-mascot-icon] :is(path, circle, rect, line, polyline, polygon, ellipse, use, image) {
  stroke: transparent !important;
  fill: transparent !important;
  opacity: 0 !important;
}

svg[data-mascot-icon].is-awake {
  rotate: 0deg !important;
  scale: 1.45 !important;
  background-image:
    var(--mascot-action-now, var(--mascot-action)),
    radial-gradient(
      circle at 50% 45%,
      color-mix(in oklab, var(--mascot-primary) 18%, transparent),
      transparent 76%
    );
  background-size: contain, 100% 100%;
  background-position: center, center;
  position: relative;
  z-index: 60;
  filter:
    drop-shadow(0 0 1.5px var(--mascot-outline))
    drop-shadow(0 4px 7px rgba(8, 20, 40, 0.32))
    drop-shadow(0 0 8px var(--mascot-glow))
    saturate(1.08);
  animation: none;
}

svg[data-mascot-icon][data-mascot-context="sidebar"] {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
}

svg[data-mascot-icon][data-mascot-context="header"] {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px;
  min-height: 30px;
}

svg[data-mascot-icon][data-mascot-context="large"] {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
}

svg[data-mascot-icon].lucide-search {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
}

html[data-mascot="gpt"] svg[data-mascot-icon] {
  background-color: rgba(124, 104, 201, 0.28);
  border-radius: 30%;
  box-shadow: inset 0 0 0 1px rgba(124, 104, 201, 0.22);
}

html.dark[data-mascot="gpt"] svg[data-mascot-icon] {
  background-color: rgba(196, 181, 253, 0.16);
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.18);
}

.mascot-awake-parent {
  overflow: visible !important;
}

@keyframes mascot-breathe {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
}

/* ---------- brand lockup: mark + site name ---------- */

.mascot-brand-lockup {
  gap: 8px !important;
}

.mascot-brand-lockup img {
  width: 36px !important;
  height: 36px !important;
  object-fit: contain !important;
  background: transparent !important;
}

/* The landing shell renders its header over the dark hero image, so the
   brand name needs a light colour instead of the light-theme foreground. */
html[data-mascot="skip"] header a[href="/"] {
  color: rgba(255, 255, 255, 0.92) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* text buttons keep their label only */
.mascot-text-only svg {
  display: none !important;
}

/* ---------- character switcher ---------- */

.mascot-switcher {
  position: fixed;
  top: 11px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  flex: none;
  z-index: 41;
  font-family: inherit;
  line-height: 1;
}

.mascot-switcher--fixed {
  position: fixed;
  top: 11px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 41;
}

.mascot-switcher--header-fallback {
  margin-left: auto;
}

.mascot-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 10px 0 5px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--primary) 24%, var(--border));
  background:
    linear-gradient(
      135deg,
      color-mix(in oklab, var(--card) 92%, var(--primary) 8%),
      color-mix(in oklab, var(--card) 74%, var(--primary) 26%)
    );
  color: var(--foreground);
  box-shadow:
    0 2px 10px color-mix(in oklab, var(--primary) 14%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.mascot-switcher__btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
  box-shadow:
    0 6px 20px color-mix(in oklab, var(--primary) 24%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.mascot-switcher__btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.mascot-switcher__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, #ffffff 0 42%, transparent 70%),
    linear-gradient(135deg, var(--mascot-soft), color-mix(in oklab, var(--primary) 24%, #ffffff));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 25%, transparent);
}

.mascot-switcher__avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  filter:
    drop-shadow(0 0 1px var(--mascot-outline))
    drop-shadow(0 1px 1px rgba(8, 20, 40, 0.2));
}

.mascot-switcher__btn:hover .mascot-switcher__avatar img {
  transform: scale(1.08);
}

.mascot-switcher__label {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.mascot-switcher__label b {
  font-weight: 800;
  color: var(--primary);
}

.mascot-switcher__chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.mascot-switcher__btn[aria-expanded="true"] .mascot-switcher__chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.mascot-switcher__menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 252px;
  padding: 7px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--primary) 18%, var(--border));
  background: color-mix(in oklab, var(--popover) 94%, transparent);
  box-shadow:
    0 24px 60px rgba(5, 12, 28, 0.24),
    0 2px 8px rgba(5, 12, 28, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  transform-origin: top center;
  animation: mascot-menu-in 0.18s ease-out both;
  z-index: 1000;
}

.mascot-switcher__menu[hidden] {
  display: none !important;
}

.mascot-switcher__hint {
  padding: 5px 10px 7px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.mascot-switcher__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.mascot-switcher__option:hover,
.mascot-switcher__option:focus-visible {
  background: color-mix(in oklab, var(--primary) 9%, var(--card));
  border-color: color-mix(in oklab, var(--primary) 22%, var(--border));
  outline: none;
  transform: translateX(2px);
}

.mascot-switcher__option[aria-selected="true"] {
  background: var(--accent);
  border-color: color-mix(in oklab, var(--primary) 42%, var(--border));
}

.mascot-switcher__option-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.92) 0 38%, transparent 70%),
    linear-gradient(135deg, color-mix(in oklab, var(--primary) 12%, #ffffff), color-mix(in oklab, var(--primary) 24%, #ffffff));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--primary) 18%, transparent);
}

.mascot-switcher__option-avatar img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 1px var(--mascot-outline));
}

.mascot-switcher__option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mascot-switcher__option-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--foreground);
}

.mascot-switcher__option-sub {
  font-size: 10.5px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.mascot-switcher__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--option-color, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--option-color, var(--primary)) 18%, transparent);
}

.mascot-switcher__check {
  margin-left: auto;
  width: 8px;
  height: 13px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(42deg);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mascot-switcher__option[aria-selected="true"] .mascot-switcher__check {
  opacity: 1;
}

@keyframes mascot-menu-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ---------- desk companion ---------- */

.mascot-companion {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 118px;
  height: 128px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mascot-companion__glow {
  position: absolute;
  inset: 10px 4px 6px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 58%,
    color-mix(in oklab, var(--primary) 26%, transparent),
    transparent 66%
  );
  filter: blur(6px);
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mascot-companion__cushion {
  position: absolute;
  bottom: 26px;
  left: 9px;
  right: 9px;
  height: 26px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, 0.72), transparent 55%),
    linear-gradient(180deg, var(--mascot-soft), color-mix(in oklab, var(--primary) 30%, var(--mascot-soft)));
  border: 1px solid color-mix(in oklab, var(--primary) 22%, transparent);
  box-shadow:
    0 6px 14px color-mix(in oklab, var(--primary) 18%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: perspective(80px) rotateX(48deg);
}

.mascot-companion__img {
  position: relative;
  width: 94px;
  height: 94px;
  object-fit: contain;
  transform: translateY(-22px) scale(0.98);
  transform-origin: 50% 90%;
  transition: transform 0.48s cubic-bezier(0.18, 1.45, 0.36, 1), filter 0.3s ease;
  filter:
    drop-shadow(0 0 1px var(--mascot-outline))
    drop-shadow(0 6px 8px rgba(8, 20, 40, 0.26))
    saturate(0.88);
  z-index: 2;
}

.mascot-companion:hover .mascot-companion__img,
.mascot-companion.is-awake .mascot-companion__img {
  transform: translateY(-26px) scale(1.06);
  filter:
    drop-shadow(0 0 1px var(--mascot-outline))
    drop-shadow(0 10px 14px rgba(8, 20, 40, 0.32))
    drop-shadow(0 0 12px var(--mascot-glow))
    saturate(1.08);
}

.mascot-companion:hover .mascot-companion__glow,
.mascot-companion.is-awake .mascot-companion__glow {
  opacity: 1;
  transform: scale(1.08);
}

.mascot-companion__zzz {
  position: absolute;
  top: 18px;
  right: 14px;
  z-index: 3;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--mascot-primary);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: mascot-zzz 2.6s ease-in-out infinite;
}

.mascot-companion:hover .mascot-companion__zzz,
.mascot-companion.is-awake .mascot-companion__zzz {
  opacity: 0;
  animation: none;
}

.mascot-companion__label {
  display: none;
  position: absolute;
  left: auto;
  right: 0;
  bottom: 2px;
  transform: none;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--primary) 20%, var(--border));
  background: color-mix(in oklab, var(--card) 88%, transparent);
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(8, 20, 40, 0.08);
  backdrop-filter: blur(8px);
}

@keyframes mascot-zzz {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.92);
  }
  50% {
    opacity: 1;
    transform: translateY(-5px) scale(1.06);
  }
}

/* ---------- speech bubble ---------- */

.mascot-bubble {
  position: fixed;
  z-index: 99999;
  max-width: 238px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--mascot-bubble-border);
  background: var(--mascot-bubble-bg);
  color: var(--mascot-bubble-fg);
  box-shadow:
    0 14px 34px rgba(4, 10, 24, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.01em;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mascot-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mascot-bubble::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}

.mascot-bubble[data-side="right"]::after {
  left: -12px;
  top: 50%;
  margin-top: -6px;
  border-right-color: var(--mascot-bubble-bg);
  border-left-width: 6px;
}

.mascot-bubble[data-side="left"]::after {
  right: -12px;
  top: 50%;
  margin-top: -6px;
  border-left-color: var(--mascot-bubble-bg);
  border-right-width: 6px;
}

.mascot-bubble[data-side="top"]::after {
  left: 50%;
  bottom: -12px;
  margin-left: -6px;
  border-top-color: var(--mascot-bubble-bg);
  border-bottom-width: 6px;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .mascot-switcher__chevron {
    display: none;
  }
  .mascot-switcher__btn {
    padding-right: 9px;
  }
}

@media (max-width: 640px) {
  .mascot-switcher {
    top: 9px;
  }
  .mascot-switcher__label b {
    display: none;
  }
  .mascot-switcher__label {
    font-size: 11px;
  }
  .mascot-switcher__chevron {
    display: none;
  }
  .mascot-switcher__btn {
    height: 32px;
    padding: 0 6px;
  }
  .mascot-switcher__menu {
    width: min(252px, calc(100vw - 24px));
  }
  .mascot-companion {
    width: 86px;
    height: 94px;
    right: 10px;
    bottom: 10px;
  }
  .mascot-companion__img {
    width: 70px;
    height: 70px;
  }
  .mascot-companion__cushion {
    left: 4px;
    right: 4px;
    bottom: 20px;
    height: 20px;
  }
  .mascot-companion__label {
    font-size: 9px;
    bottom: 1px;
  }
  .mascot-companion__img {
    transform: translateY(-16px) scale(0.98);
  }
  .mascot-companion:hover .mascot-companion__img,
  .mascot-companion.is-awake .mascot-companion__img {
    transform: translateY(-20px) scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  svg[data-mascot-icon],
  .mascot-companion__img,
  .mascot-switcher__avatar img {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}
