.ojomi-chat {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(14px, 2vw, 28px);
  z-index: 9999;
  font-family: inherit;
  color: #f7f0df;
  --ojomi-ink: #f7f0df;
  --ojomi-muted: rgba(247, 240, 223, 0.68);
  --ojomi-panel: rgba(9, 23, 19, 0.94);
  --ojomi-panel-2: rgba(15, 35, 29, 0.96);
  --ojomi-gold: #c7a24c;
  --ojomi-line: rgba(218, 187, 103, 0.28);
  --ojomi-user: #d5b45d;
  --ojomi-bot: rgba(255, 247, 226, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 240ms ease, transform 240ms ease;
}

body.intro-complete .ojomi-chat--hint,
body.intro-complete .ojomi-chat--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  right: clamp(18px, 4vw, 72px);
  bottom: clamp(18px, 6vh, 86px);
}

.ojomi-chat--embedded {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  min-height: 560px;
  opacity: 1;
  transform: none;
}

body:not(.page-faq-active) .ojomi-chat--embedded {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.ojomi-chat * {
  box-sizing: border-box;
}

.ojomi-chat button,
.ojomi-chat input {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
}

.ojomi-chat__launcher {
  position: relative;
  display: none;
  place-items: end;
  width: 128px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.ojomi-chat__launcher img {
  width: min(128px, 24vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.24));
  transform-origin: 55% 88%;
  animation: ojomi-idle 5.8s ease-in-out infinite;
  transition: transform 220ms ease, filter 220ms ease;
}

.ojomi-chat--hint .ojomi-chat__launcher {
  display: grid;
}

.ojomi-chat__launcher:hover img {
  transform: scale(1.018, 0.986);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.3));
}

.ojomi-chat--open .ojomi-chat__launcher img {
  animation: ojomi-listen 4.2s ease-in-out infinite;
}

.ojomi-chat--answering .ojomi-chat__launcher img {
  animation: ojomi-answer-pop 460ms ease both;
}

.ojomi-chat__bubble {
  position: absolute;
  right: 86px;
  bottom: 110px;
  min-width: 154px;
  max-width: 210px;
  padding: 10px 12px;
  border: 1px solid rgba(213, 180, 93, 0.48);
  border-radius: 8px;
  background: rgba(5, 15, 12, 0.98);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  color: #f7f0df;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  transform-origin: 100% 100%;
  animation: ojomi-bubble-in 520ms ease both, ojomi-bubble-pulse 3.2s ease-in-out 900ms infinite;
}

.ojomi-chat__bubble::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: 16px;
  width: 16px;
  height: 16px;
  border-right: 1px solid var(--ojomi-line);
  border-bottom: 1px solid var(--ojomi-line);
  background: rgba(5, 15, 12, 0.98);
  transform: rotate(-45deg);
}

.ojomi-chat__panel {
  position: absolute;
  right: 0;
  bottom: 152px;
  width: min(560px, calc(100vw - 28px));
  max-height: min(700px, calc(100vh - 36px));
  display: none;
  grid-template-rows: auto minmax(0, 1fr) 180px;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 34%, 230px);
  overflow: hidden;
  border: 1px solid var(--ojomi-line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 80% 100%, rgba(90, 128, 90, 0.18), transparent 34%),
    linear-gradient(180deg, var(--ojomi-panel-2), var(--ojomi-panel));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.46);
  transform-origin: 100% 100%;
  animation: ojomi-panel-in 220ms ease both;
}

.ojomi-chat--open .ojomi-chat__panel {
  display: grid;
}

.ojomi-chat--embedded .ojomi-chat__panel {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-height: none;
  display: grid;
  border-color: rgba(213, 180, 93, 0.18);
  border-radius: 0;
  background:
    radial-gradient(circle at 88% 78%, rgba(79,224,200,0.12), transparent 28%),
    rgba(7, 23, 18, 0.46);
  box-shadow: none;
  animation: none;
}

.ojomi-chat--embedded .ojomi-chat__head,
.ojomi-chat--embedded .ojomi-chat__launcher,
.ojomi-chat--embedded .ojomi-chat__stage {
  display: none;
}

.ojomi-chat--embedded .ojomi-chat__body {
  padding: clamp(22px, 3vw, 44px);
}

.ojomi-chat--embedded .ojomi-chat__message {
  max-width: 78%;
}

.ojomi-chat--embedded .ojomi-chat__quick {
  gap: clamp(12px, 1.5vw, 20px);
  margin: 0;
  max-width: 660px;
}

.ojomi-chat--embedded .ojomi-chat__quick button {
  min-height: clamp(54px, 5.2vw, 78px);
  padding: 14px clamp(18px, 2vw, 28px);
  border-color: rgba(213, 180, 93, 0.34);
  background: rgba(255, 255, 255, 0.075);
  font-size: clamp(16px, 1.45vw, 24px);
  font-weight: 700;
}

.ojomi-chat--embedded .ojomi-chat__form {
  padding: clamp(16px, 2vw, 28px);
  border-top-color: rgba(213, 180, 93, 0.24);
  background: rgba(4, 12, 10, 0.28);
}

.ojomi-chat--embedded .ojomi-chat__input {
  height: clamp(48px, 4.8vw, 68px);
  font-size: clamp(16px, 1.35vw, 22px);
}

.ojomi-chat--embedded .ojomi-chat__send {
  width: clamp(48px, 4.8vw, 68px);
  height: clamp(48px, 4.8vw, 68px);
}

.ojomi-chat--open .ojomi-chat__bubble {
  display: none;
}

.ojomi-chat--open .ojomi-chat__launcher {
  display: none;
}

.ojomi-chat__head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ojomi-line);
  background: rgba(4, 12, 10, 0.42);
}

.ojomi-chat__lang {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.ojomi-chat__lang button {
  min-width: 30px;
  height: 26px;
  border: 1px solid rgba(218, 187, 103, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ojomi-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.ojomi-chat__lang button.active {
  background: rgba(213, 180, 93, 0.92);
  color: #101512;
}

.ojomi-chat__avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(218, 187, 103, 0.42);
  box-shadow: inset 0 0 14px rgba(213, 180, 93, 0.16), 0 0 14px rgba(53, 206, 170, 0.1);
}

.ojomi-chat__avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.ojomi-chat__title {
  min-width: 0;
  flex: 1;
}

.ojomi-chat__name {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ojomi-ink);
}

.ojomi-chat__state {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--ojomi-muted);
}

.ojomi-chat__mood {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--ojomi-muted);
}

.ojomi-chat__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ojomi-ink);
  font-family: Arial, sans-serif !important;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.ojomi-chat__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ojomi-chat__body {
  grid-column: 1 / -1;
  overflow: auto;
  padding: 14px;
  position: relative;
}

.ojomi-chat__stage {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  justify-self: end;
  position: relative;
  right: auto;
  bottom: auto;
  width: clamp(190px, 15vw, 226px);
  height: clamp(270px, 21vw, 322px);
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  margin: -82px 10px 12px 0;
}

.ojomi-chat__stage img {
  width: auto;
  max-width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.42));
  transform: scaleX(-1);
  transform-origin: 50% 90%;
  animation: ojomi-idle-stage 5.8s ease-in-out infinite;
}

.ojomi-chat--answering .ojomi-chat__stage img {
  animation: ojomi-answer-pop-stage 460ms ease both;
}

.ojomi-chat__message {
  position: relative;
  z-index: 2;
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.38;
  animation: ojomi-message-in 180ms ease both;
}

.ojomi-chat__message--bot {
  background: var(--ojomi-bot);
  border: 1px solid rgba(247, 240, 223, 0.1);
}

.ojomi-chat__message--user {
  margin-left: auto;
  background: rgba(213, 180, 93, 0.92);
  color: #101512;
}

.ojomi-chat__quick {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ojomi-chat__quick button {
  width: 100%;
  border: 1px solid var(--ojomi-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ojomi-ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.ojomi-chat__quick button:hover {
  background: rgba(213, 180, 93, 0.18);
  transform: translateX(-2px);
}

.ojomi-chat__form {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 8px;
  min-height: 176px;
  padding: 22px 10px 18px 18px;
  border-top: 1px solid var(--ojomi-line);
  background:
    linear-gradient(90deg, rgba(4, 12, 10, 0.52), rgba(12, 35, 28, 0.36));
  align-content: end;
}

.ojomi-chat__note {
  grid-column: 1 / -1;
  max-width: 330px;
  margin: 0 0 18px;
  color: rgba(247, 240, 223, 0.78);
  font-size: 16px;
  line-height: 1.42;
  font-weight: 400;
}

.ojomi-chat__input {
  min-width: 0;
  height: 42px;
  border: 1px solid var(--ojomi-line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #101512;
  font: inherit;
  font-size: 14px;
}

.ojomi-chat__send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #d5b45d !important;
  background-image: none !important;
  color: #101512;
  font-family: Arial, sans-serif !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ojomi-chat__send:hover {
  background: #f0d47a !important;
}

.ojomi-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 62px;
}

.ojomi-chat__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(35, 27, 21, 0.5);
  animation: ojomi-dot 900ms ease-in-out infinite;
}

.ojomi-chat__typing span:nth-child(2) {
  animation-delay: 120ms;
}

.ojomi-chat__typing span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes ojomi-idle {
  0%, 100% { transform: scaleX(-1) scale(1, 1); }
  48% { transform: scaleX(-1) scale(1.006, 0.996); }
  70% { transform: scaleX(-1) scale(0.997, 1.004); }
}

@keyframes ojomi-listen {
  0%, 100% { transform: scaleX(-1) scale(1, 1); }
  50% { transform: scaleX(-1) scale(1.01, 0.992); }
}

@keyframes ojomi-answer-pop {
  0% { transform: scaleX(-1) scale(1, 1); }
  35% { transform: scaleX(-1) scale(1.035, 0.965); }
  68% { transform: scaleX(-1) scale(0.988, 1.018); }
  100% { transform: scaleX(-1) scale(1, 1); }
}

@keyframes ojomi-idle-stage {
  0%, 100% { transform: scaleX(-1) scale(1, 1); }
  48% { transform: scaleX(-1) scale(1.006, 0.996); }
  70% { transform: scaleX(-1) scale(0.997, 1.004); }
}

@keyframes ojomi-answer-pop-stage {
  0% { transform: scaleX(-1) scale(1, 1); }
  35% { transform: scaleX(-1) scale(1.035, 0.965); }
  68% { transform: scaleX(-1) scale(0.988, 1.018); }
  100% { transform: scaleX(-1) scale(1, 1); }
}

@keyframes ojomi-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ojomi-bubble-pulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.02); }
}

@keyframes ojomi-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ojomi-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ojomi-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 620px) {
  .ojomi-chat {
    right: 10px;
    bottom: 10px;
  }

  body.intro-complete .ojomi-chat--hint,
  body.intro-complete .ojomi-chat--open {
    right: 10px;
    bottom: 10px;
  }

  .ojomi-chat--embedded {
    min-height: 520px;
  }

  .ojomi-chat__launcher {
    width: 102px;
  }

  .ojomi-chat__launcher img {
    width: 102px;
  }

  .ojomi-chat__bubble {
    right: 64px;
    bottom: 86px;
    min-width: 132px;
    font-size: 13px;
  }

  .ojomi-chat__panel {
    right: 0;
    bottom: 118px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 156px);
  }

  .ojomi-chat__body {
    padding: 12px;
  }

  .ojomi-chat__stage {
    width: 132px;
    height: 188px;
    margin: -44px 6px 10px 0;
  }

  .ojomi-chat__form {
    min-height: 132px;
    padding: 12px 6px 10px 10px;
  }

  .ojomi-chat__note {
    max-width: 220px;
    margin-bottom: 10px;
    font-size: 14px;
  }
}
