:root {
  --td-accent: #ffbc00;
  --td-accent-deep: #b48500;
  --td-accent-soft: #f6ebc4;
  --td-ink: #11161f;
  --td-ink-2: #1d2430;
  --td-line: #d9d1bc;
  --td-paper: #f7f3e7;
  --td-paper-2: #fffdf8;
  --td-text: #1a1d24;
  --td-muted: #6f6a5c;
  --td-shadow: 0 14px 40px rgba(12, 14, 20, 0.18);
}

#techdot-chat-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 68px;
  height: 68px;
  border: none;
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 231, 154, 0.82) 0, rgba(255, 207, 63, 0.62) 32%, transparent 33%),
    linear-gradient(145deg, #f2bf1e 0%, #ecb40b 55%, #ab7d05 100%);
  color: var(--td-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 13px 30px rgba(180, 133, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  z-index: 99999;
}

#techdot-chat-toggle:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 34px rgba(180, 133, 0, 0.31);
  filter: saturate(1.02);
}

#techdot-chat-toggle svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

#techdot-chat-toggle::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 25px;
  border: 1px solid rgba(255, 188, 0, 0.2);
  pointer-events: none;
}

#techdot-chat-toggle.has-history::before {
  content: attr(data-badge);
  position: absolute;
  top: -10px;
  left: -8px;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--td-ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(12, 14, 20, 0.22);
}

#techdot-chat-window {
  position: fixed;
  right: 24px;
  bottom: 108px;
  width: 410px;
  max-width: calc(100vw - 24px);
  height: 620px;
  max-height: calc(100vh - 132px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 188, 0, 0.06) 0%, rgba(255, 188, 0, 0) 30%),
    linear-gradient(180deg, #fffdf8 0%, #f7f3e7 100%);
  border: 1px solid rgba(180, 133, 0, 0.2);
  box-shadow: var(--td-shadow);
  z-index: 99998;
  font-family: inherit;
  isolation: isolate;
}

#techdot-chat-window.open {
  display: flex;
  animation: techdotWindowIn 0.26s ease-out;
}

@keyframes techdotWindowIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.techdot-chat-header {
  position: relative;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 188, 0, 0.16) 0%, rgba(255, 188, 0, 0) 35%),
    linear-gradient(160deg, #121720 0%, #1a2029 58%, #2a2d35 100%);
  border-bottom: 1px solid rgba(255, 188, 0, 0.1);
}

.techdot-chat-header::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 188, 0, 0.38), transparent);
}

.techdot-chat-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f2bf1e 0%, #a97800 100%);
  color: var(--td-ink);
  font-size: 15px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.techdot-chat-header-info h3 {
  margin: 0 0 3px;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.techdot-chat-header-info span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.techdot-chat-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.techdot-chat-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 188, 0, 0.36);
  transform: translateY(-1px);
}

.techdot-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at top left, rgba(255, 188, 0, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 243, 231, 0.94) 100%);
  transition: filter 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
}

.techdot-msg {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.58;
  word-break: break-word;
  box-shadow: 0 6px 12px rgba(17, 22, 31, 0.04);
}

.techdot-msg-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.88);
  color: var(--td-text);
  border: 1px solid rgba(180, 133, 0, 0.14);
  border-bottom-left-radius: 6px;
}

.techdot-msg-user {
  align-self: flex-end;
  background: linear-gradient(150deg, #181d25 0%, #2a2d34 100%);
  color: #fff;
  border: 1px solid rgba(255, 188, 0, 0.14);
  border-bottom-right-radius: 6px;
}

.techdot-msg a {
  color: inherit;
  font-weight: 700;
}

.techdot-msg-bot a {
  color: var(--td-accent-deep);
}

.techdot-msg-bot ul,
.techdot-msg-bot ol {
  margin: 4px 0 4px 2px;
  padding-left: 18px;
}

.techdot-msg-bot li {
  margin-bottom: 2px;
  line-height: 1.5;
}

.techdot-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(180, 133, 0, 0.14);
  box-shadow: 0 6px 12px rgba(17, 22, 31, 0.04);
}

.techdot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--td-accent-deep);
  animation: techdotBlink 1.1s infinite ease-in-out;
}

.techdot-typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.techdot-typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes techdotBlink {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.techdot-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 14px;
  background: transparent;
  transition: filter 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
}

.techdot-qbtn {
  border: 1px solid rgba(180, 133, 0, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--td-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.techdot-qbtn:hover {
  transform: translateY(-1px);
  background: var(--td-accent-soft);
  border-color: rgba(180, 133, 0, 0.34);
}

.techdot-chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 14px;
  background: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(180, 133, 0, 0.14);
  backdrop-filter: blur(10px);
  transition: filter 0.22s ease, opacity 0.22s ease, transform 0.22s ease;
}

.techdot-chat-input-area input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 133, 0, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: var(--td-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.techdot-chat-input-area input::placeholder {
  color: rgba(111, 106, 92, 0.92);
  font-size: 12px;
}

.techdot-chat-input-area input:focus {
  border-color: rgba(255, 188, 0, 0.58);
  box-shadow: 0 0 0 4px rgba(255, 188, 0, 0.08);
}

.techdot-chat-input-area input:disabled {
  cursor: not-allowed;
  color: var(--td-muted);
  background: rgba(243, 243, 243, 0.9);
}

.techdot-chat-input-area button {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f2bf1e 0%, #a97800 100%);
  color: var(--td-ink);
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(180, 133, 0, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.techdot-chat-input-area button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(180, 133, 0, 0.22);
}

.techdot-chat-input-area button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2);
  opacity: 0.55;
  box-shadow: none;
}

.techdot-chat-input-area button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.techdot-chat-window--resume .techdot-chat-messages,
.techdot-chat-window--resume .techdot-chat-quick,
.techdot-chat-window--resume .techdot-chat-input-area {
  filter: blur(3px);
  opacity: 0.46;
  transform: scale(0.99);
  pointer-events: none;
  user-select: none;
}

.techdot-chat-resume-overlay {
  position: absolute;
  inset: 79px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 18px 18px;
  background: linear-gradient(180deg, rgba(247, 243, 231, 0.1) 0%, rgba(247, 243, 231, 0.22) 100%);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 6;
}

.techdot-chat-resume-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.techdot-chat-resume-card {
  width: min(100%, 336px);
  padding: 22px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 188, 0, 0.05) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(180, 133, 0, 0.18);
  box-shadow: 0 16px 30px rgba(12, 14, 20, 0.1);
  color: var(--td-text);
  text-align: center;
}

.techdot-chat-resume-eyebrow {
  margin-bottom: 8px;
  color: var(--td-accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.techdot-chat-resume-card h4 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.techdot-chat-resume-card p {
  margin: 0 0 12px;
  color: var(--td-muted);
  font-size: 14px;
  line-height: 1.6;
}

.techdot-chat-resume-meta {
  margin-bottom: 16px;
  color: var(--td-text);
  font-size: 12px;
  font-weight: 600;
}

.techdot-chat-resume-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.techdot-chat-action {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.techdot-chat-action:hover {
  transform: translateY(-1px);
}

.techdot-chat-action-primary {
  border: none;
  background: linear-gradient(145deg, #f2bf1e 0%, #a97800 100%);
  color: var(--td-ink);
  box-shadow: 0 10px 18px rgba(180, 133, 0, 0.16);
}

.techdot-chat-action-secondary {
  border: 1px solid rgba(17, 22, 31, 0.15);
  background: #fff;
  color: var(--td-text);
}

.techdot-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.techdot-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.techdot-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(180, 133, 0, 0.34);
  border-radius: 999px;
}

@media (max-width: 680px) {
  #techdot-chat-toggle {
    right: 16px;
    bottom: 16px;
    width: 62px;
    height: 62px;
    border-radius: 20px;
  }

  #techdot-chat-window {
    right: 12px;
    left: 12px;
    bottom: 88px;
    width: auto;
    max-width: none;
    height: min(76vh, 620px);
    border-radius: 22px;
  }

  .techdot-chat-header,
  .techdot-chat-messages {
    padding-left: 16px;
    padding-right: 16px;
  }

  .techdot-chat-quick,
  .techdot-chat-input-area {
    padding-left: 14px;
    padding-right: 14px;
  }

  .techdot-chat-resume-overlay {
    inset: 76px 0 0 0;
    padding: 18px 14px 14px;
  }

  .techdot-chat-resume-actions {
    flex-direction: column;
  }

  .techdot-chat-action {
    width: 100%;
  }
}
