/* Okno i dymki adaptowane z ZiZi Media; izolowany motyw Telsio. */
#telsio-chat-root.telsio-chat {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  max-width: calc(100vw - 32px);
  color: #f2f4f6;
  font: 400 14px/1.5 "Manrope", "Segoe UI", sans-serif;
  color-scheme: dark;
  --tc-mint: #a4f2dc;
  --tc-muted: #b8c0cb;
  --tc-line: #39424e;
}
.telsio-chat *, .telsio-chat *::before, .telsio-chat *::after { box-sizing: border-box; }
.telsio-chat [hidden] { display: none !important; }
.telsio-chat button, .telsio-chat input, .telsio-chat textarea { font: inherit; }
.telsio-chat button, .telsio-chat a { -webkit-tap-highlight-color: transparent; }
.telsio-chat button { cursor: pointer; }
.telsio-chat button:disabled { cursor: default; opacity: .5; }
.telsio-chat :is(button, a, input, textarea):focus-visible {
  outline: 2px solid var(--tc-mint);
  outline-offset: 3px;
}
.telsio-chat ::selection { color: #101714; background: var(--tc-mint); }
.tc-launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 17px 8px 10px;
  border: 1px solid #687584;
  border-radius: 15px;
  color: #f2f4f6;
  background: linear-gradient(150deg, #39434f, #181e25 70%);
  box-shadow: inset 0 1px 0 #ffffff24, 0 10px 28px -9px #000b;
  transition: background .18s, border-color .18s;
}
.tc-launcher:hover { border-color: var(--tc-mint); background: #303b45; }
.tc-avatar { display: block; flex: 0 0 auto; width: 40px; height: 40px; object-fit: contain; }
.tc-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 392px;
  max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  height: min(640px, calc(100vh - 104px));
  height: min(640px, calc(100dvh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overflow: hidden;
  border: 1px solid #596674;
  border-radius: 21px;
  background: #101419;
  box-shadow: inset 0 1px 0 #ffffff1c, 0 22px 58px -16px #000c;
  animation: tc-open .2s cubic-bezier(.16, 1, .3, 1);
}
@keyframes tc-open { from { opacity: .6; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tc-head { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--tc-line); background: linear-gradient(160deg, #2b343e, #171d24); }
.tc-identity { min-width: 0; flex: 1; }
.tc-title-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tc-title { margin: 0; color: #f2f4f6; font-size: 15px; font-weight: 600; line-height: 1.3; }
.tc-ai { padding: 1px 5px; border: 1px solid #88cbb6; border-radius: 5px; color: var(--tc-mint); font-size: 10px; font-weight: 600; line-height: 1.5; }
.tc-status { margin: 3px 0 0; color: var(--tc-muted); font-size: 12px; overflow-wrap: anywhere; }
.tc-close { min-width: 44px; min-height: 44px; padding: 6px; border: 0; border-radius: 8px; background: transparent; color: #d5dce4; font-size: 11px; }
.tc-close:hover { color: var(--tc-mint); background: #ffffff0a; }
.tc-body { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; padding: 14px; scrollbar-width: thin; scrollbar-color: #596674 #101419; overscroll-behavior: contain; }
.tc-conversation { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.tc-intro { padding: 8px 2px 4px; }
.tc-intro-title, .tc-human-title { margin: 0 0 8px; font-size: 18px; line-height: 1.3; font-weight: 600; }
.tc-copy { margin: 0 0 16px; color: var(--tc-muted); font-size: 13px; }
.tc-primary { min-height: 44px; padding: 11px 15px; border: 1px solid #c6d1d7; border-radius: 10px; background: linear-gradient(160deg, #f1f5f7, #aebdc6); color: #152126; font-weight: 600; }
.tc-primary:hover:not(:disabled) { background: #e1eeea; border-color: var(--tc-mint); }
.tc-start { width: 100%; }
.tc-error { margin: 0; padding: 11px 12px; border: 1px solid #805d65; border-radius: 10px; color: #ffd0d0; background: #2b1e24; font-size: 13px; overflow-wrap: anywhere; }
.tc-messages { min-height: 64px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 2px 1px 8px; scrollbar-width: thin; scrollbar-color: #596674 #101419; overscroll-behavior: contain; }
.tc-message { max-width: 94%; align-self: flex-start; }
.tc-message--user { align-self: flex-end; }
.tc-message-label { display: block; margin: 0 0 4px; color: var(--tc-muted); font-size: 11px; }
.tc-message--user .tc-message-label { text-align: right; }
.tc-message-text { margin: 0; padding: 11px 13px; border: 1px solid #323d48; border-radius: 13px 13px 13px 4px; color: #eef2f6; background: #1b222b; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-message--user .tc-message-text { border-color: #587f74; border-radius: 13px 13px 4px 13px; color: #e1fff4; background: #1b3931; }
.tc-prompts { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.tc-prompt { min-height: 44px; max-width: 100%; padding: 8px 11px; border: 1px solid #45534f; border-radius: 9px; color: #caf6e8; background: #152721; font-size: 12px; line-height: 1.4; text-align: left; }
.tc-prompt:hover:not(:disabled) { border-color: var(--tc-mint); background: #20382f; }
.tc-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; flex: 0 0 auto; margin: 0; }
.tc-input, .tc-field { min-width: 0; width: 100%; padding: 10px 11px; border: 1px solid #728195; border-radius: 9px; color: #f2f4f6; background: #151c24; caret-color: var(--tc-mint); }
.tc-input { min-height: 66px; max-height: 120px; resize: vertical; }
.tc-input::placeholder { color: #aab5c3; }
.tc-input:disabled { opacity: .65; }
.tc-send { min-width: 64px; min-height: 44px; align-self: start; padding: 11px 12px; border: 1px solid #97dcc7; border-radius: 9px; color: #0b221a; background: var(--tc-mint); font-weight: 600; }
.tc-send:hover:not(:disabled) { background: #c9fbea; }
.tc-count { grid-column: 1 / -1; text-align: right; color: var(--tc-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tc-support-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--tc-line); background: #171e25; }
.tc-human-toggle { min-height: 44px; padding: 6px 0; border: 0; color: #e7ecf2; background: transparent; font-size: 12px; text-align: left; }
.tc-support { display: inline-flex; align-items: center; min-height: 44px; color: var(--tc-mint); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tc-handoff { padding: 4px 0; }
.tc-human-form { display: flex; flex-direction: column; gap: 13px; margin: 0; }
.tc-field-row { display: grid; gap: 5px; }
.tc-label { color: #e7ecf2; font-size: 13px; }
textarea.tc-field { resize: vertical; min-height: 90px; }
.tc-consent { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; color: var(--tc-muted); font-size: 12px; cursor: pointer; }
.tc-checkbox { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--tc-mint); }
.tc-human-result { margin: 0; padding: 12px 0; color: var(--tc-mint); overflow-wrap: anywhere; }
.tc-fallback { display: inline-flex; align-items: center; min-height: 44px; color: var(--tc-mint); text-decoration: underline; text-underline-offset: 3px; }
.tc-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 420px) {
  .tc-head { gap: 8px; padding: 12px; }
  .tc-head .tc-avatar { width: 32px; height: 32px; }
  .tc-title { font-size: 14px; }
  .tc-body { padding: 12px; }
  .tc-support-row { flex-wrap: wrap; gap: 0 12px; }
  .tc-panel { border-radius: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .telsio-chat *, .telsio-chat *::before, .telsio-chat *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Lokalny kontekst ZiZi, bez zmiany stalowego motywu huskyAI. */
.telsio-chat select { font: inherit; }
.tc-send[aria-disabled="true"] { cursor: default; opacity: .5; }
.tc-support-row { flex-wrap: wrap; }
.tc-support { white-space: normal; overflow-wrap: anywhere; }
.tc-disclosure { margin: 12px 0 4px; color: var(--tc-muted); font-size: 12px; line-height: 1.5; }
.tc-privacy { display: inline-flex; align-items: center; min-height: 44px; color: var(--tc-mint); font-size: 12px; text-underline-offset: 3px; }
