/* ==========================================================================
   Tâm An Nhiên AI — Chat Interface Styles
   ========================================================================== */

/* ===== LAYOUT ===== */
.app {
  display: none;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 100%;
  height: 100vh;
  height: 100dvh;
}

.app.visible {
  display: grid;
  animation: appFadeIn 0.5s ease both;
}

/* ===== SIDEBAR ===== */
.sidebar {
  background: #f5f2eb !important;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 20px;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.lotus-icon {
  width: 56px;
  height: 56px;
  background: radial-gradient(circle at 40% 40%, #C5A880, #8A6D44);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 20px rgba(197, 168, 128, 0.35);
  animation: breathe 4s ease-in-out infinite;
}

.logo-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-align: center;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* User Card in Sidebar */
.user-card {
  background: #f5f2eb;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(30, 41, 59, 0.05);
}

.status-card {
  display: none !important;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Domain filter */
.domain-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.domain-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid transparent;
  user-select: none;
}

.domain-item:hover {
  background: rgba(147, 112, 194, 0.06);
  color: var(--text);
}

.domain-item.active {
  background: rgba(147, 112, 194, 0.1);
  color: var(--gold);
  border-color: var(--border);
}

.domain-check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--gold);
  transition: all var(--transition);
}

.domain-item.active .domain-check {
  background: rgba(147, 112, 194, 0.2);
  border-color: var(--gold);
}

.domain-loading {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 10px;
}

/* Admin quick-nav button in Sidebar */
.admin-nav-btn {
  background: #FFFFFF;
  border: 1.5px solid #8A6634;
  border-radius: var(--radius-sm);
  color: #694F25;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
}

.admin-nav-btn:hover {
  background: #694F25;
  border-color: #694F25;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(105, 79, 37, 0.3);
  transform: translateY(-1px);
}

/* New chat button */
.new-chat-btn {
  background: #f5f2eb;
  border: none;
  border-radius: var(--radius-sm);
  color: #1E293B;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  text-align: left;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(30, 41, 59, 0.06);
}

.new-chat-btn:hover,
.new-chat-btn:active {
  background: #E8E2D5;
  border: none;
  color: #0F172A;
  box-shadow: 0 3px 10px rgba(30, 41, 59, 0.1);
  transform: translateY(-1px);
}

/* User chat history in sidebar */
.user-history-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 120px;
  max-height: 280px;
  margin-top: 4px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.history-reload-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.history-reload-btn:hover {
  color: #8A6D44;
  background: rgba(197, 168, 128, 0.15);
}

.user-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 4px;
}

.user-history-list::-webkit-scrollbar {
  width: 3px;
}

.user-history-list::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.history-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 12px;
  background: #f5f2eb;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
  position: relative;
  box-shadow: 0 1px 4px rgba(30, 41, 59, 0.05);
}

.history-item:hover {
  background: #E8E2D5;
  border: none;
  transform: translateX(2px);
  box-shadow: 0 3px 8px rgba(30, 41, 59, 0.08);
}

.history-item.active {
  background: #C5A880;
  border: none;
  box-shadow: 0 3px 12px rgba(197, 168, 128, 0.35);
}

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.history-item-question {
  font-size: 12.5px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  flex: 1;
}

.history-item.active .history-item-question {
  color: #0F172A;
  font-weight: 700;
}

.history-item-del-btn {
  background: none;
  border: none;
  color: #64748B;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.2s;
}

.history-item:hover .history-item-del-btn {
  opacity: 1;
}

.history-item.active .history-item-del-btn {
  color: #334155;
}

.history-item-del-btn:hover {
  background: rgba(136, 19, 55, 0.15);
  color: #881337;
}

.history-item-meta {
  font-size: 10.5px;
  color: #64748B;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item.active .history-item-meta {
  color: #334155;
}

.history-count-badge {
  background: rgba(30, 41, 59, 0.06);
  color: #475569;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 600;
}

.history-item.active .history-count-badge {
  background: rgba(255, 255, 255, 0.6);
  color: #0F172A;
}


.history-empty, .history-loading {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 16px 0;
  font-style: italic;
}

/* ===== MAIN AREA ===== */
.main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
}

.sidebar-close-btn {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.header-brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-quick-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #1E293B;
  border: 1px solid #1E293B;
  color: #FFFFFF;
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 10px rgba(30, 41, 59, 0.15);
}

.header-quick-call-btn:hover {
  background: #8A6634;
  border-color: #8A6634;
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(138, 102, 52, 0.3);
  transform: translateY(-1px);
}

.header-new-chat-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #1E293B;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-subtle);
}

.header-new-chat-btn:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(30, 41, 59, 0.2);
}

/* Language Toggle Buttons (Flags: Vietnam 🇻🇳 and UK 🇬🇧) */
.header-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #1E293B;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  user-select: none;
}

.header-lang-btn:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.header-lang-btn:active {
  transform: translateY(0);
}

.header-lang-btn .flag-img,
.header-lang-btn .flag-item {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

.header-lang-btn .flag-img.active,
.header-lang-btn .flag-item.active {
  opacity: 1;
  transform: scale(1.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  outline: 2px solid #0D9488;
  outline-offset: 1px;
}

.header-lang-btn .flag-img:not(.active),
.header-lang-btn .flag-item:not(.active) {
  opacity: 0.35;
  filter: grayscale(40%);
}

.header-lang-btn .flag-img:not(.active):hover,
.header-lang-btn .flag-item:not(.active):hover {
  opacity: 0.75;
  filter: grayscale(0%);
}

.header-lang-btn .flag-divider {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
  user-select: none;
}

/* Login Card Top Bar Language Toggle */
.login-top-bar {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 6px;
}

.login-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #334155;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-lang-btn:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
  transform: translateY(-1px);
}

.login-lang-btn .flag-img,
.login-lang-btn .flag-item {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

.login-lang-btn .flag-img.active,
.login-lang-btn .flag-item.active {
  opacity: 1;
  transform: scale(1.12);
  outline: 2px solid #0D9488;
  outline-offset: 1px;
}

.login-lang-btn .flag-img:not(.active),
.login-lang-btn .flag-item:not(.active) {
  opacity: 0.35;
  filter: grayscale(40%);
}

.login-lang-btn .flag-divider {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
}

.login-lang-btn .login-lang-name {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-left: 2px;
}

/* ===== MESSAGES ===== */
.messages-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0;
  scroll-behavior: smooth;
  background: var(--bg-primary);
}

.messages-wrapper::-webkit-scrollbar {
  width: 4px;
}

.messages-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.messages-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.messages-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Welcome screen */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 50px 20px 20px;
  text-align: center;
  animation: fadeUp 0.5s ease both;
}

.welcome-lotus {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 86px;
  animation: floatLotus 5s ease-in-out infinite;
}

.welcome h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.welcome p {
  font-size: 14.5px;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.7;
}

.welcome-suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
  width: 100%;
  max-width: 600px;
}

.suggestion-chip {
  background: #FFFFFF;
  border: 1.5px solid #D5CEBE;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  color: #0F172A;
  transition: var(--transition-smooth);
  font-family: var(--font-sans);
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.04);
}

.suggestion-chip:hover {
  border-color: #1E293B;
  color: #0F172A;
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.12);
}

.suggestion-chip .chip-icon {
  font-size: 18px;
  display: block;
  margin-bottom: 6px;
}

/* Message bubble */
.message {
  display: flex;
  gap: 14px;
  animation: fadeUp 0.35s ease both;
}

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.avatar.ai-avatar {
  background: radial-gradient(circle at 40% 40%, #543E24, #2A1D11);
  border: 1.5px solid rgba(197, 168, 128, 0.5);
  box-shadow: 0 0 14px rgba(197, 168, 128, 0.4);
  color: #FFFFFF;
  overflow: hidden;
}

.avatar.user-avatar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.bubble {
  max-width: 75%;
  border-radius: var(--radius);
  padding: 14px 18px;
  line-height: 1.75;
  font-size: 14.5px;
}

.message.ai .bubble {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-subtle);
}

.message.user .bubble {
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  color: #FFFFFF !important;
  border-top-right-radius: 4px;
  box-shadow: var(--shadow-subtle);
}

.message.user .bubble p,
.message.user .bubble span,
.message.user .bubble div {
  color: #FFFFFF !important;
}

.chat-hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(197, 168, 128, 0.4), rgba(197, 168, 128, 0.1), transparent);
  margin: 12px 0 8px 0;
}

.chat-link {
  color: #8A6D44;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.chat-link:hover {
  color: var(--accent-gold-hover);
}

/* Sources */
.sources {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sources-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.source-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(147, 112, 194, 0.04);
  border: 1px solid rgba(147, 112, 194, 0.1);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
}

.source-item:hover {
  background: rgba(147, 112, 194, 0.08);
  border-color: rgba(147, 112, 194, 0.2);
}

.source-score {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold-dim);
  flex-shrink: 0;
  margin-top: 1px;
}

.source-info {
  flex: 1;
  min-width: 0;
}

.source-title {
  font-size: 12px;
  color: var(--gold);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-url {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Message suggestions */
.message-suggestions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(147, 112, 194, 0.25);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-sug-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.msg-sug-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.msg-sug-chip {
  background: #F5F2EB;
  border: 1.5px solid #D5CEBE;
  border-radius: 20px;
  padding: 7px 14px;
  color: #1E293B;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(30, 41, 59, 0.04);
}

.msg-sug-chip:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.18);
}

.msg-sug-dot {
  color: var(--gold);
  font-size: 11px;
  flex-shrink: 0;
}

/* ===== PRODUCT CARDS & GALLERY ===== */
.message-products {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(147, 112, 194, 0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-prod-header {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

@media (max-width: 600px) {
  .msg-prod-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
}

.prod-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
  box-shadow: var(--shadow-subtle);
}

.prod-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.prod-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface);
  overflow: hidden;
  cursor: zoom-in;
}

.prod-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.prod-card:hover .prod-img {
  transform: scale(1.06);
}

.prod-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #8A6D44;
  padding: 2px 7px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(30, 41, 59, 0.08);
}

.prod-zoom-hint {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 6px;
  font-size: 10px;
  padding: 2px 6px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.prod-img-wrap:hover .prod-zoom-hint {
  opacity: 1;
}

.prod-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 3px;
}

.prod-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.prod-price {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--danger-burgundy);
  margin-top: 2px;
}

.prod-material {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prod-footer {
  margin-top: auto;
  padding-top: 8px;
}

.prod-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 8px 12px;
  background: #1E293B;
  border: 1px solid #1E293B;
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px rgba(30, 41, 59, 0.12);
}

.prod-btn:hover {
  background: #8A6634;
  border-color: #8A6634;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(138, 102, 52, 0.3);
  transform: translateY(-1px);
}

/* Typing bounce indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 2px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Error message */
.error-bubble {
  background: rgba(192, 97, 74, 0.1);
  border: 1px solid rgba(192, 97, 74, 0.3);
  color: #e0917a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}

/* ===== INPUT AREA ===== */
.input-area {
  padding: 16px 28px 24px;
  flex-shrink: 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
}

.input-inner {
  max-width: 780px;
  margin: 0 auto;
}

.input-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.04);
}

.input-box:hover {
  border-color: #94A3B8;
}

.input-box:focus-within {
  border-color: #1E293B;
  box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.08), 0 4px 16px rgba(30, 41, 59, 0.06);
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  resize: none;
  max-height: 140px;
  min-height: 26px;
  line-height: 1.55;
  padding: 3px 0;
}

#chat-input::placeholder {
  color: #64748B;
  opacity: 0.85;
  font-size: 14px;
}

#chat-input::-webkit-scrollbar {
  width: 3px;
}

#chat-input::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-end;
}

.send-btn {
  width: 38px;
  height: 38px;
  background: #1E293B;
  border: 1px solid #1E293B;
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.2);
}

.send-btn:hover:not(:disabled) {
  background: #8A6634;
  border-color: #8A6634;
  color: #FFFFFF;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(138, 102, 52, 0.35);
}

.send-btn:disabled {
  background: #E2E8F0;
  border-color: #E2E8F0;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.send-btn svg {
  fill: #FFFFFF;
}

.send-btn:disabled svg {
  fill: #94A3B8;
}

.mic-btn {
  width: 38px;
  height: 38px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #1E293B;
  transition: var(--transition-smooth);
}

.mic-btn:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.2);
}

.mic-btn.listening {
  background: #881337;
  border-color: #881337;
  color: #FFFFFF;
  animation: mic-pulse 1.4s infinite;
}

@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(230, 57, 70, 0);
    transform: scale(1.08);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0);
    transform: scale(1);
  }
}

/* Image Upload Button */
.image-btn {
  width: 38px;
  height: 38px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #1E293B;
  transition: var(--transition-smooth);
}

.image-btn:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.2);
}

.image-btn.active {
  background: #0284C7;
  border-color: #0284C7;
  color: #FFFFFF;
}

/* Image Upload Preview Bar */
.image-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F1F5F9;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease;
}

.preview-thumb-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.preview-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.preview-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #EF4444;
  color: #FFFFFF;
  border: 1.5px solid #FFFFFF;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  line-height: 1;
  padding: 0;
}

.preview-remove-btn:hover {
  transform: scale(1.15);
  background: #DC2626;
}

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.preview-filename {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.preview-filesize {
  font-size: 11px;
  color: #64748B;
}

/* User chat bubble image thumbnail */
.bubble-user-image {
  margin-bottom: 8px;
}

.bubble-user-image img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,0.2);
  cursor: pointer;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bubble-user-image img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Voice recording status banner */
.voice-recording-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(230, 57, 70, 0.12);
  border: 1px solid rgba(230, 57, 70, 0.35);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #ff9999;
  animation: fadeIn 0.2s ease;
}

.voice-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4d;
  animation: blink 1s infinite alternate;
  flex-shrink: 0;
}

@keyframes blink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.voice-recording-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-cancel-btn {
  background: transparent;
  border: none;
  color: #ff9999;
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
}

/* Message Tool Buttons (Voice speak, Copy) */
.msg-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.msg-tool-btn {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 14px;
  color: #334155;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-smooth);
  font-family: var(--font-sans);
  box-shadow: 0 1px 3px rgba(30, 41, 59, 0.04);
}

.msg-tool-btn:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
  transform: translateY(-1px);
}

.msg-tool-btn.speaking {
  background: #8A6634;
  border-color: #8A6634;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(138, 102, 52, 0.35);
}

.input-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 0.03em;
}

/* Markdown-like formatting in bubbles */
.bubble strong {
  color: var(--gold-light);
  font-weight: 600;
}

.bubble em {
  font-style: italic;
  color: var(--cream);
}

.bubble p {
  margin-bottom: 8px;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble ul,
.bubble ol {
  padding-left: 18px;
  margin-bottom: 8px;
}

.bubble li {
  margin-bottom: 4px;
}

.bubble code {
  background: rgba(147, 112, 194, 0.1);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 12px;
  color: var(--gold);
}

/* ===== STREAMING TYPING ANIMATION ===== */
.streaming-cursor {
  display: inline-block;
  margin-left: 5px;
  color: var(--gold-light);
  font-size: 14px;
  animation: pulseCursor 0.7s infinite alternate ease-in-out;
  vertical-align: baseline;
  user-select: none;
}

@keyframes pulseCursor {
  0% { opacity: 0.15; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.2); }
}

.message.streaming .bubble {
  border-color: var(--border-bright);
  box-shadow: 0 0 20px rgba(147, 112, 194, 0.15);
}

/* ===== RESPONSIVE ===== */
/* ===== RESPONSIVE (TABLETS & MOBILE PHONES) ===== */
@media (max-width: 768px) {
  .app {
    display: none;
    grid-template-columns: 1fr;
    height: 100dvh;
    height: 100vh;
    position: relative;
  }

  .app.visible {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    height: 100vh;
    height: -webkit-fill-available;
    max-height: 100dvh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  /* Sidebar transforms into a Slide-in Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 84%;
    max-width: 320px;
    height: 100dvh;
    height: 100vh;
    z-index: 1000;
    background: rgba(18, 14, 25, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: none; /* Xóa triệt để vệt bóng đen rò rỉ vào mép trái */
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s ease, box-shadow 0.32s ease;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    gap: 16px;
  }

  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: 8px 0 25px rgba(0, 0, 0, 0.45);
  }

  .sidebar-close-btn {
    display: flex;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 15px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
  }

  .sidebar-close-btn:hover {
    background: rgba(235, 77, 75, 0.3);
    border-color: rgba(235, 77, 75, 0.6);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.28s ease;
  }

  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
  }

  /* Header on Mobile */
  .header {
    padding: 10px 14px;
    min-height: 56px;
  }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4.5px;
    width: 38px;
    height: 38px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-menu-btn .bar {
    width: 100%;
    height: 2px;
    background: var(--cream);
    border-radius: 2px;
  }

  .header-brand-info {
    overflow: hidden;
  }

  .header-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-subtitle {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    gap: 6px;
  }

  .header-quick-call-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .header-lang-btn {
    padding: 4px 8px;
    gap: 4px;
  }

  .header-lang-btn .flag-img {
    width: 18px;
    height: 12px;
  }

  /* Main & Messages on Mobile */
  .main {
    height: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative;
  }

  .messages-wrapper {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 10px 10px 14px;
  }

  .messages-inner {
    padding: 0 2px;
    max-width: 100%;
  }

  .message {
    max-width: 95%;
    gap: 8px;
    margin-bottom: 12px;
  }

  .message-avatar {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .message-bubble {
    padding: 10px 13px;
    font-size: 14px;
    line-height: 1.55;
  }

  .msg-tools {
    flex-wrap: wrap;
    gap: 4px;
  }

  .msg-tool-btn {
    font-size: 11px;
    padding: 3px 7px;
  }

  /* Welcome Screen on Mobile */
  .welcome {
    padding: 16px 8px 12px;
  }

  .welcome-lotus {
    font-size: 30px;
    margin-bottom: 6px;
    min-height: 60px;
  }

  .welcome h1 {
    font-size: 17px;
    line-height: 1.35;
    margin-bottom: 4px;
  }

  .welcome p {
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.55;
  }

  .welcome-suggestions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .suggestion-chip {
    padding: 10px 12px;
    font-size: 12.5px;
    text-align: left;
    justify-content: flex-start;
  }

  /* Input Area on Mobile — Luôn ghim đáy, không bị che khuất */
  .input-area {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 50;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 8px)) 10px;
    flex-shrink: 0;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.06);
  }

  .input-inner {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .input-box {
    padding: 6px 8px 6px 12px;
    gap: 6px;
    border-radius: 22px;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    align-items: center;
  }

  #chat-input {
    font-size: 16px !important; /* 16px ngăn iOS Safari tự zoom màn hình làm lệch khung */
    min-height: 32px;
    max-height: 90px;
    padding: 4px 0;
    line-height: 1.4;
  }

  #chat-input::placeholder {
    font-size: 13.5px;
  }

  .input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .image-btn, .mic-btn, .send-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
  }

  .input-hint {
    display: none;
  }

  /* Product Card Grid */
  .msg-prod-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 8px;
  }

  .prod-card {
    border-radius: 10px;
  }

  .prod-name {
    font-size: 11.5px;
  }

  .prod-price {
    font-size: 11px;
  }

  /* Urgent Lead Banner on Mobile */
  .urgent-banner {
    padding: 12px;
  }

  .urgent-banner-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .urgent-btn {
    width: 100%;
    justify-content: center;
    padding: 9px 12px;
  }
}

@media (max-width: 480px) {
  .header-quick-call-btn .call-btn-text {
    display: none;
  }
  .header-quick-call-btn {
    padding: 6px 9px;
  }
  .header-title {
    font-size: 14px;
  }
  .header-subtitle {
    display: none;
  }
}

/* ===== URGENT LEAD BANNER & HOTLINE ===== */
.urgent-banner {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.12), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(230, 57, 70, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.3s ease both;
}

.urgent-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ff8080;
  display: flex;
  align-items: center;
  gap: 6px;
}

.urgent-banner-desc {
  font-size: 12.5px;
  color: var(--cream);
  line-height: 1.5;
}

.urgent-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.urgent-btn {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all var(--transition);
}

.urgent-btn.call-now {
  background: #881337;
  color: #FFFFFF !important;
  box-shadow: 0 2px 10px rgba(136, 19, 55, 0.35);
}

.urgent-btn.call-now:hover {
  background: #9F1239;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(136, 19, 55, 0.5);
}

.urgent-btn.req-call {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #1E293B;
  font-weight: 600;
}

.urgent-btn.req-call:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
}

/* Sidebar 24/7 Hotline Button (Nằm sau Lịch sử cuộc trò chuyện) */
.sidebar-hotline-btn {
  margin-top: 14px;
  background: transparent !important;
  color: #FFFFFF !important;
  text-decoration: none;
  padding: 4px 0;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  filter: drop-shadow(0 4px 12px rgba(169, 132, 54, 0.18));
  transition: transform 0.25s ease, filter 0.25s ease;
  position: relative;
  overflow: visible;
}

.hotline-call-widget:hover,
.sidebar-hotline-btn:hover {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 6px 20px rgba(169, 132, 54, 0.35));
}

/* Icon Badge bên trái (vòng tròn đồng tâm) */
.hotline-icon-badge {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Vòng sóng mỏng bên ngoài */
.hotline-ring-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid #F3C88E;
  pointer-events: none;
  animation: hotlineRingWave 2.2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

/* Vòng hào quang mờ ở giữa */
.hotline-ring-middle {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(229, 147, 58, 0.22);
  pointer-events: none;
  transition: background 0.3s ease;
}

.hotline-call-widget:hover .hotline-ring-middle,
.sidebar-hotline-btn:hover .hotline-ring-middle {
  background: rgba(229, 147, 58, 0.32);
}

/* Vòng tròn cam lõi bên trong */
.hotline-circle-core {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F19B38 0%, #D88225 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(229, 147, 58, 0.45);
  color: #FFFFFF;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hotline-call-widget:hover .hotline-circle-core,
.sidebar-hotline-btn:hover .hotline-circle-core {
  transform: scale(1.06);
}

/* SVG ống nghe điện thoại */
.hotline-svg-phone {
  width: 18px;
  height: 18px;
  fill: #FFFFFF;
  display: block;
  transform: rotate(-10deg);
  transition: transform 0.3s ease;
}

.hotline-call-widget:hover .hotline-svg-phone,
.sidebar-hotline-btn:hover .hotline-svg-phone {
  animation: hotlinePhoneShake 0.6s ease-in-out;
}

/* Thanh Ribbon mạ vàng bên phải */
.hotline-ribbon {
  position: relative;
  z-index: 1;
  margin-left: -18px;
  min-width: 140px;
  height: 36px;
  background: linear-gradient(90deg, #9E792E 0%, #B89343 100%);
  border-radius: 0 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px 0 24px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 3px 10px rgba(158, 121, 46, 0.25);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.hotline-call-widget:hover .hotline-ribbon,
.sidebar-hotline-btn:hover .hotline-ribbon {
  background: linear-gradient(90deg, #A88233 0%, #C49F4C 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 4px 14px rgba(158, 121, 46, 0.35);
}

/* Chữ số điện thoại / Tư vấn trực tiếp */
.hotline-phone-number {
  color: #FFFFFF !important;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  font-family: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  user-select: none;
}

/* Animations */
@keyframes hotlineRingWave {
  0% {
    transform: scale(0.92);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.35;
  }
  100% {
    transform: scale(0.92);
    opacity: 0.85;
  }
}

@keyframes hotlinePhoneShake {
  0%, 100% {
    transform: rotate(-10deg);
  }
  20%, 60% {
    transform: rotate(-24deg);
  }
  40%, 80% {
    transform: rotate(4deg);
  }
}

/* Floating Hotline Button (nếu dùng) */
.floating-hotline-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: linear-gradient(135deg, #e63946, #b01a27);
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 28px;
  box-shadow: 0 6px 24px rgba(230, 57, 70, 0.5);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  transition: all var(--transition);
  animation: breathe 3s ease-in-out infinite;
}

.floating-hotline-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(230, 57, 70, 0.7);
}

/* Stock Status Badges */
.stock-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.stock-badge.in-stock {
  background: rgba(80, 200, 120, 0.15);
  color: #50c878;
  border: 1px solid rgba(80, 200, 120, 0.3);
}

.stock-badge.out-of-stock {
  background: rgba(255, 100, 100, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 100, 100, 0.3);
}

.stock-badge.pre-order {
  background: rgba(232, 169, 74, 0.15);
  color: #e8a94a;
  border: 1px solid rgba(232, 169, 74, 0.3);
}

/* Urgent Callback Modal */
.urgent-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.urgent-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow-card), 0 20px 50px rgba(30, 41, 59, 0.12);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}

.urgent-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.urgent-modal-close:hover {
  background: rgba(136, 19, 55, 0.1);
  color: var(--danger-burgundy);
  border-color: var(--danger-burgundy);
  transform: scale(1.08);
}

.urgent-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.urgent-modal-icon {
  font-size: 32px;
  display: inline-block;
  margin-bottom: 8px;
  animation: breathe 2s ease-in-out infinite;
}

.urgent-modal-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--danger-burgundy);
  letter-spacing: -0.01em;
}

.urgent-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.5;
}

/* ===== LLMOPS FEEDBACK BUTTONS & MODAL ===== */
.msg-tools-divider {
  color: var(--border-subtle);
  font-size: 11px;
  user-select: none;
  margin: 0 2px;
}

.feedback-thumb-btn {
  transition: all 0.2s ease;
}

.feedback-thumb-btn:hover {
  border-color: var(--accent-gold);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.feedback-thumb-btn.active-up {
  background: rgba(46, 125, 50, 0.12) !important;
  border-color: rgba(46, 125, 50, 0.4) !important;
  color: #2E7D32 !important;
}

.feedback-thumb-btn.active-down {
  background: rgba(136, 19, 55, 0.1) !important;
  border-color: rgba(136, 19, 55, 0.3) !important;
  color: var(--danger-burgundy) !important;
}

.feedback-btn-text {
  font-size: 11px;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.feedback-modal-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 20px 50px rgba(30, 41, 59, 0.12);
  padding: 28px 28px 24px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}

.feedback-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.feedback-modal-close:hover {
  background: rgba(136, 19, 55, 0.1);
  border-color: var(--danger-burgundy);
  color: var(--danger-burgundy);
  transform: scale(1.08);
}

.feedback-modal-header {
  text-align: center;
  margin-bottom: 18px;
}

.feedback-modal-icon {
  font-size: 28px;
  display: inline-block;
  margin-bottom: 6px;
}

.feedback-modal-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.feedback-modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

.feedback-tags-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.feedback-tag-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.feedback-tag-option:hover {
  background: #FFFFFF;
  border-color: var(--accent-gold);
}

.feedback-tag-option input[type="radio"] {
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.feedback-submit-btn {
  width: 100%;
  padding: 12px;
  background: #1E293B;
  border: 1px solid #1E293B;
  border-radius: var(--radius-sm);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.2);
}

.feedback-submit-btn:hover {
  background: #8A6634;
  border-color: #8A6634;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(138, 102, 52, 0.3);
}

/* =====================================================================
   AI VOICE / CALLBOT AGENT STYLING (ĐỀ XUẤT 1)
   ===================================================================== */

/* Header Call Button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-call-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1E293B;
  border: 1px solid #1E293B;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 10px rgba(30, 41, 59, 0.2);
}

.header-call-btn:hover {
  background: #8A6634;
  border-color: #8A6634;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(138, 102, 52, 0.35);
}

.call-pulse-dot {
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #2ecc71;
  animation: callDotPulse 1.8s infinite;
}

@keyframes callDotPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #2ecc71; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Sidebar Call Button */
.sidebar-call-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  margin-top: 8px;
  background: #f5f2eb;
  border: none;
  color: #1E293B;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 1px 4px rgba(30, 41, 59, 0.06);
}

.sidebar-call-btn:hover,
.sidebar-call-btn:active {
  background: #E8E2D5;
  border: none;
  color: #0F172A;
  box-shadow: 0 3px 10px rgba(30, 41, 59, 0.1);
  transform: translateY(-1px);
}

/* =====================================================================
   AI VOICE / CALLBOT AGENT MODAL (THIẾT KẾ ĐÀM THOẠI TRỰC TIẾP 24/7)
   ===================================================================== */

/* Voice Call Modal Backdrop */
.voice-call-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: voiceFadeInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes voiceFadeInModal {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.voice-call-card {
  position: relative;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 24px 60px rgba(30, 41, 59, 0.14);
  width: 100%;
  max-width: 560px;
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-primary);
  max-height: 94vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.voice-call-card::-webkit-scrollbar {
  width: 5px;
}
.voice-call-card::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

/* Topbar: Badges & Close */
.voice-card-topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.voice-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.voice-hotline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(197, 168, 128, 0.15);
  border: 1px solid var(--accent-gold);
  color: #8A6D44;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
}

.hotline-live-dot {
  width: 7px;
  height: 7px;
  background: #2E7D32;
  border-radius: 50%;
  box-shadow: 0 0 8px #2E7D32;
  animation: voiceLivePulse 1.8s infinite;
}

@keyframes voiceLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.voice-call-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11.5px;
  font-family: monospace;
  padding: 4px 10px;
  border-radius: 9999px;
}

.timer-dot {
  width: 6px;
  height: 6px;
  background: var(--danger-burgundy);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--danger-burgundy);
  animation: voiceTimerBlink 1s infinite;
}

@keyframes voiceTimerBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.voice-call-close-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.voice-call-close-btn:hover {
  background: rgba(136, 19, 55, 0.1);
  border-color: var(--danger-burgundy);
  color: var(--danger-burgundy);
  transform: scale(1.08);
}

/* Header */
.voice-call-header {
  margin-bottom: 12px;
}

.voice-call-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.35;
}

.voice-call-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.5;
}

/* Sacred Avatar Stage with Multi-layer Aura */
.voice-avatar-stage {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 4px 0;
}

.voice-avatar-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2.5px solid var(--accent-gold);
  box-shadow: 0 4px 24px rgba(197, 168, 128, 0.35);
  position: relative;
  z-index: 4;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  transition: all 0.3s ease;
}

.voice-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.voice-avatar-glow-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 12px rgba(197, 168, 128, 0.3);
  pointer-events: none;
}

.voice-aura-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(197, 168, 128, 0.3);
  transition: all 0.4s ease;
  pointer-events: none;
}

.voice-aura-ring.ring-1 {
  width: 112px;
  height: 112px;
  z-index: 3;
}

.voice-aura-ring.ring-2 {
  width: 134px;
  height: 134px;
  z-index: 2;
  border-color: rgba(197, 168, 128, 0.2);
}

.voice-aura-ring.ring-3 {
  width: 154px;
  height: 154px;
  z-index: 1;
  border-color: rgba(197, 168, 128, 0.1);
}

/* State: Speaking (AI đang nói) */
.voice-avatar-stage.active-speaking .voice-avatar-circle {
  border-color: var(--accent-gold);
  box-shadow: 0 0 35px rgba(197, 168, 128, 0.6);
  transform: scale(1.03);
}

.voice-avatar-stage.active-speaking .voice-aura-ring.ring-1 {
  border-color: rgba(197, 168, 128, 0.7);
  animation: voiceAuraRipple 2.2s infinite ease-out;
}

.voice-avatar-stage.active-speaking .voice-aura-ring.ring-2 {
  border-color: rgba(197, 168, 128, 0.45);
  animation: voiceAuraRipple 2.2s infinite ease-out 0.45s;
}

.voice-avatar-stage.active-speaking .voice-aura-ring.ring-3 {
  border-color: rgba(197, 168, 128, 0.25);
  animation: voiceAuraRipple 2.2s infinite ease-out 0.9s;
}

/* State: Listening (Gia đình đang nói) */
.voice-avatar-stage.active-listening .voice-avatar-circle {
  border-color: #2E7D32;
  box-shadow: 0 0 32px rgba(46, 125, 50, 0.45);
}

.voice-avatar-stage.active-listening .voice-aura-ring {
  border-color: rgba(46, 125, 50, 0.35);
  animation: voiceAuraPulseListen 1.4s infinite ease-in-out;
}

@keyframes voiceAuraRipple {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.3); opacity: 0; }
}

@keyframes voiceAuraPulseListen {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

/* Waveform Canvas */
.voice-waveform-container {
  width: 100%;
  max-width: 480px;
  height: 54px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 6px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#voice-waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Status Pill */
.voice-status-wrapper {
  margin-bottom: 10px;
}

.voice-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 5px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.voice-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  transition: background 0.3s;
}

.voice-status-indicator.ready {
  background: #8A6D44;
  box-shadow: 0 0 8px rgba(197, 168, 128, 0.6);
}

.voice-status-indicator.listening {
  background: #2E7D32;
  box-shadow: 0 0 10px rgba(46, 125, 50, 0.6);
  animation: voiceLivePulse 1.2s infinite;
}

.voice-status-indicator.thinking {
  background: #E8A94A;
  box-shadow: 0 0 10px rgba(232, 169, 74, 0.6);
  animation: voiceLivePulse 0.9s infinite;
}

.voice-status-indicator.speaking {
  background: var(--accent-gold);
  box-shadow: 0 0 10px rgba(197, 168, 128, 0.6);
  animation: voiceLivePulse 1.4s infinite;
}

/* Permission Banner */
.voice-perm-banner {
  width: 100%;
  max-width: 480px;
  background: rgba(136, 19, 55, 0.08);
  border: 1px solid rgba(136, 19, 55, 0.25);
  color: var(--danger-burgundy);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  text-align: left;
  line-height: 1.45;
  margin-bottom: 10px;
}

/* Live Subtitles Box */
.voice-subtitles-box {
  width: 100%;
  max-width: 490px;
  min-height: 95px;
  max-height: 145px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.voice-subtitles-box::-webkit-scrollbar {
  width: 4px;
}
.voice-subtitles-box::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.subtitle-line {
  font-size: 13.5px;
  line-height: 1.55;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  animation: voiceFadeInSub 0.25s ease-out;
}

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

.subtitle-line .sub-role {
  font-weight: 700;
  margin-right: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.subtitle-line.caller-line {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--text-secondary);
  color: var(--text-primary);
}
.subtitle-line.caller-line .sub-role {
  color: var(--text-secondary);
}

.subtitle-line.ai-line {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-gold);
  color: var(--text-primary);
}
.subtitle-line.ai-line .sub-role {
  color: #8A6D44;
}

/* Quick Question Prompt Chips */
.voice-quick-chips-wrapper {
  width: 100%;
  max-width: 490px;
  text-align: left;
  margin-bottom: 12px;
}

.voice-quick-chips-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-quick-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-chip-btn {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #1E293B;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(30, 41, 59, 0.05);
}

.voice-chip-btn:hover {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.15);
}

/* Voice Options Bar */
.voice-options-bar {
  width: 100%;
  max-width: 490px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.voice-select-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.voice-select-input:focus {
  border-color: var(--accent-gold);
}

.voice-select-input option {
  background: #FFFFFF;
  color: #1E293B;
}

.voice-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.voice-toggle-label input[type="checkbox"] {
  accent-color: var(--accent-gold);
  cursor: pointer;
}

/* Call Controls Toolbar */
.voice-controls-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 14px;
}

.call-control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ctrl-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition-smooth);
}

.call-control-btn .ctrl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.2s;
}

.call-control-btn:hover .ctrl-label {
  color: var(--text-primary);
}

.call-control-btn.btn-secondary .ctrl-icon-circle {
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #1E293B;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.08);
}

.call-control-btn.btn-secondary:hover .ctrl-icon-circle {
  background: #1E293B;
  border-color: #1E293B;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(30, 41, 59, 0.2);
}

/* Main Mic Button */
.call-control-btn.btn-mic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.btn-mic-inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #1E293B;
  border: 2.5px solid var(--accent-gold);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(30, 41, 59, 0.35);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.call-control-btn.btn-mic:hover .btn-mic-inner {
  background: #8A6634;
  border-color: #FFFFFF;
  transform: scale(1.08);
  box-shadow: 0 8px 30px rgba(138, 102, 52, 0.45);
}

.call-control-btn.btn-mic.recording .btn-mic-inner {
  background: var(--danger-burgundy);
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 24px rgba(136, 19, 55, 0.6);
  animation: voiceMicRecordingPulse 1.2s infinite;
}

@keyframes voiceMicRecordingPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(136, 19, 55, 0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 32px rgba(136, 19, 55, 0.8); }
}

/* Hangup Button */
.call-control-btn.btn-hangup .ctrl-icon-circle {
  background: var(--danger-burgundy);
  border: 1px solid #700f2b;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(136, 19, 55, 0.35);
}

.call-control-btn.btn-hangup:hover .ctrl-icon-circle {
  background: #9F1239;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(136, 19, 55, 0.55);
}

/* Emergency Footer - High Priority Banner */
.voice-emergency-footer {
  width: 100%;
  max-width: 490px;
  background: rgba(136, 19, 55, 0.04);
  border: 1px solid rgba(136, 19, 55, 0.2);
  box-shadow: var(--shadow-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.voice-emergency-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.emergency-icon-pulse {
  font-size: 15px;
  animation: pulseEmergencyIcon 1.5s infinite;
}

@keyframes pulseEmergencyIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.voice-emergency-hint {
  font-size: 12.5px;
  color: var(--danger-burgundy);
  font-weight: 500;
  line-height: 1.35;
}

.voice-quick-call-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--danger-burgundy);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 9px 18px;
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(136, 19, 55, 0.3);
  transition: var(--transition-smooth);
}

.voice-quick-call-link:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.voice-quick-call-link:active {
  transform: translateY(0);
}

.voice-call-cta-icon {
  font-size: 16px;
}

.voice-call-cta-text strong {
  color: #fff9d2;
  font-size: 15px;
  letter-spacing: 0.03em;
}

/* Responsive Mobile */
@media (max-width: 600px) {
  .voice-call-card {
    padding: 20px 16px 16px 16px;
    border-radius: 22px;
  }
  .voice-avatar-stage {
    width: 120px;
    height: 120px;
  }
  .voice-avatar-circle {
    width: 76px;
    height: 76px;
  }
  .voice-aura-ring.ring-1 { width: 90px; height: 90px; }
  .voice-aura-ring.ring-2 { width: 106px; height: 106px; }
  .voice-aura-ring.ring-3 { width: 122px; height: 122px; }
  .voice-controls-toolbar {
    gap: 20px;
  }
  .header-call-btn .call-btn-text {
    display: none;
  }
  .header-call-btn {
    padding: 8px 10px;
  }
}
