/* Чат-бот «Покос травы» — оформление в стилистике сайта:
   зелёный акцент (#276847), тёмный блок #18392a, фон #f9faf5, шрифт Gilroy. */

#pokosbot, #pokosbot * { box-sizing: border-box; }
#pokosbot {
  --bot-accent: #276847;
  --bot-accent-hover: #194d33;
  --bot-ink: #20352a;
  --bot-dark: #18392a;
  --bot-pale: #e6ecde;
  --bot-line: #dedfd9;
  --bot-muted: #65716a;
  z-index: 54;
  font: 15px/1.5 Gilroy, Arial, Helvetica, sans-serif;
  color: var(--bot-ink);
}

#pokosbot .launch {
  position: fixed; right: 20px; bottom: 92px;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 14px 22px;
  background: var(--bot-accent); color: #fff;
  border: 1px solid var(--bot-accent); border-radius: 8px;
  font: 700 14px/1 Gilroy, Arial, Helvetica, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(39, 104, 71, .32);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
#pokosbot .launch::before {
  content: ""; width: 18px; height: 18px; flex: none;
  background: currentColor;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20c0-6 4-10 10-10 2 0 4 .5 6 1.5C20 18 16 21 10 21c-2 0-4-.3-6-1Z'/%3E%3Cpath d='M9 21c1-5 4-8 8-9'/%3E%3C/svg%3E");
  mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20c0-6 4-10 10-10 2 0 4 .5 6 1.5C20 18 16 21 10 21c-2 0-4-.3-6-1Z'/%3E%3Cpath d='M9 21c1-5 4-8 8-9'/%3E%3C/svg%3E");
}
#pokosbot .launch:hover { background: var(--bot-accent-hover); border-color: var(--bot-accent-hover); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(39, 104, 71, .42); }
#pokosbot .launch:focus-visible { outline: 3px solid var(--bot-accent); outline-offset: 5px; }

#pokosbot .panel {
  display: none; position: fixed; right: 20px; bottom: 160px; z-index: 61;
  width: min(410px, calc(100vw - 24px));
  height: min(600px, calc(100dvh - 200px));
  flex-direction: column;
  background: #fff; border: 1px solid var(--bot-line); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(24, 57, 42, .22);
  overflow: hidden;
}
#pokosbot .panel.open { display: flex; animation: pokos-bot-rise .18s ease; }
@keyframes pokos-bot-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#pokosbot header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bot-dark); color: #fff;
}
#pokosbot .logo {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  background: var(--bot-accent); color: #fff;
  border-radius: 9px; font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
#pokosbot .head-text { flex: 1; min-width: 0; }
#pokosbot .head-text b { display: block; font-size: 16px; letter-spacing: -.02em; }
#pokosbot .head-text small { display: block; font-size: 12px; color: #bbcdbd; }
#pokosbot header .close {
  background: none; border: 0; color: #fff; font-size: 26px; line-height: 1;
  padding: 0 2px; cursor: pointer; opacity: .85;
}
#pokosbot header .close:hover { opacity: 1; }
#pokosbot header .close:focus-visible { outline: 3px solid #bbcdbd; outline-offset: 3px; }

#pokosbot .progress { height: 3px; background: var(--bot-pale); }
#pokosbot .progress span { display: block; height: 100%; width: 0; background: var(--bot-accent); transition: width .25s ease; }
#pokosbot .progress.done span { background: var(--bot-accent-hover); }

#pokosbot .msgs {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  background: #f9faf5;
}
#pokosbot .bubble {
  max-width: 90%; padding: 11px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
#pokosbot .bot { align-self: flex-start; background: #fff; border: 1px solid var(--bot-line); border-bottom-left-radius: 4px; }
#pokosbot .user { align-self: flex-end; background: var(--bot-pale); border: 1px solid #d3ddc6; border-bottom-right-radius: 4px; }

#pokosbot .controls {
  flex-shrink: 0; max-height: 42%; overflow-y: auto;
  padding: 12px; background: #fff; border-top: 1px solid #eceee6;
  display: flex; flex-direction: column; gap: 9px;
}
#pokosbot .choices { display: flex; flex-wrap: wrap; gap: 8px; }

#pokosbot .opt, #pokosbot a.opt {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 9px 14px;
  background: #fff; border: 1px solid var(--bot-line); border-radius: 8px;
  color: var(--bot-ink); font: 600 13px/1.3 Gilroy, Arial, Helvetica, sans-serif;
  cursor: pointer; text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
#pokosbot .opt:hover { border-color: var(--bot-accent); color: var(--bot-accent); }
#pokosbot .opt:focus-visible { outline: 3px solid var(--bot-accent); outline-offset: 2px; }
#pokosbot .opt.subtle { font-weight: 400; color: var(--bot-muted); }
#pokosbot a.opt.link { background: var(--bot-pale); border-color: #d3ddc6; color: var(--bot-accent-hover); font-weight: 700; }

#pokosbot .suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
#pokosbot .note { margin: 0; font-size: 12.5px; color: var(--bot-muted); }

#pokosbot .row { display: flex; gap: 8px; }
#pokosbot input {
  min-width: 0; flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--bot-line); border-radius: 8px;
  font: 15px/1.3 Gilroy, Arial, Helvetica, sans-serif; color: var(--bot-ink);
  background: #fff;
}
#pokosbot input::placeholder { color: #9aa39b; }
#pokosbot input:focus { outline: 3px solid rgba(39, 104, 71, .25); outline-offset: 1px; border-color: var(--bot-accent); }

#pokosbot .send {
  flex: none; min-height: 46px; padding: 12px 18px;
  background: var(--bot-accent); border: 1px solid var(--bot-accent); border-radius: 8px;
  color: #fff; font: 700 14px/1 Gilroy, Arial, Helvetica, sans-serif;
  cursor: pointer; transition: background .15s ease;
}
#pokosbot .send:hover { background: var(--bot-accent-hover); }
#pokosbot .send:disabled { opacity: .45; cursor: default; }
#pokosbot .send:focus-visible { outline: 3px solid var(--bot-accent); outline-offset: 3px; }

#pokosbot .consent { display: flex; flex-direction: column; gap: 10px; }
#pokosbot .consent-label { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.45; color: #3c4a40; }
#pokosbot .consent-label input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--bot-accent); }
#pokosbot .consent-label a { color: var(--bot-accent); text-decoration: underline; text-underline-offset: 2px; }
#pokosbot .policy { font-size: 11.5px; color: var(--bot-muted); }
#pokosbot .policy:hover { color: var(--bot-accent); }

@media (max-width: 650px) {
  #pokosbot .launch { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); padding: 12px 16px; min-height: 48px; }
  #pokosbot .panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  #pokosbot header { padding-top: max(14px, env(safe-area-inset-top)); }
  #pokosbot .controls { max-height: 45%; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  #pokosbot .panel.open { animation: none; }
  #pokosbot .progress span, #pokosbot .launch, #pokosbot .opt, #pokosbot .send { transition: none; }
}
