/* Окно чата и общие стили страницы продукта. Цвета: фон 246,243,236; акцент 196,68,20; текст 27,27,27. */
:root { --bg: #f6f3ec; --ink: #1b1b1b; --accent: #c44414; --card: #fff; --line: #ddd7c8; --muted: #6b665b; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 24px 0 10px; }
h2 { font-size: 1.4rem; line-height: 1.25; margin: 0 0 8px; }
p { margin: 0 0 14px; overflow-wrap: anywhere; }
.block { padding: 28px 0; border-top: 1px solid var(--line); }
.block img { border-radius: 12px; margin-bottom: 16px; }
.hero-img { border-radius: 12px; margin: 24px 0; }
footer { padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); }
@media (min-width: 700px) { h1 { font-size: 2.2rem; } .block { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center; } .block img { margin: 0; } }

.chat { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; margin: 16px 0 4px; max-width: 100%; }
.chat-list { position: relative; min-height: 96px; max-height: min(66vh, 520px); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) { .chat-list { min-height: 140px; max-height: 460px; } }
.chat-msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; overflow-wrap: anywhere; font-size: 16px; line-height: 1.4; }
.chat-msg[hidden] { display: none; }
.chat-msg.bot { align-self: flex-start; background: #efeadd; border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.chat-msg.user a { color: #fff; }
.chat-msg.pending { opacity: .6; }
.chat-body pre { white-space: pre-wrap; overflow-x: auto; margin: 4px 0; }
.chat-body blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--line); }
.chat-body code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; }
.chat-body a { color: var(--accent); }
.chat-file { display: inline-block; margin-top: 6px; color: var(--accent); font-weight: 600; text-decoration: none; }
.chat-btns { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.chat-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-btn { flex: 1 1 auto; min-height: 40px; padding: 8px 12px; border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 10px; font: inherit; font-size: 15px; cursor: pointer; }
.chat-btn:hover { background: #fbeee8; }
.chat-btn:disabled { opacity: .5; cursor: default; }
.chat-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-menu:not([hidden]) + .chat-form { border-top: 0; }
.chat-input { flex: 1 1 auto; min-width: 0; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 16px; line-height: 1.3; background: #fff; color: var(--ink); max-height: 140px; }
.chat-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.chat-attach { flex: 0 0 auto; width: 42px; height: 42px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-attach:hover { color: var(--accent); background: #f3eee2; }
.chat-send { flex: 0 0 auto; height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.chat-toast { position: absolute; left: 12px; right: 12px; top: 10px; background: #1b1b1b; color: #fff; border-radius: 10px; padding: 8px 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 2; }
.chat-toast.on { opacity: .95; }
.chat-menu { display: flex; gap: 6px; padding: 6px 8px 0; border-top: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.chat-menu[hidden] { display: none; }
.chat-mbtn { flex: 0 0 auto; white-space: nowrap; min-height: 34px; padding: 5px 12px; border: 1px solid var(--line); background: #faf8f3; color: var(--ink); border-radius: 17px; font: inherit; font-size: 14px; cursor: pointer; }
.chat-mbtn:hover { border-color: var(--accent); color: var(--accent); }
.chat-cmd { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.chat-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; font-size: 13px; margin: 4px 10px 8px; }
.chat-save { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.chat-save[hidden] { display: none; }
.chat-tg { margin-left: auto; }
.chat-tg a { color: var(--muted); }
.chat-hidden-copy { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }
