/* Istniejący czat Telsio: biały panel, grafitowy metal, zielona dioda. */
#telsio-chat-root.telsio-chat {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60; max-width: calc(100vw - 32px); color: #0f1113;
  font: 400 14px/1.5 "Onest", "Segoe UI", sans-serif; color-scheme: light;
  --tc-green: #0a7541; --tc-muted: #636a73; --tc-line: #e3e6ea;
}
.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-green); outline-offset: 3px; }
.telsio-chat ::selection { color: #0f1113; background: #cbf3dd; }
.tc-launcher {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 9px 20px 9px 10px;
  border: 1px solid #d5dadd; border-radius: 36px; color: #0f1113; background: #fff;
  box-shadow: 0 6px 24px #0f11131a, 0 0 0 4px #ffffff80; transition: box-shadow .18s, border-color .18s;
}
.tc-launcher:hover { border-color: #8bd5aa; box-shadow: 0 8px 28px #0f111321, 0 0 0 4px #12c46b0d; }
.tc-launcher[aria-expanded="true"] { border-color: #0a7541; }
.tc-avatar { display: block; flex: none; width: 44px; height: 44px; object-fit: contain; }
.tc-launcher .tc-avatar { width: 30px; height: 30px; }
.tc-launcher-copy { display: flex; flex-direction: column; text-align: left; }
.tc-launcher-name { font-size: 19px; line-height: 1.2; letter-spacing: -.04em; font-weight: 600; }
.tc-launcher-label { margin-top: 3px; color: var(--tc-muted); font-size: 11px; }
.tc-panel {
  position: absolute; right: 0; bottom: calc(100% + 14px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  width: 390px; max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  max-height: calc(100vh - 126px); max-height: calc(100dvh - 126px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden; border: 1px solid #d6dce0; border-radius: 24px; background: #fff;
  box-shadow: 0 20px 64px #0f111329, 0 4px 12px #0f11130a; animation: tc-open .18s ease-out;
}
@keyframes tc-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tc-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: linear-gradient(135deg, #fff, #eefaf3); }
.tc-head .tc-avatar { width: 44px; height: 44px; padding: 3px; border-radius: 50%; background: #ffffff0d; }
.tc-identity { min-width: 0; flex: 1; }
.tc-title { margin: 0; color: #0f1113; font-size: 22px; font-weight: 600; line-height: 1.15; letter-spacing: -.04em; }
.tc-head .brand-ai { --ai-ink: #08743f; --ai-shine: #48d99b; --ai-light: #0a7541; }
.tc-status { margin: 4px 0 0; color: #636a73; font-size: 11px; }
.tc-status::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: #a5adb3; }
.tc-close { flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid #dce8e1; border-radius: 50%; color: #3f444b; background: transparent; font-size: 26px !important; line-height: 1 !important; }
.tc-close:hover { background: #dcf4e5; }
.tc-body { min-height: 0; overflow: auto; padding: 20px; scrollbar-width: thin; scrollbar-color: #b7c2bc #fff; overscroll-behavior: contain; }
.tc-conversation { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.tc-intro { padding: 2px 2px 6px; text-align: center; }
.tc-intro-avatar { width: 88px; height: 88px; margin: 0 auto 18px; padding: 6px; border: 1px solid #dce8e1; border-radius: 50%; background: #f4f8f5; }
.tc-intro-title { margin: 0 auto 10px; max-width: 270px; font-size: 25px; line-height: 1.18; letter-spacing: -.035em; font-weight: 600; }
.tc-copy { margin: 0 0 20px; color: var(--tc-muted); font-size: 13px; line-height: 1.6; }
.tc-primary { min-height: 46px; padding: 12px 16px; border: 1px solid #086136; border-radius: 12px; color: #fff; background: #0a7541; font-weight: 500 !important; }
.tc-primary:hover:not(:disabled) { background: #075f34; }
.tc-start { width: 100%; }
.tc-error { margin: 0 0 14px; padding: 12px; border: 1px solid #edcac7; border-radius: 12px; color: #8c2921; background: #fff5f3; font-size: 13px; overflow-wrap: anywhere; }
.tc-messages { min-height: 170px; max-height: min(310px, calc(100dvh - 390px)); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 2px 1px 8px; scrollbar-width: thin; scrollbar-color: #b7c2bc #fff; 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 5px; color: var(--tc-muted); font-size: 11px; }
.tc-message--user .tc-message-label { text-align: right; }
.tc-message-text { margin: 0; padding: 12px 14px; border: 1px solid #e3e6ea; border-radius: 4px 16px 16px; color: #23282d; background: #f5f6f7; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-message--user .tc-message-text { border-color: #c2e6d0; border-radius: 16px 4px 16px 16px; background: #eaf7ef; }
.tc-prompts { display: flex; flex-direction: column; gap: 7px; }
.tc-prompt { min-height: 44px; padding: 9px 12px; border: 1px solid #dbe5df; border-radius: 11px; color: #0a6540; background: #fff; font-size: 12px !important; text-align: left; }
.tc-prompt:hover:not(:disabled) { background: #f0f8f3; border-color: #9cccae; }
.tc-prompt::after { content: "↗"; float: right; margin-left: 8px; }
.tc-composer { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 6px 8px; margin: 0; padding-top: 4px; }
.tc-input, .tc-field { width: 100%; min-width: 0; padding: 12px; border: 1px solid #bfc8c2; border-radius: 12px; color: #0f1113; background: #fff; outline: none; }
.tc-input { min-height: 60px; max-height: 120px; resize: vertical; }
.tc-input::placeholder { color: #727b75; }
.tc-input:disabled { opacity: .65; }
.tc-send { width: 44px; height: 44px; align-self: center; padding: 0; border: 1px solid #086136; border-radius: 50%; color: #fff; background: #0a7541; font-size: 26px !important; line-height: 1 !important; }
.tc-send:hover:not(:disabled) { background: #075f34; }
.tc-send[aria-disabled="true"] { opacity: .5; }
.tc-count { grid-column: 1 / -1; text-align: right; color: var(--tc-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.tc-support-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 18px; border-top: 1px solid var(--tc-line); background: #fafbfa; }
.tc-human-toggle { min-height: 44px; padding: 6px 0; border: 0; color: #3f444b; background: transparent; font-size: 11px !important; text-align: left; }
.tc-human-toggle:hover { color: #0a7541; }
.tc-support { display: inline-flex; align-items: center; min-height: 44px; color: #0a7541; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tc-handoff { padding: 2px 0; }
.tc-human-title { margin: 0 0 10px; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; font-weight: 600; }
.tc-human-form { display: flex; flex-direction: column; gap: 13px; margin: 0; }
.tc-field-row { display: grid; gap: 6px; }
.tc-label { color: #3f444b; font-size: 12px; }
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: #0a7541; }
.tc-human-result { margin: 0; padding: 12px 0; color: #0a7541; overflow-wrap: anywhere; }
.tc-fallback { display: inline-flex; align-items: center; min-height: 44px; color: #0a7541; 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: 480px) {
  #telsio-chat-root.telsio-chat { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .tc-launcher { width: 64px; height: 64px; min-height: 64px; padding: 7px; justify-content: center; }
  .tc-launcher-copy { display: none; }
  .tc-panel { border-radius: 22px; max-height: calc(100dvh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .tc-head { gap: 10px; padding: 14px 16px; }
  .tc-body { padding: 18px 16px; }
  .tc-support-row { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .telsio-chat *, .telsio-chat *::before, .telsio-chat *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Avatar asystenta jest odrębny od głównego znaku marki. */
.tc-avatar { border-radius: 50%; background: transparent; }
.tc-head .tc-avatar { padding: 0; background: transparent; border-radius: 50%; }
.tc-intro-avatar { width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%; background: transparent; margin-bottom: 16px; }
.telsio-chat:not([hidden])[data-ruch="true"] .tc-panel:not([hidden]) .tc-head .tc-avatar {
  animation: tc-wait 1400ms ease-in-out infinite alternate;
}
@keyframes tc-wait { from { opacity: 1; } to { opacity: .65; } }

/* Połysk avatara jest ozdobą. Status rozmowy nadal wynika z transportu. */
@media(prefers-reduced-motion:no-preference) {
  .telsio-chat[data-widoczny="true"] .tc-launcher .tc-avatar,
  .telsio-chat[data-widoczny="true"] .tc-panel:not([hidden]) .tc-intro-avatar { animation: tc-ai-glow 6s ease-in-out infinite alternate; }
}
@keyframes tc-ai-glow { from { filter: drop-shadow(0 0 2px #5cebf466); } to { filter: drop-shadow(0 0 5px #f05aee99); } }

.tc-privacy-intro { display: flex; justify-content: center; margin: -8px 0 12px; font-size: 11px; min-height: 32px; }
