.medikur-chat {
  --chat-blue: #b5322d;
  position: fixed;
  z-index: 1000;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  font-family: Inter, Arial, sans-serif;
  color: #15171c;
  font-size: 14px;
  line-height: 1.5;
}
.medikur-chat *,
.medikur-chat *::before,
.medikur-chat *::after {
  box-sizing: border-box;
}
.medikur-chat button,
.medikur-chat textarea {
  font: inherit;
}
.medikur-chat button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.medikur-chat button:focus-visible,
.medikur-chat textarea:focus-visible {
  outline: 3px solid #b5322d;
  outline-offset: 4px;
}
.medikur-chat [hidden] {
  display: none !important;
}
.medikur-chat__launcher {
  display: block;
  position: relative;
  width: 64px;
  height: 64px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 16px;
}
.medikur-chat__head {
  position: absolute;
  width: 88px;
  height: 88px;
  max-width: none;
  inset: -12px;
  pointer-events: none;
  filter: drop-shadow(0 4px 4px #11214424);
}
.medikur-chat__head-video {
  visibility: hidden;
}
.medikur-chat__launcher.is-animating .medikur-chat__head-video.is-current {
  visibility: visible;
}
.medikur-chat__launcher.is-animating > img {
  visibility: hidden;
}
.medikur-chat__sleep {
  position: absolute;
  top: -14px;
  right: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms;
}
.medikur-chat__sleep span {
  position: absolute;
  color: #67738c;
  font-weight: 600;
  font-size: 13px;
  animation: medikur-sleep 2.4s linear infinite paused;
}
.medikur-chat__sleep span:nth-child(2) {
  animation-delay: -0.8s;
  font-size: 17px;
}
.medikur-chat__sleep span:nth-child(3) {
  animation-delay: -1.6s;
  font-size: 14px;
}
.medikur-chat__launcher.is-sleeping .medikur-chat__sleep {
  opacity: 1;
}
.medikur-chat__launcher.is-sleeping .medikur-chat__sleep span {
  animation-play-state: running;
}
@keyframes medikur-sleep {
  0% {
    transform: translate(-10px, 8px) scale(0.75);
    opacity: 0;
  }
  20% {
    opacity: 0.85;
  }
  100% {
    transform: translate(12px, -28px) scale(1.1);
    opacity: 0;
  }
}
.medikur-chat__panel {
  position: absolute;
  width: 360px;
  height: min(510px, calc(100dvh - 120px));
  right: 0;
  bottom: 84px;
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid #e2e5ec;
  border-radius: 17px;
  box-shadow:
    0 14px 50px #15264b20,
    0 3px 10px #15264b0a;
  transform-origin: calc(100% - 32px) bottom;
  animation: medikur-chat-open 180ms ease-out;
}
.medikur-chat__panel::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -9px;
  width: 17px;
  height: 17px;
  background: white;
  border-right: 1px solid #e2e5ec;
  border-bottom: 1px solid #e2e5ec;
  transform: rotate(45deg);
}
@keyframes medikur-chat-open {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.medikur-chat__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px 16px;
  border-radius: 16px 16px 0 0;
  background: var(--chat-blue);
  color: #fff;
}
.medikur-chat__avatar {
  width: 34px;
  height: 34px;
  object-fit: cover;
  transform: scale(1.4);
  margin-right: 2px;
}
.medikur-chat__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.3px;
}
.medikur-chat__close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  border: 0;
  background: transparent;
  border-radius: 50%;
}
.medikur-chat__close:hover {
  background: #ffffff1a;
}
.medikur-chat__close svg {
  width: 22px;
  height: 22px;
}
.medikur-chat__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 18px 12px;
  scrollbar-width: thin;
}
.medikur-chat__day {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #586174;
  font-size: 12px;
  margin-bottom: 22px;
}
.medikur-chat__day::before,
.medikur-chat__day::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #e9ecf2;
}
.medikur-chat__message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 18px;
}
.medikur-chat__message p {
  max-width: 88%;
  margin: 0;
  padding: 11px 14px;
  background: #f0f1f5;
  border-radius: 16px 16px 16px 4px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
}
.medikur-chat__message time {
  margin-top: 5px;
  font-size: 11px;
  color: #586174;
}
.medikur-chat__message--user {
  align-items: flex-end;
}
.medikur-chat__message--user p {
  background: var(--chat-blue);
  color: white;
  border-radius: 16px 16px 4px 16px;
}
.medikur-chat__typing {
  display: flex;
  gap: 5px;
  width: fit-content;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: #f0f1f5;
  border-radius: 16px 16px 16px 4px;
}
.medikur-chat__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #586174;
  animation: medikur-chat-typing 1.2s ease-in-out infinite;
}
.medikur-chat__typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.medikur-chat__typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes medikur-chat-typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-3px);
  }
}
html[data-motion-paused="true"] .medikur-chat__typing span {
  animation: none;
}
.medikur-chat__form {
  margin: 0;
  padding: 8px 16px 15px;
}
.medikur-chat__input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 72px;
  padding: 9px;
  border: 1px solid #788393;
  border-radius: 22px;
}
.medikur-chat__input-wrap:focus-within {
  border-color: var(--chat-blue);
  box-shadow: 0 0 0 2px #b5322d0d;
}
.medikur-chat__input {
  display: block;
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 4px 2px 4px 5px;
  resize: none;
  border: 0;
  background: transparent;
  color: #15171c;
  font-size: 14px;
  line-height: 21px;
}
.medikur-chat__input::placeholder {
  color: #586174;
}
.medikur-chat .medikur-chat__input:focus-visible {
  outline: none;
}
.medikur-chat__send {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--chat-blue);
  color: white;
}
.medikur-chat__send:disabled {
  opacity: 0.45;
  cursor: default;
}
.medikur-chat__send svg {
  width: 23px;
  height: 23px;
}
.medikur-chat__status {
  margin: 8px 4px 0;
  color: #586174;
  font-size: 10px;
  line-height: 1.4;
}
.medikur-chat__status:empty {
  margin: 0;
}
.medikur-chat__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .medikur-chat {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .medikur-chat__panel {
    width: calc(100vw - 24px);
    max-width: 360px;
    height: min(510px, calc(100dvh - 110px));
    bottom: 80px;
  }
  .medikur-chat .medikur-chat__input {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .medikur-chat__typing span {
    animation: none;
  }
  .medikur-chat__panel {
    animation: none;
  }
  .medikur-chat__sleep {
    display: none;
  }
}

.medikur-chat__message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.medikur-chat__message a {
  color: #b5322d;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.medikur-chat__message a:hover {
  text-decoration-thickness: 2px;
}
.medikur-chat__message a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.medikur-chat__header button:focus-visible {
  outline-color: #fff;
  outline-offset: 1px;
}

.medikur-chat.is-compact .medikur-chat__panel {
  bottom: 0;
  height: calc(100dvh - 32px);
  overflow-y: auto;
}
.medikur-chat.is-compact .medikur-chat__panel::after {
  display: none;
}
.medikur-chat.is-compact .medikur-chat__header,
.medikur-chat.is-compact .medikur-chat__form {
  flex-shrink: 0;
}
.medikur-chat.is-compact .medikur-chat__messages {
  flex: 1 0 80px;
}
.medikur-chat.is-compact .medikur-chat__launcher[aria-expanded="true"] {
  visibility: hidden;
}

@media (pointer: coarse) {
  .medikur-chat .medikur-chat__input {
    font-size: 16px;
  }
}

.medikur-chat.is-constrained {
  bottom: 0;
}
.medikur-chat.is-constrained .medikur-chat__header {
  min-height: 44px;
  padding: 2px 8px;
}
.medikur-chat.is-constrained .medikur-chat__form {
  padding: 4px;
}
.medikur-chat.is-constrained .medikur-chat__input-wrap {
  min-height: 50px;
  padding: 4px;
}
.medikur-chat.is-constrained .medikur-chat__input {
  height: 34px;
}
:host {
  all: initial;
}
.demo-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 17px;
  border: 1px solid #dbe1eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 20px #14264b15;
  font:
    12px/1.4 Arial,
    sans-serif;
  color: #4c566b;
}
.demo-badge b {
  color: #b5322d;
}
.demo-badge a {
  color: #b5322d;
  text-decoration: none;
}
.medikur-chat {
  z-index: 10000;
}
.medikur-chat__panel {
  width: 400px;
  height: min(620px, calc(100dvh - 130px));
}
.medikur-chat__close {
  font-size: 29px;
}
.demo-subtitle {
  display: block;
  font-size: 11px;
  opacity: 0.85;
}
.demo-page-context {
  padding: 9px 18px;
  background: #fff7ef;
  font-size: 11px;
  color: #596579;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.medikur-chat__message p {
  max-width: 95%;
  font-size: 14px;
}
.demo-suggestions {
  display: grid;
  gap: 7px;
  margin: 4px 0 18px;
}
.demo-suggestions button {
  border: 1px solid #f0d8c9;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  color: #a92b28;
  background: white;
  font-size: 12px;
}
.demo-suggestions button:hover {
  background: #fff4eb;
}
.demo-sources {
  font-size: 11px;
  margin: 8px 0;
  color: #68738b;
  max-width: 100%;
}
.demo-sources summary {
  cursor: pointer;
}
.demo-sources a {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}
.demo-review,
.demo-reset {
  background: none;
  border: 0;
  color: #65738c;
  font-size: 10px;
  padding: 5px 0;
  text-decoration: underline;
  text-align: left;
}
.demo-reset {
  display: block;
  margin: 3px auto 0;
}
.is-thinking {
  color: #64748b;
  animation: demo-pulse 1.2s infinite alternate;
}
@keyframes demo-pulse {
  to {
    opacity: 0.45;
  }
}
@media (max-width: 480px) {
  .medikur-chat__panel {
    width: calc(100vw - 24px);
    max-width: 400px;
  }
  .demo-badge {
    left: 8px;
    bottom: 10px;
    gap: 8px;
    padding: 8px 10px;
    font-size: 10px;
  }
  .medikur-chat__title {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-thinking {
    animation: none;
  }
}
.demo-hotels {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}
.demo-hotel {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e1e6f1;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  text-decoration: none !important;
  line-height: 1.4;
  font-size: 11px;
}
.demo-hotel img {
  width: 70px;
  height: 63px;
  object-fit: cover;
  flex-shrink: 0;
}
.demo-hotel span {
  padding: 7px 7px 7px 0;
}
.medikur-chat__launcher {
  width: 64px;
  height: 64px;
  background: #b5322d;
  border-radius: 50%;
  box-shadow: 0 5px 22px #6d302630;
  display: grid;
  place-items: center;
}
.medikur-chat__head {
  position: static;
  inset: auto;
  width: 48px;
  height: 48px;
  background: #fff9f0;
  border-radius: 50%;
  filter: none;
  padding: 3px;
}
.medikur-chat__avatar {
  width: 34px;
  height: 34px;
  background: #fff9f0;
  border-radius: 50%;
  padding: 3px;
  transform: none;
  object-fit: contain;
}
