/* ============================================================
   Live chat widget — návštěvník webu × operátor
   ============================================================ */

#chat-widget { --chat-modra: #0a4ea0; --chat-modra-tmava: #062f63; --chat-tyrkys: #14d3c5;
  --chat-stin: 0 12px 32px rgba(15, 26, 44, .18);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

.chat-bublina {
  position: fixed; right: 18px; bottom: 18px; z-index: 9000;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--chat-modra); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  box-shadow: var(--chat-stin);
  transition: transform .2s ease, background .2s ease;
}
.chat-bublina:hover { transform: translateY(-2px); background: var(--chat-modra-tmava); }
.chat-bublina svg { width: 28px; height: 28px; }
.chat-bublina__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: #e63946; color: #fff; border-radius: 11px;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.chat-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 9001;
  width: 360px; max-width: calc(100vw - 24px);
  height: 540px; max-height: calc(100vh - 36px);
  background: #fff; border-radius: 14px;
  box-shadow: var(--chat-stin);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.chat-hlavicka {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--chat-modra-tmava), var(--chat-modra));
  color: #fff; display: flex; align-items: center; gap: 10px;
}
.chat-hlavicka__nadpis { flex: 1; font-weight: 600; font-size: 15px; }
.chat-hlavicka__status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; opacity: .9;
}
.chat-hlavicka__status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #888; box-shadow: 0 0 0 2px rgba(255,255,255,.2);
}
.chat-hlavicka__status.je-online::before { background: #4ade80; }
.chat-hlavicka__zavri {
  background: none; border: none; color: #fff;
  cursor: pointer; padding: 4px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.chat-hlavicka__zavri:hover { background: rgba(255,255,255,.15); }
.chat-hlavicka__zavri svg { width: 18px; height: 18px; }

.chat-banner {
  padding: 10px 14px; background: #fff7d6; border-bottom: 1px solid #f0e3a8;
  font-size: 12.5px; line-height: 1.4; color: #5a4400;
}

.chat-telo {
  flex: 1; overflow-y: auto; padding: 14px;
  background: #f8fafc;
  display: flex; flex-direction: column; gap: 8px;
}

.chat-zprava {
  max-width: 85%; padding: 9px 12px; border-radius: 14px;
  font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; word-wrap: break-word;
}
.chat-zprava--host     { align-self: flex-end; background: var(--chat-modra); color: #fff; border-bottom-right-radius: 4px; }
.chat-zprava--operator { align-self: flex-start; background: #fff; color: #0f1a2c; border: 1px solid #e7ecf3; border-bottom-left-radius: 4px; }
.chat-zprava--system   { align-self: center; background: transparent; color: #56627a; font-style: italic; font-size: 12.5px; text-align: center; padding: 4px 8px; }

.chat-zprava__cas { display: block; font-size: 10.5px; opacity: .65; margin-top: 3px; }

.chat-formular {
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  flex: 1; overflow-y: auto;
}
.chat-formular__uvod {
  font-size: 13px; color: #56627a; line-height: 1.5; margin: 0 0 4px;
}
.chat-formular label { font-size: 12.5px; color: #0f1a2c; font-weight: 500; }
.chat-formular input {
  padding: 9px 11px; border: 1px solid #e7ecf3; border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
}
.chat-formular input:focus { border-color: var(--chat-modra); }
.chat-formular__chyba {
  background: #fee2e2; color: #991b1b; font-size: 12.5px;
  padding: 8px 10px; border-radius: 6px;
}
.chat-formular button {
  margin-top: 4px; padding: 11px; border: none; border-radius: 8px;
  background: var(--chat-modra); color: #fff; font-weight: 600;
  font-family: inherit; font-size: 14px; cursor: pointer;
  transition: background .2s ease;
}
.chat-formular button:hover:not(:disabled) { background: var(--chat-modra-tmava); }
.chat-formular button:disabled { background: #c1cad8; cursor: not-allowed; }

.chat-vstup {
  border-top: 1px solid #e7ecf3; padding: 10px;
  display: flex; gap: 8px; align-items: flex-end; background: #fff;
}
.chat-vstup__textarea {
  flex: 1; resize: none; max-height: 110px; min-height: 38px;
  border: 1px solid #e7ecf3; border-radius: 8px; padding: 9px 11px;
  font-size: 14px; font-family: inherit; outline: none; line-height: 1.4;
}
.chat-vstup__textarea:focus { border-color: var(--chat-modra); }
.chat-vstup__odeslat {
  border: none; background: var(--chat-modra); color: #fff;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.chat-vstup__odeslat:hover:not(:disabled) { background: var(--chat-modra-tmava); }
.chat-vstup__odeslat:disabled { background: #c1cad8; cursor: not-allowed; }
.chat-vstup__odeslat svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
  .chat-panel {
    right: 0; bottom: 0; width: 100%; height: 100dvh; max-height: 100dvh;
    border-radius: 0;
  }
  .chat-bublina { right: 14px; bottom: 14px; }
}
