:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --surface: #ffffff;
  --accent: #111111;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Outfit, Inter, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100svh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  font: 15px/1.4 var(--font);
  background: #fff;
  color: var(--ink);
}
a { color: inherit; }
.eyebrow {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a8a8a;
  font-size: 0.72rem;
  font-weight: 700;
}
.mark {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 70%;
  margin: 0 auto;
  padding: 16px 0 4px;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #111;
}
.mark h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.6rem;
  line-height: 1;
}
.mark a {
  color: var(--ink);
  opacity: 0.62;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.mark a:hover { opacity: 1; }
#chat-root { min-height: 0; width: 70%; margin: 0 auto; padding: 4px 0 12px; }
.desk-chat {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  background: transparent;
}
.xchat-log {
  overflow: auto;
  overflow-anchor: none;
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.day-chip {
  align-self: center;
  margin: 4px 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f3f3;
  color: #8a8a8a;
  font-size: 11px;
  font-weight: 600;
}
.xchat-log article {
  max-width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
}
.xchat-log .news { width: 100%; text-align: left; }
.offers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.offer-media img,
.offer-media video {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 0;
}
.offer-copy h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.offer-copy p {
  margin: 0;
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
  color: #333;
}
.xchat-log .visitor {
  align-self: flex-end;
  max-width: min(560px, 82%);
}
.xchat-log p { margin: 0; white-space: pre-wrap; font-size: 15px; line-height: 1.4; }
.xchat-log .visitor p { font-size: 14px; line-height: 1.35; }
.xchat-log time { display: block; text-align: right; color: #9a9a9a; font-size: 9px; line-height: 1; margin-top: 3px; }
.ticks { display: inline-block; width: 15px; height: 10px; margin-left: 3px; vertical-align: -1px; color: #a3a3a3; }
.ticks svg { width: 100%; height: 100%; display: block; }
.ticks.sent { width: 11px; }
.ticks.read { color: #34b7f1; }
.xchat-log .staff time { text-align: left; width: fit-content; }
.xchat-log img, .xchat-log video { width: min(100%, 420px); border-radius: 12px; display: block; margin-top: 8px; }
.xchat-log img { cursor: zoom-in; }
.xchat-log .att { width: min(100%, 210px); }
.xchat-log .visitor > .att { margin-left: auto; }
.xchat-log .visitor > .att:first-child { margin-top: 0; }
.photo-frame { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: rgba(17, 17, 17, 0.86); }
.photo-frame[hidden] { display: none; }
.photo-frame img { max-width: min(1100px, 100%); max-height: calc(100vh - 72px); width: auto; height: auto; margin: 0; border-radius: 12px; object-fit: contain; cursor: zoom-in; transform-origin: center center; }
.photo-frame button { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: #111; font-size: 26px; line-height: 40px; padding: 0; cursor: pointer; }
.xchat-log .offer-media img,
.xchat-log .offer-media video { width: 100%; max-width: none; margin-top: 0; border-radius: 16px; }
/* Форма «Имя и телефон» от мастера */
.xchat-log article.contact-form { max-width: min(420px, 92%); padding: 12px 14px 8px; border: 1px solid #e6e6e6; border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); }
.cf-card { margin-top: 10px; }
.cf-form { display: grid; gap: 8px; }
.cf-form[hidden], .cf-done[hidden] { display: none; }
.cf-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  font-size: 16px;
  background: #fafafa;
}
.cf-form input:focus { outline: none; border-color: #111; background: #fff; }
.cf-form button { min-height: 44px; border: 0; border-radius: 12px; background: #111; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.xchat-log .cf-error { margin: 0; min-height: 1em; color: #b42318; font-size: 13px; white-space: normal; }
.cf-done { padding: 10px 12px; border-radius: 12px; background: #effaf2; color: #127a3a; font-size: 14px; line-height: 1.4; }
.cf-change { margin-left: 6px; padding: 0; border: 0; background: none; color: #127a3a; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* Новости из визуального редактора */
.offer.no-media { grid-template-columns: minmax(0, 1fr); }
.offer-copy .rich { font-size: 15px; line-height: 1.5; color: #333; overflow-wrap: anywhere; }
.xchat-log .offer-copy .rich p { margin: 0 0 8px; white-space: normal; font-size: inherit; line-height: inherit; }
.offer-copy .rich > :last-child { margin-bottom: 0; }
.offer-copy .rich h1, .offer-copy .rich h2, .offer-copy .rich h3, .offer-copy .rich h4 { margin: 12px 0 6px; font-size: 17px; letter-spacing: -0.02em; }
.offer-copy .rich ul, .offer-copy .rich ol { margin: 0 0 8px; padding-left: 22px; }
.offer-copy .rich li { margin: 2px 0; }
.offer-copy .rich a { color: #2563eb; text-decoration: underline; }
.offer-copy .rich blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid #d4d4d4; color: #555; }
.offer-copy .rich hr { border: 0; border-top: 1px solid #e6e6e6; margin: 12px 0; }
.xchat-log .offer-copy .rich img { width: auto; max-width: 100%; height: auto; margin: 8px 0; border-radius: 12px; }
.offer-copy .rich iframe { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; margin: 8px 0; }
.offer-copy .rich table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.offer-copy .rich th, .offer-copy .rich td { border: 1px solid #e6e6e6; padding: 6px 8px; text-align: left; vertical-align: top; }
.offer-copy .rich th { background: #f7f7f7; }
.xchat-log audio { display: none; }
.voice-player { display: flex; align-items: center; gap: 8px; width: min(100%, 280px); margin-top: 4px; }
.voice-play { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #111; color: #fff; flex: none; cursor: pointer; font-size: 12px; line-height: 32px; padding: 0 0 0 2px; }
.voice-player.playing .voice-play { font-size: 0; padding: 0; }
.voice-player.playing .voice-play::before { content: ""; display: block; width: 10px; height: 10px; margin: 0 auto; background: linear-gradient(#fff, #fff) left / 3px 100% no-repeat, linear-gradient(#fff, #fff) right / 3px 100% no-repeat; }
.voice-track { flex: 1; height: 4px; border-radius: 999px; background: #dedede; cursor: pointer; }
.voice-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: #111; }
.voice-time { font-size: 11px; color: #8a8a8a; min-width: 34px; font-variant-numeric: tabular-nums; }
.file-row { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.file-row a, .file-dl { color: #111; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.file-dl { border: 0; background: transparent; padding: 0; cursor: pointer; }
.composer { position: relative; display: grid; gap: 6px; padding: 8px 0 4px; background: transparent; }
.emoji-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; font-size: 20px; line-height: 36px; padding: 0; cursor: pointer; flex: none; }
.emoji-btn:hover { background: #f3f3f3; }
.emoji-panel { position: absolute; right: 52px; bottom: 58px; z-index: 4; display: grid; grid-template-columns: repeat(7, 34px); gap: 2px; padding: 8px; background: #fff; border: 1px solid #e6e6e6; border-radius: 16px; box-shadow: 0 8px 28px rgba(0,0,0,.08); }
.emoji-panel[hidden] { display: none; }
.emoji-panel button { border: 0; background: transparent; font-size: 22px; line-height: 34px; padding: 0; cursor: pointer; border-radius: 8px; }
.emoji-panel button:hover { background: #f3f3f3; }
.composer-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #e6e6e6;
  border-radius: 28px;
  background: #fff;
  padding: 6px 6px 6px 8px;
  box-shadow: var(--shadow);
}
.clip, .voice, .send {
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font: inherit;
  box-shadow: none;
}
.clip, .voice {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: none;
}
.clip:hover, .voice:hover { background: #f3f3f3; }
.clip svg, .voice svg { width: 20px; height: 20px; display: block; }
.voice.recording { background: #111; color: #fff; }
.send {
  border-radius: 999px;
  min-height: 36px;
  padding: 0 14px;
  color: #fff;
  font-weight: 650;
  font-size: 14px;
  background: #111;
}
.composer-bar input[name="text"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px;
  color: #111;
}
input, button { font: inherit; color: #111; }
.who { display: flex; gap: 8px; align-items: center; }
.who:not(:has(input:not([hidden]))) { display: none; }
.phone-label, .name-label { display: flex; align-items: center; gap: 8px; color: #8a8a8a; font-size: 13px; white-space: nowrap; }
.name-label { flex-wrap: wrap; white-space: normal; }
.phone-label:has(input[hidden]), .name-label:has(input[hidden]) { display: none; }
.composer input[name="name"],
.composer input[name="phone"] {
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  background: #fff;
  padding: 8px 12px;
  width: 140px;
  min-height: 36px;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.composer input[name="phone"] { width: 200px; letter-spacing: 0.01em; }
.clip.is-locked, .voice.is-locked, .emoji-btn.is-locked { opacity: 0.35; }
/* Инфо-строка под полем ввода: предупреждение о блокировке и текст мастера из админки чатов */
.xchat-offer { margin: 6px 0 0; padding: 8px 12px; border: 1px dashed var(--line); border-left: 3px solid var(--accent); border-radius: 10px; color: var(--ink); font-size: 13px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.xchat-offer[hidden] { display: none; }
/* Чат заблокирован (вручную или за спам): все элементы ввода неактивны */
.desk-chat.blocked .composer-bar > :not(.emoji-panel) { opacity: 0.4; cursor: not-allowed; }
.desk-chat.blocked .composer-bar button, .desk-chat.blocked .clip { pointer-events: none; }
.desk-chat.blocked .composer-bar input[name="text"] { cursor: not-allowed; }
.xchat-log .visitor time { cursor: pointer; }
.xchat-log time .edit-msg { display: none; margin-left: 6px; border: 0; background: transparent; color: #8a8a8a; font-size: 12px; cursor: pointer; padding: 0; }
.xchat-log time.open .edit-msg { display: inline; }
.msg-more, .edit-msg { border: 0; background: transparent; color: #8a8a8a; cursor: pointer; padding: 0; }
.msg-more { opacity: 0; font-size: 18px; letter-spacing: 1px; line-height: 1; }
.xchat-log article:hover .msg-more,
.msg-tools.open .msg-more { opacity: 1; }
.edit-msg { display: none; font-size: 12px; }
.msg-tools.open .edit-msg { display: inline; }
.edited { display: block; margin-top: 2px; color: #9a9a9a; font-size: 10px; }
@media (hover: none) {
  .msg-more { opacity: 0.65; }
}
.edit-box { display: grid; gap: 6px; margin-top: 4px; }
.edit-box textarea { width: 100%; min-height: 52px; border: 1px solid #e6e6e6; border-radius: 12px; padding: 8px; resize: vertical; }
body.login {
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
}
body.login form {
  width: min(100%, 420px);
  display: grid;
  gap: 12px;
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}
body.login h1 { margin: 0; font-family: var(--display); letter-spacing: -0.04em; }
body.login p { margin: 0; color: var(--muted); }
body.login .error { color: #b42318; }
body.login button {
  border: 0;
  border-radius: 16px;
  min-height: 52px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  background: #111;
}
body.login a { justify-self: center; font-weight: 700; opacity: 0.7; }
/* =====================================================================
   Темы сайта. Значения по умолчанию = «Классика» (как было до тем).
   Тема ставится сервером в <html data-theme="...">.
   ===================================================================== */
:root {
  --page: #ffffff;
  --card: #ffffff;
  --field: #fafafa;
  --chip: #f3f3f3;
  --bubble: #f4f4f4;
  --bubble-ink: #111111;
  --text2: #333333;
  --soft: #8a8a8a;
  --btn: #111111;
  --btn-ink: #ffffff;
  --brand-mark: #111111;
  --link: #2563eb;
  --hover: #f3f3f3;
}
:root[data-theme="steel"] {
  --page: #eef2f6;
  --card: #ffffff;
  --field: #f5f8fb;
  --chip: #e2e8f0;
  --bubble: #dbeafe;
  --bubble-ink: #0f2a4a;
  --text2: #334155;
  --soft: #64748b;
  --line: #d6dee8;
  --btn: linear-gradient(135deg, #0ea5e9 0%, #0f766e 100%);
  --brand-mark: linear-gradient(135deg, #0ea5e9 0%, #0f766e 100%);
  --link: #0369a1;
  --hover: #e2e8f0;
  --ink: #0f172a;
}
:root[data-theme="workshop"] {
  --page: #f7f2ea;
  --card: #fffdf9;
  --field: #fffaf3;
  --chip: #efe5d6;
  --bubble: #ffedd5;
  --bubble-ink: #4a2a0a;
  --text2: #4b3f33;
  --soft: #8c7b68;
  --line: #e8dccb;
  --btn: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  --brand-mark: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  --link: #c2410c;
  --hover: #efe5d6;
  --ink: #2b2118;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --page: #0d1117;
  --card: #161b22;
  --field: #0d1117;
  --chip: #21262d;
  --bubble: #1f3a4d;
  --bubble-ink: #e6edf3;
  --text2: #c9d1d9;
  --soft: #8b949e;
  --line: #30363d;
  --btn: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --brand-mark: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --link: #67e8f9;
  --hover: #21262d;
  --ink: #e6edf3;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
body, body.login { background: var(--page); }
/* Карточка «этап заказа» — автоматическое сообщение из CRM */
.xchat-log article.notice { width: min(440px, 94%); max-width: min(440px, 94%); }
/* Вся карточка — таблица в рамке цвета этапа, текст сообщения — выделенная строка */
.stage-notice {
  overflow: hidden;
  border: 2px solid var(--sn);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}
.sn-table { width: 100%; border-collapse: collapse; border-style: hidden; font-size: 14px; }
.sn-table th, .sn-table td { padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--sn) 30%, var(--line)); text-align: left; vertical-align: top; }
.sn-table th { width: 34%; background: var(--chip); color: var(--soft); font-weight: 600; }
.sn-table td { color: var(--ink); }
.sn-table th.sn-head {
  width: auto;
  padding: 9px 12px;
  background: var(--sn);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.sn-table th.sn-head b { color: #fff; font-weight: 800; }
.sn-table td.sn-text {
  padding: 12px 14px;
  background: color-mix(in srgb, var(--sn) 16%, var(--card));
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-wrap;
}
/* Ответ на код — карточка в виде новости */
.code-post { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07); text-align: left; }
.sn-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--sn); }
/* Выбор темы посетителем */
.mark-actions { position: relative; display: flex; align-items: center; gap: 12px; }
.theme-pick {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 17px;
  line-height: 34px;
  cursor: pointer;
}
.theme-pick:hover { background: var(--hover); }
.theme-menu {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}
.theme-menu[hidden] { display: none; }
.theme-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.theme-menu button:hover { background: var(--hover); }
.theme-menu button.on { font-weight: 700; }
.theme-menu button.on::after { content: "✓"; margin-left: auto; }
.theme-menu i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); flex: none; }
.theme-menu i.auto { background: conic-gradient(#111 0 25%, #0ea5e9 0 50%, #f59e0b 0 75%, #8b5cf6 0); }
.eyebrow, .day-chip, .voice-time, .xchat-log time .edit-msg, .edit-msg, .msg-more { color: var(--soft); }
.brand-mark { background: var(--brand-mark); }
.mark h1 { color: var(--ink); }
.day-chip { background: var(--chip); }
.offer-copy p, .offer-copy .rich { color: var(--text2); }
.offer-copy .rich a { color: var(--link); }
.offer-copy .rich blockquote { border-left-color: var(--line); color: var(--soft); }
.offer-copy .rich hr, .offer-copy .rich th, .offer-copy .rich td { border-color: var(--line); }
.offer-copy .rich th { background: var(--chip); }
/* Фото в тексте новости: не выше 60% экрана, чтобы вертикальный снимок не растягивался */
.xchat-log .offer-copy .rich img { max-height: 60vh; object-fit: cover; }
/* Обтекание: картинка слева или справа, текст вокруг */
.offer-copy .rich { display: flow-root; }
.xchat-log .offer-copy .rich img[style*="float: left"],
.xchat-log .offer-copy .rich img[style*="float:left"] { float: left; max-width: 50%; margin: 4px 16px 8px 0 !important; }
.xchat-log .offer-copy .rich img[style*="float: right"],
.xchat-log .offer-copy .rich img[style*="float:right"] { float: right; max-width: 50%; margin: 4px 0 8px 16px !important; }
.xchat-log .visitor { color: var(--ink); }
.xchat-log article.contact-form { background: var(--card); border-color: var(--line); }
.cf-form input { background: var(--field); border-color: var(--line); color: var(--ink); }
.cf-form input:focus { background: var(--card); border-color: var(--ink); }
.cf-form button, .send, .voice-play, .voice.recording, body.login button { background: var(--btn); color: var(--btn-ink); }
.voice-fill { background: var(--ink); }
.voice-track { background: var(--line); }
.file-row a, .file-dl { color: var(--ink); }
.composer-bar { background: var(--card); border-color: var(--line); }
.composer-bar input[name="text"], input, button { color: var(--ink); }
.clip, .voice { color: var(--ink); }
.clip:hover, .voice:hover, .emoji-btn:hover, .emoji-panel button:hover { background: var(--hover); }
.emoji-panel { background: var(--card); border-color: var(--line); }
body.login form { background: var(--card); }
body.login input { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; color: var(--ink); }
:root[data-theme="night"] .cf-done { background: rgba(22, 163, 74, 0.16); color: #4ade80; }
:root[data-theme="night"] .cf-change { color: #4ade80; }
:root[data-theme="night"] .photo-frame button { background: #21262d; color: #e6edf3; }

@media (max-width: 700px) {
  .mark, #chat-root { width: 94%; }
  .send { padding: 0 10px; font-size: 13px; flex: none; }
  .clip, .voice, .emoji-btn { width: 32px; height: 32px; }
  .composer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .offer { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .offer-media img, .offer-media video { height: 180px; }
  /* На узком экране картинка с обтеканием — не шире половины, иначе тексту негде встать */
  .xchat-log .offer-copy .rich img[style*="float"] { max-width: 45%; max-height: 40vh; }
}

/* Команды чата: подсказка при вводе «/» и вывод скрипта */
.cmd-hints { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 5; display: grid; max-height: 240px; overflow-y: auto; margin-bottom: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.cmd-hints[hidden] { display: none; }
.cmd-hints button { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cmd-hints button:hover { background: var(--field, #f4f4f4); }
.cmd-hints b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cmd-hints span { color: var(--muted); font-size: 14px; }
.xchat-log .cmd-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.xchat-log .cmd-out { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--field, #f5f5f5); white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
/* Меню в шапке: Главная, Галерея, Контакты */
.site-nav { display: flex; gap: 4px; }
.site-nav button { padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 600 0.92rem var(--font); opacity: 0.68; cursor: pointer; }
.site-nav button:hover { opacity: 1; background: var(--hover, #f3f3f3); }
.site-nav button.on { opacity: 1; background: var(--hover, #f3f3f3); }
@media (max-width: 700px) {
  .mark { flex-wrap: wrap; row-gap: 8px; }
  .site-nav { order: 3; width: 100%; }
  .site-nav button { flex: 1; padding: 8px 6px; }
}

/* Карточки «Галерея» и «Контакты» в ленте чата */
.xchat-log article.wide { width: 100%; max-width: 100%; align-self: stretch; }
.wd-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card, #fff); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07); text-align: left; }
.wd-card h2 { margin: 0 0 12px; font-family: var(--display); font-size: 1.2rem; letter-spacing: -0.02em; }
.wd-empty { margin: 0; color: var(--muted); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gal-cell { aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--field, #f4f4f4); cursor: zoom-in; }
.gal-cell[hidden] { display: none; }
.xchat-log .gal-cell img { display: block; width: 100%; height: 100%; margin: 0; border-radius: 0; object-fit: cover; transition: transform 0.2s; }
.gal-cell:hover img { transform: scale(1.04); }
.gal-more { width: 100%; min-height: 42px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.gal-more:hover { background: var(--hover, #f3f3f3); }
.ct-list { display: grid; gap: 10px; }
.ct-row { display: flex; gap: 10px; align-items: flex-start; }
.ct-row > span { flex: none; width: 22px; text-align: center; }
.ct-row > div { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-row a { color: var(--ink); font-weight: 600; }
.ct-map { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.ct-map iframe { display: block; width: 100%; height: 340px; border: 0; }
@media (max-width: 700px) {
  .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ct-map iframe { height: 280px; }
}

/* Просмотр фото галереи: стрелки и подпись */
.photo-frame .pf-nav { top: 50%; width: 48px; height: 48px; margin-top: -24px; font-size: 32px; line-height: 44px; opacity: 0.9; }
.photo-frame .pf-prev { left: 16px; right: auto; }
.photo-frame .pf-next { right: 16px; }
.photo-frame .pf-nav[hidden] { display: none; }
.photo-frame .pf-cap { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: min(720px, 90%); margin: 0; padding: 6px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 14px; text-align: center; }
.photo-frame .pf-cap[hidden] { display: none; }

/* Новости скрыты, пока наверху галерея или контакты */
.xchat-log article[hidden] { display: none; }
.ct-tg { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }

/* Подсказка над полем ввода: видна, пока посетитель ничего не написал */
.xchat-hint { display: grid; gap: 2px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 14px; background: var(--field, #fafafa); color: var(--ink); font-size: 14px; line-height: 1.35; text-align: center; }
.xchat-hint[hidden] { display: none; }
.xchat-hint b { font-size: 15px; }
.xchat-hint span { color: var(--muted); }/* Ячейка галереи в серверной разметке (для поисковиков) — ссылка, а не кнопка */
a.gal-cell { display: block; }
/* Номер со скрытыми цифрами: подсказка, что его можно открыть */
.ct-reveal:not([data-shown]) { cursor: pointer; text-decoration-style: dotted; }

/* Логотип в шапке: эмблема с прозрачным фоном вместо цветного квадрата */
.brand-logo { display: block; flex: none; width: 56px; height: 56px; object-fit: contain; }
@media (max-width: 700px) {
  .brand-logo { width: 46px; height: 46px; }
}
/* Строка согласия под полем ввода и в форме «Имя и телефон» */
.xchat-legal, .cf-consent { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: center; }
.cf-consent { text-align: left; }
.xchat-legal a, .cf-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.xchat-legal a:hover, .cf-consent a:hover { color: var(--ink); }

/* Страницы документов: оферта, политика, реквизиты */
body.doc-page { display: block; height: auto; min-height: 100svh; }
.doc-page .brand { text-decoration: none; color: var(--ink); }
.doc-page .brand-name { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.04em; font-size: 1.6rem; line-height: 1; }
.site-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink); font: 600 0.92rem var(--font); opacity: 0.68; text-decoration: none; }
.site-nav a:hover { opacity: 1; background: var(--hover, #f3f3f3); }
.doc { width: 70%; max-width: 820px; margin: 0 auto; padding: 18px 0 56px; color: var(--ink); font-size: 15px; line-height: 1.6; }
.doc h1 { margin: 8px 0 4px; font-family: var(--display); font-size: 1.8rem; line-height: 1.2; letter-spacing: -0.02em; }
.doc h2 { margin: 28px 0 8px; font-size: 1.15rem; }
.doc p { margin: 0 0 10px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 4px; }
.doc a { color: var(--ink); text-underline-offset: 3px; }
.doc-meta { color: var(--muted); font-size: 13px; }
.doc-table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; }
.doc-table th, .doc-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-table th { width: 34%; color: var(--muted); font-weight: 600; }
.doc-links { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.doc-links a { color: var(--muted); }
@media (max-width: 700px) {
  .doc { width: 92%; font-size: 14px; }
  .doc h1 { font-size: 1.45rem; }
  .doc-table th { width: 40%; }
}
/* Пункт «Документы» в шапке и страница со списком документов */
.site-nav a.on { opacity: 1; background: var(--hover, #f3f3f3); }
@media (max-width: 700px) {
  .site-nav a { flex: 1; padding: 8px 6px; text-align: center; }
}
.doc-cards { display: grid; gap: 12px; margin-top: 18px; }
.doc a.doc-card { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); color: var(--ink); text-decoration: none; }
.doc a.doc-card:hover { border-color: var(--ink); }
.doc-card b { font-size: 16px; }
.doc-card span { color: var(--muted); font-size: 14px; line-height: 1.45; }
/* Подвал сайта: согласие, сведения об исполнителе и ссылки на документы — мелким шрифтом */
.site-footer { display: grid; gap: 1px; color: var(--muted); font-size: 11px; line-height: 1.4; text-align: center; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ink); }
.doc .site-footer { margin-top: 14px; text-align: left; }