/* Tax AI Chat Widget */
.tax-chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  font-family: var(--font-sans);
}

.tax-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tax-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.5);
}

.tax-chat-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 2rem);
  max-height: 500px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.tax-chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tax-chat-header {
  padding: 1rem 1.25rem;
  background: var(--color-surface-elevated);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.tax-chat-header h3 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}

.tax-chat-header p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

.tax-chat-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.tax-chat-close:hover {
  color: var(--color-text);
}

.tax-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 200px;
  max-height: 280px;
}

.tax-chat-msg {
  margin-bottom: 1rem;
}

.tax-chat-msg-inner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tax-chat-msg-user .tax-chat-msg-inner {
  background: var(--color-accent);
  color: white;
  margin-left: 2rem;
}

.tax-chat-msg-bot .tax-chat-msg-inner {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  margin-right: 2rem;
}

.tax-chat-msg-inner a {
  color: var(--color-accent);
  text-decoration: none;
}

.tax-chat-msg-inner a:hover {
  text-decoration: underline;
}

.tax-chat-input-wrap {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 0.5rem;
}

.tax-chat-input-wrap input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-family: inherit;
}

.tax-chat-input-wrap input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.tax-chat-send {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
}

.tax-chat-send:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.tax-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tax-chat-disclaimer {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  padding: 0.5rem 1rem;
  margin: 0;
  border-top: 1px solid var(--color-border);
}

.tax-chat-disclaimer a {
  color: var(--color-accent);
}

@media (max-width: 480px) {
  .tax-chat-panel {
    width: calc(100vw - 2rem);
    right: -0.5rem;
    max-height: 70vh;
  }
}
