/* LevelUp v38 — czytelna typografia AI i płynna zmiana avatara bez przeładowania. */

/* AI może być renderowane portalem poza #root, dlatego reguły nie są ograniczone do #root. */
.levelupAiDrawerV38 {
  font-size: 14px !important;
}

.levelupAiDrawerV38 .aiDrawerHeader strong,
.levelupAiDrawerV38 .levelupAiTitleV38 {
  font-size: 16px !important;
  line-height: 1.25 !important;
  letter-spacing: -.01em !important;
}

.levelupAiDrawerV38 .aiDrawerHeader span,
.levelupAiDrawerV38 .levelupAiStatusV38 {
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}

.levelupAiDrawerV38 .aiModeTabs button,
.levelupAiDrawerV38 .levelupAiModeV38 {
  min-height: 42px !important;
  font-size: 13px !important;
  line-height: 1.25 !important;
}

.levelupAiDrawerV38 .aiContext {
  min-height: 46px !important;
  padding: 10px 12px !important;
  font-size: 12.5px !important;
  line-height: 1.55 !important;
}

.levelupAiDrawerV38 .chatFeed {
  padding: 18px 14px 26px !important;
}

.levelupAiDrawerV38 .chatMessage {
  gap: 10px !important;
  margin-bottom: 17px !important;
}

.levelupAiDrawerV38 .chatAvatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
}

.levelupAiDrawerV38 .chatBubble {
  max-width: 90% !important;
  padding: 13px 14px !important;
  font-size: 14px !important;
  line-height: 1.62 !important;
}

.levelupAiDrawerV38 .chatBubble p,
.levelupAiDrawerV38 .chatBubble li,
.levelupAiDrawerV38 .chatBubble strong {
  font-size: inherit !important;
  line-height: inherit !important;
}

.levelupAiDrawerV38 .quickPrompts {
  margin-top: 12px !important;
  margin-left: 44px !important;
  gap: 8px !important;
}

.levelupAiDrawerV38 .quickPrompts > span,
.levelupAiDrawerV38 .levelupAiQuickLabelV38 {
  margin-bottom: 4px !important;
  font-size: 11.5px !important;
  line-height: 1.4 !important;
}

.levelupAiDrawerV38 .quickPrompts button {
  min-height: 38px !important;
  padding: 8px 12px !important;
  gap: 7px !important;
  font-size: 12.5px !important;
  line-height: 1.35 !important;
}

.levelupAiDrawerV38 .aiResults {
  margin-top: 12px !important;
  gap: 8px !important;
}

.levelupAiDrawerV38 .aiResults > button {
  min-height: 58px !important;
  padding: 9px 10px !important;
  grid-template-columns: 35px minmax(0, 1fr) auto !important;
  gap: 10px !important;
}

.levelupAiDrawerV38 .aiResults > button > span {
  width: 35px !important;
  height: 35px !important;
  font-size: 10px !important;
}

.levelupAiDrawerV38 .aiResults > button strong {
  font-size: 13px !important;
  line-height: 1.3 !important;
}

.levelupAiDrawerV38 .aiResults > button small,
.levelupAiDrawerV38 .moreResults {
  font-size: 11px !important;
  line-height: 1.4 !important;
}

.levelupAiDrawerV38 .aiResultActions button,
.levelupAiDrawerV38 .actionButtons button {
  min-height: 36px !important;
  padding: 0 11px !important;
  font-size: 11.5px !important;
}

.levelupAiDrawerV38 .actionTitle strong {
  font-size: 13px !important;
}

.levelupAiDrawerV38 .actionTitle small {
  font-size: 11px !important;
}

.levelupAiDrawerV38 .aiActionCard textarea {
  min-height: 82px !important;
  padding: 12px !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}

.levelupAiDrawerV38 .aiActionCard > p {
  font-size: 10.5px !important;
  line-height: 1.5 !important;
}

.levelupAiDrawerV38 .aiComposer {
  min-height: 64px !important;
  padding: 9px 9px 9px 13px !important;
}

.levelupAiDrawerV38 .aiComposer textarea,
.levelupAiDrawerV38 textarea::placeholder {
  font-size: 13.5px !important;
  line-height: 1.5 !important;
}

/* Morning Brief — osobne elementy tekstowe oznaczane bez ruszania DOM Reacta. */
.levelupAiDrawerV38 .levelupAiMorningTitleV38 {
  font-size: 17px !important;
  line-height: 1.25 !important;
}

.levelupAiDrawerV38 .levelupAiMorningGreetingV38 {
  font-size: 25px !important;
  line-height: 1.16 !important;
  letter-spacing: -.025em !important;
}

.levelupAiDrawerV38 .levelupAiMorningSectionV38,
.levelupAiDrawerV38 .levelupAiRecommendationV38 {
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}

/* Bezpieczny fallback dla tekstów, których klasy zmieniają się w bundlu. */
.levelupAiDrawerV38 button {
  font-size: max(12px, 1em) !important;
}

.levelupAiDrawerV38 p {
  line-height: 1.55 !important;
}

/* Avatar */
.trainerAvatar {
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  cursor: pointer !important;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease !important;
}

.trainerAvatar:hover,
.trainerAvatar:focus-visible {
  border-color: rgba(239, 199, 95, .62) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .10), 0 9px 25px rgba(0, 0, 0, .26) !important;
  transform: translateY(-1px);
}

.trainerAvatar::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: rgba(4, 6, 8, .58) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23f4d36c' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4h-5L8 6H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-3z'/%3E%3Ccircle cx='12' cy='13' r='3.25'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  transition: opacity .18s ease;
}

.trainerAvatar:hover::after,
.trainerAvatar:focus-visible::after {
  opacity: 1;
}

.trainerAvatar.levelupAvatarPreviewV38 {
  background-image: var(--levelup-avatar-preview) !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

.trainerAvatar.levelupAvatarPreviewV38 > svg {
  opacity: 0 !important;
}

html.levelupAvatarUploadingV38 .trainerAvatar {
  pointer-events: none;
  opacity: .72;
}

#levelupAvatarToastV38 {
  position: fixed;
  z-index: 10000;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 32px));
  min-height: 50px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .9);
  background: rgba(17, 18, 22, .97);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .45);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

#levelupAvatarToastV38.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#levelupAvatarToastV38 .levelupAvatarToastDot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d8b14a;
  box-shadow: 0 0 0 4px rgba(216, 177, 74, .10);
}

#levelupAvatarToastV38.is-success .levelupAvatarToastDot { background: #55d998; }
#levelupAvatarToastV38.is-error .levelupAvatarToastDot { background: #ff6b79; }
#levelupAvatarToastV38.is-loading .levelupAvatarToastDot { animation: levelupAvatarPulseV38 .9s ease-in-out infinite alternate; }

@keyframes levelupAvatarPulseV38 {
  from { opacity: .35; transform: scale(.78); }
  to { opacity: 1; transform: scale(1.12); }
}

@media (max-width: 520px) {
  .levelupAiDrawerV38 .chatBubble { max-width: 93% !important; font-size: 13.5px !important; }
  .levelupAiDrawerV38 .quickPrompts { margin-left: 0 !important; }
  .levelupAiDrawerV38 .levelupAiMorningGreetingV38 { font-size: 22px !important; }
}

@media (max-width: 760px) {
  #levelupAvatarToastV38 { right: 12px; bottom: 12px; }
}
