/* DOT отправки */
.chat-dot-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: auto; /* <- исправлено! Кнопка всегда кликабельна */
  transition: opacity 0.6s cubic-bezier(0.32,0.72,0.32,1);
  width: 36px;
  height: 36px;
}

.chat-dot-btn .dot-svg-wrap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.22s;
  box-shadow: 0 1px 10px #0003;
}

body.light-theme .chat-dot-btn .dot-svg-wrap {
  background: #fff;
  color: #000;
  box-shadow: 0 1px 10px #0001;
}

body:not(.light-theme) .chat-dot-btn .dot-svg-wrap {
  background: #000;
  color: #fff;
}

.chat-dot-btn .dot-svg-wrap svg {
  display: block;
  width: 32px;
  height: 32px;
}

.chat-dot-btn.dot-show {
  opacity: 1 !important;
  pointer-events: auto;
  transition: opacity 0.65s cubic-bezier(0.32,0.72,0.32,1);
}

#dot-core.dot-hide {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.32,0.72,0.32,1);
}

/* === Чатовая разметка === */

.chat-window {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  position: relative;
  background: transparent;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom)); /* увеличенный нижний отступ */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  scroll-behavior: smooth;
}

/* Сообщения */
.chat-message {
  padding: 7px 18px;
  border-radius: 14px;
  background: #161616;
  color: #fff;
  font-size: 17px;
  align-self: flex-start;
  max-width: 76vw;
  word-break: break-word;
  box-shadow: 0 1px 5px #0003;
  margin-bottom: 2px;
}

body.light-theme .chat-message {
  background: #f1f1f1;
  color: #222;
  box-shadow: 0 1px 4px #0001;
}

/* Форма ввода */
#chat-form {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px calc(35px + env(safe-area-inset-bottom)) 16px;
  background: #000;
  border-top: 1px solid #333;
  z-index: 100;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.light-theme #chat-form {
  background: #fff;
  border-top: 1px solid #ffff;
}

.chat-input {
  flex: 1 1 auto;
  font-size: 18px;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  padding: 8px 12px;
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  transition: background 0.17s;
}

.chat-input::placeholder {
  color: #999;
  opacity: 0.85;
}

body.light-theme .chat-input {
  background: #fff;
  color: #000;
}

@media (max-width: 600px) {
  .chat-message {
    max-width: 92vw;
    font-size: 16px;
    padding: 7px 8px;
  }

/* Scrollbar для сообщений */
.chat-messages {
  scrollbar-width: thin;
  scrollbar-color: #222 #181818;
}

body.light-theme .chat-messages {
  scrollbar-color: #ccc #fafafa;
}
/* ==== DOT login modal styles ==== */
.login-modal button {
  width: 100%;
  padding: 12px 0;
  margin-bottom: 14px;
  border: none !important;
  border-radius: 22px;
  background: #111 !important;
  color: #fff !important;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 10px #0001;
  transition: background 0.18s, color 0.15s, box-shadow 0.17s;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.login-modal button:last-child {
  margin-bottom: 0;
}
.login-modal button:hover,
.login-modal button:focus {
  background: #000 !important;
  color: #fff !important;
  box-shadow: 0 2px 20px #0002;
}
.login-modal input {
  width: 100%;
  font-size: 16px;
  margin-bottom: 10px;
  padding: 9px 13px;
  border: 1px solid #d5d5d5;
  border-radius: 10px;
  background: #fafafa;
  color: #222;
  outline: none;
  transition: border 0.17s;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.login-modal input:focus {
  border: 1.5px solid #111;
}
.login-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 0;
}
@media (max-width: 600px) {
  .login-modal {
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
}
.login-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 36px 22px 24px 22px;
  box-sizing: border-box;
  border-radius: 22px;
  box-shadow: 0 4px 36px #0002;
}
@media (max-width: 600px) {
  .login-modal {
    border-radius: 0;
    box-shadow: none;
    padding: 18px 4vw 20px 4vw;
    max-width: 100vw;
  }
}
.login-modal svg {
  margin-bottom: 18px;
}
.login-modal .dot-slogan {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 28px;
  text-align: center;
  letter-spacing: 0.01em;
  color: #222;
}
/* Кнопки в модалке логина/регистрации */
.login-modal button {
  width: 100%;
  padding: 12px 0;
  margin-bottom: 14px;
  border: none;
  border-radius: 22px;
  background: #111;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 10px #0001;
  transition: background 0.18s, color 0.15s, box-shadow 0.17s;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.login-modal button:last-child {
  margin-bottom: 0;
}

.login-modal button:hover,
.login-modal button:focus {
  background: #000;
  color: #fff;
  box-shadow: 0 2px 20px #0002;
}
.logout-btn {
  display: block;
  width: 100px;
  margin: 10px auto 20px auto;
  padding: 8px 0;
  border: none;
  border-radius: 12px;
  background-color: #d33;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.logout-btn:hover {
  background-color: #a00;
}