/* ══════════════════════════════════════════════════════════════
   НефроСфера — Chat Modal Styles
   ══════════════════════════════════════════════════════════════ */

.chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.chat-overlay.active { display: flex; }

.chat-modal {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
  width: 100%;
  max-width: 480px;
  height: 85vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--primary);
  color: #fff;
  border-radius: 1rem 1rem 0 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chat-header h3 { font-size: 1rem; font-weight: 600; }
.chat-header small { font-size: .75rem; opacity: .85; }

.chat-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.chat-close:hover { background: rgba(255,255,255,.3); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}

.msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: .9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.msg-bot {
  align-self: flex-start;
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.msg-typing {
  align-self: flex-start;
  background: #fff;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
  font-style: italic;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 18px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
}
.chat-input:focus { border-color: var(--primary); }

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background .2s;
}
.chat-send:hover { background: var(--primary-hover); }
.chat-send:disabled { background: #94a3b8; cursor: not-allowed; }
