.obcity-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #132238;
}

.obcity-chat-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #136f63;
  color: #fff;
  box-shadow: 0 14px 38px rgba(19, 111, 99, 0.28);
  cursor: pointer;
  font: 700 15px/1.1 inherit;
}

.obcity-chat-button:hover,
.obcity-chat-button:focus-visible {
  background: #0f5e54;
  outline: 3px solid rgba(246, 196, 67, 0.42);
  outline-offset: 3px;
}

.obcity-chat-button__icon {
  font-size: 21px;
  line-height: 1;
}

.obcity-chat-panel {
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 104px));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgba(19, 34, 56, 0.12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(11, 24, 43, 0.24);
}

.obcity-chat-panel[hidden] {
  display: none;
}

.obcity-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 14px 16px;
  background: #132238;
  color: #fff;
}

.obcity-chat-header strong,
.obcity-chat-header span {
  display: block;
}

.obcity-chat-header strong {
  font-size: 16px;
  line-height: 1.25;
}

.obcity-chat-header span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.3;
}

.obcity-chat-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: 400 25px/1 inherit;
}

.obcity-chat-close:hover,
.obcity-chat-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.obcity-chat-messages {
  height: calc(100% - 238px);
  min-height: 190px;
  overflow-y: auto;
  padding: 16px;
  background: #f5f7f3;
}

.obcity-chat-message {
  display: flex;
  margin: 0 0 10px;
}

.obcity-chat-message--visitor {
  justify-content: flex-end;
}

.obcity-chat-message__bubble {
  max-width: min(82%, 290px);
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  color: #132238;
  box-shadow: 0 1px 2px rgba(19, 34, 56, 0.08);
  font-size: 14px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.obcity-chat-message--visitor .obcity-chat-message__bubble {
  background: #136f63;
  color: #fff;
}

.obcity-chat-form {
  padding: 12px;
  border-top: 1px solid rgba(19, 34, 56, 0.1);
  background: #fff;
}

.obcity-chat-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.obcity-chat-input,
.obcity-chat-textarea {
  width: 100%;
  border: 1px solid rgba(19, 34, 56, 0.18);
  border-radius: 6px;
  background: #fff;
  color: #132238;
  font: 400 14px/1.35 inherit;
}

.obcity-chat-input {
  height: 38px;
  padding: 0 10px;
}

.obcity-chat-textarea {
  min-height: 78px;
  max-height: 150px;
  padding: 10px;
  resize: vertical;
}

.obcity-chat-input:focus,
.obcity-chat-textarea:focus {
  border-color: #136f63;
  outline: 3px solid rgba(19, 111, 99, 0.14);
}

.obcity-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.obcity-chat-status {
  min-height: 18px;
  color: #6b5b16;
  font-size: 12px;
  line-height: 1.3;
}

.obcity-chat-send {
  min-width: 112px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: #f6c443;
  color: #132238;
  cursor: pointer;
  font: 800 14px/1 inherit;
}

.obcity-chat-send:hover,
.obcity-chat-send:focus-visible {
  background: #e8b329;
  outline: none;
}

.obcity-chat-send:disabled {
  cursor: progress;
  opacity: 0.7;
}

@media (max-width: 520px) {
  .obcity-chat {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .obcity-chat-panel {
    width: 100%;
    height: min(620px, calc(100vh - 94px));
  }

  .obcity-chat-button {
    float: right;
  }

  .obcity-chat-fields {
    grid-template-columns: 1fr;
  }

  .obcity-chat-messages {
    height: calc(100% - 276px);
  }
}
