#tcask-root {
  position: fixed;
  right: 18px;
  top: 86px;
  left: auto;
  bottom: auto;
  z-index: 9999;
  font-family: "JetBrains Mono", "Courier New", monospace;
  color: #d7edf4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#tctruth-toggle,
#tcask-toggle,
.tcask-send,
.tcask-close,
.tctruth-close {
  border: 1px solid rgba(91, 200, 245, .55);
  background: rgba(4, 12, 18, .96);
  color: #d7edf4;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .16em;
}

#tctruth-toggle,
#tcask-toggle {
  min-width: 154px;
  padding: 11px 14px;
  font-size: 11px;
}

#tctruth-toggle {
  min-width: 236px;
  border-color: rgba(91, 200, 245, .72);
  box-shadow: 0 0 0 1px rgba(91, 200, 245, .36), 0 10px 28px rgba(0, 0, 0, .45), 0 0 18px rgba(91, 200, 245, .16);
  animation: tctruth-pulse 3.1s ease-in-out infinite;
}

#tcask-toggle {
  border-color: #ff6b22;
  box-shadow: 0 0 0 1px rgba(255, 107, 34, .62), 0 10px 28px rgba(0, 0, 0, .45), 0 0 22px rgba(255, 107, 34, .18);
  animation: tcask-pulse 2.6s ease-in-out infinite;
}

#tctruth-toggle:hover,
#tcask-toggle:hover,
.tcask-send:hover,
.tcask-close:hover,
.tctruth-close:hover {
  border-color: #ff6b22;
  color: #ffffff;
}

.tctruth-panel,
.tcask-panel {
  display: none;
  width: min(420px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 28px));
  background: rgba(2, 6, 10, .98);
  border: 1px solid rgba(255, 107, 34, .78);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .62), 0 0 0 1px rgba(255, 107, 34, .34), 0 0 32px rgba(255, 107, 34, .14);
}

.tctruth-panel {
  height: min(720px, calc(100vh - 28px));
  border-color: rgba(91, 200, 245, .78);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .62), 0 0 0 1px rgba(91, 200, 245, .3), 0 0 34px rgba(91, 200, 245, .16);
}

#tcask-root.truth-open .tctruth-panel,
#tcask-root.open .tcask-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

#tcask-root.truth-open .tctruth-panel {
  grid-template-rows: auto 1fr;
}

#tcask-root.truth-open #tctruth-toggle,
#tcask-root.truth-open #tcask-toggle,
#tcask-root.open #tctruth-toggle,
#tcask-root.open #tcask-toggle {
  display: none;
}

/* floating chatbot button (outside #tcask-root on non-landing pages) */
body > #tcask-toggle {
  min-width: 154px;
  padding: 11px 14px;
  font-size: 11px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: .16em;
  border: 1px solid #ff6b22;
  background: rgba(4, 12, 18, .96);
  color: #d7edf4;
  cursor: grab;
  box-shadow: 0 0 0 1px rgba(255, 107, 34, .62), 0 10px 28px rgba(0, 0, 0, .45), 0 0 22px rgba(255, 107, 34, .18);
  animation: tcask-pulse 2.6s ease-in-out infinite;
}

body > #tcask-toggle:hover {
  border-color: #ff8844;
  color: #ffffff;
}

@keyframes tcask-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(255, 107, 34, .58), 0 10px 28px rgba(0, 0, 0, .45), 0 0 18px rgba(255, 107, 34, .12);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(255, 107, 34, .92), 0 10px 28px rgba(0, 0, 0, .45), 0 0 34px rgba(255, 107, 34, .38);
  }
}

@keyframes tctruth-pulse {
  0%, 100% {
    border-color: rgba(91, 200, 245, .62);
    box-shadow: 0 0 0 1px rgba(91, 200, 245, .34), 0 10px 28px rgba(0, 0, 0, .45), 0 0 18px rgba(91, 200, 245, .12);
  }
  50% {
    border-color: rgba(91, 200, 245, .95);
    box-shadow: 0 0 0 2px rgba(91, 200, 245, .88), 0 10px 28px rgba(0, 0, 0, .45), 0 0 34px rgba(91, 200, 245, .36);
  }
}

@media (prefers-reduced-motion: reduce) {
  #tctruth-toggle,
  #tcask-toggle {
    animation: none;
  }
}

.tcask-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(91, 200, 245, .22);
  background: linear-gradient(90deg, rgba(0, 180, 208, .12), rgba(255, 107, 34, .08));
}

.tctruth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(91, 200, 245, .28);
  background: linear-gradient(90deg, rgba(91, 200, 245, .14), rgba(255, 107, 34, .06));
}

.tctruth-kicker,
.tcask-kicker {
  font-size: 8px;
  letter-spacing: .28em;
  color: #7fb6c6;
  text-transform: uppercase;
}

.tctruth-title,
.tcask-title {
  margin-top: 3px;
  font-size: 13px;
  letter-spacing: .18em;
  color: #ffffff;
  text-transform: uppercase;
}

.tctruth-close,
.tcask-close {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.tctruth-body {
  overflow-y: auto;
  padding: 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.62;
  color: #e7f7fb;
  background: rgba(2, 6, 10, .99);
}

.tctruth-body p {
  margin: 0 0 13px;
  color: #e7f7fb;
  font-weight: 400;
  opacity: 1;
}

.tctruth-body blockquote {
  margin: 14px 0;
  padding: 11px 12px;
  border-left: 2px solid #ff6b22;
  background: rgba(255, 107, 34, .08);
  color: #ffffff;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.tctruth-signature {
  color: #ffb28d;
  font-family: "JetBrains Mono", "Courier New", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tcask-log {
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tcask-msg {
  border-left: 2px solid rgba(91, 200, 245, .4);
  background: rgba(91, 200, 245, .055);
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.tcask-msg.user {
  border-left-color: #ff6b22;
  background: rgba(255, 107, 34, .08);
}

.tcask-msg.error {
  border-left-color: #ff4b4b;
  color: #ffd0d0;
}

.tcask-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(91, 200, 245, .22);
}

.tcask-input {
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  background: rgba(0, 0, 0, .28);
  color: #f0fbff;
  border: 1px solid rgba(91, 200, 245, .25);
  padding: 10px;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.tcask-input:focus {
  outline: none;
  border-color: rgba(255, 107, 34, .7);
}

.tcask-send {
  width: 72px;
  font-size: 10px;
}

.tcask-sources {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tcask-sources a {
  color: #5bc8f5;
  border: 1px solid rgba(91, 200, 245, .25);
  padding: 3px 5px;
  text-decoration: none;
  font-size: 9px;
}

@media (max-width: 640px) {
  #tcask-root {
    right: 12px;
    top: 72px;
  }

  #tctruth-toggle {
    min-width: 212px;
  }

  .tctruth-panel,
  .tcask-panel {
    height: min(560px, calc(100vh - 84px));
  }
}
