.kh-chat__panel {
  border-color: rgba(47, 139, 189, 0.58);
  background:
    radial-gradient(circle at 85% 0%, rgba(28, 118, 177, 0.13), transparent 34%),
    #061722;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(32, 119, 164, 0.08);
}

.kh-chat__head {
  padding: 0.9rem 1rem;
  background: linear-gradient(125deg, rgba(12, 52, 80, 0.96), rgba(7, 29, 44, 0.98));
}

.kh-chat__head > button {
  display: none;
}

.kh-chat__welcome {
  margin: auto 0;
  padding: 1.35rem 1.25rem 0.75rem;
}

.kh-chat__welcome > img {
  width: 48px;
  height: 48px;
}

.kh-chat__welcome h2 {
  margin-top: 0.65rem;
  font-size: 1.12rem;
}

.kh-chat__form {
  gap: 0.65rem;
  margin: 0;
  padding: 0.8rem 1rem 1rem;
  border: 0;
  border-top: 1px solid rgba(40, 96, 125, 0.58);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(4, 17, 27, 0.42), rgba(4, 17, 27, 0.86));
  box-shadow: none;
  transition: background 0.18s ease;
}

.kh-chat__form:focus-within {
  background: linear-gradient(180deg, rgba(6, 24, 37, 0.62), rgba(4, 17, 27, 0.92));
}

.kh-chat__form input,
.kh-chat__form textarea {
  border-color: rgba(43, 93, 119, 0.9);
  border-radius: 11px;
  background: rgba(8, 29, 42, 0.86);
  padding: 0.72rem 0.78rem;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.kh-chat__form input:focus,
.kh-chat__form textarea:focus {
  border-color: #2da9eb;
  background: #081f2e;
  box-shadow: 0 0 0 3px rgba(45, 169, 235, 0.09);
}

.kh-chat__form textarea {
  height: 44px;
  min-height: 44px;
  max-height: 132px;
  overflow-y: hidden;
  resize: none;
  line-height: 1.35;
}

.kh-chat__form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  gap: 0.55rem;
  width: 100%;
  padding: 0.68rem 0.95rem;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(17, 116, 218, 0.27);
  font-size: 0.78rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.kh-chat__form button::after {
  content: '→';
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.kh-chat__form button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 11px 28px rgba(17, 116, 218, 0.34);
}

.kh-chat__form button:hover::after {
  transform: translateX(2px);
}

.kh-chat__form button:active {
  transform: translateY(0);
}

.kh-chat__form button:disabled {
  cursor: wait;
  filter: saturate(0.55);
  opacity: 0.65;
  transform: none;
}

.kh-chat__composer {
  gap: 0.6rem;
  padding: 0.75rem;
  background: rgba(4, 17, 27, 0.78);
}

.kh-chat__composer textarea {
  height: 44px;
  min-height: 44px;
  max-height: 132px;
  overflow-y: hidden;
  resize: none;
  border-radius: 12px;
  background: #071c29;
  line-height: 1.4;
}

.kh-chat__composer textarea:focus {
  border-color: #2da9eb;
  box-shadow: 0 0 0 3px rgba(45, 169, 235, 0.09);
}

.kh-chat__composer button {
  min-width: 66px;
  border-radius: 11px;
  box-shadow: 0 7px 20px rgba(17, 116, 218, 0.24);
}

.kh-chat__new {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 54px;
  padding: 0.8rem 1rem;
  border: 0;
  border-top: 1px solid var(--ui-line, #173f55);
  background: linear-gradient(135deg, var(--ui-accent, #22aefa), var(--ui-accent-2, #176ed9));
  color: #fff;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.kh-chat__new:hover,
.kh-chat__new:focus-visible {
  filter: brightness(1.13);
}

@media (max-width: 520px) {
  .kh-chat__head > button {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(105, 177, 215, 0.22);
    border-radius: 10px;
    background: rgba(5, 22, 34, 0.48);
    font-size: 0;
    cursor: pointer;
  }

  .kh-chat__head > button::before,
  .kh-chat__head > button::after {
    content: '';
    position: absolute;
    width: 19px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
  }

  .kh-chat__head > button::before {
    transform: rotate(45deg);
  }

  .kh-chat__head > button::after {
    transform: rotate(-45deg);
  }

  .kh-chat__form {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }
}
