/* Виджет чата Марии. Характер сайта: кремово-пепельный фон, тёмно-зелёный акцент, тёплый кирпич. */
.tiflis-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  font-family: var(--font-body, "Inter", "Noto Sans Georgian", system-ui, sans-serif);
  color: var(--ink, #1f2320);
}

.tiflis-chat__launcher {
  background: #fdf7ea;
  color: var(--ink, #1f2320);
  border: 1px solid var(--line, #d9cfbe);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(31,35,32,.22);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tiflis-chat__launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(31,35,32,.28); }
.tiflis-chat__launcher-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; display: block;
  background: var(--brick-soft, #e8c9ab);
}
.tiflis-chat__launcher-text { display: flex; flex-direction: column; line-height: 1.15; padding-right: 4px; }
.tiflis-chat__launcher-name { font-weight: 700; font-size: .95rem; color: var(--ink, #1f2320); }
.tiflis-chat__launcher-sub  { font-size: .72rem; color: var(--ink-mute, #78786f); }
.tiflis-chat__launcher-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2aa56a; box-shadow: 0 0 0 3px rgba(42,165,106,.18);
  display: inline-block; margin-right: 4px; vertical-align: middle;
}

.tiflis-chat__badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--brick, #a5542a); color: #fff;
  font-size: .72rem; min-width: 18px; height: 18px; border-radius: 999px;
  display: none; align-items: center; justify-content: center; padding: 0 6px;
}
.tiflis-chat.has-unread .tiflis-chat__badge { display: inline-flex; }

.tiflis-chat__panel {
  position: absolute;
  right: 0; bottom: calc(100% + 10px);
  width: 375px;
  max-height: calc(100vh - 140px);
  background: var(--paper, #fbf7f0);
  border: 1px solid var(--line, #d9cfbe);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(31,35,32,.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.tiflis-chat.is-open .tiflis-chat__panel { display: flex; }
.tiflis-chat__header {
  background: var(--accent, #2a4a3a);
  color: #fdf7ea;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.tiflis-chat__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brick-soft, #e8c9ab);
  object-fit: cover; display: block;
}
.tiflis-chat__who { font-family: var(--font-head, "Playfair Display", Georgia, serif); font-size: 1.05rem; line-height: 1.2; }
.tiflis-chat__who small { display: block; font-size: .72rem; opacity: .85; font-family: var(--font-body, system-ui); font-weight: 400; }
.tiflis-chat__close {
  margin-left: auto;
  background: transparent; border: 0; color: #fdf7ea; cursor: pointer; padding: 6px;
  width: 32px; height: 32px; border-radius: 6px; font-size: 1.2rem;
}
.tiflis-chat__close:hover { background: rgba(255,255,255,.1); }

/* Режим telegram_only — одна кнопка к живому боту, никакой имитации */
.tiflis-chat__body {
  padding: 20px 20px 12px;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--bg, #f5efe6);
}
.tiflis-chat__hello {
  background: var(--paper, #fbf7f0);
  border: 1px solid var(--line, #d9cfbe);
  border-radius: 14px;
  padding: 14px;
  color: var(--ink, #1f2320);
  font-size: .95rem; line-height: 1.45;
}
.tiflis-chat__actions {
  display: flex; flex-direction: column; gap: 10px;
}
.tiflis-chat__tg {
  background: var(--accent, #2a4a3a);
  color: #fdf7ea;
  border: 0; border-radius: 999px;
  padding: 14px 18px;
  font-size: 1rem; font-weight: 700; text-align: center;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.tiflis-chat__tg:hover { background: var(--accent-dark, #1d3327); text-decoration: none; }
.tiflis-chat__soon {
  color: var(--ink-mute, #78786f);
  font-size: .82rem; text-align: center; margin: 2px 0 10px;
}

/* --- режим web (веб-чат активен) --- */
.tiflis-chat__log {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: var(--bg, #f5efe6);
  display: flex; flex-direction: column; gap: 10px;
  min-height: 300px; max-height: 420px;
}
.tiflis-chat__msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .95rem;
  line-height: 1.4;
}
.tiflis-chat__msg--guest {
  align-self: flex-end;
  background: var(--accent, #2a4a3a);
  color: #fdf7ea;
  border-bottom-right-radius: 4px;
}
.tiflis-chat__msg--bot {
  align-self: flex-start;
  background: var(--paper, #fbf7f0);
  border: 1px solid var(--line, #d9cfbe);
  border-bottom-left-radius: 4px;
}
.tiflis-chat__msg--notice {
  align-self: center;
  background: var(--brick-soft, #e8c9ab);
  color: var(--ink, #1f2320);
  font-size: .85rem;
  border-radius: 10px;
  text-align: center;
}
.tiflis-chat__typing {
  align-self: flex-start;
  display: inline-flex; gap: 4px; align-items: center;
  background: var(--paper, #fbf7f0);
  border: 1px solid var(--line, #d9cfbe);
  padding: 10px 14px; border-radius: 14px;
}
.tiflis-chat__typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-mute, #78786f);
  animation: tiflis-typing 1s infinite ease-in-out;
}
.tiflis-chat__typing span:nth-child(2) { animation-delay: .15s; }
.tiflis-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes tiflis-typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.tiflis-chat__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line, #d9cfbe);
  background: var(--paper, #fbf7f0);
}
.tiflis-chat__input {
  flex: 1;
  border: 1px solid var(--line, #d9cfbe);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  background: var(--bg, #f5efe6);
  color: var(--ink, #1f2320);
}
.tiflis-chat__input:focus { outline: 2px solid var(--accent, #2a4a3a); outline-offset: -1px; }
.tiflis-chat__send {
  background: var(--accent, #2a4a3a);
  color: #fdf7ea;
  border: 0; border-radius: 10px;
  padding: 0 16px; font-weight: 600; cursor: pointer;
  min-width: 60px;
}
.tiflis-chat__send:disabled { opacity: .5; cursor: not-allowed; }
.tiflis-chat__send:hover:not(:disabled) { background: var(--accent-dark, #1d3327); }

.tiflis-chat__footer {
  font-size: .72rem; color: var(--ink-mute, #78786f);
  padding: 0 12px 10px; text-align: center;
}
.tiflis-chat__footer a { color: var(--accent-dark, #1d3327); }

/* Полноэкранный на /booking/ или когда сайт просит открыть */
.tiflis-chat.is-embedded {
  position: static;
  width: 100%;
}
.tiflis-chat.is-embedded .tiflis-chat__panel {
  position: relative;
  display: flex;
  right: auto; bottom: auto;
  width: 100%;
  max-height: none;
  box-shadow: none;
  border-radius: 14px;
}
.tiflis-chat.is-embedded .tiflis-chat__launcher { display: none; }

@media (max-width: 480px) {
  .tiflis-chat__panel {
    position: fixed;
    inset: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
  }
  .tiflis-chat { right: 14px; bottom: 14px; }
  .tiflis-chat__launcher { padding: 6px 12px 6px 6px; }
  .tiflis-chat__launcher-avatar { width: 40px; height: 40px; }
}
