/* BLACKCENSUS – chatovací poradce (27. 11. 2026). Barvy a písma z /assets/style.css, bez avatara. */
:root {
  --bc-chat-ink: var(--ink, #0A0A0C);
  --bc-chat-surface: var(--surface, #111115);
  --bc-chat-surface-2: var(--surface-2, #18181D);
  --bc-chat-line: var(--line, #26262D);
  --bc-chat-line-strong: var(--line-strong, #6E6E7A);
  --bc-chat-text: var(--text, #ECEAE6);
  --bc-chat-text-2: var(--text-2, #B9B7BF);
  --bc-chat-muted: var(--muted, #8E8C96);
  --bc-chat-signal: var(--signal, #E5223B);
  --bc-chat-signal-hover: var(--signal-hover, #F03A51);
  --bc-chat-on-signal: var(--on-signal, #FFFFFF);
  --bc-chat-ring: var(--sig-ring, rgb(229 34 59 / .35));
  --bc-chat-tint: var(--sig-tint, rgb(229 34 59 / .06));
  --bc-chat-shadow: var(--shadow, rgb(0 0 0 / .8));
  --bc-chat-clear: transparent;
  --bc-chat-font: var(--font-body, "IBM Plex Sans", system-ui, sans-serif);
  --bc-chat-display: var(--font-display, "Big Shoulders Display", "Arial Narrow", sans-serif);
  --bc-chat-mono: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  --bc-chat-gap: 16px;
  --bc-chat-z: 150;
  --bc-chat-ease: var(--ease, cubic-bezier(.22, 1, .36, 1));
  --bc-chat-launcher-h: 52px;
}

.bc-chat-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* intro přes celou obrazovku (z-index 200) – během něj chat neukazujeme */
html.intro-lock .bc-chat-launcher,
html.intro-lock .bc-chat-hello { display: none; }

.bc-chat-launcher {
  position: fixed;
  z-index: var(--bc-chat-z);
  right: calc(var(--bc-chat-gap) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--bc-chat-gap) + env(safe-area-inset-bottom, 0px) + var(--bc-chat-lift, 0px));
  display: inline-flex; align-items: center; gap: 12px;
  height: var(--bc-chat-launcher-h);
  margin: 0; padding: 0 20px 0 16px;
  background: var(--bc-chat-signal);
  color: var(--bc-chat-on-signal);
  border: 1px solid var(--bc-chat-signal);
  border-radius: 2px;
  font-family: var(--bc-chat-display);
  font-size: 1.125rem; font-weight: 800; line-height: 1;
  letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--bc-chat-shadow), 0 0 0 1px var(--bc-chat-ink);
  -webkit-tap-highlight-color: var(--bc-chat-clear);
  touch-action: manipulation;
}
.bc-chat-launcher[aria-expanded="true"] { opacity: 0; visibility: hidden; pointer-events: none; }
.bc-chat-launcher:hover { background: var(--bc-chat-signal-hover); border-color: var(--bc-chat-signal-hover); }
.bc-chat-launcher:active { transform: translateY(1px); }
.bc-chat-launcher:focus { outline: none; }
.bc-chat-launcher:focus-visible { outline: 2px solid var(--bc-chat-text); outline-offset: 3px; }
.bc-chat-launcher-label { white-space: nowrap; }
.bc-chat-icon { display: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.bc-chat-launcher.is-mini { width: var(--bc-chat-launcher-h); padding: 0; justify-content: center; }
.bc-chat-launcher.is-mini .bc-chat-launcher-label,
.bc-chat-launcher.is-mini .bc-chat-pulse { display: none; }
.bc-chat-launcher.is-mini .bc-chat-icon { display: block; }
.bc-chat-pulse {
  position: relative; flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--bc-chat-on-signal);
}
.bc-chat-pulse::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--bc-chat-on-signal);
  opacity: 0;
}

.bc-chat-hello {
  position: fixed;
  z-index: var(--bc-chat-z);
  right: calc(var(--bc-chat-gap) + env(safe-area-inset-right, 0px) + var(--bc-chat-launcher-w, 240px) + 12px);
  bottom: calc(var(--bc-chat-gap) + env(safe-area-inset-bottom, 0px) + var(--bc-chat-lift, 0px));
  max-width: 240px;
  padding: 12px 16px;
  background: var(--bc-chat-surface-2);
  color: var(--bc-chat-text);
  border: 1px solid var(--bc-chat-line-strong);
  border-left: 3px solid var(--bc-chat-signal);
  border-radius: 2px;
  font-family: var(--bc-chat-font);
  font-size: .9375rem; font-weight: 600; line-height: 1.3;
  box-shadow: 0 10px 24px var(--bc-chat-shadow);
  pointer-events: none;
}
.bc-chat-hello[hidden] { display: none; }
.bc-chat-hello.is-leaving { opacity: 0; transform: translateX(8px); }

.bc-chat-panel {
  position: fixed;
  z-index: calc(var(--bc-chat-z) + 1);
  right: calc(var(--bc-chat-gap) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--bc-chat-gap) + env(safe-area-inset-bottom, 0px));
  width: min(420px, calc(100% - 2 * var(--bc-chat-gap)));
  height: min(640px, calc(100vh - 2 * var(--bc-chat-gap) - 16px));
  height: min(640px, calc(100dvh - 2 * var(--bc-chat-gap) - 16px));
  min-height: 320px;
  display: flex; flex-direction: column;
  background: var(--bc-chat-ink);
  color: var(--bc-chat-text);
  border: 1px solid var(--bc-chat-line-strong);
  border-top: 3px solid var(--bc-chat-signal);
  border-radius: 2px;
  box-shadow: 0 24px 60px var(--bc-chat-shadow);
  font-family: var(--bc-chat-font);
  font-size: 1rem; line-height: 1.5;
  text-align: left;
  opacity: 0;
  transform: translateY(12px);
}
.bc-chat-panel[hidden] { display: none; }
.bc-chat-panel.is-open { opacity: 1; transform: none; }

.bc-chat-head {
  flex: none;
  position: relative;
  display: flex; align-items: flex-start;
  padding: 16px 56px 14px 18px;
  background: var(--bc-chat-surface);
  border-bottom: 1px solid var(--bc-chat-line);
}
.bc-chat-titles { min-width: 0; }
.bc-chat-kicker {
  margin: 0 0 6px;
  font-family: var(--bc-chat-mono);
  font-size: .75rem; line-height: 1.2; letter-spacing: .06em;
  color: var(--bc-chat-signal);
  text-transform: uppercase;
}
.bc-chat-title {
  margin: 0;
  font-family: var(--bc-chat-display);
  font-size: 1.625rem; font-weight: 800; line-height: 1;
  letter-spacing: .01em; text-transform: uppercase;
  color: var(--bc-chat-text);
  overflow-wrap: break-word;
}
.bc-chat-sub {
  margin: 6px 0 0;
  font-size: .8125rem; line-height: 1.3;
  color: var(--bc-chat-muted);
}
.bc-chat-close {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0; padding: 0;
  background: var(--bc-chat-clear);
  color: var(--bc-chat-text);
  border: 1px solid var(--bc-chat-clear);
  border-radius: 2px;
  font-family: var(--bc-chat-font);
  font-size: 1.75rem; font-weight: 400; line-height: 1;
  cursor: pointer;
}
.bc-chat-close:hover { color: var(--bc-chat-signal); border-color: var(--bc-chat-line); }
.bc-chat-close:focus { outline: none; }
.bc-chat-close:focus-visible { outline: 2px solid var(--bc-chat-signal); outline-offset: -2px; }

.bc-chat-log {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 12px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-color: var(--bc-chat-line) var(--bc-chat-ink);
}
.bc-chat-msg {
  max-width: 88%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .9375rem;
}
.bc-chat-msg--bot {
  align-self: flex-start;
  background: var(--bc-chat-surface-2);
  color: var(--bc-chat-text);
  border: 1px solid var(--bc-chat-line);
  border-left: 2px solid var(--bc-chat-signal);
}
.bc-chat-msg--user {
  align-self: flex-end;
  background: var(--bc-chat-signal);
  color: var(--bc-chat-on-signal);
  font-weight: 500;
}
.bc-chat-msg--error {
  background: var(--bc-chat-surface);
  border: 1px dashed var(--bc-chat-signal);
}

.bc-chat-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 2px 0 4px;
}
.bc-chat-chips[hidden] { display: none; }
.bc-chat-chip {
  display: inline-flex; align-items: center;
  min-height: 44px; margin: 0; padding: 0 14px;
  background: var(--bc-chat-tint);
  color: var(--bc-chat-text);
  border: 1px solid var(--bc-chat-ring);
  border-radius: 2px;
  font-family: var(--bc-chat-font);
  font-size: .875rem; font-weight: 600; line-height: 1.2;
  cursor: pointer;
}
.bc-chat-chip:hover,
.bc-chat-chip[aria-pressed="true"] { background: var(--bc-chat-signal); border-color: var(--bc-chat-signal); color: var(--bc-chat-on-signal); }
.bc-chat-chip:focus { outline: none; }
.bc-chat-chip:focus-visible { outline: 2px solid var(--bc-chat-text); outline-offset: 2px; }
.bc-chat-chip:disabled { opacity: .45; cursor: not-allowed; }

.bc-chat-typing {
  align-self: flex-start;
  display: inline-flex; align-items: center;
  padding: 12px 16px;
  background: var(--bc-chat-surface-2);
  border: 1px solid var(--bc-chat-line);
  border-left: 2px solid var(--bc-chat-signal);
  border-radius: 2px;
}
.bc-chat-dots { display: inline-flex; gap: 4px; }
.bc-chat-dots span {
  display: block; width: 6px; height: 6px;
  background: var(--bc-chat-signal);
  opacity: .6;
}

.bc-chat-form {
  flex: none;
  padding: 12px;
  border-top: 1px solid var(--bc-chat-line);
  background: var(--bc-chat-surface);
}
.bc-chat-row { display: flex; align-items: flex-end; gap: 8px; }
.bc-chat-input {
  flex: 1; min-width: 0;
  min-height: 48px; max-height: 140px;
  margin: 0; padding: 12px;
  resize: none;
  background: var(--bc-chat-ink);
  color: var(--bc-chat-text);
  border: 1px solid var(--bc-chat-line-strong);
  border-radius: 2px;
  font-family: var(--bc-chat-font);
  font-size: 16px; line-height: 1.35;
  caret-color: var(--bc-chat-signal);
}
.bc-chat-input::placeholder { color: var(--bc-chat-muted); opacity: 1; }
.bc-chat-input:hover { border-color: var(--bc-chat-text-2); }
.bc-chat-input:focus { outline: none; border-color: var(--bc-chat-signal); box-shadow: 0 0 0 2px var(--bc-chat-ring); }
.bc-chat-send {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin: 0; padding: 0;
  background: var(--bc-chat-signal);
  color: var(--bc-chat-on-signal);
  border: 1px solid var(--bc-chat-signal);
  border-radius: 2px;
  cursor: pointer;
}
.bc-chat-send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; }
.bc-chat-send:hover { background: var(--bc-chat-signal-hover); border-color: var(--bc-chat-signal-hover); }
.bc-chat-send:focus { outline: none; }
.bc-chat-send:focus-visible { outline: 2px solid var(--bc-chat-text); outline-offset: 2px; }
.bc-chat-send:disabled { opacity: .45; cursor: not-allowed; }
.bc-chat-note {
  margin: 8px 0 0;
  font-size: .75rem; line-height: 1.35;
  color: var(--bc-chat-muted);
}

@media (prefers-reduced-motion: no-preference) {
  .bc-chat-pulse::after { animation: bc-chat-ping 2.4s var(--bc-chat-ease) infinite; }
  .bc-chat-launcher { transition: background-color .15s linear; }
  .bc-chat-hello { transition: opacity .3s linear, transform .3s var(--bc-chat-ease); }
  .bc-chat-panel { transition: opacity .22s linear, transform .32s var(--bc-chat-ease); }
  .bc-chat-dots span { animation: bc-chat-dot 1.1s ease-in-out infinite; }
  .bc-chat-dots span:nth-child(2) { animation-delay: .15s; }
  .bc-chat-dots span:nth-child(3) { animation-delay: .3s; }
}
@keyframes bc-chat-ping {
  0% { opacity: .8; transform: scale(.6); }
  70% { opacity: 0; transform: scale(1.6); }
  100% { opacity: 0; transform: scale(1.6); }
}
@keyframes bc-chat-dot {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 639.98px) {
  .bc-chat-launcher { height: 48px; padding: 0 16px 0 14px; font-size: 1rem; }
  .bc-chat-launcher.is-mini { width: 48px; padding: 0; }
  .bc-chat-panel {
    top: 0; right: 0; bottom: auto; left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-top: 3px solid var(--bc-chat-signal);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .bc-chat-form { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .bc-chat-msg { max-width: 92%; }
}

@media (forced-colors: active) {
  .bc-chat-launcher, .bc-chat-panel, .bc-chat-chip, .bc-chat-send, .bc-chat-input, .bc-chat-hello { border-color: CanvasText; }
}
