/* ===========================================================================
   Da-lle Bot — Saturn Face + Overlay UI Styles (Bloub-inspired)
   =========================================================================== */

/* ===== BOT OVERLAY ===== */
.bot-overlay { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: none; flex-direction: column; opacity: 0; transition: opacity 0.3s ease; }
.bot-overlay.active { display: flex; opacity: 1; }

.bot-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 201; height: 56px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0)); }
[data-theme="light"] .bot-topbar { background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0)); }
.bot-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bot-brand-mark { display: grid; place-items: center; width: 36px; height: 36px; filter: none; flex-shrink: 0; overflow: visible; cursor: pointer; }
.bot-brand-name { font-weight: 700; letter-spacing: 0.5px; font-size: 18px; color: var(--text-heading); white-space: nowrap; animation: nameFadeIn 1.1s ease-out 0.15s both; }
.bot-tools { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; flex-shrink: 0; }
.bot-tools .tool { width: 38px; height: 38px; flex-shrink: 0; }

/* Bot topbar theme button */
#botThemeBtn i.ph-sun { display: none; }
#botThemeBtn i.ph-moon { display: block; }
[data-theme="light"] #botThemeBtn i.ph-sun { display: block; }
[data-theme="light"] #botThemeBtn i.ph-moon { display: none; }

.bot-stage { position: relative; z-index: 1; flex: 1; padding: 56px 16px 150px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--matte3) transparent; }
.bot-stage::-webkit-scrollbar { width: 8px; }
.bot-stage::-webkit-scrollbar-thumb { background: var(--matte3); border-radius: 8px; }

/* ===== WELCOME SCREEN ===== */
.bot-welcome { max-width: var(--bot-max); margin: 0 auto; min-height: calc(100vh - 230px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.bot-welcome.hidden { display: none; }

.bot-welcome-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: 640px;
  width: 100%;
  padding: 0 16px;
}

/* Saturn side */
.bot-welcome-saturn {
  flex: 0 0 auto;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Dial side */
.bot-welcome-dial {
  flex: 0 0 auto;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== SATURN BOT BODY ===== */
.saturn-bot { position: relative; display: grid; place-items: center; cursor: pointer; }
.saturn-body {
  position: absolute; border-radius: 50%;
  background: linear-gradient(145deg, var(--bot-body-light) 0%, var(--bot-body) 50%, var(--bot-body-dark) 100%);
  box-shadow: 0 0 30px rgba(139,120,255,0.35), inset -6px -6px 18px rgba(0,0,0,0.35), inset 6px 6px 18px rgba(255,255,255,0.12);
  z-index: 2; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease, background 0.6s ease, filter 0.6s ease;
}
.saturn-bot.breathing .saturn-body { animation: saturnBreathe 3s ease-in-out infinite; }
@keyframes saturnBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015); } }

/* ===== SATURN RING ===== */
.saturn-ring-wrap { position: absolute; z-index: 1; pointer-events: none; }
.saturn-ring {
  position: absolute; border: 2.5px solid var(--bot-ring); border-radius: 50%;
  top: 50%; left: 50%; transform: translate(-50%, -50%) rotateX(70deg) rotateY(-12deg);
  box-shadow: 0 0 16px rgba(139,120,255,0.15); transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.saturn-ring::after { content: ''; position: absolute; border: 1.5px solid rgba(139,120,255,0.22); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* Ring colors per emotion */
.saturn-bot.happy    .saturn-ring { border-color: #F5A623; box-shadow: 0 0 22px rgba(245,166,35,0.58), 0 0 44px rgba(245,166,35,0.28), 0 0 70px rgba(245,166,35,0.12); }
.saturn-bot.sad      .saturn-ring { border-color: #4A6F9E; box-shadow: 0 0 12px rgba(74,111,158,0.3); }
.saturn-bot.angry    .saturn-ring { border-color: #C0392B; box-shadow: 0 0 20px rgba(192,57,43,0.5); }
.saturn-bot.surprised .saturn-ring { border-color: #06D6A0; box-shadow: 0 0 20px rgba(6,214,160,0.45); }
.saturn-bot.thinking .saturn-ring { border-color: #5C4FA6; box-shadow: 0 0 16px rgba(92,79,166,0.4); }
.saturn-bot.listening .saturn-ring { border-color: #2A9D8F; box-shadow: 0 0 18px rgba(42,157,143,0.45); }
.saturn-bot.sleeping .saturn-ring { border-color: #5C5C7A; box-shadow: 0 0 8px rgba(92,92,122,0.2); }
.saturn-bot.confused .saturn-ring { border-color: #E07B00; box-shadow: 0 0 16px rgba(224,123,0,0.4); }
.saturn-bot.excited  .saturn-ring { border-color: #D63BB7; box-shadow: 0 0 22px rgba(214,59,183,0.55); }
.saturn-bot.worried  .saturn-ring { border-color: #8B8B00; box-shadow: 0 0 14px rgba(139,139,0,0.35); }
.saturn-bot.love     .saturn-ring { border-color: #E0356A; box-shadow: 0 0 24px rgba(224,53,106,0.62), 0 0 46px rgba(224,53,106,0.32), 0 0 72px rgba(224,53,106,0.14); }
.saturn-bot.dead     .saturn-ring { border-color: #333; box-shadow: none; }

/* ===== EXTENDED RING DECORATIONS ===== */

/* happy — make inner sub-ring visible in gold; outer extended ring via ring-wrap::before */
.saturn-bot.happy .saturn-ring::after { border-color: rgba(245,166,35,0.52); }
.saturn-bot.happy .saturn-ring-wrap::before {
  content: ''; position: absolute; border: 2px solid rgba(245,166,35,0.38); border-radius: 50%;
  top: 50%; left: 50%; pointer-events: none;
  animation: happyOuterRingPulse 2.4s ease-in-out infinite;
}
.saturn-bot.size-welcome.happy .saturn-ring-wrap::before { width: 136px; height: 38px; transform: translate(-50%,-50%) rotateX(70deg) rotateY(-12deg); }
.saturn-bot.size-small.happy   .saturn-ring-wrap::before { width: 44px;  height: 13px; transform: translate(-50%,-50%) rotateX(70deg) rotateY(-12deg); }
.saturn-bot.size-avatar.happy  .saturn-ring-wrap::before { width: 36px;  height: 10px; transform: translate(-50%,-50%) rotateX(70deg) rotateY(-12deg); }
@keyframes happyOuterRingPulse { 0%, 100% { opacity: 0.28; } 50% { opacity: 0.74; } }

/* love — inner sub-ring in rose; outer extended ring; orbiting ♥ love-shaped ring */
.saturn-bot.love .saturn-ring::after { border-color: rgba(224,53,106,0.58); }

/* Outer extended ring */
.saturn-bot.love .saturn-ring-wrap::before {
  content: ''; position: absolute; border: 2px solid rgba(224,53,106,0.44); border-radius: 50%;
  top: 50%; left: 50%; pointer-events: none;
  animation: loveOuterRingPulse 1.8s ease-in-out infinite;
}
.saturn-bot.size-welcome.love .saturn-ring-wrap::before { width: 140px; height: 42px; transform: translate(-50%,-50%) rotateX(70deg) rotateY(-12deg); }
.saturn-bot.size-small.love   .saturn-ring-wrap::before { width: 46px;  height: 14px; transform: translate(-50%,-50%) rotateX(70deg) rotateY(-12deg); }
.saturn-bot.size-avatar.love  .saturn-ring-wrap::before { width: 38px;  height: 11px; transform: translate(-50%,-50%) rotateX(70deg) rotateY(-12deg); }
@keyframes loveOuterRingPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.84; } }

/* Love-shaped ring — a ♥ orbiting the ring path */
.saturn-bot.love .saturn-ring-wrap::after {
  content: '♥'; position: absolute; top: 50%; left: 50%; pointer-events: none;
  color: #E0356A; text-shadow: 0 0 8px rgba(224,53,106,0.95), 0 0 18px rgba(224,53,106,0.55);
  line-height: 1;
}
.saturn-bot.size-welcome.love .saturn-ring-wrap::after { font-size: 11px; margin: -5px  0 0 -5px;  animation: loveHeartOrbitLg 3.6s linear infinite; }
.saturn-bot.size-small.love   .saturn-ring-wrap::after { font-size: 5px;  margin: -2px  0 0 -2px;  animation: loveHeartOrbitSm 3.6s linear infinite; }
.saturn-bot.size-avatar.love  .saturn-ring-wrap::after { font-size: 4px;  margin: -2px  0 0 -2px;  animation: loveHeartOrbitAv 3.6s linear infinite; }
/* Heart counter-rotates to stay upright while orbiting */
@keyframes loveHeartOrbitLg { from { transform: rotate(0deg)   translateX(62px) rotate(0deg);    } to { transform: rotate(360deg) translateX(62px) rotate(-360deg); } }
@keyframes loveHeartOrbitSm { from { transform: rotate(0deg)   translateX(21px) rotate(0deg);    } to { transform: rotate(360deg) translateX(21px) rotate(-360deg); } }
@keyframes loveHeartOrbitAv { from { transform: rotate(0deg)   translateX(16px) rotate(0deg);    } to { transform: rotate(360deg) translateX(16px) rotate(-360deg); } }

.saturn-bot.spinning .saturn-ring-wrap { animation: ringSpin 8s linear infinite; }
@keyframes ringSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.saturn-bot.fast-spin .saturn-ring-wrap { animation: ringSpinFast 2s linear infinite; }
@keyframes ringSpinFast { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.saturn-bot.slow-spin .saturn-ring-wrap { animation: ringSpinSlow 20s linear infinite; }
@keyframes ringSpinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.saturn-bot.pulse-rings .saturn-ring { animation: ringPulse 1.5s ease-in-out infinite; }
@keyframes ringPulse { 0%, 100% { box-shadow: 0 0 16px rgba(139,120,255,0.15); border-color: var(--bot-ring); } 50% { box-shadow: 0 0 32px rgba(139,120,255,0.4); border-color: rgba(179,181,227,0.8); } }

/* ===== EYES ===== */
.eye-wrap { position: absolute; z-index: 3; pointer-events: none; }
.eye {
  position: absolute; background: #ffffff; border-radius: 50%;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-box: fill-box; transform-origin: center center;
}

/* ===== EMOTION STATES ===== */
/* neutral — default purple */
.saturn-bot.neutral .eye-left  { transform: scale(1, 1); }
.saturn-bot.neutral .eye-right { transform: scale(1, 1); }
.saturn-bot.neutral .saturn-body { background: linear-gradient(145deg, var(--bot-body-light) 0%, var(--bot-body) 50%, var(--bot-body-dark) 100%); box-shadow: 0 0 30px rgba(139,120,255,0.35), inset -6px -6px 18px rgba(0,0,0,0.35), inset 6px 6px 18px rgba(255,255,255,0.12); }

/* happy — warm golden yellow */
.saturn-bot.happy .eye-left  { transform: scale(1.1, 0.85) translateY(-1px); }
.saturn-bot.happy .eye-right { transform: scale(1.1, 0.85) translateY(-1px); }
.saturn-bot.happy .saturn-body { background: linear-gradient(145deg, #FFD97D 0%, #F5A623 50%, #C97D10 100%); box-shadow: 0 0 40px rgba(245,166,35,0.55), inset -6px -6px 18px rgba(0,0,0,0.3), inset 6px 6px 18px rgba(255,255,255,0.2); }

/* sad — muted steel blue */
.saturn-bot.sad .eye-left  { transform: scale(0.9, 0.8) translateY(3px); }
.saturn-bot.sad .eye-right { transform: scale(0.9, 0.8) translateY(3px); }
.saturn-bot.sad .saturn-body { background: linear-gradient(145deg, #7B9EC7 0%, #4A6F9E 50%, #2C4D72 100%); box-shadow: 0 0 20px rgba(74,111,158,0.3), inset -6px -6px 18px rgba(0,0,0,0.45), inset 6px 6px 18px rgba(255,255,255,0.08); }

/* angry — fiery red (sleeping-style dead-flat eyes: eerily calm fury) */
.saturn-bot.angry .eye-left  { transform: scale(1.2, 0.07); }
.saturn-bot.angry .eye-right { transform: scale(1.2, 0.07); }
.saturn-bot.angry .saturn-body { background: linear-gradient(145deg, #FF6B6B 0%, #C0392B 50%, #8E1A10 100%); box-shadow: 0 0 45px rgba(192,57,43,0.6), inset -6px -6px 18px rgba(0,0,0,0.35), inset 6px 6px 18px rgba(255,100,80,0.15); }

/* surprised — electric cyan */
.saturn-bot.surprised .eye-left  { transform: scale(1.25, 1.35) translateY(-3px); }
.saturn-bot.surprised .eye-right { transform: scale(1.25, 1.35) translateY(-3px); }
.saturn-bot.surprised .saturn-body { background: linear-gradient(145deg, #72EFDD 0%, #06D6A0 50%, #028A63 100%); box-shadow: 0 0 50px rgba(6,214,160,0.55), inset -6px -6px 18px rgba(0,0,0,0.3), inset 6px 6px 18px rgba(255,255,255,0.18); }

/* thinking — deep indigo */
.saturn-bot.thinking .eye-left  { transform: rotate(-10deg) scale(0.9, 0.55) translateY(-2px) translateX(-1px); }
.saturn-bot.thinking .eye-right { transform: rotate(10deg) scale(0.9, 0.55) translateY(-2px) translateX(1px); }
.saturn-bot.thinking .saturn-body { background: linear-gradient(145deg, #9B8FD4 0%, #5C4FA6 50%, #3A2E7A 100%); box-shadow: 0 0 35px rgba(92,79,166,0.5), inset -6px -6px 18px rgba(0,0,0,0.4), inset 6px 6px 18px rgba(255,255,255,0.1); animation: saturnThink 0.8s ease-in-out infinite alternate; }
@keyframes saturnThink { from { transform: scale(1); } to { transform: scale(1.03); } }

/* listening — soft teal */
.saturn-bot.listening .eye-left  { transform: scale(1.05, 1.1); }
.saturn-bot.listening .eye-right { transform: scale(1.05, 1.1); }
.saturn-bot.listening .saturn-body { background: linear-gradient(145deg, #5EC4C4 0%, #2A9D8F 50%, #1A6B62 100%); box-shadow: 0 0 50px rgba(42,157,143,0.6), inset -6px -6px 18px rgba(0,0,0,0.3), inset 6px 6px 18px rgba(255,255,255,0.15); }

/* sleeping — dim grey-lavender (angry-style angled squint: scowling in sleep) */
.saturn-bot.sleeping .eye-left  { transform: rotate(-18deg) scale(1.2, 0.45) translateX(2px); }
.saturn-bot.sleeping .eye-right { transform: rotate(18deg) scale(1.2, 0.45) translateX(-2px); }
.saturn-bot.sleeping .saturn-body { background: linear-gradient(145deg, #8E8EA8 0%, #5C5C7A 50%, #3A3A52 100%); box-shadow: 0 0 15px rgba(92,92,122,0.2), inset -6px -6px 18px rgba(0,0,0,0.5), inset 6px 6px 18px rgba(255,255,255,0.05); animation: saturnSleep 4s ease-in-out infinite; }
@keyframes saturnSleep { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.01) translateY(1px); } }

/* confused — orange-amber */
.saturn-bot.confused .eye-left  { transform: rotate(-12deg) scale(0.95, 0.85) translateY(-2px); }
.saturn-bot.confused .eye-right { transform: rotate(8deg) scale(0.95, 0.85) translateY(2px); }
.saturn-bot.confused .saturn-body { background: linear-gradient(145deg, #FFB347 0%, #E07B00 50%, #A85500 100%); box-shadow: 0 0 30px rgba(224,123,0,0.45), inset -6px -6px 18px rgba(0,0,0,0.35), inset 6px 6px 18px rgba(255,255,255,0.12); }

/* excited — vivid magenta-pink */
.saturn-bot.excited .eye-left  { transform: scale(1.2, 1.15) translateY(-2px); }
.saturn-bot.excited .eye-right { transform: scale(1.2, 1.15) translateY(-2px); }
.saturn-bot.excited .saturn-body { background: linear-gradient(145deg, #FF6FCF 0%, #D63BB7 50%, #9B1D86 100%); box-shadow: 0 0 55px rgba(214,59,183,0.65), inset -6px -6px 18px rgba(0,0,0,0.3), inset 6px 6px 18px rgba(255,255,255,0.2); animation: saturnBounce 0.6s ease infinite; }
@keyframes saturnBounce { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.04) translateY(-3px); } }

/* worried — olive-khaki */
.saturn-bot.worried .eye-left  { transform: rotate(-14deg) scale(0.85, 0.6) translateY(-1px) translateX(-2px); }
.saturn-bot.worried .eye-right { transform: rotate(14deg) scale(0.85, 0.6) translateY(-1px) translateX(2px); }
.saturn-bot.worried .saturn-body { background: linear-gradient(145deg, #BDB76B 0%, #8B8B00 50%, #5C5A00 100%); box-shadow: 0 0 25px rgba(139,139,0,0.4), inset -6px -6px 18px rgba(0,0,0,0.4), inset 6px 6px 18px rgba(255,255,255,0.1); }

/* love — rose pink (with excited-bot bump) */
.saturn-bot.love .eye-left  { transform: scale(1.15, 1.1) translateX(1px); }
.saturn-bot.love .eye-right { transform: scale(1.15, 1.1) translateX(-1px); }
.saturn-bot.love .saturn-body { background: linear-gradient(145deg, #FF8FAB 0%, #E0356A 50%, #A0164A 100%); box-shadow: 0 0 45px rgba(224,53,106,0.55), inset -6px -6px 18px rgba(0,0,0,0.3), inset 6px 6px 18px rgba(255,180,200,0.15); animation: saturnBounce 0.9s ease infinite; }

/* dead — near-black desaturated */
.saturn-bot.dead .eye-left  { transform: scale(1, 0.12); opacity: 0.5; }
.saturn-bot.dead .eye-right { transform: scale(1, 0.12); opacity: 0.5; }
.saturn-bot.dead .saturn-body { background: linear-gradient(145deg, #4a4a4a 0%, #2a2a2a 50%, #141414 100%); box-shadow: 0 0 10px rgba(0,0,0,0.5), inset -6px -6px 18px rgba(0,0,0,0.6), inset 6px 6px 18px rgba(255,255,255,0.03); filter: grayscale(0.6); }

/* blink — inherits current emotion color, just squishes eyes */
.saturn-bot.blink .eye-left  { transform: scale(1.2, 0.05); }
.saturn-bot.blink .eye-right { transform: scale(1.2, 0.05); }

/* ===== GAZE DRIFT ===== */
.saturn-bot.size-small.gaze-drift .eye-wrap { animation: gazeSm 5.4s ease-in-out infinite alternate; }
@keyframes gazeSm {
  0%   { transform: translate(0px,    0px); }
  20%  { transform: translate(1px,   -0.5px); }
  40%  { transform: translate(-1px,   0.5px); }
  60%  { transform: translate(0.5px, -1px); }
  80%  { transform: translate(-0.5px, 0.5px); }
  100% { transform: translate(1px,    1px); }
}

.saturn-bot.size-welcome.gaze-drift .eye-wrap { animation: gazeLg 4.2s ease-in-out infinite alternate; }
@keyframes gazeLg {
  0%   { transform: translate(0px,   0px); }
  15%  { transform: translate(5px,  -3px); }
  30%  { transform: translate(-5px,  2px); }
  45%  { transform: translate(4px,   4px); }
  60%  { transform: translate(-5px, -3px); }
  75%  { transform: translate(4px,  -2px); }
  90%  { transform: translate(-3px,  3px); }
  100% { transform: translate(2px,  -4px); }
}

/* ===== SIZE VARIANTS ===== */
.saturn-bot.size-welcome { width: 120px; height: 120px; }
.saturn-bot.size-welcome .saturn-body { width: 80px; height: 80px; }
.saturn-bot.size-welcome .saturn-ring-wrap { width: 120px; height: 120px; }
.saturn-bot.size-welcome .saturn-ring { width: 110px; height: 28px; border-width: 2.5px; }
.saturn-bot.size-welcome .saturn-ring::after { width: 86px; height: 16px; border-width: 1.5px; }
.saturn-bot.size-welcome .eye-wrap { width: 80px; height: 80px; }
.saturn-bot.size-welcome .eye-left  { left: 20px; top: 30px; width: 14px; height: 22px; }
.saturn-bot.size-welcome .eye-right { left: 46px; top: 30px; width: 14px; height: 22px; }

.saturn-bot.size-small { width: 36px; height: 36px; }
.saturn-bot.size-small .saturn-body { width: 24px; height: 24px; }
.saturn-bot.size-small .saturn-ring-wrap { width: 36px; height: 36px; }
.saturn-bot.size-small .saturn-ring { width: 34px; height: 9px; border-width: 1.5px; }
.saturn-bot.size-small .saturn-ring::after { width: 26px; height: 5px; border-width: 1px; }
.saturn-bot.size-small .eye-wrap { width: 24px; height: 24px; }
.saturn-bot.size-small .eye-left  { left: 5px; top: 8px; width: 5px; height: 8px; }
.saturn-bot.size-small .eye-right { left: 14px; top: 8px; width: 5px; height: 8px; }

.saturn-bot.size-avatar { width: 30px; height: 30px; }
.saturn-bot.size-avatar .saturn-body { width: 20px; height: 20px; }
.saturn-bot.size-avatar .saturn-ring-wrap { width: 30px; height: 30px; }
.saturn-bot.size-avatar .saturn-ring { width: 28px; height: 7px; border-width: 1.5px; }
.saturn-bot.size-avatar .saturn-ring::after { width: 22px; height: 4px; border-width: 1px; }
.saturn-bot.size-avatar .eye-wrap { width: 20px; height: 20px; }
.saturn-bot.size-avatar .eye-left  { left: 4px; top: 7px; width: 4px; height: 7px; }
.saturn-bot.size-avatar .eye-right { left: 12px; top: 7px; width: 4px; height: 7px; }

/* ===== BOT WELCOME SCREEN ===== */
.bot-welcome-title { font-weight: 700; font-size: clamp(26px, 6vw, 38px); letter-spacing: 0.3px; margin: 2px 0 0; color: var(--text-heading); }
.bot-accent { color: var(--accent); }
.bot-welcome-sub { color: var(--silver); margin: 0; max-width: 440px; font-size: 14.5px; }

.bot-suggestions { margin-top: 14px; width: 100%; max-width: 520px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bot-chip { width: 100%; border: 1px solid var(--border); background: rgba(24,28,31,0.72); color: var(--text); padding: 13px 14px; border-radius: 14px; font-size: 14px; text-align: center; cursor: pointer; transition: all 0.45s ease; opacity: 0; transform: translateY(6px); }
[data-theme="light"] .bot-chip { background: var(--bg-card); }
.bot-chip.show { opacity: 1; transform: translateY(0); }
.bot-chip:hover { border-color: var(--accent); background: var(--accent-glow); color: var(--accent-soft); }

/* ===== CHAT MESSAGES ===== */
.bot-chat { max-width: var(--bot-max); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.bot-msg { display: flex; gap: 12px; align-items: flex-start; animation: rise 0.28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.bot-msg.user { flex-direction: row-reverse; }

.bot-avatar { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; margin-top: 2px; }
.bot-avatar.bot { background: transparent; border: none; padding: 0; }
.bot-avatar.you { background: linear-gradient(145deg, #2a2a2a, #1c1c1c); color: var(--silver); border: 1px solid #333; border-radius: 50%; }
[data-theme="light"] .bot-avatar.you { background: linear-gradient(145deg, #e8e8e8, #ddd); border-color: var(--border); color: var(--text-dim); }
.bot-avatar.you svg { width: 15px; height: 15px; }

/* ===== CHAT BUBBLES ===== */
.bot-bubble { padding: 11px 15px; border-radius: 14px; max-width: 78%; white-space: pre-wrap; word-wrap: break-word; color: var(--text); }
.bot-msg.bot  .bot-bubble { background: var(--matte2); border: 1px solid var(--matte3); border-top-left-radius: 4px; }
.bot-msg.user .bot-bubble { background: var(--matte3); border: 1px solid var(--matte3); border-top-right-radius: 4px; }
[data-theme="light"] .bot-msg.bot  .bot-bubble { background: var(--bg-card); border-color: var(--border); }
[data-theme="light"] .bot-msg.user .bot-bubble { background: var(--bg-elevated); border-color: var(--border); }

.bot-bubble.rich { white-space: normal; }
.bot-bubble.rich > :first-child { margin-top: 0; }
.bot-bubble.rich > :last-child { margin-bottom: 0; }
.bot-bubble.rich p { margin: 0 0 8px; }
.bot-bubble.rich ul, .bot-bubble.rich ol { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.bot-bubble.rich li { margin: 0; }
.bot-bubble.rich strong { color: var(--text-heading); font-weight: 700; }
.bot-bubble.rich em { font-style: italic; color: var(--text); }
.bot-bubble.rich code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--matte1); border: 1px solid var(--matte3); border-radius: 6px; padding: 1px 5px; }
[data-theme="light"] .bot-bubble.rich code { background: #f0f0f0; border-color: #e0e0e0; }
.bot-bubble.rich .rich-h { font-weight: 700; color: var(--text-heading); margin: 10px 0 4px; }
.bot-bubble.rich .rich-h1 { font-size: 17px; }
.bot-bubble.rich .rich-h2 { font-size: 16px; }
.bot-bubble.rich .rich-h3, .bot-bubble.rich .rich-h4 { font-size: 15px; }

.rich-link { color: var(--accent-soft); text-decoration: none; border-bottom: 1px solid rgba(179,181,227,0.35); }
.rich-link:hover { color: var(--text-heading); border-bottom-color: var(--accent); }
.rich-link .rl-arrow { font-size: 11px; margin-left: 2px; vertical-align: 1px; opacity: 0.7; }

/* ===== TYPING DOTS ===== */
.dots { display: inline-flex; gap: 5px; padding: 4px 2px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--silver); animation: blink 1.4s infinite both; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ===== COMPOSER ===== */
.bot-composer-wrap { position: fixed; bottom: 0; left: 0; right: 0; z-index: 201; padding: 12px 16px 14px; background: linear-gradient(0deg, var(--bg) 55%, rgba(0,0,0,0)); }
.bot-composer { max-width: var(--bot-max); margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: var(--matte1); border: 1px solid #2c2c2c; border-radius: 26px; padding: 7px 7px 7px 20px; }
[data-theme="light"] .bot-composer { background: var(--bg-card); border-color: var(--border); }
.bot-input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); caret-color: var(--edge); font-size: 15px; resize: none; max-height: 160px; padding: 7px 0; line-height: 1.5; font-family: 'classy', system-ui, -apple-system, sans-serif; }
.bot-input:focus, .bot-input:focus-visible { outline: none; box-shadow: none; }
.bot-input::placeholder { color: var(--edge); }
.bot-send { flex: 0 0 auto; width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--matte3); color: #6f6f6f; display: grid; place-items: center; cursor: pointer; transition: all 0.18s ease; }
.bot-send svg { width: 19px; height: 19px; }
.bot-send.ready { background: #e8e8e8; color: #101010; }
.bot-send.ready:hover { background: #ffffff; }
.bot-send:active { transform: scale(0.94); }
.bot-send:disabled { opacity: 0.45; cursor: not-allowed; }
.bot-disclaimer { max-width: var(--bot-max); margin: 8px auto 0; text-align: center; color: var(--silver); font-size: 11.5px; }

/* ===== HISTORY PANEL ===== */
.history-panel { position: fixed; top: 60px; right: 12px; z-index: 202; width: min(330px, calc(100vw - 24px)); max-height: min(62vh, 520px); overflow-y: auto; background: var(--matte-panel); border: 1px solid var(--matte3); border-radius: 16px; box-shadow: 0 20px 54px rgba(0,0,0,0.6); padding: 8px; animation: rise 0.18s ease both; scrollbar-width: thin; scrollbar-color: var(--matte3) transparent; }
[data-theme="light"] .history-panel { background: var(--bg-elevated); border-color: var(--border); box-shadow: 0 20px 54px rgba(0,0,0,0.15); }
.history-panel[hidden] { display: none; }
.history-panel::-webkit-scrollbar { width: 8px; }
.history-panel::-webkit-scrollbar-thumb { background: var(--matte3); border-radius: 8px; }
.history-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; color: var(--silver); font-size: 13px; letter-spacing: 0.4px; }
.history-close { background: none; border: none; color: var(--silver); font-size: 14px; cursor: pointer; width: 26px; height: 26px; border-radius: 7px; line-height: 1; }
.history-close:hover { background: var(--matte1); color: var(--text-heading); }
.history-list { display: flex; flex-direction: column; gap: 4px; }
.history-empty { color: var(--text-dim); font-size: 13px; padding: 16px 8px; text-align: center; }
.history-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; text-align: left; font-family: 'classy', system-ui, -apple-system, sans-serif; }
.history-item:hover { background: var(--matte1); border-color: var(--matte3); }
.history-item.active { background: var(--matte1); border-color: #3a3a3a; }
.hi-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.hi-time { flex: 0 0 auto; color: var(--text-dim); font-size: 11px; }
.history-del { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border: none; background: none; color: #6a6a6a; border-radius: 7px; cursor: pointer; }
.history-del svg { width: 15px; height: 15px; }
.history-del:hover { color: #d98a7a; background: var(--matte2); }

/* ===== EMOTION DIAL (integrated into welcome inner) ===== */
.emotion-dial {
  position: relative;
  width: 110px;
  height: 200px;
  overflow: hidden;
  cursor: ns-resize;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--matte1);
}
[data-theme="light"] .emotion-dial {
  background: var(--bg-card);
  border-color: var(--border);
}

/* Fade mask top and bottom */
.emotion-dial::before,
.emotion-dial::after {
  content: ''; position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
  height: 70px;
}
.emotion-dial::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
}
.emotion-dial::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
}
[data-theme="light"] .emotion-dial::before {
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
}
[data-theme="light"] .emotion-dial::after {
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
}

/* Selection highlight bar */
.emotion-dial-notch {
  position: absolute; left: 8px; right: 8px; z-index: 1;
  top: 50%; transform: translateY(-50%);
  height: 40px; pointer-events: none;
  border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 6px;
}

/* The scrollable track */
.emotion-dial-track {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; padding: 80px 10px;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Each dial item */
.emotion-dial-item {
  width: 90px; height: 40px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; letter-spacing: 0.4px; text-transform: capitalize;
  color: var(--text-dim); cursor: pointer;
  transition: color 0.15s ease, font-size 0.15s ease, font-weight 0.15s ease;
}
.emotion-dial-item.active {
  color: var(--accent-soft); font-weight: 700; font-size: 14px;
}
.emotion-dial-item:not(.active) { opacity: 0.55; }

/* ===== RESPONSIVE (bot) ===== */
@media (max-width: 560px) {
  .bot-suggestions { grid-template-columns: 1fr; max-width: 340px; }
  .bot-bubble { max-width: 84%; }
  .bot-stage { padding-bottom: 160px; }
  .saturn-bot.size-welcome { width: 100px; height: 100px; }
  .saturn-bot.size-welcome .saturn-body { width: 66px; height: 66px; }
  .saturn-bot.size-welcome .saturn-ring-wrap { width: 100px; height: 100px; }
  .saturn-bot.size-welcome .saturn-ring { width: 90px; height: 22px; }
  .saturn-bot.size-welcome .eye-wrap { width: 66px; height: 66px; }
  .saturn-bot.size-welcome .eye-left  { left: 16px; top: 24px; width: 12px; height: 18px; }
  .saturn-bot.size-welcome .eye-right { left: 38px; top: 24px; width: 12px; height: 18px; }
  .bot-welcome-inner { flex-direction: column; gap: 20px; }
  .bot-welcome-saturn, .bot-welcome-dial { max-width: 100%; }
  .emotion-dial { width: 140px; }
  .emotion-dial-item { width: 120px; }
}

@media (prefers-reduced-motion: reduce) { .saturn-bot * { animation: none !important; transition: none !important; } }
