/* Assistente — tridente desktop (stile Clippy) */

.as-mascot {
  position: fixed;
  right: 18px;
  bottom: calc(var(--taskbar-h, 48px) + 14px);
  z-index: 180;
  width: 96px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.as-mascot[hidden] {
  display: none !important;
}

.as-mascot-body {
  width: 96px;
  height: 112px;
  cursor: grab;
  position: relative;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

.as-mascot-body:active {
  cursor: grabbing;
}

.as-mascot-svg {
  width: 96px;
  height: 112px;
  display: block;
  overflow: visible;
}

.as-mascot.is-idle .as-float {
  animation: as-float 3s ease-in-out infinite;
}

.as-mascot.is-listen .as-prong-l {
  animation: as-prong-l 0.7s ease-in-out infinite;
  transform-origin: 0px 40px;
}

.as-mascot.is-listen .as-prong-r {
  animation: as-prong-r 0.7s ease-in-out infinite;
  transform-origin: 0px 40px;
}

.as-mascot.is-think .as-trident {
  animation: as-tilt 1.4s ease-in-out infinite;
  transform-origin: 0px 60px;
}

.as-mascot.is-talk .as-head {
  animation: as-nod 0.4s ease-in-out infinite;
  transform-origin: 0px 40px;
}

.as-mascot.is-talk .as-eyes {
  animation: as-blink 1s ease-in-out infinite;
}

@keyframes as-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes as-prong-l {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-8deg); }
}

@keyframes as-prong-r {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}

@keyframes as-tilt {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

@keyframes as-look {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(2px, 1px); }
  70% { transform: translate(-2px, 0); }
}

@keyframes as-nod {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-3deg) translateY(1px); }
}

@keyframes as-blink {
  0%, 82%, 100% { opacity: 1; }
  88% { opacity: 0.15; }
}

.as-bubble {
  position: absolute;
  right: 0;
  bottom: 118px;
  width: min(340px, calc(100vw - 24px));
  background: #1b2030;
  border: 1px solid #2c3350;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
  color: #eef1fb;
  font-family: system-ui, -apple-system, sans-serif;
  user-select: text;
  -webkit-user-select: text;
}

.as-mascot.is-open .as-bubble {
  display: flex;
}

.as-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #232a40;
  font-size: 13px;
  font-weight: 700;
}

.as-bubble-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.as-bubble-close {
  border: 0;
  background: transparent;
  color: #9aa3c4;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
}

.as-bubble-log {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.as-msg {
  font-size: 13px;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 95%;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.as-msg.user {
  align-self: flex-end;
  background: #3a86ff;
  color: #fff;
}

.as-msg.bot {
  align-self: flex-start;
  background: #232a40;
  color: #eef1fb;
}

.as-msg.sys {
  align-self: center;
  background: transparent;
  color: #9aa3c4;
  font-size: 12px;
  padding: 2px 0;
}

.as-confirm {
  display: flex;
  gap: 8px;
  padding: 0 12px 10px;
}

.as-confirm button {
  flex: 1;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.as-confirm .ok {
  background: #3a86ff;
  color: #fff;
}

.as-confirm .no {
  background: #2c3350;
  color: #eef1fb;
}

.as-bubble-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #232a40;
}

.as-bubble-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #2c3350;
  background: #151a28;
  color: #eef1fb;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
}

.as-bubble-form button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #2c3350;
  color: #eef1fb;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.as-bubble-form button.primary {
  background: #3a86ff;
}

.as-bubble-form button.is-rec {
  background: #e0533d;
  animation: as-pulse 0.8s ease-in-out infinite;
}

.as-bubble-form button:disabled {
  opacity: 0.5;
  cursor: wait;
}
