/* TomaChat Widget — v1.0.0 — #387 rediseño dark/cyan */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300..700;1,9..40,300..700&display=swap');

:root {
  --tc-dark: #01081e;
  --tc-cyan: #13ceed;
  --tc-primary: #0f2572;
  --tc-primary-light: #1a3a8f;
  --tc-white: #fff;
  --tc-gray-50: #f8fafc;
  --tc-gray-100: #f1f5f9;
  --tc-gray-200: #e2e8f0;
  --tc-gray-300: #cbd5e1;
  --tc-gray-400: #94a3b8;
  --tc-gray-500: #64748b;
  --tc-gray-600: #475569;
  --tc-gray-700: #334155;
  --tc-gray-800: #1e293b;
  --tc-green: #22c55e;
  --tc-red: #ef4444;
  --tc-orange: #f59e0b;
  --tc-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --tc-radius-sm: 8px;
  --tc-radius-md: 14px;
  --tc-radius-lg: 20px;
  --tc-transition: cubic-bezier(0.22,1,0.36,1);
  --tc-shadow-btn: 0 4px 20px rgba(1,8,30,0.45), 0 2px 8px rgba(1,8,30,0.25);
  --tc-shadow-btn-hover: 0 6px 28px rgba(1,8,30,0.55), 0 3px 12px rgba(1,8,30,0.3);
  --tc-shadow-lg: 0 8px 32px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.08);
  --tc-cyan-glow: rgba(19,206,237,0.25);
}

/* Reset — proteger de WordPress/Elementor */
#tc-widget *, #tc-widget *::before, #tc-widget *::after { box-sizing: border-box !important; }
#tc-widget svg { overflow: visible !important; flex-shrink: 0 !important; }

#tc-widget { position: fixed; z-index: 999999; font-family: var(--tc-font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

#tc-panel { width: 380px; max-width: calc(100vw - 40px); height: 600px; background: var(--tc-white); border-radius: var(--tc-radius-lg); box-shadow: var(--tc-shadow-lg); display: flex; flex-direction: column; overflow: hidden; margin-bottom: 12px; transform-origin: bottom right; }
@keyframes tc-panel-in { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes tc-panel-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }

/* ── FAB — dark con punto cyan ── */
#tc-btn { width: 60px; height: 60px; border-radius: 50%; background: var(--tc-dark); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--tc-shadow-btn); transition: transform 0.3s var(--tc-transition), box-shadow 0.3s var(--tc-transition); margin-top: 12px; position: relative; animation: tc-fab-in 0.5s var(--tc-transition) both; }
#tc-btn:hover { transform: scale(1.08); box-shadow: var(--tc-shadow-btn-hover); }
#tc-btn:active { transform: scale(.95); }
#tc-btn::after { content: ''; position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; background: var(--tc-cyan); border-radius: 50%; border: 2.5px solid var(--tc-white); animation: tc-pulse-cyan 2s ease-in-out infinite; }
@keyframes tc-fab-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tc-pulse-cyan { 0%,100% { box-shadow: 0 0 0 0 rgba(19,206,237,0.4); } 50% { box-shadow: 0 0 0 6px rgba(19,206,237,0); } }

#tc-badge { position: absolute; top: -4px; right: -4px; width: 22px; height: 22px; background: var(--tc-red); color: white; font-size: 11px; font-weight: 700; border-radius: 50%; display: none; align-items: center; justify-content: center; border: 2.5px solid white; z-index: 1; font-family: var(--tc-font); }
#tc-badge.visible { display: flex; }

/* ── Header — dark sólido ── */
.tc-header-bar { background: var(--tc-dark); padding: 14px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; position: relative; overflow: hidden; }

.tc-header-logo { width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
#tc-widget .tc-header-logo img { width: 24px !important; height: 24px !important; object-fit: contain; }
.tc-header-logo span { font-size: 16px; font-weight: 800; color: white; }

.tc-header-av { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; position: relative; z-index: 1; }
.tc-header-av-online::after { content: ''; position: absolute; bottom: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: var(--tc-cyan); border: 1.5px solid var(--tc-dark); }

.tc-header-info { flex: 1; min-width: 0; z-index: 1; }
.tc-header-title { color: white; font-size: 0.95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-header-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.tc-header-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tc-cyan); flex-shrink: 0; animation: tc-pulse-cyan 2s ease-in-out infinite; }
.tc-header-status-dot.offline { background: var(--tc-gray-400); animation: none; }
.tc-header-status-text { color: var(--tc-cyan); font-size: 0.75rem; }
.tc-header-actions { display: flex; gap: 4px; z-index: 1; flex-shrink: 0; }

.tc-header-btn { width: 32px; height: 32px; min-width: 32px; border-radius: 8px; border: none; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; padding: 0; overflow: visible; }
#tc-widget .tc-header-btn svg { width: 16px !important; height: 16px !important; min-width: 16px !important; stroke: currentColor; fill: none; stroke-width: 2; display: block !important; overflow: visible !important; }
.tc-header-btn:hover { background: rgba(255,255,255,0.15); color: white; }

#tc-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

/* ── Welcome — zona oscura + zona clara ── */
.tc-welcome { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.tc-welcome-dark { background: var(--tc-dark); padding: 28px 22px 22px; flex-shrink: 0; position: relative; overflow: hidden; }
.tc-welcome-heading { font-size: 1.375rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; margin: 0 0 8px; line-height: 1.3; }
.tc-welcome-sub { font-size: 0.8125rem; color: rgba(255,255,255,0.55); line-height: 1.5; margin: 0 0 16px; }

/* Trust pills — dos variantes */
.tc-trust-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-trust-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 4px 10px; font-size: 0.695rem; font-weight: 500; }
.tc-trust-pill-cyan { background: rgba(19,206,237,0.1); border: 1px solid rgba(19,206,237,0.25); color: var(--tc-cyan); }
.tc-trust-pill-dim { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); }

/* Círculos decorativos */
.tc-deco-circle { position: absolute; border-radius: 50%; background: none; border: 1px solid rgba(19,206,237,0.08); pointer-events: none; }
.tc-deco-circle-1 { width: 180px; height: 180px; top: -50px; right: -50px; }
.tc-deco-circle-2 { width: 120px; height: 120px; top: -30px; right: -30px; }

/* Zona clara */
.tc-welcome-light { background: var(--tc-white); flex: 1; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; }

/* Input de bienvenida */
.tc-welcome-input-wrap { display: flex; align-items: flex-end; gap: 8px; border: 1.5px solid var(--tc-cyan); border-radius: 14px; padding: 10px 12px; background: var(--tc-white); transition: box-shadow 0.2s; }
.tc-welcome-input-wrap:focus-within { box-shadow: 0 0 0 3px var(--tc-cyan-glow); }
.tc-welcome-input { flex: 1; border: none; outline: none; font-family: var(--tc-font); font-size: 0.84rem; color: var(--tc-gray-800); background: transparent; resize: none; min-height: 38px; max-height: 90px; line-height: 1.4; }
.tc-welcome-input::placeholder { color: var(--tc-gray-400); }
.tc-welcome-send { width: 38px; height: 38px; min-width: 38px; border-radius: 50%; border: none; background: var(--tc-cyan); cursor: default; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.2s, box-shadow 0.2s; opacity: 0.4; }
#tc-widget .tc-welcome-send svg { width: 18px !important; height: 18px !important; min-width: 18px !important; fill: var(--tc-dark) !important; stroke: none !important; display: block !important; }
.tc-welcome-send.ready { cursor: pointer; opacity: 1; }
.tc-welcome-send.ready:hover { transform: scale(1.08); box-shadow: 0 2px 10px rgba(19,206,237,0.4); }
.tc-welcome-send.ready:active { transform: scale(0.92); }

/* Canal buttons — grid 3 columnas con icono centrado */
.tc-welcome-channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tc-channel-btn-placeholder { display: block; }
.tc-channel-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 12px 6px 10px; border-radius: var(--tc-radius-sm); border: 1.5px solid var(--tc-gray-200); background: var(--tc-white); cursor: pointer; transition: all 0.2s var(--tc-transition); font-family: var(--tc-font); text-align: center; }
.tc-channel-btn:hover { border-color: var(--tc-cyan); background: rgba(19,206,237,0.04); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(19,206,237,0.1); }
.tc-channel-btn-icon { width: 40px; height: 40px; min-width: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 22px; }
.tc-channel-btn-icon.whatsapp { background: linear-gradient(135deg, #dcfce7, #f0fdf4); }
.tc-channel-btn-icon.tutorials { background: linear-gradient(135deg, #fef3c7, #fffbeb); }
.tc-channel-btn-icon.client { background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.tc-channel-btn-label { font-size: 0.7rem; font-weight: 600; color: var(--tc-gray-600); line-height: 1.2; }

/* ── State 2 — Collect (nombre + consentimientos) ── */
.tc-collect { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tc-collect-messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.tc-collect-messages::-webkit-scrollbar { width: 4px; }
.tc-collect-messages::-webkit-scrollbar-thumb { background: var(--tc-gray-200); border-radius: 4px; }
.tc-collect-card { background: var(--tc-gray-50); border: 1.5px solid var(--tc-gray-200); border-radius: var(--tc-radius-md); padding: 16px; margin: 0 2px; }
.tc-collect-card-title { font-size: 0.82rem; font-weight: 700; color: var(--tc-gray-700); margin-bottom: 12px; }
.tc-collect-field { margin-bottom: 10px; }
.tc-collect-label { font-size: 0.72rem; font-weight: 600; color: var(--tc-gray-500); margin-bottom: 4px; display: block; }
.tc-collect-input { width: 100%; padding: 9px 12px; border: 1.5px solid var(--tc-gray-200); border-radius: 8px; font-family: var(--tc-font); font-size: 0.84rem; color: var(--tc-gray-800); background: var(--tc-white); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.tc-collect-input:focus { border-color: var(--tc-cyan); box-shadow: 0 0 0 3px var(--tc-cyan-glow); }
.tc-collect-input::placeholder { color: var(--tc-gray-400); }
.tc-consent-items { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.tc-consent-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; background: var(--tc-white); border-radius: 8px; border: 1px solid var(--tc-gray-200); }
.tc-consent-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--tc-cyan); margin-top: 2px; flex-shrink: 0; }
.tc-consent-item label { font-size: 0.73rem; color: var(--tc-gray-600); line-height: 1.5; cursor: pointer; }
.tc-consent-item label a { color: var(--tc-primary); text-decoration: underline; }
.tc-consent-required-star { color: var(--tc-red); font-size: 0.7rem; margin-left: 2px; }
.tc-collect-btn { width: 100%; padding: 11px; border-radius: 10px; border: none; background: var(--tc-cyan); color: var(--tc-dark); font-family: var(--tc-font); font-size: 0.84rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s, transform 0.2s; margin-top: 8px; }
.tc-collect-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.tc-collect-btn:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ── Messages (State 3) ── */
#tc-messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; scroll-behavior: smooth; }
#tc-messages::-webkit-scrollbar { width: 4px; }
#tc-messages::-webkit-scrollbar-thumb { background: var(--tc-gray-200); border-radius: 4px; }

.tc-msg-group { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.tc-msg-group.me { align-items: flex-end; }
.tc-msg-group.agent { align-items: flex-start; }
.tc-msg-sender { font-size: 0.68rem; font-weight: 600; margin-bottom: 2px; padding: 0 4px; }
.tc-msg-group.me .tc-msg-sender { color: var(--tc-primary); }
.tc-msg-group.agent .tc-msg-sender { color: var(--tc-gray-500); }
.tc-bubble { max-width: 78%; padding: 10px 14px; font-size: 0.84rem; line-height: 1.5; word-break: break-word; }
.tc-msg-group.me .tc-bubble { background: var(--tc-dark); color: white; border-radius: 16px 4px 16px 16px; animation: tc-in-me 0.2s var(--tc-transition) both; }
.tc-msg-group.me .tc-bubble:first-of-type, .tc-msg-group.me .tc-bubble:only-of-type { border-radius: 16px 16px 4px 16px; }
.tc-msg-group.agent .tc-bubble { background: var(--tc-gray-100); color: var(--tc-gray-800); border-radius: 4px 16px 16px 16px; animation: tc-in-agent 0.2s var(--tc-transition) both; }
.tc-msg-group.agent .tc-bubble:first-of-type, .tc-msg-group.agent .tc-bubble:only-of-type { border-radius: 16px 16px 16px 4px; }
/* Markdown elements inside agent bubbles */
.tc-msg-group.agent .tc-bubble p { margin: 0 0 .4em; }
.tc-msg-group.agent .tc-bubble p:last-child { margin-bottom: 0; }
.tc-msg-group.agent .tc-bubble em { font-style: italic; }
.tc-msg-group.agent .tc-bubble strong { font-weight: 700; }
.tc-msg-group.agent .tc-bubble code { font-family: monospace; font-size: .82em; background: rgba(0,0,0,.08); border-radius: 3px; padding: .1em .3em; }
.tc-msg-group.agent .tc-bubble pre { background: rgba(0,0,0,.08); border-radius: 6px; padding: .5em .7em; overflow-x: auto; margin: .3em 0; }
.tc-msg-group.agent .tc-bubble pre code { background: none; padding: 0; }
.tc-msg-group.agent .tc-bubble ul, .tc-msg-group.agent .tc-bubble ol { margin: .3em 0; padding-left: 1.4em; }
.tc-msg-group.agent .tc-bubble li { margin-bottom: .15em; }
.tc-msg-group.agent .tc-bubble blockquote { border-left: 3px solid var(--tc-primary); margin: .3em 0; padding: .15em .6em; color: var(--tc-gray-500); font-style: italic; }
.tc-msg-group.agent .tc-bubble a { color: var(--tc-primary); text-decoration: underline; }
@keyframes tc-in-me { from { opacity: 0; transform: translateX(10px) scale(0.96); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes tc-in-agent { from { opacity: 0; transform: translateX(-10px) scale(0.96); } to { opacity: 1; transform: translateX(0) scale(1); } }
.tc-bubble-system { font-size: 0.68rem; color: var(--tc-gray-400); background: var(--tc-gray-100); padding: 4px 12px; border-radius: 20px; text-align: center; align-self: center; }
.tc-date-sep { text-align: center; padding: 8px 0; }
.tc-date-sep span { font-size: 0.68rem; color: var(--tc-gray-400); background: var(--tc-gray-100); padding: 4px 12px; border-radius: 20px; }
.tc-msg-time { font-size: 0.62rem; color: var(--tc-gray-400); padding: 0 4px; margin-top: 2px; }
.tc-msg-group.me .tc-msg-time { text-align: right; }

#tc-typing { display: none; align-items: center; gap: 8px; padding: 4px 18px 8px; flex-shrink: 0; }
.tc-typing-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--tc-primary); display: flex; align-items: center; justify-content: center; font-size: 0.55rem; font-weight: 700; color: white; flex-shrink: 0; }
.tc-typing-dots { display: flex; gap: 3px; }
.tc-typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--tc-gray-300); animation: tc-typing-bounce 1.4s ease-in-out infinite; }
.tc-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.tc-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tc-typing-bounce { 0%,60%,100% { transform: translateY(0); background: var(--tc-gray-300); } 30% { transform: translateY(-4px); background: var(--tc-cyan); } }
.tc-typing-name { font-size: 0.7rem; color: var(--tc-gray-400); font-style: italic; }

/* ── Input bar (State 3) — send circular cyan ── */
.tc-input-bar { padding: 12px 14px; border-top: 1px solid var(--tc-gray-100); display: flex; align-items: flex-end; gap: 8px; background: var(--tc-white); flex-shrink: 0; position: relative; }
.tc-input-actions { display: flex; gap: 2px; padding-bottom: 4px; }
.tc-input-action { width: 34px; height: 34px; min-width: 34px; border-radius: 8px; border: none; background: transparent; color: var(--tc-gray-400); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; padding: 0; }
.tc-input-action:hover { background: var(--tc-gray-100); color: var(--tc-gray-600); }
#tc-widget .tc-input-action svg { width: 18px !important; height: 18px !important; min-width: 18px !important; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block !important; }
.tc-input-wrap { flex: 1; }
.tc-input-field { width: 100%; padding: 10px 14px; border: 1.5px solid var(--tc-gray-200); border-radius: 12px; font-family: var(--tc-font); font-size: 0.84rem; color: var(--tc-gray-800); background: var(--tc-gray-50); outline: none; resize: none; min-height: 42px; max-height: 120px; transition: border-color 0.2s, box-shadow 0.2s; line-height: 1.4; }
.tc-input-field::placeholder { color: var(--tc-gray-400); }
.tc-input-field:focus { border-color: var(--tc-cyan); box-shadow: 0 0 0 3px var(--tc-cyan-glow); background: var(--tc-white); }
.tc-send-btn { width: 42px; height: 42px; min-width: 42px; border-radius: 50%; border: none; background: var(--tc-cyan); color: var(--tc-dark); cursor: default; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.2s, box-shadow 0.2s; opacity: 0.4; }
#tc-widget .tc-send-btn svg { width: 18px !important; height: 18px !important; min-width: 18px !important; fill: var(--tc-dark) !important; stroke: none !important; display: block !important; }
.tc-send-btn.ready { cursor: pointer; opacity: 1; }
.tc-send-btn.ready:hover { transform: scale(1.08); box-shadow: 0 2px 10px rgba(19,206,237,0.4); }
.tc-send-btn.ready:active { transform: scale(0.92); }

#tc-emoji-picker { position: absolute; bottom: 68px; left: 0; right: 0; background: var(--tc-white); border-top: 1px solid var(--tc-gray-100); padding: 8px; display: flex; flex-wrap: wrap; gap: 2px; max-height: 180px; overflow-y: auto; z-index: 10; }
#tc-emoji-picker button { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; border-radius: 6px; line-height: 1; transition: background 0.1s; }
#tc-emoji-picker button:hover { background: rgba(19,206,237,0.08); }

/* ── Forms genéricos ── */
.tc-form-body { padding: 20px; }
.tc-form-title { font-size: 14.5px; font-weight: 700; color: var(--tc-gray-800); margin: 0 0 16px; }
.tc-field { margin-bottom: 11px; }
.tc-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--tc-gray-200); border-radius: 10px; font-size: 14px; font-family: var(--tc-font); color: var(--tc-gray-800); background: var(--tc-gray-50); outline: none; transition: border-color 0.15s, background 0.15s; box-sizing: border-box; }
.tc-input:focus { border-color: var(--tc-cyan); background: var(--tc-white); }
.tc-input::placeholder { color: var(--tc-gray-400); }
.tc-form-err { color: #dc2626; font-size: 12.5px; margin-bottom: 8px; display: none; }
.tc-primary-btn { width: 100%; padding: 12px; background: var(--tc-dark); color: var(--tc-white); border: none; border-radius: 10px; font-size: 14px; font-weight: 600; font-family: var(--tc-font); cursor: pointer; transition: opacity 0.15s, transform 0.12s; }
.tc-primary-btn:hover { opacity: 0.85; }
.tc-primary-btn:active { opacity: 0.8; transform: scale(0.99); }
.tc-primary-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.tc-ghost-btn { width: 100%; padding: 8px; background: none; border: none; font-size: 12.5px; color: var(--tc-gray-400); cursor: pointer; margin-top: 6px; font-family: var(--tc-font); }
.tc-ghost-btn:hover { color: var(--tc-gray-500); }
.tc-dept-btn { width: 100%; padding: 12px 14px; margin-bottom: 8px; border-radius: 10px; border: 1.5px solid var(--tc-gray-200); background: var(--tc-white); cursor: pointer; text-align: left; font-size: 14px; font-family: var(--tc-font); color: var(--tc-gray-800); display: flex; align-items: center; gap: 10px; transition: border-color 0.18s, background 0.18s, transform 0.13s; }
.tc-dept-btn:hover { border-color: var(--tc-cyan); background: rgba(19,206,237,0.04); transform: translateX(3px); }

/* ── Consent view legacy ── */
.tc-consent { flex: 1; display: flex; flex-direction: column; padding: 28px 24px; gap: 16px; }
.tc-consent-title { font-size: 1rem; font-weight: 700; color: var(--tc-gray-800); }
.tc-consent-text { font-size: 0.78rem; color: var(--tc-gray-500); line-height: 1.6; background: var(--tc-gray-50); padding: 14px 16px; border-radius: var(--tc-radius-sm); border-left: 3px solid var(--tc-cyan); overflow-wrap: break-word; word-break: break-word; }
.tc-consent-check { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; }
.tc-consent-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--tc-cyan); margin-top: 2px; flex-shrink: 0; }
.tc-consent-check label { font-size: 0.78rem; color: var(--tc-gray-600); line-height: 1.5; cursor: pointer; overflow-wrap: break-word; word-break: break-word; }
.tc-consent-check label a { color: var(--tc-primary); text-decoration: underline; }
.tc-consent-actions { display: flex; gap: 10px; }
.tc-consent-accept { flex: 1; padding: 12px; border-radius: 10px; border: none; background: var(--tc-cyan); color: var(--tc-dark); font-family: var(--tc-font); font-size: 0.84rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s, transform 0.2s; }
.tc-consent-accept:hover { transform: translateY(-1px); }
.tc-consent-accept:disabled { opacity: 0.45; cursor: default; transform: none; }
.tc-consent-decline { padding: 12px 18px; border-radius: 10px; border: 1.5px solid var(--tc-gray-200); background: transparent; color: var(--tc-gray-500); font-family: var(--tc-font); font-size: 0.84rem; cursor: pointer; }

.tc-powered { padding: 8px; text-align: center; font-size: 0.62rem; color: var(--tc-gray-300); background: var(--tc-gray-50); border-top: 1px solid var(--tc-gray-100); flex-shrink: 0; }
.tc-powered a { color: var(--tc-gray-400); text-decoration: none; font-weight: 600; }

.tc-rating-bar { padding: 14px 16px 12px; border-top: 1px solid var(--tc-gray-100); background: var(--tc-gray-50); flex-shrink: 0; }
.tc-rating-title { font-size: 13px; color: var(--tc-gray-600); font-weight: 600; text-align: center; margin: 0 0 10px; }
.tc-rating-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.tc-rating-stars button { background: none; border: none; font-size: 24px; cursor: pointer; padding: 2px; line-height: 1; color: var(--tc-gray-300); transition: color 0.12s, transform 0.12s; }
.tc-transcript-btn { display: block; width: 100%; background: none; border: 1.5px solid var(--tc-primary); color: var(--tc-primary); border-radius: 8px; padding: 7px 18px; font-size: 12.5px; cursor: pointer; font-family: var(--tc-font); transition: background 0.15s; }
.tc-transcript-btn:hover { background: rgba(15,37,114,0.05); }

.tc-attach-img { max-width: 180px; max-height: 130px; border-radius: 10px; object-fit: cover; display: block; cursor: pointer; margin-bottom: 4px; }
.tc-attach-file { background: var(--tc-gray-100); border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--tc-gray-600); }
.tc-pending-files { display: none; flex-wrap: wrap; gap: 4px; padding: 6px 14px 0; }
.tc-pending-chip { display: flex; align-items: center; gap: 4px; background: var(--tc-gray-100); border-radius: 4px; padding: 2px 8px; font-size: 11px; color: var(--tc-gray-700); max-width: 160px; }
.tc-pending-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tc-pending-rm { background: none; border: none; color: var(--tc-gray-400); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; flex-shrink: 0; }
.tc-pending-rm:hover { color: var(--tc-red); }

@media (min-width: 481px) and (max-width: 768px) {
  #tc-panel { width: 360px; height: 540px; }
  #tc-btn { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
  #tc-widget { bottom: 16px !important; right: 16px !important; left: auto !important; }
  #tc-btn { width: 56px; height: 56px; }
  #tc-btn::after { width: 12px; height: 12px; top: 1px; right: 1px; }
  #tc-widget.tc-is-open #tc-btn { display: none; }
  #tc-panel { position: fixed !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; max-width: 100% !important; border-radius: 0 !important; margin-bottom: 0 !important; }
  .tc-header-bar { padding: 14px 16px; }
  .tc-header-btn { width: 38px; height: 38px; min-width: 38px; }
  #tc-widget .tc-header-btn svg { width: 20px !important; height: 20px !important; min-width: 20px !important; }
  .tc-welcome-dark { padding: 20px 16px 16px; }
  .tc-welcome-light { padding: 14px 14px 12px; }
  .tc-consent { padding: 20px 16px; }
  .tc-form-body { padding: 16px; }
  #tc-messages { padding: 12px 14px; }
  .tc-input-bar { padding: 10px 12px; }
  @keyframes tc-panel-in { from { transform: translateY(100%); opacity: 0.9; } to { transform: translateY(0); opacity: 1; } }
  @keyframes tc-panel-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100%); opacity: 0; } }
}

/* ── Screen Share widget ── */
.tc-share-btn {
  background: none; border: 1px solid rgba(255,255,255,.12); border-radius: 6px;
  color: rgba(255,255,255,.5); cursor: pointer; padding: 4px 7px;
  transition: all .2s; display: flex; align-items: center;
}
.tc-share-btn:hover { border-color: var(--tc-cyan); color: var(--tc-cyan); }
.tc-share-btn.active { background: rgba(19,206,237,0.12); border-color: var(--tc-cyan); color: var(--tc-cyan); }

#tc-sharing-banner {
  display: none; background: rgba(19,206,237,0.08); border: 1px solid rgba(19,206,237,0.25);
  border-radius: 8px; padding: 8px 12px; margin: 6px 8px; font-size: .78rem;
  color: var(--tc-cyan); align-items: center; gap: 8px; animation: pulse-border 2s infinite;
}
#tc-sharing-banner.visible { display: flex; }
@keyframes pulse-border {
  0%, 100% { border-color: rgba(19,206,237,0.25); }
  50%       { border-color: rgba(19,206,237,0.6); }
}

.tc-pending-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--tc-orange);
  animation: tc-pulse 1.5s ease-in-out infinite;
}
@keyframes tc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}

#tc-share-request-modal,
#tc-audio-request-modal {
  display: none; position: absolute; bottom: 60px; left: 0; right: 0;
  background: var(--tc-white); border: 1px solid var(--tc-gray-200);
  border-radius: var(--tc-radius-sm); margin: 0 8px; padding: 14px; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
#tc-share-request-modal.visible,
#tc-audio-request-modal.visible { display: block; }
#tc-share-request-modal h4,
#tc-audio-request-modal h4 { margin: 0 0 6px; font-size: .82rem; color: var(--tc-gray-800); }
#tc-share-request-modal p,
#tc-audio-request-modal p { margin: 0 0 12px; font-size: .75rem; color: var(--tc-gray-500); }
.tc-share-modal-btns { display: flex; gap: 8px; }
.tc-share-accept { background: var(--tc-dark); color: #fff; border: none; border-radius: 6px; padding: 6px 14px; cursor: pointer; font-size: .78rem; flex: 1; }
.tc-share-decline { background: none; border: 1px solid var(--tc-gray-200); border-radius: 6px; padding: 6px 14px; cursor: pointer; font-size: .78rem; color: var(--tc-gray-500); flex: 1; }

.tc-audio-badge {
  display: none; background: rgba(19,206,237,0.12); border: 1px solid rgba(19,206,237,0.25);
  border-radius: 4px; padding: 1px 6px; font-size: .65rem; color: var(--tc-cyan); margin-left: 2px;
}
.tc-audio-badge.visible { display: inline-flex; }

/* ── Modo offline — pantalla de dos opciones ── */
.tc-offline { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tc-offline-dark { background: var(--tc-dark); flex: 1; padding: 20px 18px 16px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.tc-offline-light { background: var(--tc-white); padding: 10px 18px; flex-shrink: 0; border-top: 1px solid rgba(255,255,255,0.06); }

/* Botones de opción — sobre fondo oscuro */
.tc-welcome-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.tc-action-btn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); cursor: pointer; transition: background 0.2s, border-color 0.2s; text-align: left; font-family: var(--tc-font); width: 100%; }
.tc-action-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(19,206,237,0.5); }
.tc-action-btn.tc-action-primary { border-color: rgba(19,206,237,0.4); background: rgba(19,206,237,0.08); }
.tc-action-btn.tc-action-primary:hover { background: rgba(19,206,237,0.15); border-color: var(--tc-cyan); }
.tc-action-icon { width: 38px; height: 38px; min-width: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tc-action-icon.support { background: rgba(19,206,237,0.15); color: var(--tc-cyan); }
.tc-action-icon.commercial { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.65); }
.tc-action-text { flex: 1; min-width: 0; }
.tc-action-text h4 { font-size: 0.84rem; font-weight: 600; color: #fff; margin: 0 0 2px; line-height: 1.2; }
.tc-action-text p { font-size: 0.72rem; color: rgba(255,255,255,0.5); line-height: 1.3; margin: 0; }
.tc-action-arrow { color: rgba(255,255,255,0.3); font-size: 1rem; margin-left: auto; flex-shrink: 0; transition: transform 0.2s, color 0.2s; }
.tc-action-btn:hover .tc-action-arrow { transform: translateX(3px); color: var(--tc-cyan); }

/* Mini-badges de horario */
.tc-offline-badges { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 12px; margin-top: auto; }
.tc-offline-badge { display: flex; align-items: center; gap: 8px; opacity: 0.45; }
.tc-offline-badge-icon { font-size: 0.78rem; flex-shrink: 0; }
.tc-offline-badge-label { font-size: 0.72rem; color: rgba(255,255,255,0.75); flex: 1; }
.tc-offline-badge-pill { font-size: 0.6rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: rgba(245,158,11,0.18); color: #f59e0b; border: 1px solid rgba(245,158,11,0.28); flex-shrink: 0; }
