.mira-widget { position: fixed; z-index: 35; right: max(24px,env(safe-area-inset-right)); bottom: max(22px,env(safe-area-inset-bottom)); font-family: Golos, sans-serif; color: #2a2d50; }
.mira-widget[hidden], .mira-invite[hidden] { display: none; }
.mira-widget button, .mira-widget textarea { font: inherit; }
.mira-launcher { position: relative; display: grid; justify-items: center; width: 90px; height: 104px; padding: 0; border: 0; background: none; color: #2a2d50; cursor: pointer; animation: mira-arrive .5s ease-out both; }
/* A CSS window onto the actual robot in the course intro, no new mascot. */
.mira-robot { display: block; flex: none; width: 80px; height: 80px; border-radius: 28px; background: #f0e5ee url('./assets/motion/hero-intro-desktop-v2-poster.webp') -482.5px -120.6px / 812.7px 457.1px no-repeat; box-shadow: 0 8px 24px #2a2d5020, 0 0 0 1px #fff; }
.mira-launcher .mira-robot { animation: mira-greet 1.6s ease-in-out 2; }
.mira-label { font-size: 12px; font-weight: 700; background: white; padding: 3px 14px; border-radius: 20px; margin-top: -9px; box-shadow: 0 2px 8px #2a2d5010; z-index: 1; }
.mira-invite { position: absolute; right: 0; bottom: 116px; width: 280px; border: 1px solid #d7deeb; border-radius: 20px 20px 5px 20px; padding: 22px; background: #fff; box-shadow: 0 12px 48px #2a2d5020; animation: mira-arrive .4s ease-out both; }
.mira-invite strong { display: block; font-size: 19px; line-height: 1.3; padding-right: 20px; }
.mira-invite p { margin: 10px 0 12px; font-size: 14px; line-height: 1.55; color: #59617b; }
.mira-dismiss, .mira-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; font-size: 26px!important; color: #59617b; background: transparent; cursor: pointer; }
.mira-dismiss { position: absolute; right: 5px; top: 5px; }
.mira-start { min-height: 44px; border: 0; padding: 8px 0; font-weight: 600!important; color: #ad0c51; background: transparent; cursor: pointer; }
.mira-dialog { position: fixed; inset: auto max(24px,env(safe-area-inset-right)) max(22px,env(safe-area-inset-bottom)) auto; width: min(440px,calc(100vw - 32px)); height: min(690px,calc(100dvh - 32px)); max-height: none; margin: 0; padding: 0; border: 1px solid #d7deeb; border-radius: 22px; background: #fff; color: #2a2d50; box-shadow: 0 20px 70px #2a2d5033; overflow: hidden; }
.mira-dialog[open] { display: flex; flex-direction: column; }
.mira-header { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid #d7deeb; background: #eef2fa; }
.mira-header .mira-robot { zoom: .6; box-shadow: none; }
.mira-header h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.mira-header p { margin: 3px 0 0; font-size: 12px; color: #59617b; }
.mira-close { margin-left: auto; }
.mira-close:hover, .mira-dismiss:hover { background: #dfe6f3; }
.mira-messages { flex: 1; min-height: 100px; padding: 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.mira-message { max-width: 100%; padding: 14px 16px; border: 1px solid #e0e6f1; border-radius: 4px 16px 16px; background: #f7f9fd; margin-bottom: 14px; overflow-wrap: anywhere; }
.mira-message-user { margin-left: 36px; background: #2a2d50; color: white; border-color: #2a2d50; border-radius: 16px 4px 16px 16px; }
.mira-author { display: block; font-size: 11px; opacity: .8; margin-bottom: 6px; }
.mira-message p { white-space: pre-line; font-size: 14px; line-height: 1.65; margin: 0; }
.mira-message small { display: block; margin-top: 10px; color: #68728a; font-size: 10px; }
.mira-sources { display: grid; gap: 6px; margin-top: 12px; }
.mira-sources a { color: #ad0c51; font-size: 12px; line-height: 1.5; text-underline-offset: 3px; }
.mira-suggestions { display: flex; overflow-x: auto; flex: none; gap: 8px; padding: 0 18px 12px; scrollbar-width: thin; }
.mira-suggestions button { white-space: nowrap; min-height: 40px; border: 1px solid #d7deeb; border-radius: 9px; padding: 8px 11px; font-size: 12px; background: white; color: #2a2d50; cursor: pointer; }
.mira-form { flex: none; margin: 0; padding: 14px 18px; border-top: 1px solid #d7deeb; background: white; }
.mira-compose { display: flex; align-items: end; gap: 8px; }
.mira-compose textarea { min-width: 0; width: 100%; max-height: 120px; min-height: 52px; resize: vertical; border: 1px solid #bac7dd; border-radius: 10px; padding: 12px; font-size: 16px; line-height: 1.4; background: white; color: #2a2d50; }
.mira-compose button { width: 44px; height: 48px; flex: none; border: 0; border-radius: 10px; background: #ad0c51; color: white; font-size: 26px; cursor: pointer; }
.mira-form > p { font-size: 11px; line-height: 1.5; color: #59617b; margin: 10px 0 0; }
.mira-form a { color: #2a2d50; text-underline-offset: 2px; }
.mira-widget button:disabled { opacity: .5; cursor: wait; }
.mira-widget.is-open .mira-launcher { visibility: hidden; }
@keyframes mira-arrive { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes mira-greet { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-4deg); } }
@media (max-width: 600px) {
  .mira-widget { right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); }
  .mira-launcher { width: 70px; height: 84px; }
  .mira-launcher .mira-robot { zoom: .8; }
  .mira-invite { bottom: 98px; width: min(270px,calc(100vw - 24px)); padding: 18px; }
  .mira-dialog { right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); width: calc(100vw - 16px); height: min(660px,calc(100dvh - 24px)); border-radius: 18px; }
  .mira-header { padding: 12px; }
  .mira-messages { padding: 12px; }
  .mira-form { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .mira-widget *, .mira-widget *::before { animation: none!important; transition: none!important; } }
@media print { .mira-widget { display: none!important; } }
