/* ============================================================
   Promo test-chat widget — self-contained, theme-adaptive.
   Reads the host page's CSS vars (--card/--ink/--muted/--line/--r);
   accent picks iris (gptpromo) → green (main promo) → fallback.
   ============================================================ */
#promo-ai-chat {
  --pc-accent: var(--iris, var(--green, #4b3bff));
  --pc-accent-ink: #fff;
  --pc-card: var(--card, #fff);
  --pc-ink: var(--ink, #16242f);
  --pc-muted: var(--muted, #5d7180);
  --pc-line: var(--line, #dfe3e0);
  --pc-bubble: var(--surface-2, var(--bg-2, #f4f5f7));
  --pc-r: var(--r-lg, var(--r, 16px));
  display: block;
  padding: 30px 18px 8px;
}
.pc-wrap { max-width: 760px; margin: 0 auto; }
.pc-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 13px/1 var(--font-body, system-ui);
  color: var(--pc-accent); letter-spacing: .02em; margin: 0 0 10px;
  text-transform: uppercase;
}
.pc-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pc-accent); }
.pc-title {
  font: 700 clamp(22px, 3.4vw, 30px)/1.15 var(--font-disp, system-ui);
  color: var(--heading, var(--pc-ink)); margin: 0 0 6px;
}
.pc-sub { color: var(--pc-muted); font: 400 15px/1.5 var(--font-body, system-ui); margin: 0 0 18px; max-width: 560px; }

.pc-card {
  background: var(--pc-card); border: 1px solid var(--pc-line);
  border-radius: var(--pc-r); box-shadow: var(--shadow, 0 12px 28px -12px rgba(0,0,0,.18));
  overflow: hidden; display: flex; flex-direction: column;
}
.pc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--pc-line);
  background: color-mix(in srgb, var(--pc-card) 92%, var(--pc-accent));
}
.pc-head img { width: 26px; height: 26px; border-radius: 7px; flex: none; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.pc-head-txt { display: flex; flex-direction: column; line-height: 1.15; }
.pc-model { font: 700 14px/1.2 var(--font-body, system-ui); color: var(--pc-ink); }
.pc-model small { font-weight: 500; color: var(--pc-muted); }
.pc-counter {
  margin-left: auto; font: 600 12px/1 var(--font-body, system-ui);
  color: var(--pc-muted); background: var(--pc-bubble);
  border: 1px solid var(--pc-line); border-radius: 999px; padding: 5px 10px; white-space: nowrap;
}
.pc-msgs {
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  min-height: 190px; max-height: 340px; overflow-y: auto;
}
.pc-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font: 400 14.5px/1.5 var(--font-body, system-ui); white-space: pre-wrap; word-wrap: break-word; }
.pc-msg.ai { align-self: flex-start; background: var(--pc-bubble); color: var(--pc-ink); border-bottom-left-radius: 5px; }
.pc-msg.user { align-self: flex-end; background: var(--pc-accent); color: var(--pc-accent-ink); border-bottom-right-radius: 5px; }
.pc-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 13px; }
.pc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--pc-muted); opacity: .6; animation: pc-bounce 1.2s infinite; }
.pc-typing span:nth-child(2) { animation-delay: .15s; }
.pc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pc-bounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: .9; } }

.pc-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--pc-line); }
.pc-input {
  flex: 1; resize: none; min-height: 44px; max-height: 120px;
  border: 1px solid var(--pc-line); border-radius: 12px; padding: 11px 13px;
  font: 400 15px/1.4 var(--font-body, system-ui); color: var(--pc-ink);
  background: var(--field-bg, var(--pc-card)); outline: none;
}
.pc-input:focus { border-color: var(--pc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-accent) 22%, transparent); }
.pc-send {
  flex: none; border: 0; border-radius: 12px; padding: 0 18px; cursor: pointer;
  background: var(--pc-accent); color: var(--pc-accent-ink);
  font: 600 15px/1 var(--font-body, system-ui); display: inline-flex; align-items: center; gap: 6px;
}
.pc-send:disabled { opacity: .5; cursor: not-allowed; }
.pc-send:not(:disabled):hover { filter: brightness(1.06); }

.pc-limit {
  margin: 4px 14px 14px; padding: 14px 16px; border-radius: 12px; text-align: center;
  background: color-mix(in srgb, var(--pc-accent) 10%, var(--pc-card));
  border: 1px solid color-mix(in srgb, var(--pc-accent) 30%, var(--pc-line));
}
.pc-limit p { margin: 0 0 10px; color: var(--pc-ink); font: 500 14.5px/1.5 var(--font-body, system-ui); }
.pc-limit .pc-cta { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pc-limit a { text-decoration: none; border-radius: 999px; padding: 9px 16px; font: 600 14px/1 var(--font-body, system-ui); }
.pc-limit a.primary { background: var(--pc-accent); color: var(--pc-accent-ink); }
.pc-limit a.ghost { background: transparent; color: var(--pc-accent); border: 1px solid var(--pc-accent); }
.pc-hint { text-align: center; color: var(--pc-muted); font: 400 12px/1.4 var(--font-body, system-ui); margin: 8px 0 0; }
.pc-err { color: var(--warn, #c2410c); }
[hidden] { display: none !important; }

/* ── Prominent header contacts (call / write right away) ──────────────────── */
.topbar-contacts { display: inline-flex; align-items: center; gap: 14px; margin: 0 14px 0 4px; }
.topbar-contacts .tc-phone {
  font: 700 15px/1 var(--font-body, system-ui); color: var(--heading, var(--ink, #054274));
  text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.topbar-contacts .tc-phone::before { content: "📞"; font-size: 13px; }
.topbar-contacts .tc-write {
  font: 600 13.5px/1 var(--font-body, system-ui);
  color: var(--iris, var(--green, #46B76B)); text-decoration: none;
  border-bottom: 1px dashed currentColor; padding-bottom: 1px;
}
.topbar-contacts .tc-write:hover { filter: brightness(1.1); }
@media (max-width: 900px) { .topbar-contacts { display: none; } }

/* contacts inside mobile slide-in menu */
.mnav-contacts { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line, #dfe3e0); display: flex; flex-direction: column; gap: 12px; }
.mnav-contacts a { color: var(--heading, var(--ink)); text-decoration: none; font: 600 16px/1 var(--font-body, system-ui); }
.mnav-contacts a.big { font-size: 19px; color: var(--iris, var(--green, #054274)); }
