/* ============================================================
   CHAT SIDEBAR LAYOUT — PlacedAI Career Coach
   Colors: Trusted Advocate palette
   ============================================================ */

/* ─── Layout Wrapper ─── */
/* When chat is open, shift body content left via padding */
body.chat-panel-open {
  padding-right: 384px !important;
  transition: padding-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.chat-panel-closed {
  padding-right: 0 !important;
  transition: padding-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix fixed nav to not overlap chat panel */
body.chat-panel-open nav,
body.chat-panel-open header.site-header {
  right: 384px !important;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.chat-panel-closed nav,
body.chat-panel-closed header.site-header {
  right: 0 !important;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Chat Panel ─── */
#placedai-chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 384px;
  height: 100vh;
  height: 100dvh; /* Modern: accounts for mobile keyboard & browser chrome */
  background: #F8F9FA;
  border-left: 1px solid #d8e0e8;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
}

#placedai-chat-panel.chat-hidden {
  transform: translateX(100%);
}

/* ─── Chat Header ─── */
.chat-header {
  background: #1B2A4A;
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 2px solid #00C9A7;
  min-height: 60px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-coach-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #00C9A7, #00a589);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.chat-header-info h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: #ffffff;
}

.chat-header-info span {
  font-size: 11px;
  color: #00C9A7;
  font-weight: 500;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 16px;
  line-height: 1;
}

.chat-header-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

/* ─── Messages Area ─── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #d0d8e0;
  border-radius: 2px;
}

/* ─── Message Bubbles ─── */
.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: chatMsgIn 0.25s ease-out;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message.coach {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-message.coach .chat-message-row {
  flex-direction: row;
}

.chat-message.user .chat-message-row {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.chat-message.coach .chat-msg-avatar {
  background: linear-gradient(135deg, #00C9A7, #00a589);
}

.chat-message.user .chat-msg-avatar {
  background: #FF6B6B;
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.user .chat-bubble {
  background: #FF6B6B;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-message.coach .chat-bubble {
  background: #E0FAF5;
  color: #2D3436;
  border-bottom-left-radius: 4px;
}

/* ─── Markdown in coach bubbles ─── */
.chat-message.coach .chat-bubble strong {
  font-weight: 700;
  color: #1B2A4A;
}

.chat-message.coach .chat-bubble em {
  font-style: italic;
}

.chat-inline-code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.chat-timestamp {
  font-size: 10px;
  color: #9aabbb;
  margin-top: 3px;
  padding: 0 4px;
}

/* ─── Welcome State ─── */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 8px;
  text-align: center;
  animation: chatMsgIn 0.3s ease-out;
}

.chat-welcome-emoji {
  font-size: 32px;
  margin-bottom: 10px;
}

.chat-welcome h4 {
  font-size: 16px;
  font-weight: 700;
  color: #1B2A4A;
  margin-bottom: 6px;
}

.chat-welcome p {
  font-size: 13px;
  color: #556677;
  line-height: 1.6;
  margin-bottom: 4px;
}

.chat-welcome-bullets {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  text-align: left;
  width: 100%;
}

.chat-welcome-bullets li {
  font-size: 13px;
  color: #2D3436;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-welcome-bullets li::before {
  content: '\2022';
  color: #00C9A7;
  font-size: 16px;
  line-height: 1;
}

.chat-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.chat-quick-btn {
  background: #ffffff;
  border: 1.5px solid #d8e8f0;
  color: #1B2A4A;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-quick-btn:hover {
  background: #E0FAF5;
  border-color: #00C9A7;
  color: #006b58;
}

.chat-quick-btn .quick-icon {
  font-size: 16px;
}

/* Primary (analyse) button */
.chat-quick-btn--primary {
  background: #00C9A7;
  border-color: #00C9A7;
  color: #ffffff;
  font-weight: 700;
}

.chat-quick-btn--primary:hover {
  background: #00b898;
  border-color: #00b898;
  color: #ffffff;
}

.chat-quick-btn--primary .quick-icon {
  font-size: 16px;
}

/* Beta (jobs) button — less prominent */
.chat-quick-btn--beta {
  background: #f7f9fb;
  border-color: #c8d8e8;
  color: #6b7f8f;
  font-weight: 500;
  font-size: 12.5px;
}

.chat-quick-btn--beta:hover {
  background: #eef4f8;
  border-color: #a0b8cc;
  color: #3d5a6a;
}

/* Quick actions container in welcome */
.chat-quick-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}

.chat-quick-actions .chat-quick-btn {
  flex: 0 0 auto;
  font-size: 12.5px;
  padding: 8px 14px;
}

.salary-quick-btn {
  border-color: #f5e6d3;
  background: #fefcf9;
}

.salary-quick-btn:hover {
  background: #fff8e6;
  border-color: #f5d089;
  color: #8a6d3b;
}

.beta-badge {
  display: inline-block;
  background: #e0f0ff;
  color: #2a80b0;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-left: 2px;
}

/* Credits meter pill */
.chat-credits-meter {
  min-height: 24px;
  margin: 8px 0 4px;
}

.chat-credits-pill {
  display: inline-block;
  background: #f0f8f6;
  border: 1px solid #b8e8de;
  color: #2a6a5a;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}

.chat-credits-pill--unlimited {
  background: #f0f8f6;
  border-color: #00C9A7;
  color: #007a62;
}

/* Microcopy above quick actions */
.chat-quick-microcopy {
  font-size: 11.5px !important;
  color: #8a9bb0 !important;
  margin: 0 0 8px !important;
  font-style: italic;
}

/* Loading state (shown while fetching history) */
.chat-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.chat-loading-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Jobs beta note bubble */
.chat-jobs-beta-bubble {
  max-width: 260px;
}

.chat-jobs-beta-bubble strong {
  display: block;
  margin-bottom: 6px;
  color: #1B2A4A;
}

/* Jobs fallback CTAs */
.chat-jobs-fallback {
  margin-top: 10px;
}

.chat-jobs-fallback p {
  font-size: 12px;
  color: #556677;
  margin: 0 0 8px;
}

.chat-fallback-btn {
  display: block;
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #d8e8f0;
  color: #1B2A4A;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  margin-bottom: 6px;
  transition: all 0.2s;
  font-family: 'DM Sans', -apple-system, sans-serif;
  line-height: 1.4;
}

.chat-fallback-btn:hover {
  background: #E0FAF5;
  border-color: #00C9A7;
  color: #006b58;
  text-decoration: none;
}

.chat-fallback-btn--continue {
  background: #f7f9fb;
  border-color: #c8d8e8;
  color: #6b7f8f;
  font-weight: 500;
}

.chat-fallback-btn--continue:hover {
  background: #eef4f8;
  border-color: #a0b8cc;
  color: #3d5a6a;
}

/* ─── Typing Indicator ─── */
.chat-typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0;
  animation: chatMsgIn 0.2s ease-out;
}

.typing-bubble {
  background: #E0FAF5;
  padding: 10px 14px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #00C9A7;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ─── Input Area ─── */
.chat-input-area {
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: #ffffff;
  border-top: 1px solid #e8eff5;
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #F8F9FA;
  border: 1.5px solid #d8e0e8;
  border-radius: 12px;
  padding: 8px 8px 8px 14px;
  transition: border-color 0.2s;
}

.chat-input-row:focus-within {
  border-color: #00C9A7;
  background: #fff;
}

.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  color: #2D3436;
  outline: none;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  padding: 2px 0;
}

.chat-input::placeholder {
  color: #a0b0bb;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  background: #00C9A7;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  color: white;
}

.chat-send-btn:hover {
  background: #00b898;
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  background: #c5d8d8;
  cursor: default;
  transform: none;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
}

/* ─── Voice Input — Mic Button ─── */
.chat-mic-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1.5px solid #d8e0e8;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  color: #7a8f9e;
}

.chat-mic-btn:hover {
  background: #eef4f8;
  border-color: #00C9A7;
  color: #00C9A7;
}

/* Listening state — teal pulsing ring */
.chat-mic-btn--listening {
  background: #00C9A7 !important;
  border-color: #00C9A7 !important;
  color: #ffffff !important;
  animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 201, 167, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(0, 201, 167, 0); }
}

/* ─── Text-to-Speech — Speaker Button ─── */
.chat-message-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  padding: 0 4px;
}

.chat-tts-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #b0c0cc;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.chat-tts-btn:hover {
  color: #00C9A7;
  background: rgba(0, 201, 167, 0.08);
}

.chat-tts-btn--playing {
  color: #00C9A7;
  background: rgba(0, 201, 167, 0.1);
  animation: ttsPlayPulse 2s ease-in-out infinite;
}

@keyframes ttsPlayPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ─── Collapse Toggle Button ─── */
#chat-toggle-btn {
  position: fixed;
  top: 50%;
  right: 384px;
  transform: translateY(-50%) translateX(0);
  z-index: 10000;
  background: #1B2A4A;
  color: white;
  border: none;
  border-radius: 8px 0 0 8px;
  width: 22px;
  height: 56px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -3px 0 12px rgba(0,0,0,0.2);
  font-size: 12px;
}

#chat-toggle-btn:hover {
  background: #00C9A7;
  width: 26px;
}

#chat-toggle-btn.chat-collapsed {
  right: 0;
  border-radius: 8px 0 0 8px;
}

/* ─── Mobile FAB ─── */
#chat-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 10001;
  width: 56px;
  height: 56px;
  background: #FF6B6B;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  color: white;
}

#chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(255, 107, 107, 0.55);
}

#chat-fab:active {
  transform: scale(0.96);
}

/* ─── Rate limit / error message ─── */
.chat-error-bar {
  background: #fff0f0;
  color: #cc3333;
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
  border-top: 1px solid #ffd0d0;
  display: none;
}

/* ─── Mobile responsive ─── */
@media (max-width: 768px) {
  body.chat-panel-open {
    padding-right: 0 !important;
    /* Prevent background scrolling when chat is open */
    overflow: hidden;
  }

  body.chat-panel-open nav,
  body.chat-panel-open header.site-header {
    right: 0 !important;
  }

  #placedai-chat-panel {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Ensure panel fills the visible viewport, not behind keyboard */
    height: -webkit-fill-available;
  }

  #placedai-chat-panel.chat-hidden {
    transform: translateX(100%);
  }

  #chat-toggle-btn {
    display: none !important;
  }

  #chat-fab {
    display: flex;
  }

  /* Hide FAB when chat panel is open on mobile — prevents overlap with input */
  body.chat-panel-open #chat-fab {
    display: none !important;
  }

  /* Slightly larger touch targets on mobile */
  .chat-header-btn {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
  }

  /* Input area: ensure it's above safe area */
  .chat-input-area {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  /* Prevent zoom on input focus (iOS zooms on < 16px) */
  .chat-input {
    font-size: 16px;
  }
}

/* ─── Persona Selector ──────────────────────────────────────────────────────── */
.persona-prompt {
  font-size: 13px;
  color: #556677;
  margin: 4px 0 12px;
  font-weight: 500;
}

.persona-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
}

.persona-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  background: #ffffff;
  border: 1.5px solid #d8e8f0;
  border-radius: 12px;
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.persona-card:hover {
  background: #E0FAF5;
  border-color: #00C9A7;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 201, 167, 0.15);
}

.persona-emoji {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 2px;
}

.persona-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #1B2A4A;
  line-height: 1.2;
}

.persona-sub {
  font-size: 11px;
  color: #7a8fa5;
  font-weight: 400;
  line-height: 1.3;
}

.persona-skip-note {
  font-size: 11px;
  color: #9aabb8;
  margin: 0;
  text-align: center;
  font-style: italic;
  width: 100%;
}

/* ─── Persona Badge ─────────────────────────────────────────────────────────── */
.chat-persona-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0faf8;
  border: 1px solid #b8e8de;
  border-radius: 20px;
  padding: 4px 12px 4px 10px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #2a6a5a;
  width: 100%;
  box-sizing: border-box;
}

.persona-change-btn {
  background: none;
  border: none;
  color: #00C9A7;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.persona-change-btn:hover {
  color: #008e78;
}

/* ─── Persona Chips ─────────────────────────────────────────────────────────── */
.persona-chips-intro {
  font-size: 12px;
  color: #7a8fa5;
  margin: 6px 0 8px;
  font-weight: 500;
}

.persona-chips-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  margin-bottom: 10px;
}

.persona-chip {
  background: #f7f9fb;
  border: 1.5px solid #d0e4f0;
  color: #1B2A4A;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}

.persona-chip:hover {
  background: #E0FAF5;
  border-color: #00C9A7;
  color: #005f4d;
  transform: translateX(2px);
}

/* ─── Structured Template Cards ─────────────────────────────────────────────── */
.tpl-card {
  background: #f8fbff;
  border: 1.5px solid #d0e8f4;
  border-radius: 12px;
  padding: 14px 14px 10px;
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

.tpl-card-header {
  font-size: 13px;
  font-weight: 700;
  color: #1B2A4A;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #d0e8f4;
}

/* Checklist */
.tpl-checklist { border-color: #c8e0f8; background: #f4f9ff; }
.tpl-checklist .tpl-card-header { border-color: #c8e0f8; }
.tpl-checklist-item { padding: 8px 10px; border-radius: 8px; margin-bottom: 7px; background: #fff; border-left: 3px solid #d0d8e0; }
.tpl-item-critical { border-left-color: #e74c3c; background: #fff8f7; }
.tpl-item-important { border-left-color: #f39c12; background: #fffdf4; }
.tpl-item-nice { border-left-color: #27ae60; background: #f7fff9; }
.tpl-item-title { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.tpl-dot { font-size: 13px; flex-shrink: 0; }
.tpl-item-desc { font-size: 12px; color: #556677; line-height: 1.4; padding-left: 20px; }

/* Action Plan */
.tpl-action-plan { border-color: #c8d8f8; background: #f4f7ff; }
.tpl-action-plan .tpl-card-header { border-color: #c8d8f8; }
.tpl-day-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-bottom: 1px solid #e8eef8; }
.tpl-day-item:last-child { border-bottom: none; }
.tpl-day-badge { flex-shrink: 0; background: #1B2A4A; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; letter-spacing: 0.02em; margin-top: 2px; }
.tpl-day-content { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: #1B2A4A; line-height: 1.4; }
.tpl-day-why { font-size: 11.5px; color: #7a8fa5; font-style: italic; }

/* STAR Builder */
.tpl-star { border-color: #d0c8f8; background: #f7f4ff; }
.tpl-star .tpl-card-header { border-color: #d0c8f8; }
.tpl-star-item { padding: 8px 10px; background: #fff; border-radius: 8px; margin-bottom: 7px; border-left: 3px solid #7c6fe0; }
.tpl-star-label { font-size: 12px; font-weight: 700; color: #4a3c8a; margin-bottom: 3px; }
.tpl-star-content { font-size: 12px; color: #556677; line-height: 1.4; }

/* Salary Script */
.tpl-salary { border-color: #c8e8c0; background: #f5fff4; }
.tpl-salary .tpl-card-header { border-color: #c8e8c0; }
.tpl-salary-item { padding: 8px 10px; background: #fff; border-radius: 8px; margin-bottom: 7px; border-left: 3px solid #27ae60; }
.tpl-salary-label { font-size: 11.5px; color: #1a6e3c; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.tpl-salary-script { font-size: 12.5px; color: #1B2A4A; line-height: 1.45; font-style: italic; }

/* CTA buttons */
.tpl-cta-btn {
  display: inline-flex;
  align-items: center;
  background: #00C9A7;
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none !important;
  margin-top: 10px;
  transition: background 0.18s ease;
  cursor: pointer;
}

.tpl-cta-btn:hover {
  background: #00b898;
}

/* ─── Salary Insights Form ───────────────────────────────────────────────── */
.chat-salary-form {
  padding: 24px 20px;
}

.chat-salary-progress {
  height: 4px;
  background: #e8e8e8;
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.salary-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00C9A7, #00E5B8);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.chat-salary-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.chat-salary-form h4 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #1a1a1a;
}

.salary-step-label {
  font-size: 13px;
  color: #666;
  margin: 0 0 16px;
}

.salary-input-wrapper {
  margin-bottom: 16px;
}

.salary-input-text,
.salary-input-select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.salary-input-text:focus,
.salary-input-select:focus {
  border-color: #00C9A7;
  box-shadow: 0 0 0 3px rgba(0, 201, 167, 0.1);
}

.salary-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.salary-next-btn {
  background: #00C9A7;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.salary-next-btn:hover:not(:disabled) {
  background: #00b898;
}

.salary-next-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.salary-back-btn {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.salary-back-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.salary-cancel {
  text-align: center;
  margin: 16px 0 0;
  font-size: 13px;
}

.salary-cancel button {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

.salary-cancel button:hover {
  color: #666;
}

/* ─── Salary Range Card ─────────────────────────────────────────────────── */
.salary-generating {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.salary-generating-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8e8e8;
  border-top-color: #00C9A7;
  border-radius: 50%;
  animation: salary-spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes salary-spin {
  to { transform: rotate(360deg); }
}

.salary-range-card {
  background: linear-gradient(135deg, #f8fdfb 0%, #fff 100%);
  border: 1px solid #d4f5ee;
  border-radius: 12px;
  padding: 20px;
  margin: 12px 0;
}

.salary-range-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}

.salary-role-icon {
  font-size: 20px;
}

.salary-role-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
}

.salary-range-values {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.salary-range-item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: #fafafa;
  border-radius: 8px;
}

.salary-range-item--median {
  background: #e8faf5;
  border: 1px solid #b8e8d8;
}

.salary-range-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 4px;
}

.salary-range-number {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.salary-range-item--median .salary-range-number {
  color: #00a085;
}

.salary-disclaimer {
  font-size: 11px;
  color: #999;
  text-align: center;
  margin: 0;
  font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
  .chat-salary-form {
    padding: 20px 16px;
  }

  .salary-range-values {
    flex-direction: column;
  }

  .salary-range-item {
    flex: none;
  }
}
