/* ── Чат-помощник ──────────────────────────────────────────
   Кружок в углу и окно разговора. Палитра сайта: хаки и бумага,
   никаких чужих цветов. На телефоне окно разворачивается почти
   во весь экран — иначе в нём не почитать. */

.lchat {
  position: fixed;
  right: 2.2rem;
  bottom: 2.2rem;
  z-index: 120;
  font-size: 1.4rem;
}

/* ── кнопка вызова ── */

.lchat__fab {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 5.4rem;
  padding: 0 2rem 0 1.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 1.45rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20, 20, 16, .28);
  transition: background var(--fast), transform var(--fast);
}
.lchat__fab:hover {
  background: var(--brand);
  transform: translateY(-2px);
}
.lchat__fab b { font-weight: 600; }

.lchat.is-open .lchat__fab { display: none; }

/* Значок: три полоски, как заряд в знаке мастерской. */
.lchat__ico {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  width: 2.2rem;
  height: 2.2rem;
}
.lchat__ico span {
  display: block;
  height: .32rem;
  border-radius: .2rem;
  background: var(--acc);
}
.lchat__ico span:nth-child(2) { width: 70%; }
.lchat__ico span:nth-child(3) { width: 45%; }

/* ── окно ── */

.lchat__panel[hidden] { display: none; }

.lchat__panel {
  display: flex;
  flex-direction: column;
  width: min(38rem, calc(100vw - 4rem));
  height: min(56rem, calc(100svh - 12rem));
  border-radius: 1.6rem;
  background: var(--paper);
  box-shadow: 0 16px 48px rgba(20, 20, 16, .3);
  overflow: hidden;
}

.lchat__top {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.4rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
}

.lchat__mark {
  flex: none;
  width: 1.8rem;
  height: 2.6rem;
  border-width: 2px;
  border-radius: .5rem;
  color: var(--paper);
}

.lchat__who { flex: 1; line-height: 1.3; }
.lchat__who b {
  display: block;
  font-family: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -.04em;
}
.lchat__who sup { font-size: .6em; vertical-align: super; }
.lchat__who span { font-size: 1.2rem; color: #a8a89c; }

.lchat__x {
  flex: none;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}
.lchat__x:hover { background: #26271f; }

/* ── лента сообщений ── */

.lchat__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lchat__msg p {
  margin: 0;
  padding: 1rem 1.3rem;
  border-radius: 1.2rem;
  font-size: 1.4rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.lchat__msg--bot p {
  background: #e7e7dd;
  border-bottom-left-radius: .4rem;
  color: var(--ink);
}

.lchat__msg--user {
  align-self: flex-end;
  max-width: 85%;
}
.lchat__msg--user p {
  background: var(--brand);
  border-bottom-right-radius: .4rem;
  color: var(--paper);
}

.lchat__msg a { color: var(--brand); }
.lchat__msg--user a { color: var(--acc); }

.lchat__wait p { color: #6e6e64; font-style: italic; }

/* Подсказки: с ними разговор начинают чаще, чем с пустого поля. */
.lchat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .4rem;
}
.lchat__chips button {
  padding: .7rem 1.2rem;
  border: 1px solid #d2d2c4;
  border-radius: 999px;
  background: var(--paper);
  font: inherit;
  font-size: 1.3rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast);
}
.lchat__chips button:hover {
  background: #eeeee4;
  border-color: var(--brand);
}

/* ── ввод ── */

.lchat__form {
  display: flex;
  gap: .8rem;
  padding: 1.2rem 1.4rem 1.4rem;
  border-top: 1px solid #ddddd2;
}

.lchat__form input {
  flex: 1;
  padding: 1rem 1.3rem;
  border: 1px solid #d2d2c4;
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 1.4rem;
}
.lchat__form input:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}

.lchat__form button {
  flex: none;
  width: 4.2rem;
  height: 4.2rem;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--fast);
}
.lchat__form button:hover { background: var(--brand); }

/* ── телефон ── */

@media (max-width: 620px) {
  .lchat { right: 1.4rem; bottom: 1.4rem; }

  .lchat__fab { height: 4.8rem; padding: 0 1.6rem 0 1.3rem; }

  .lchat__panel {
    position: fixed;
    inset: auto 1.2rem 1.2rem;
    width: auto;
    height: min(72svh, 56rem);
  }
}
