/* ===== Kath AI floating support bubble ===== */
.kath-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: linear-gradient(180deg, #5eead4 0%, #22d3ee 100%);
  color: #04141a;
  border: 1px solid rgba(34, 211, 238, 0.5);
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 12px 32px -6px rgba(34, 211, 238, 0.5),
    0 0 0 6px rgba(34, 211, 238, 0.06),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 200ms ease, box-shadow 200ms ease;
  font-family: var(--font-body);
  overflow: hidden;
}
.kath-bubble:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -6px rgba(34, 211, 238, 0.65), 0 0 0 6px rgba(34, 211, 238, 0.08), inset 0 1px 0 rgba(255,255,255,0.5); }
.kath-bubble.open {
  width: 56px;
  background: var(--panel-solid);
  color: var(--ink);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 12px 32px -6px rgba(0,0,0,0.6);
  justify-content: center;
}
.kath-bubble > svg { width: 26px; height: 26px; flex-shrink: 0; margin-left: 15px; }
.kath-bubble.open > svg { margin: 0; }

.kath-bubble-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px 0 14px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.kath-bubble-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: #04141a;
  box-shadow: 0 0 0 2px rgba(4,20,26,0.2);
  animation: kath-blink 2s ease-in-out infinite;
}
@keyframes kath-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.kath-bubble-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1.5px solid rgba(34, 211, 238, 0.5);
  pointer-events: none;
  animation: kath-pulse 2.8s ease-out infinite;
}
.kath-bubble.open .kath-bubble-pulse { display: none; }
@keyframes kath-pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Chat window */
.kath-window {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 200;
  width: 360px;
  max-width: calc(100vw - 44px);
  height: 520px;
  max-height: calc(100vh - 130px);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0) 60%),
    rgba(10, 16, 24, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.7),
    0 0 0 1px rgba(34, 211, 238, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  overflow: hidden;
}
.kath-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.kath-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(34, 211, 238, 0.1), transparent 60%);
}
.kath-avatar {
  position: relative;
  width: 38px; height: 38px;
  flex-shrink: 0;
}
.kath-avatar-orbit {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px dashed rgba(34, 211, 238, 0.4);
  animation: kath-spin 8s linear infinite;
}
@keyframes kath-spin { to { transform: rotate(360deg); } }
.kath-avatar-core {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5eead4, #22d3ee 60%, #0d7e74);
  color: #04141a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.kath-id { flex: 1; min-width: 0; }
.kath-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.kath-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.kath-role {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
}
.kath-close {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.kath-close:hover { color: var(--ink); background: rgba(255,255,255,0.08); }

.kath-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kath-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 90%;
}
.kath-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.kath-msg-avatar {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--cyan-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kath-msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  letter-spacing: -0.005em;
}
.kath-msg-ai .kath-msg-bubble {
  border-top-left-radius: 6px;
}
.kath-msg-user .kath-msg-bubble {
  background: linear-gradient(180deg, #5eead4, #22d3ee);
  color: #04141a;
  border-color: rgba(34, 211, 238, 0.4);
  border-top-right-radius: 6px;
  font-weight: 500;
}

.kath-typing {
  display: inline-flex !important;
  gap: 4px;
  align-items: center;
}
.kath-typing i {
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--cyan-2);
  display: inline-block;
  animation: kath-dot 1.2s ease-in-out infinite;
}
.kath-typing i:nth-child(2) { animation-delay: 0.15s; }
.kath-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes kath-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.kath-suggest {
  display: flex;
  gap: 6px;
  padding: 0 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.kath-suggest::-webkit-scrollbar { display: none; }
.kath-suggest-chip {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--cyan-2);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.kath-suggest-chip:hover { background: rgba(34, 211, 238, 0.12); }

.kath-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
}
.kath-input input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  padding: 9px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 160ms;
  letter-spacing: -0.005em;
}
.kath-input input:focus { border-color: rgba(34, 211, 238, 0.4); }
.kath-input input::placeholder { color: var(--ink-4); }
.kath-send {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5eead4, #22d3ee);
  color: #04141a;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 4px 12px -3px rgba(34, 211, 238, 0.5);
  transition: transform 160ms;
}
.kath-send:hover:not(:disabled) { transform: scale(1.05); }
.kath-send:disabled { opacity: 0.4; cursor: not-allowed; }

.kath-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-4);
  padding: 6px 12px 10px;
  letter-spacing: 0.04em;
}
.kath-foot svg { color: var(--cyan-2); }

@media (max-width: 540px) {
  .kath-bubble-label { display: none; }
  .kath-bubble { width: 56px; padding: 0; justify-content: center; }
  .kath-bubble > svg { margin: 0; }
  .kath-window { right: 16px; bottom: 86px; width: calc(100vw - 32px); }
}
