.tcq-ted {
  --tt-ink: #141414;
  --tt-acid: #dfff00;
  --tt-chalk: #f2f1eb;
  --tt-pan: #fff;
  --tt-border: #dcded3;
  font-family: Diagramm, system-ui, sans-serif;
}
.tcq-ted.tcq-ted [hidden] { display: none !important; }
.tcq-ted.tcq-ted *, .tcq-ted *::before, .tcq-ted *::after { box-sizing: border-box; }
.tcq-ted.tcq-ted button, .tcq-ted.tcq-ted a { font-family: inherit; letter-spacing: normal; text-transform: none; }
.tcq-ted.tcq-ted button { cursor: pointer; }
.tcq-ted.tcq-ted :is(a,button):focus-visible { outline: 3px solid #3164cc; outline-offset: 3px; }
.tcq-ted .tcq-ted-launch {
  position: fixed; z-index: 1000;
  inset-inline-end: max(22px, env(safe-area-inset-right, 0px));
  inset-block-end: max(22px, env(safe-area-inset-bottom, 0px));
  min-height: 52px; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--tt-ink); border-radius: 999px; padding: 7px 16px 7px 8px;
  color: var(--tt-ink); background: var(--tt-acid);
  font-size: 14px; line-height: 1.1;
  box-shadow: 0 10px 30px #0004;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tcq-ted .tcq-ted-launch:where(:hover,:active) {
  color: var(--tt-ink); background: var(--tt-acid); transform: translateY(-2px); box-shadow: 0 12px 34px #0006;
}
.tcq-ted .tcq-ted-face {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 41% 45% 43% 42%; background: var(--tt-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transform: rotate(-9deg); transform-origin: center; color: var(--tt-acid);
}
.tcq-ted .tcq-ted-face > span {
  background: currentColor; display: block; width: 4px; height: 10px; border-radius: 5px;
  transform: rotate(7deg);
}
.tcq-ted .tcq-ted-launch .tcq-ted-face > span { animation: tcq-ted-blink 7s 1.7s 4 both; }
.tcq-ted .tcq-ted-dialog[open] .tcq-ted-face > span { animation: tcq-ted-blink 6s 1.5s 4 both; }
.tcq-ted .tcq-ted-dialog.is-thinking .tcq-ted-face { animation: tcq-ted-tilt .32s ease both; }
@keyframes tcq-ted-blink {
  0%, 92%, 100% { transform: rotate(7deg) scaleY(1); }
  95% { transform: rotate(7deg) scaleY(.15); }
}
@keyframes tcq-ted-tilt {
  0%,100% { transform: rotate(-9deg); }
  45% { transform: translateY(-2px) rotate(10deg); }
}

.tcq-ted .tcq-ted-dialog {
  position: fixed; border: 0; border-radius: 20px; padding: 0; margin: 0;
  color: var(--tt-ink); background: var(--tt-pan); inset: auto 22px 22px auto;
  width: min(398px, calc(100% - 44px)); max-height: calc(100% - 48px); max-height: calc(100dvh - 48px);
  box-shadow: 0 14px 70px #14141438; overflow: hidden;
}
.tcq-ted .tcq-ted-dialog:not([open]) { display: none; }
.tcq-ted .tcq-ted-dialog[open] { animation: tcq-ted-in .22s cubic-bezier(.22,.8,.25,1) both; }
.tcq-ted .tcq-ted-dialog::backdrop { background: #14141466; }
@keyframes tcq-ted-in {
  from { opacity: 0; transform: translateY(7px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tcq-ted .tcq-ted-shell { display: flex; flex-direction: column; max-height: inherit; }
.tcq-ted .tcq-ted-head {
  background: var(--tt-acid); color: var(--tt-ink);
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; min-height: 66px;
}
.tcq-ted .tcq-ted-head :is(strong, small) { display: block; color: inherit; }
.tcq-ted .tcq-ted-head strong { margin: 0; font-size: 16px; line-height: 1.2; font-weight: 750; }
.tcq-ted .tcq-ted-head small { margin-top: 3px; font-size: 12px; line-height: 1.2; }
.tcq-ted .tcq-ted-close {
  display: inline-grid; place-items: center; flex: 0 0 44px; height: 44px;
  margin-inline-start: auto; padding: 0; border: 0; border-radius: 50%;
  color: var(--tt-ink); background: transparent;
}
.tcq-ted .tcq-ted-close:hover { background: #14141415; color: var(--tt-ink); }
.tcq-ted .tcq-ted-body { padding: 17px 17px 13px; overflow: auto; overscroll-behavior: contain; }
.tcq-ted .tcq-ted-meta {
  min-height: 16px; display: flex; align-items: center; gap: 8px; color: #414138;
  font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: .07em; text-transform: uppercase;
}
.tcq-ted .tcq-ted-dots { display: none; align-items: center; gap: 3px; }
.tcq-ted .tcq-ted-dots i { width: 4px; height: 4px; background: #44463c; border-radius: 50%; display: block; }
.tcq-ted .tcq-ted-dialog.is-thinking .tcq-ted-dots { display: flex; }
.tcq-ted .tcq-ted-dialog.is-thinking .tcq-ted-dots i { animation: tcq-ted-dot .35s ease 1 both; }
.tcq-ted .tcq-ted-dialog.is-thinking .tcq-ted-dots i:nth-child(2) { animation-delay: .05s; }
.tcq-ted .tcq-ted-dialog.is-thinking .tcq-ted-dots i:nth-child(3) { animation-delay: .1s; }
@keyframes tcq-ted-dot { 50% { transform: translateY(-3px); } }
.tcq-ted .tcq-ted-question {
  color: var(--tt-ink); margin: 6px 0 14px; font-weight: 680; font-size: 18px; line-height: 1.34;
}
.tcq-ted .tcq-ted-question:focus { outline: none; }
.tcq-ted .tcq-ted-choices { display: grid; gap: 7px; }
.tcq-ted .tcq-ted-choice {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 11px; border: 1px solid var(--tt-border); border-radius: 11px;
  text-align: start; white-space: normal; font-size: 14px; line-height: 1.25; font-weight: 590;
  color: var(--tt-ink); background: var(--tt-chalk);
}
.tcq-ted .tcq-ted-choice span { margin-inline-start: auto; }
.tcq-ted .tcq-ted-choice:not(:disabled):hover { background: #eff5cd; color: var(--tt-ink); border-color: #a4a991; }
.tcq-ted .tcq-ted-choice:disabled { opacity: .67; }
.tcq-ted .tcq-ted-back {
  min-height: 44px; margin: 3px 0 -8px; padding: 7px 4px; border: 0; border-radius: 7px;
  color: #34362e; background: transparent; font-size: 13px; font-weight: 700; text-align: start;
}
.tcq-ted .tcq-ted-back:hover { color: var(--tt-ink); text-decoration: underline; background: transparent; }
.tcq-ted .tcq-ted-summary p { margin: 0 0 10px; color: var(--tt-ink); font-size: 14px; line-height: 1.45; }
.tcq-ted .tcq-ted-summary .tcq-ted-draft {
  padding: 9px 11px; border-radius: 8px; background: var(--tt-chalk); margin: 4px 0 12px; white-space: pre-line;
}
.tcq-ted .tcq-ted-summary .tcq-ted-send {
  display: block; padding: 12px; border: 1px solid var(--tt-ink); border-radius: 9px;
  text-decoration: none; text-align: center; font-weight: 720; font-size: 14px;
  background: var(--tt-acid); color: var(--tt-ink);
}
.tcq-ted .tcq-ted-summary .tcq-ted-send:hover { text-decoration: underline; }
.tcq-ted .tcq-ted-footer {
  flex: 0 0 auto; padding: 3px 16px; border-top: 1px solid var(--tt-border);
  background: #fff;
}
.tcq-ted .tcq-ted-footer a {
  display: inline-flex; gap: 6px; align-items: center; min-height: 44px;
  text-decoration: underline; text-underline-offset: 2px; font-weight: 650; font-size: 13px; color: #2d3025;
}
.tcq-ted .tcq-ted-static { position: fixed; right: 14px; bottom: 14px; z-index: 1000; padding: 8px; background: var(--tt-acid); color: var(--tt-ink); }
@media (max-width: 600px) {
  .tcq-ted .tcq-ted-launch {
    inset-inline-end: max(10px, calc(env(safe-area-inset-right, 0px) + 10px));
    inset-block-end: max(13px, calc(env(safe-area-inset-bottom, 0px) + 8px));
    min-height: 48px; font-size: 13px; padding: 6px 12px 6px 7px;
  }
  .tcq-ted .tcq-ted-launch .tcq-ted-face { width: 34px; height: 34px; flex-basis: 34px; }
  .tcq-ted .tcq-ted-dialog {
    inset: auto 9px max(9px, env(safe-area-inset-bottom, 0px)) 9px;
    width: calc(100% - 18px); margin-inline: auto; max-height: calc(100% - 24px); max-height: calc(100dvh - 24px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tcq-ted.tcq-ted *, .tcq-ted *::before, .tcq-ted *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .tcq-ted .tcq-ted-launch:hover { transform: none; }
}

/* Estados independientes del tema: Acid siempre lleva texto Carbon. */
body .tcq-ted .tcq-ted-face {
  background: #dfff00 !important;
  color: #141414 !important;
  border: 1px solid #141414;
  border-radius: 43% 44% 46% 42%;
  box-shadow: inset 0 1px 0 #ffffff9c, inset 0 -2px 0 #14141420;
}
body .tcq-ted .tcq-ted-head {
  background: linear-gradient(116deg, #141414 63%, #303228) !important;
  color: #fff !important;
  border-bottom: 1px solid #36382e;
  min-height: 68px;
}
body .tcq-ted .tcq-ted-head .tcq-ted-face { border-color: #dfff00; }
body .tcq-ted .tcq-ted-head small { color: #d7d9cc; }
body .tcq-ted .tcq-ted-launch,
body .tcq-ted .tcq-ted-summary .tcq-ted-send {
  background: #dfff00 !important;
  color: #141414 !important;
  border-color: #141414 !important;
  -webkit-tap-highlight-color: transparent;
}
body .tcq-ted .tcq-ted-launch b,
body .tcq-ted .tcq-ted-choice span,
body .tcq-ted .tcq-ted-footer a span { color: inherit !important; }
body .tcq-ted .tcq-ted-launch:is(:hover,:focus,:focus-visible,:active),
body .tcq-ted .tcq-ted-summary .tcq-ted-send:is(:hover,:focus,:focus-visible,:active) {
  background: #e7ff4b !important;
  color: #141414 !important;
}
body .tcq-ted .tcq-ted-head .tcq-ted-close {
  background: #2b2b28 !important;
  border: 1px solid #41413d !important;
  color: #fff !important;
}
body .tcq-ted .tcq-ted-choice {
  min-height: 46px;
  padding: 9px 12px;
  background: #fafaf6;
}
body .tcq-ted .tcq-ted-head .tcq-ted-close:is(:hover,:focus,:focus-visible,:active),
body .tcq-ted .tcq-ted-choice:is(:hover,:focus,:focus-visible,:active),
body .tcq-ted .tcq-ted-back:is(:hover,:focus,:focus-visible,:active) {
  background: #dfff00 !important;
  border-color: #616e00 !important;
  color: #141414 !important;
  -webkit-tap-highlight-color: transparent;
}
body .tcq-ted .tcq-ted-choice:disabled { color: #141414 !important; }
body .tcq-ted .tcq-ted-footer a {
  border-radius: 8px;
  padding-inline: 7px;
  color: #141414 !important;
}
body .tcq-ted .tcq-ted-footer a:is(:hover,:focus,:focus-visible,:active) {
  background: #dfff00 !important;
  color: #141414 !important;
}

/* Ted flota solo. La invitación es un globo independiente y no abre el chat. */
body .tcq-ted .tcq-ted-launch,
body .tcq-ted .tcq-ted-launch:is(:hover,:focus,:focus-visible,:active) {
  padding: 3px;
  gap: 12px;
  flex-direction: row-reverse;
  align-items: center;
  background: transparent !important;
  color: #141414 !important;
  border-color: transparent !important;
  box-shadow: none;
  transform: none;
}
body .tcq-ted .tcq-ted-launch .tcq-ted-face {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
  border: 2px solid #141414 !important;
  box-shadow: 0 6px 21px #14141451, inset 0 1px 0 #ffffffa0, inset 0 -2px 0 #14141422;
  transition: transform .2s ease;
}
body .tcq-ted .tcq-ted-launch .tcq-ted-face > span { width: 6px; height: 15px; }
body .tcq-ted .tcq-ted-launch:is(:hover,:focus-visible) .tcq-ted-face {
  transform: rotate(-4deg) translateY(-2px);
}
body .tcq-ted .tcq-ted-thought {
  position: relative;
  display: grid;
  gap: 2px;
  text-align: start;
  max-width: 204px;
  padding: 9px 12px;
  border: 1px solid #cfd1c4;
  border-radius: 13px;
  background: #fff;
  color: #141414 !important;
  box-shadow: 0 4px 20px #14141425;
  line-height: 1.25;
  white-space: normal;
  font-size: 13px;
  font-weight: 600;
}
body .tcq-ted .tcq-ted-thought small {
  color: #34362d;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
}
body .tcq-ted .tcq-ted-thought::after,
body .tcq-ted .tcq-ted-thought::before {
  position: absolute;
  display: block;
  border-radius: 50%;
  border: 1px solid #cfd1c4;
  background-color: inherit;
  content: "";
}
body .tcq-ted .tcq-ted-thought::before { width: 8px; height: 8px; right: -7px; bottom: 11px; }
body .tcq-ted .tcq-ted-thought::after { width: 5px; height: 5px; right: -13px; bottom: 6px; }
body .tcq-ted .tcq-ted-launch:is(:hover,:focus,:focus-visible,:active) .tcq-ted-thought {
  background: #dfff00;
  border-color: #667529;
  color: #141414 !important;
}
body .tcq-ted .tcq-ted-launch:is(:hover,:focus,:focus-visible,:active) .tcq-ted-thought small { color: #141414 !important; }
@media (max-width: 600px) {
  body .tcq-ted .tcq-ted-launch .tcq-ted-face { width: 53px; height: 53px; flex-basis: 53px; }
  body .tcq-ted .tcq-ted-launch .tcq-ted-face > span { width: 5px; height: 13px; }
  body .tcq-ted .tcq-ted-thought { max-width: 166px; padding: 8px 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body .tcq-ted .tcq-ted-launch:is(:hover,:focus-visible) .tcq-ted-face { transform: rotate(-9deg); }
}
