/* ============ Cheers — палитра брендбука ============ */
:root {
  --pink:  #F4C6DD;  /* Bubbly Pink — нежность и эмпатия */
  --pink-soft: #F9DEEC;
  --wine:  #870526;  /* Warm Hug — уверенность и профессионализм */
  --peach: #FD934F;  /* Peachy Mood — радость */
  --navy:  #384D6B;  /* Cool Trust — баланс и свежесть */
  --cream: #F2EFE6;  /* Soft Glow — чистота и пространство */

  --font-head: 'Comfortaa', system-ui, sans-serif;   /* прототип: вместо TT Transforma */
  --font-body: 'Montserrat', system-ui, sans-serif;
  --font-hand: 'Caveat', cursive;

  --radius-blob: 46% 54% 51% 49% / 55% 47% 53% 45%;
  --radius-band: 48px 64px 52px 70px / 60px 48px 66px 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--wine);
  background: var(--pink);
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 500; line-height: 1.25; }
h2 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 32px; }
h3 { font-size: 19px; }

img { max-width: 100%; display: block; }
a { color: inherit; }

/* волнистая мягкая плашка — фирменная форма без острых углов */
.blob { border-radius: var(--radius-blob); }

/* ============ Кнопки ============ */
.btn {
  font-family: var(--font-head);
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  padding: 10px 22px;
  border-radius: 24px 28px 24px 30px / 30px 24px 28px 24px;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: rotate(-1deg) scale(1.04); }
.btn-primary { background: var(--wine); color: var(--pink); }
.btn-primary:hover { background: var(--peach); color: var(--wine); }
.btn-ghost {
  background: transparent; color: var(--wine);
  outline: 2px solid var(--wine); outline-offset: -2px;
}
.btn-ghost:hover { background: var(--wine); color: var(--pink); }
.btn-lg { font-size: 18px; padding: 14px 36px; }

/* ============ Шапка ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--pink);
  border-bottom: 1px solid rgba(135, 5, 38, .18);
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  padding-top: 14px; padding-bottom: 14px;
}
.header-logo img { height: 26px; width: auto; }
.main-nav { display: flex; gap: 22px; margin-left: auto; }
.main-nav a {
  text-decoration: none; font-weight: 500; font-size: 15px;
}
.main-nav a:hover { color: var(--peach); }
.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions [hidden] { display: none; }
.burger { display: none; }

/* ============ Хиро ============ */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 72px 0 96px;
}
.hero-inner { position: relative; }
.hero-logo {
  width: min(480px, 70vw);
  margin: 0 auto 8px;
}
.hero-title {
  margin: 28px auto 44px;
  max-width: 1000px;
  font-size: clamp(26px, 3.9vw, 54px);
  line-height: 1.2;
}

/* дудлы и рукописные стикеры */
.doodle { position: absolute; color: var(--wine); opacity: .85; pointer-events: none; }
.doodle-hero-star   { width: 90px;  left: 8%;  top: 12%; transform: rotate(-12deg); }
.doodle-hero-spiral { width: 110px; right: 9%; top: 18%; transform: rotate(9deg); }
.doodle-hero-wave   { width: 200px; left: 12%; bottom: 10%; }
.sticker {
  font-family: var(--font-hand);
  font-size: 24px;
  color: var(--navy);
  position: absolute;
  pointer-events: none;
}
.sticker.inline { position: static; font-size: 20px; color: var(--peach); }
.sticker-1 { left: 16%; top: 34%; transform: rotate(-8deg); }
.sticker-2 { right: 14%; top: 42%; transform: rotate(6deg); }
.sticker-3 { right: 20%; bottom: 18%; transform: rotate(-5deg); }
.sticker-4 { left: 9%;  bottom: 30%; transform: rotate(4deg); }

/* ============ О нас ============ */
.about { background: var(--cream); padding: 88px 0; }
.about-inner {
  display: grid; grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 56px; align-items: center;
}
.about-photo {
  background: var(--pink);
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid; place-items: center;
  overflow: hidden;
}
.about-photo .doodle-placeholder { width: 65%; opacity: .9; }
.about-photo figcaption {
  position: absolute; left: 50%; bottom: 12%;
  transform: translateX(-50%) rotate(-4deg);
  white-space: nowrap;
  font-size: 26px; color: var(--wine);
}
.about-text p { margin-bottom: 14px; max-width: 56ch; }
.accent-line { font-family: var(--font-hand); font-size: 26px; color: var(--peach); }

/* ============ Преимущества ============ */
.benefits { padding: 88px 0; }
.benefits-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 56px;
}
.benefit-card {
  background: var(--cream);
  padding: 28px 30px;
  border-radius: var(--radius-band);
}
.benefit-card:nth-child(3n)   { background: var(--navy); color: var(--cream); }
.benefit-card:nth-child(3n) h3 { color: var(--pink); }
.benefit-card h3 { margin-bottom: 10px; }
.benefit-card p { font-size: 15px; }

.cta-band {
  background: var(--wine);
  color: var(--pink);
  text-align: center;
  padding: 56px 32px;
  position: relative;
  overflow: hidden;
  border-radius: 70px 90px 60px 100px / 90px 60px 100px 70px;
}
.cta-band .cta-doodle {
  color: var(--pink); opacity: .35;
  width: 130px; left: 6%; top: 50%; transform: translateY(-50%) rotate(-8deg);
}
.cta-text {
  font-family: var(--font-head);
  font-size: clamp(22px, 3vw, 32px);
  margin-bottom: 24px;
}
.cta-band .btn-primary { background: var(--peach); color: var(--wine); }
.cta-band .btn-primary:hover { background: var(--pink); }

/* ============ Мастера ============ */
.masters { padding: 88px 0; position: relative; }
.doodle-masters { width: 190px; right: 4%; top: 34px; opacity: .5; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.carousel-nav { display: flex; gap: 8px; }
.carousel-btn {
  width: 44px; height: 44px;
  border-radius: 50% 46% 52% 48%;
  border: 2px solid var(--wine);
  background: transparent; color: var(--wine);
  font-size: 18px; cursor: pointer;
  transition: background .15s, color .15s;
}
.carousel-btn:hover { background: var(--wine); color: var(--pink); }

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(300px, 78vw);
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 4px 20px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.master-card {
  scroll-snap-align: start;
  background: var(--cream);
  border-radius: 34px 40px 36px 42px / 42px 34px 40px 36px;
  padding: 26px 26px 30px;
}
.master-photo {
  background: var(--pink);
  aspect-ratio: 1;
  display: grid; place-items: center;
  margin-bottom: 18px;
  overflow: hidden;
}
.master-photo img { width: 70%; }
.master-role { font-size: 14px; opacity: .75; margin: 2px 0 8px; }
.master-with {
  display: flex; gap: 12px; align-items: flex-end;
  min-height: 30px; margin-bottom: 12px;
}
.animal-ico { height: 28px; width: auto; }
.animal-ico.small { height: 19px; }
.master-card > p:last-child { font-size: 15px; }

/* ============ Магазин ============ */
.shop { background: var(--cream); padding: 88px 0; }
.shop-note { margin: -16px 0 32px; }
.shop-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--pink);
  padding: 24px;
  text-align: center;
  transition: transform .15s ease;
  border-radius: var(--radius-band);
}
.product-card:hover { transform: rotate(-1.2deg) translateY(-4px); }
.product-img {
  height: 150px;
  display: grid; place-items: center;
  margin-bottom: 14px;
  color: var(--wine);
}
.product-img img { max-height: 120px; width: auto; }
.product-card h3 { font-size: 16px; margin-bottom: 8px; }
.price { font-weight: 600; color: var(--peach); font-size: 18px; }

/* ============ Салоны ============ */
.salons { background: var(--navy); color: var(--cream); padding: 88px 0; position: relative; overflow: hidden; }
.salons h2 { color: var(--pink); }
.doodle-salons { width: 240px; right: 6%; top: 40px; color: var(--pink); opacity: .6; }
.salons-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; margin-bottom: 32px;
}
.salon-card { background: rgba(244, 198, 221, .12); padding: 30px 34px; border-radius: var(--radius-band); }
.salon-card h3 { color: var(--pink); margin-bottom: 8px; }
.salon-addr { font-size: 18px; font-weight: 600; }
.salon-phone { display: inline-block; margin-top: 10px; text-decoration: none; color: var(--peach); font-weight: 600; }
.salons-note a { color: var(--peach); }

/* ============ Подвал ============ */
.site-footer { background: var(--wine); color: var(--pink); padding: 56px 0 24px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(244, 198, 221, .25);
}
.footer-logo { height: 34px; width: auto; filter: brightness(0) saturate(100%) invert(85%) sepia(9%) saturate(742%) hue-rotate(288deg) brightness(103%); }
.footer-brand p { font-family: var(--font-hand); font-size: 22px; margin-top: 6px; }
.footer-nav { display: grid; gap: 8px; align-content: start; }
.footer-nav a, .footer-contacts a { color: var(--pink); text-decoration: none; }
.footer-nav a:hover, .footer-contacts a:hover { color: var(--peach); }
.footer-contacts { display: grid; gap: 8px; align-content: start; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 20px; font-size: 14px; opacity: .85; flex-wrap: wrap;
}
.footer-note { font-family: var(--font-hand); font-size: 19px; }

/* ============ Чат с командой ============ */
.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.chat-toggle {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 48% 52% 45% 55% / 56% 46% 54% 44%;
  background: var(--wine);
  color: var(--pink);
  /* Кремовое кольцо отделяет кнопку от фона того же цвета */
  box-shadow: 0 0 0 3px var(--cream), 0 12px 30px rgba(56, 77, 107, .28);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.chat-toggle.has-unread svg {
  animation: chat-unread-nudge 4.8s ease-in-out infinite;
  transform-origin: center;
}
.chat-toggle.has-unread-arrival {
  animation: chat-unread-arrival .12s ease-in-out 3;
}
.chat-unread-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border: 2px solid var(--cream);
  border-radius: 999px;
  background: #e84f67;
  color: #fff;
  box-shadow: 0 4px 12px rgba(56, 77, 107, .24);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}
.chat-unread-badge[hidden] { display: none; }
@keyframes chat-unread-arrival {
  0%, 100% { transform: translateX(0) rotate(0); }
  35% { transform: translateX(-3px) rotate(-2deg); }
  70% { transform: translateX(3px) rotate(2deg); }
}
@keyframes chat-unread-nudge {
  0%, 78%, 100% { transform: rotate(0) translateX(0); }
  82% { transform: rotate(-9deg) translateX(-1px); }
  86% { transform: rotate(8deg) translateX(1px); }
  90% { transform: rotate(-6deg) translateX(-1px); }
  94% { transform: rotate(4deg) translateX(0); }
}
.chat-toggle:hover {
  transform: rotate(-3deg) scale(1.06);
  background: var(--peach);
  color: var(--wine);
  box-shadow: 0 0 0 3px var(--cream), 0 14px 34px rgba(56, 77, 107, .34);
}
.chat-toggle:focus-visible, .chat-close:focus-visible {
  outline: 3px solid var(--peach);
  outline-offset: 3px;
}
.chat-toggle svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-panel {
  /* Поверх кнопки-пузыря, в правом нижнем углу виджета */
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 48px));
  min-height: 470px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(135, 5, 38, .14);
  border-radius: 34px 28px 36px 30px / 30px 36px 28px 34px;
  background: var(--cream);
  color: var(--wine);
  box-shadow: 0 20px 55px rgba(56, 77, 107, .3);
}
.chat-panel[hidden] { display: none; }
.chat-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid rgba(135, 5, 38, .1);
}
.chat-kicker {
  margin-bottom: 2px;
  font-family: var(--font-hand);
  font-size: 21px;
  line-height: 1.2;
  color: var(--peach);
}
.chat-panel h2 {
  margin: 0;
  font-size: 26px;
}
.chat-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pink-soft);
  color: var(--wine);
  cursor: pointer;
}
.chat-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
}
.chat-connection {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--blue);
  font-size: 12px;
}
.chat-connection span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--peach);
  box-shadow: 0 0 0 3px rgba(254, 146, 78, .14);
}
.chat-connection.is-online span {
  background: #4f9569;
  box-shadow: 0 0 0 3px rgba(79, 149, 105, .14);
}
.chat-connection.is-offline span {
  background: #bd5664;
  box-shadow: 0 0 0 3px rgba(189, 86, 100, .14);
}
.chat-messages {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px 12px;
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 199, 222, .24) 0 35px, transparent 36px),
    linear-gradient(180deg, #fbf8f1, var(--cream));
  scrollbar-color: rgba(135, 5, 38, .25) transparent;
}
.chat-history-loader {
  position: sticky;
  z-index: 2;
  top: 0;
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 auto 12px;
  padding: 6px 10px;
  border-radius: 99px;
  background: rgba(242, 239, 230, .94);
  color: var(--blue);
  box-shadow: 0 4px 14px rgba(56, 77, 107, .12);
  font-size: 11px;
}
.chat-history-loader[hidden] { display: none; }
.chat-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(56, 77, 107, .2);
  border-top-color: var(--peach);
  border-radius: 50%;
  animation: chat-spin .7s linear infinite;
}
@keyframes chat-spin { to { transform: rotate(360deg); } }
.chat-empty {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
  color: var(--blue);
}
.chat-empty[hidden] { display: none; }
.chat-empty > span {
  color: var(--peach);
  font-family: var(--font-hand);
  font-size: 34px;
  line-height: 1;
}
.chat-empty p {
  max-width: 240px;
  font-size: 13px;
  line-height: 1.5;
}
.chat-message {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin: 0 0 12px;
}
.chat-message.is-visitor { justify-items: end; }
.chat-message-body {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 9px 18px 18px 18px;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 5px 16px rgba(56, 77, 107, .08);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.chat-message.is-visitor .chat-message-body {
  border-radius: 18px 9px 18px 18px;
  background: var(--wine);
  color: var(--cream);
}
.chat-message-meta {
  padding: 0 4px;
  color: rgba(56, 77, 107, .72);
  font-size: 10px;
}
.chat-message.is-pending .chat-message-body { opacity: .72; }
.chat-message.is-failed .chat-message-body {
  outline: 2px solid rgba(189, 86, 100, .4);
}
.chat-error {
  margin: 0;
  padding: 8px 20px;
  background: rgba(189, 86, 100, .1);
  color: #9d3546;
  font-size: 12px;
  line-height: 1.35;
}
.chat-error[hidden] { display: none; }
.chat-form {
  flex: 0 0 auto;
  display: grid;
  gap: 9px;
  padding: 14px 18px 16px;
  border-top: 1px solid rgba(135, 5, 38, .1);
  background: var(--cream);
}
.chat-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
}
.chat-name-field[hidden] { display: none; }
.chat-name-known {
  margin: 0;
  padding: 0 4px;
  color: rgba(56, 77, 107, .72);
  font-size: 12px;
}
.chat-name-known[hidden] { display: none; }
.chat-form input {
  width: 100%;
  border: 1px solid rgba(135, 5, 38, .2);
  border-radius: 12px;
  padding: 8px 11px;
  background: #fff;
  color: var(--wine);
  font: 13px/1.4 var(--font-body);
}
.chat-form input:focus, .chat-compose textarea:focus {
  outline: 2px solid var(--peach);
  outline-offset: 1px;
}
.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: end;
  gap: 8px;
}
.chat-compose textarea {
  width: 100%;
  min-height: 42px;
  max-height: 112px;
  resize: none;
  overflow-y: auto;
  border: 2px solid var(--pink);
  border-radius: 15px;
  padding: 9px 11px;
  background: #fff;
  color: var(--wine);
  font: 14px/1.45 var(--font-body);
}
.chat-submit {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 48% 52% 46% 54%;
  background: var(--peach);
  color: var(--wine);
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease;
}
.chat-submit:hover { transform: rotate(-3deg) scale(1.04); }
.chat-submit svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chat-submit:disabled {
  opacity: .38;
  cursor: not-allowed;
}
.chat-submit:disabled:hover { transform: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ Модалка записи ============ */
.book-modal {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: 30px 36px 32px 38px / 38px 30px 36px 32px;
  background: var(--cream);
  color: var(--wine);
  padding: 36px 40px;
  width: min(440px, 92vw);
}
.book-modal::backdrop { background: rgba(56, 77, 107, .55); }
.book-form { display: grid; gap: 14px; }
.book-form h2 { margin-bottom: 0; }
.book-note { font-family: var(--font-hand); font-size: 20px; color: var(--peach); }
.book-note.ok { color: #3d8a5f; }
.book-note.err { color: #c5484f; }
.book-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
.required-mark { color: #c5484f; font-weight: 700; margin-left: 3px; }
.book-form input, .book-form textarea {
  font-family: var(--font-body);
  font-size: 15px;
  border: 2px solid var(--pink);
  border-radius: 14px;
  padding: 9px 12px;
  background: #fff;
  color: var(--wine);
}
.book-form input:focus, .book-form textarea:focus { outline: 2px solid var(--peach); }
.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 26px;
  color: var(--wine); cursor: pointer;
}

/* ============ Адаптив ============ */
@media (max-width: 860px) {
  .about-inner { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .doodle-masters { display: none; }
}
@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--pink);
    flex-direction: column;
    padding: 18px 24px 24px;
    border-bottom: 1px solid rgba(135, 5, 38, .18);
  }
  .main-nav.open { display: flex; }
  /* Вправо шапку прижимает margin-left:auto у .main-nav, но на мобильном
     меню display:none и его auto-отступ исчезает — прижимаем сами кнопки.
     Зазоры считаем по видимым полоскам бургера (у него 6px паддинга под
     тап-область): -6px справа компенсирует паддинг → до края экрана 24px,
     gap 18px + 6px паддинга → между кнопками те же 24px. */
  .header-actions { margin-left: auto; gap: 18px; }
  .burger {
    display: grid; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 6px;
    margin-right: -6px;
  }
  .burger span { width: 24px; height: 2.5px; background: var(--wine); border-radius: 2px; }
  .btn-ghost { display: none; }
  .sticker-3, .sticker-4, .doodle-hero-wave { display: none; }
  /* На узком экране заголовок занимает почти всю ширину, и стикеры,
     позиционированные в процентах от высоты hero, попадают на его строки
     (высота hero плавает с числом строк заголовка). Позиции задаём от верха
     hero и ширины экрана (логотип 70vw, пропорции 592×275): «мягко» — под
     низом логотипа (48px паддинга + 32.5vw), «без стресса» — в свободном
     углу справа сверху, над спиралькой (её верх ≈ 18% высоты hero) */
  .sticker-1 { left: 12%; top: calc(48px + 29vw); }
  .sticker-2 { right: 8%; top: clamp(28px, 10vw, 60px); }
  .hero { padding: 48px 0 64px; }
  .hero-line1 { white-space: normal; }
  .chat-widget { right: 16px; bottom: 16px; }
  .chat-toggle { width: 58px; height: 58px; }
  /* Чат — на весь экран, в обычном потоке документа (НЕ fixed): для полей
     внутри fixed-контейнеров Safari криво считает видимость каретки (у них
     нет позиции в документе) и панорамирует вьюпорт при каждом фокусе.
     У полей в потоке координаты честные — доскролл видит, что каретка уже
     видна, и вырождается в no-op. Под клавиатурой JS ужимает высоту панели */
  body.chat-lock .chat-widget { position: static; }
  .chat-panel {
    position: static;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }
  .chat-panel:not([hidden]) ~ .chat-toggle { display: none; }
  /* Пока чат открыт, контент сайта убран из потока: документу нечего
     скроллить, и сафарин «доскролл к каретке» при фокусе полей вырождается
     в no-op вместо дёрганья панели. Позицию скролла JS вернёт при закрытии.
     Кремовый фон body закрывает просвет за полупрозрачной клавиатурой iOS
     и её панелью подсказок. */
  body.chat-lock { overflow: hidden; background: var(--cream); }
  body.chat-lock .site-header,
  body.chat-lock main,
  body.chat-lock .site-footer { display: none; }
  .chat-panel-head { padding: 14px 20px 12px; }
  /* Компактная шапка: заголовок прячем, остаются кикер и строка статуса */
  .chat-panel h2 { display: none; }
  /* Имя-строку над полем ввода показываем только на десктопе */
  .chat-name-known { display: none; }
  /* Ужатые отступы формы и ленты сообщений */
  .chat-messages { padding: 14px 14px 10px; }
  .chat-form { padding: 10px 12px 12px; gap: 7px; }
  .chat-form input { padding: 7px 10px; }
  .chat-compose { gap: 7px; }
  .chat-compose textarea { min-height: 40px; padding: 8px 10px; }
  .chat-submit { width: 40px; height: 40px; }
}

/* iOS Safari зумит страницу при фокусе на поле со шрифтом < 16px */
@media (hover: none), (pointer: coarse) {
  .chat-form input { font-size: 16px; }
  .chat-compose textarea { font-size: 16px; }
  .book-form input, .book-form textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-toggle { transition: none; }
  .chat-toggle.has-unread-arrival { animation: none; }
  .chat-toggle.has-unread svg { animation: none; }
  .chat-spinner { animation: none; }
}
