/* Ask Tekever launcher — a bottom-right red pill opens a collapsible full-height
   chat drawer on the right (Rovo-style, non-blocking, no backdrop). */

/* ── Launcher pill (bottom-right, Tekever red) ─────────────────────── */
#tk-at-handle {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 9997;
  height: 40px;
  padding: 0 16px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #D42718;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}
#tk-at-handle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
  filter: brightness(1.08);
}
#tk-at-handle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
#tk-at-handle .tk-at-handle-label {
  line-height: 1;
}

/* ── Drawer panel ──────────────────────────────────────────────────── */
#tk-at-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(420px, 100vw);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  background: var(--surface-primary, #1f2023);
  color: var(--text-primary, #ececf1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}
#tk-at-panel.open {
  transform: translateX(0);
}
#tk-at-panel .tk-at-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
#tk-at-panel .tk-at-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}
#tk-at-panel .tk-at-collapse {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  display: inline-flex;
}
#tk-at-panel .tk-at-collapse:hover {
  opacity: 1;
}

#tk-at-panel .tk-at-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#tk-at-panel .tk-at-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
#tk-at-panel .tk-at-user {
  align-self: flex-end;
  background: #D42718;
  color: #fff;
  border-bottom-right-radius: 4px;
}
#tk-at-panel .tk-at-assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 4px;
}

/* markdown inside assistant bubbles */
#tk-at-panel .tk-at-msg p { margin: 0 0 8px; }
#tk-at-panel .tk-at-msg p:last-child { margin-bottom: 0; }
#tk-at-panel .tk-at-msg h3,
#tk-at-panel .tk-at-msg h4,
#tk-at-panel .tk-at-msg h5,
#tk-at-panel .tk-at-msg h6 {
  margin: 12px 0 6px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
#tk-at-panel .tk-at-msg ul,
#tk-at-panel .tk-at-msg ol {
  margin: 6px 0;
  padding-left: 20px;
}
#tk-at-panel .tk-at-msg li { margin: 2px 0; }
#tk-at-panel .tk-at-msg code {
  background: rgba(255, 255, 255, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
}
#tk-at-panel .tk-at-msg pre {
  background: rgba(0, 0, 0, 0.35);
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}
#tk-at-panel .tk-at-msg pre code { background: none; padding: 0; }
#tk-at-panel .tk-at-msg a { color: #ff8a9a; text-decoration: underline; }
#tk-at-panel .tk-at-msg table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 12.5px;
}
#tk-at-panel .tk-at-msg th,
#tk-at-panel .tk-at-msg td {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}
#tk-at-panel .tk-at-msg th {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

/* input bar */
#tk-at-panel .tk-at-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
#tk-at-panel .tk-at-inputbar textarea {
  flex: 1;
  resize: none;
  max-height: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
}
#tk-at-panel .tk-at-inputbar textarea:focus {
  outline: none;
  border-color: #D42718;
}
#tk-at-panel #tk-at-send {
  flex: 0 0 auto;
  height: 40px;
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: #D42718;
  color: #fff;
  cursor: pointer;
}
#tk-at-panel #tk-at-send:disabled { opacity: 0.5; cursor: default; }

/* typing dots */
#tk-at-panel .tk-at-dots { display: inline-flex; gap: 4px; }
#tk-at-panel .tk-at-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  animation: tk-at-blink 1.2s infinite both;
}
#tk-at-panel .tk-at-dots i:nth-child(2) { animation-delay: 0.2s; }
#tk-at-panel .tk-at-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes tk-at-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}
