#main-header * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#main-header {
  position: relative;
  z-index: 1000;
  overflow: hidden;
  min-height: 5rem;
  transition: min-height 0.3s ease, background-color 0.3s ease;
  transform: translateZ(0);
  backface-visibility: hidden;
  background-color: #ffffff;
  width: 100%;
}

.dark #main-header {
  background-color: #000000;
}

#main-header.header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
}

.dark #main-header.header-sticky {
  background-color: #000000 !important;
}

.dark a.text-blue-600 {
  color: #3b82f6 !important;
}

.dark #main-nav a.text-blue-600 {
  color: #3b82f6 !important;
}

#main-nav a.text-blue-600 {
  color: #2563eb !important;
}

#logo-container {
  transition: transform 0.3s ease;
  transform-origin: left center;
}

#certificate-container,
#header-divider {
  transition: opacity 0.3s ease;
}

#main-header.header-compact {
  min-height: 3.5rem;
}

#main-header.header-compact #logo-container {
  transform: scale(0.8);
}

#main-header.header-compact #certificate-container,
#main-header.header-compact #header-divider {
  opacity: 0;
  pointer-events: none;
}

#top-right-buttons-container {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

#main-nav {
  position: absolute;
  right: 9rem;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#main-header.header-compact #main-nav {
  transform: translateX(calc(-50vw + 10.5rem + 50%));
}

#main-nav > div {
  display: flex;
  gap: 0.2rem;
  padding: 0 0.5rem;
}

#main-nav a {
  padding: 0 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #374151;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dark #main-nav a {
  color: #ffffff;
}

#main-nav a:hover {
  color: #2563eb;
}

.dark #main-nav a:hover {
  color: #60a5fa;
}

@media (max-width: 1100px) {
  body {
    padding-top: calc(124px + env(safe-area-inset-top, 0px));
  }

  body.chat-fullscreen {
    padding-top: 0 !important;
  }

  #top-right-buttons-container {
    display: none !important;
  }

  #main-header {
    display: none !important;
  }

  #mobile-header-custom {
    display: block !important;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 50;
    box-shadow: none;
  }

  .dark #mobile-header-custom,
  .dark #mobile-second-floor {
    background-color: #000000;
    border-color: #1a1a1a;
  }

  #mobile-header-custom.compact #iso-cert-mobile {
    display: none;
  }

  #mobile-menu-custom {
    transition: all 0.3s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  #mobile-menu-custom.hidden {
    opacity: 0;
    transform: translateY(-10px) translateZ(0);
    pointer-events: none;
  }

  #mobile-menu-custom:not(.hidden) {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }

  #mobile-menu-custom a {
    transition: all 0.2s ease;
    transform: translateZ(0);
  }

  #mobile-menu-custom:not(.hidden) a {
    animation: mobileMenuStagger 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  
  #mobile-menu-custom:not(.hidden) a:nth-child(1) { animation-delay: 0.04s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(2) { animation-delay: 0.08s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(3) { animation-delay: 0.12s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(4) { animation-delay: 0.16s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(5) { animation-delay: 0.20s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(6) { animation-delay: 0.24s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(7) { animation-delay: 0.28s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(8) { animation-delay: 0.32s; }

  @keyframes mobileMenuStagger {
    0% {
      opacity: 0;
      transform: translateY(-10px) translateZ(0);
    }
    100% {
      opacity: 1;
      transform: translateY(0) translateZ(0);
    }
  }
}

.chatbot-header {
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  isolation: isolate;
  border-radius: var(--chatbot-shell-radius) var(--chatbot-shell-radius) 0 0;
  border-bottom: 1px solid rgba(96, 165, 250, 0.10) !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #1a4b8c 0%, #153d77 100%) !important;
}

body.dark .chatbot-header {
  background: linear-gradient(135deg, #0f2545 0%, #0c1f3a 100%) !important;
  border-bottom: 1px solid rgba(59, 130, 246, 0.12) !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.chatbot-header img {
  filter: brightness(0) invert(1);
  opacity: 0.95;
  height: 2.25rem;
}

.chatbot-header-logo,
.chatbot-avatar-logo {
  display: block;
  transform-origin: center;
}

.chatbot-header-logo {
  transform: scale(0.92);
  margin-right: -0.08rem;
}

.chatbot-avatar-logo {
  transform: scale(0.67);
}

.chat-message {
  gap: 0.75rem;
}

.chat-message-content {
  min-width: 0;
  max-width: 100%;
}

.chat-message-user {
  justify-content: flex-end;
}

.chat-message-user .chat-message-content {
  display: flex;
  justify-content: flex-end;
}

.chat-user-bubble {
  margin-left: 0;
  min-width: 0;
  max-width: min(85%, 100%);
  overflow: hidden;
}

.chat-bot-bubble {
  min-width: 0;
  max-width: min(85%, 100%);
  overflow: hidden;
}

.chat-user-text,
.chat-bot-text,
.chat-bot-text * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message-user .chat-user-avatar {
  order: 2;
}

.chatbot-header button:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

#mobile-settings-wrapper {
  display: none;
}

@media (max-width: 639px) {
  #mobile-settings-wrapper {
    display: block;
  }

  #mode-dropdown-wrapper,
  .desktop-only-btn,
  .desktop-only-divider {
    display: none !important;
  }

  .chatbot-header {
    padding-left: 0.625rem !important;
    padding-right: 0.625rem !important;
  }

  .chatbot-header > div:first-child {
    gap: 0.5rem !important;
  }

  .chatbot-header img {
    height: 1.75rem;
  }

  .chatbot-header-logo {
    transform: scale(0.88);
    margin-right: -0.05rem;
  }

  .chatbot-header > div:first-child > span {
    font-size: 1.3rem !important;
  }

  #chat-info-btn {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  #chat-fullscreen-btn {
    width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0.15rem !important;
  }

  #chat-fullscreen-btn svg {
    width: 1.4rem !important;
    height: 1.4rem !important;
  }

  #mobile-settings-btn {
    width: 2.25rem !important;
    height: 2.25rem !important;
    padding: 0.15rem !important;
  }

  #mobile-settings-btn svg {
    width: 1.45rem !important;
    height: 1.45rem !important;
  }

  .chatbot-header > div:last-child {
    gap: 0 !important;
  }
}

.chatbot-header button:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  transform: scale(1.04);
}

.chatbot-header button:active {
  transform: scale(0.96);
}

.chatbot-header button,
#example-questions-toggle,
#send-button {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.chatbot-header button.chatbot-hover-suppressed:hover,
.chatbot-header button.chatbot-hover-suppressed:active,
#example-questions-toggle.chatbot-hover-suppressed:hover,
#example-questions-toggle.chatbot-hover-suppressed:active {
  background: transparent !important;
  transform: none !important;
}

#send-button.chatbot-hover-suppressed:hover,
#send-button.chatbot-hover-suppressed:active {
  transform: none !important;
  box-shadow: none !important;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  align-items: start;
}

.chat-input-shell {
  min-width: 0;
  position: relative;
}

.chat-input-actions {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.chat-input-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
}

.chat-input-shell #chat-input {
  padding-right: 3.5rem;
}

.chat-attachment-slot {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

#chat-composer + #file-preview-area {
  display: none !important;
}

#file-preview-area-legacy {
  display: none !important;
}

#attach-file-btn {
  grid-column: 2;
  grid-row: 1;
}

#send-button {
  grid-column: 3;
  grid-row: 1;
}

.chat-attachment-helper {
  display: none;
}

.mobile-settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 214px;
  min-width: 214px;
  max-width: min(240px, calc(100vw - 24px));
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14), 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  padding: 8px 6px;
  z-index: 110;
  animation: modeDropIn 0.15s ease-out;
}

body.dark .mobile-settings-dropdown {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.mobile-settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  transition: background 0.15s;
}

.mobile-settings-item:hover {
  background: #f3f4f6;
}

body.dark .mobile-settings-item {
  color: #d1d5db;
}

body.dark .mobile-settings-item:hover {
  background: #374151;
}

.mobile-mode-toggle {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 2px;
}

.mobile-mode-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  padding: 4px 10px 6px;
  margin: 0;
}

body.dark .mobile-mode-section-label {
  color: #6b7280;
}

.mobile-mode-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: transparent;
  text-align: left;
}

.mobile-mode-pill:hover {
  background: #f3f4f6;
}

body.dark .mobile-mode-pill {
  color: #d1d5db;
}

body.dark .mobile-mode-pill:hover {
  background: #374151;
}

.mobile-mode-pill.active {
  color: #1d4ed8;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.08);
}

body.dark .mobile-mode-pill.active {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.12);
}

.mobile-mode-pill .pill-check {
  display: none !important;
}

.mobile-mode-pill .pill-check::before {
  content: none !important;
  display: none !important;
}

.mobile-mode-pill .pill-check::before {
  content: '✓';
  font-size: 13px;
  line-height: 1;
}

.mobile-mode-pill .pill-check::before {
  content: "\2713";
}

.mobile-settings-item > span,
.mobile-mode-pill > span[data-key] {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

html[lang="zh"] .mobile-settings-dropdown {
  width: 220px;
  min-width: 220px;
}

html[lang="zh"] .mobile-mode-section-label {
  letter-spacing: 0.02em;
}

html[lang="zh"] .mobile-settings-item > span,
html[lang="zh"] .mobile-mode-pill > span[data-key] {
  letter-spacing: 0;
}

body.dark .mobile-mode-pill .pill-check {
  color: #93c5fd;
}

.mobile-mode-pill.active .pill-check {
  opacity: 1;
}

.mobile-settings-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 4px;
}

body.dark .mobile-settings-divider {
  background: #374151;
}

.chat-tooltip {
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}

.chat-tooltip:focus-visible {
  z-index: 40;
}

@media (hover: hover) and (pointer: fine) {
  .chat-tooltip:hover {
    z-index: 40;
  }
}

#chat-messages {
  position: relative;
  z-index: 0;
  min-height: 0;
  scrollbar-gutter: stable both-edges;
  transition: height 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

#chat-messages.chatbot-intro-stabilizing {
  overflow: hidden;
}

#chatbot-intro-stage {
  min-height: 0;
}

body.chatbot-intro-layout-pending #chat-messages {
  min-height: 0;
}

body.chatbot-intro-layout-pending #chatbot-intro-stage {
  min-height: 0;
}

#initial-bot-icon,
#initial-bot-bubble,
#example-questions-panel {
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.chat-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 140;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chat-tooltip::before {
  content: '';
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: #1e293b;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 140;
}

@media (hover: hover) and (pointer: fine) {
  .chat-tooltip:hover::after,
  .chat-tooltip:hover::before {
    opacity: 1;
  }
}

.chat-tooltip.chatbot-hover-suppressed::after,
.chat-tooltip.chatbot-hover-suppressed::before {
  opacity: 0 !important;
}

@media (hover: none), (pointer: coarse), (max-width: 768px) {
  .chat-tooltip::after,
  .chat-tooltip::before {
    display: none !important;
  }
}

#mode-hint {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 150;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  animation: hintFadeIn 0.4s ease-out;
  line-height: 1.4;
}

#mode-hint::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: #1e293b;
}

#mode-hint.hint-fade-out {
  animation: hintFadeOut 0.3s ease-out forwards;
}

@keyframes hintFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes hintFadeOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(4px); }
}

@media (max-width: 639px) {
  #mode-hint {
    left: 0;
    transform: translateX(0);
    font-size: 11px;
    padding: 5px 12px;
  }

  #mode-hint::before {
    left: 18px;
    transform: none;
  }
}

#chat-info-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

#chat-info-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

#chat-info-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 280px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid #e5e7eb;
  padding: 16px 18px;
  z-index: 130;
  animation: modeDropIn 0.15s ease-out;
}

#chat-info-popover::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  border: 5px solid transparent;
  border-bottom-color: white;
}

body.dark #chat-info-popover {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

body.dark #chat-info-popover::before {
  border-bottom-color: #1f2937;
}

#chat-info-popover .info-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

body.dark #chat-info-popover .info-title {
  color: #f1f5f9;
}

#chat-info-popover .info-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
}

#chat-info-popover .info-list li {
  font-size: 13px;
  color: #475569;
  padding: 3px 0 3px 20px;
  position: relative;
  line-height: 1.5;
}

body.dark #chat-info-popover .info-list li {
  color: #94a3b8;
}

#chat-info-popover .info-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: 700;
  font-size: 12px;
}

#chat-info-popover .info-tip {
  font-size: 12px;
  color: #64748b;
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
  margin: 0;
}

body.dark #chat-info-popover .info-tip {
  color: #64748b;
  border-top-color: #374151;
}

@media (max-width: 639px) {
  #chat-info-popover {
    width: 280px;
    max-width: calc(100vw - 32px);
    left: 50%;
    margin-left: -140px;
    padding: 14px 16px;
  }

  #chat-info-popover::before {
    left: 50%;
    margin-left: -5px;
    transform: none;
  }
}

#example-questions-panel {
  --example-questions-expanded-width: 51%;
  --example-questions-collapsed-width: 15rem;
  position: relative;
  width: var(--example-questions-expanded-width);
  max-width: 100%;
  overflow: clip;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform-origin: top left;
  transition:
    width 0.68s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    border-radius 0.62s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

#example-questions-panel.is-collapsed {
  width: var(--example-questions-collapsed-width);
}

#example-questions-toggle {
  border-radius: inherit;
  transition:
    background-color 0.28s ease,
    border-radius 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

#example-questions-panel:not(.is-collapsed) #example-questions-toggle {
  border-radius: 1rem 1rem 0.72rem 0.72rem;
}

#example-questions-content {
  overflow: hidden;
  padding: 0 1rem 1rem;
  transform-origin: top center;
  will-change: max-height, opacity, padding, transform;
  transition:
    max-height 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s ease-out,
    padding 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

#example-questions-content.collapsed {
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

#example-questions-panel.is-transitioning #example-questions-content {
  pointer-events: none;
}

#example-questions-panel.is-transitioning #example-questions-content:not(.collapsed) {
  animation: langDropdownScaleIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#example-questions-panel.is-transitioning #example-questions-content:not(.collapsed) .example-question {
  animation: langOptionFadeIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#example-questions-panel.is-transitioning #example-questions-content:not(.collapsed) .example-question:nth-child(1) { animation-delay: 0.08s; }
#example-questions-panel.is-transitioning #example-questions-content:not(.collapsed) .example-question:nth-child(2) { animation-delay: 0.14s; }
#example-questions-panel.is-transitioning #example-questions-content:not(.collapsed) .example-question:nth-child(3) { animation-delay: 0.2s; }

#example-questions-chevron {
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

#example-questions-chevron.rotate-180 {
  transform: rotate(180deg);
}

:root {
  --chatbot-shell-radius: 0.5rem;
}

#chatbot-shell {
  backface-visibility: hidden;
  will-change: transform, border-radius, box-shadow;
  border-radius: var(--chatbot-shell-radius);
  transition:
    border-radius 0.24s ease,
    box-shadow 0.24s ease;
}

#chat-fullscreen-btn.chat-fullscreen-busy {
  pointer-events: none;
}

.layout-content-container {
  position: static;
  isolation: auto;
}

body.chat-fullscreen .layout-content-container {
  background: transparent;
  max-width: 1200px;
}

body.chat-fullscreen #chatbot-shell {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  height: auto;
  max-height: none;
  border-radius: var(--chatbot-shell-radius);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.16);
}

body.chat-fullscreen #chat-messages {
  max-height: none !important;
  flex: 1;
  overflow-y: auto;
}

body.chat-fullscreen {
  overflow: hidden;
}

body.chat-fullscreen .chatbot-header {
  border-radius: var(--chatbot-shell-radius) var(--chatbot-shell-radius) 0 0;
  flex-shrink: 0;
}

body.chat-fullscreen .flex-1.flex.flex-col.bg-white.dark\:bg-gray-800,
body.chat-fullscreen .relative.flex-1.flex.flex-col {
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.chat-fullscreen .border-t.border-gray-200 {
  flex-shrink: 0;
}

body.chat-fullscreen header,
body.chat-fullscreen .text-center.mb-8,
body.chat-fullscreen .text-center.mb-4 {
  display: none !important;
}

body.chat-fullscreen footer,
body.chat-fullscreen #privacy-notice,
body.chat-fullscreen-animating footer,
body.chat-fullscreen-animating #privacy-notice {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  body.chat-fullscreen {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.chat-fullscreen .layout-content-container {
    height: auto;
  }

  body.chat-fullscreen #chatbot-shell {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    border-radius: var(--chatbot-shell-radius);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  }

  body.chat-fullscreen .relative.flex-1.flex.flex-col {
    height: 100%;
    overflow: hidden;
  }

  body.chat-fullscreen #chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.chat-fullscreen .border-t.border-gray-200 {
    flex-shrink: 0;
    background: inherit;
    padding-bottom: calc(env(safe-area-inset-bottom) + 1.25rem);
  }

}

@media (max-width: 768px) {
  .chatbot-header {
    padding: 0.5rem 0.75rem;
  }

  .chatbot-header .flex.items-center.gap-3 {
    gap: 0.5rem;
  }

  .chatbot-header img {
    height: 1.75rem;
  }

  .chatbot-header span {
    font-size: 1.1rem;
  }

  .chatbot-header span.text-2xl {
    font-size: 1.25rem !important;
  }

  .chatbot-header .flex.items-center.gap-2 {
    gap: 0.5rem;
  }

  .chatbot-header button {
    width: 36px !important;
    height: 36px !important;
    padding: 0.4rem !important;
    transition: all 0.15s ease !important;
  }

  .chatbot-header button:active {
    transform: scale(0.97) !important;
    background: rgba(255, 255, 255, 0.30) !important;
  }

  .chatbot-header button svg {
    width: 18px !important;
    height: 18px !important;
  }

  .chatbot-header .w-px {
    height: 24px !important;
    margin: 0 0.25rem !important;
  }

  #mobile-header-custom {
    transition: background-color 0.3s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  #mobile-first-floor {
    transition: max-height 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease-out, padding 420ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: max-height, padding;
    max-height: 72px;
    overflow: hidden;
  }

  #mobile-header-custom.compact #mobile-first-floor {
    max-height: 0;
    opacity: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }

  #mobile-header-custom.compact #iso-cert-mobile {
    opacity: 0;
    transform: scale(0.8) translateZ(0);
    transition: opacity 220ms ease-out, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
  }

  #mobile-second-floor {
    border-top-color: transparent !important;
    transition: border-color 220ms ease-out;
  }

  #mobile-header-custom.compact #mobile-second-floor {
    border-top: none;
  }

  #chat-messages {
    max-height: 50vh !important;
    padding: 0.875rem !important;
    overflow-x: hidden !important;
  }

  #chat-input {
    font-size: 16px !important;
    min-height: 56px !important;
    padding: 0.9rem 3.25rem 0.9rem 0.95rem !important;
  }

  #chat-input::placeholder {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #send-button {
    padding: 0.75rem 1rem !important;
    min-width: 60px !important;
  }

  .chat-composer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    padding-right: 2.75rem;
  }

  .chat-input-shell {
    order: 1;
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
    padding-right: 0;
  }

  .chat-attachment-slot {
    order: 3;
    flex: 1 1 calc(100% - 36px);
    align-self: center;
    min-width: 0;
  }

  #send-button {
    position: absolute;
    top: 10px;
    right: 0;
    width: 24px;
    height: 32px !important;
    min-width: 24px !important;
    padding: 0 !important;
    margin-top: 0 !important;
    border-radius: 8px !important;
  }

  #send-button .btn-label {
    display: none !important;
  }

  #send-button .btn-text,
  #send-button.sending .btn-text {
    grid-template-columns: 0 0 14px !important;
    column-gap: 0 !important;
    transform: none !important;
  }

  #send-button .btn-text::before {
    display: none;
  }

  #send-button .btn-icon,
  #send-button.sending .btn-icon {
    width: 14px !important;
    height: 14px !important;
    opacity: 1 !important;
    transform: none !important;
  }

  #attach-file-btn {
    order: 2;
    flex: 0 0 30px;
    width: 30px !important;
    height: 30px !important;
    margin-top: 0 !important;
    justify-self: start;
    align-self: center;
  }

  #attach-file-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  .chat-attachment-helper {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    font-size: 0.68rem;
    line-height: 1.25;
    color: #6b7280;
    overflow-wrap: anywhere;
  }

  body.dark .chat-attachment-helper {
    color: #9ca3af;
  }

  .chat-composer.has-files .chat-attachment-helper {
    display: none;
  }

  #file-preview-area {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    padding-left: 0 !important;
    flex-wrap: wrap !important;
  }

  .file-preview-item {
    max-width: 100% !important;
    min-width: 0;
    border-radius: 14px !important;
  }

  .file-name {
    min-width: 0;
    max-width: min(120px, 38vw) !important;
  }

  .chat-message {
    max-width: 100% !important;
  }

  .chat-message-content,
  .chat-bot-bubble,
  .chat-user-bubble,
  .chat-bot-text {
    min-width: 0;
    max-width: 100%;
  }

  .chat-avatar {
    width: 2rem !important;
    height: 2rem !important;
  }

  .chat-text {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  #mobile-menu-custom {
    transition: all 0.3s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
  }

  #mobile-menu-custom.hidden {
    opacity: 0;
    transform: translateY(-10px) translateZ(0);
    pointer-events: none;
  }

  #mobile-menu-custom:not(.hidden) {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }

  #mobile-menu-custom a {
    transition: all 0.2s ease;
    transform: translateZ(0);
  }

  #mobile-menu-custom:not(.hidden) a {
    animation: mobileMenuStagger 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  
  #mobile-menu-custom:not(.hidden) a:nth-child(1) { animation-delay: 0.04s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(2) { animation-delay: 0.08s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(3) { animation-delay: 0.12s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(4) { animation-delay: 0.16s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(5) { animation-delay: 0.20s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(6) { animation-delay: 0.24s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(7) { animation-delay: 0.28s; }
  #mobile-menu-custom:not(.hidden) a:nth-child(8) { animation-delay: 0.32s; }

  #mobile-menu-custom a:hover {
    transform: translateX(4px) translateZ(0);
  }



  .chatbot-header .w-px {
    display: block !important;
  }
}

.mode-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid #e5e7eb;
  padding: 6px;
  z-index: 100;
  animation: modeDropIn 0.15s ease-out;
}

@media (max-width: 639px) {
  .mode-dropdown {
    right: auto;
    left: 0;
    width: 220px;
  }
}

body.dark .mode-dropdown {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

@keyframes modeDropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.mode-option {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.mode-option:hover {
  background: #f3f4f6;
}

body.dark .mode-option:hover {
  background: #374151;
}

.mode-option.active {
  background: #eff6ff;
}

body.dark .mode-option.active {
  background: #1e3a5f;
}

.mode-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-option-label {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
}

body.dark .mode-option-label {
  color: #f3f4f6;
}

.mode-option-row svg {
  color: #6b7280;
}

.mode-option.active .mode-option-row svg {
  color: #2563eb;
}

body.dark .mode-option.active .mode-option-row svg {
  color: #60a5fa;
}

.mode-check {
  font-size: 14px;
  color: #2563eb;
  font-weight: 700;
  display: none;
}

body.dark .mode-check {
  color: #60a5fa;
}

.mode-option.active .mode-check {
  display: inline;
}

.mode-option-desc {
  font-size: 11px;
  color: #4b5563;
  margin: 4px 0 0 22px;
  line-height: 1.3;
}

body.dark .mode-option-desc {
  color: #d1d5db;
}

@media (max-width: 639px) {
  .mode-option-desc {
    display: none;
  }

  .mode-option.active,
  body.dark .mode-option.active {
    background: transparent;
  }

  .mode-option.active .mode-option-label {
    color: #2563eb;
  }

  body.dark .mode-option.active .mode-option-label {
    color: #60a5fa;
  }
}

.mode-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 2px 8px;
}

body.dark .mode-divider {
  background: #374151;
}

#mode-dropdown-btn.mode-reasoning {
  background: rgba(96, 165, 250, 0.35);
  border-color: rgba(96, 165, 250, 0.5);
}

#send-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

#send-button .btn-text {
  display: grid;
  grid-template-columns: 0 auto 0;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 100%;
  column-gap: 0;
  line-height: 1;
  transition:
    grid-template-columns 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    column-gap 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

#send-button .btn-text::before {
  content: '';
  grid-column: 1;
  width: 100%;
  height: 1px;
}

#send-button [data-key="sendButton"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  line-height: 1;
}

#send-button .btn-icon {
  grid-column: 3;
  width: 16px;
  opacity: 0;
  margin-left: 0 !important;
  justify-self: center;
  transform: translateX(-10px) scale(0.92);
  transition:
    opacity 0.22s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
  #send-button:not(:disabled):hover .btn-text {
    grid-template-columns: 8px auto 16px;
    column-gap: 6px;
    transform: translateX(-4px);
  }

  #send-button:not(:disabled):hover .btn-icon {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  #send-button:not(:disabled):hover {
    transform: translateY(-1px) scale(1.015);
    box-shadow: 0 6px 16px rgba(26, 75, 140, 0.3);
  }
}

#send-button:not(:disabled):active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 6px rgba(26, 75, 140, 0.25);
}

#send-button.sending {
  pointer-events: none;
}

#send-button.sending .btn-text {
  animation: sendPulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  grid-template-columns: 8px auto 16px;
  column-gap: 6px;
  transform: translateX(-4px);
}

#send-button.sending .btn-icon {
  opacity: 1;
  transform: translateX(0) scale(1);
  animation: sendArrow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes sendPulse {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(0.95);
  }

  60% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes sendArrow {
  0% {
    transform: translateX(0);
    opacity: 1;
  }

  50% {
    transform: translateX(12px);
    opacity: 0.5;
  }

  51% {
    transform: translateX(-8px);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

#send-button:disabled {
  transform: none;
  box-shadow: none;
}

#send-button:disabled .btn-icon {
  width: 0;
  opacity: 0;
}

@media (max-width: 768px) {
  #send-button:disabled .btn-icon {
    width: 14px !important;
    height: 14px !important;
    opacity: 0.45 !important;
  }
}

@media (max-width: 768px) {
  #chat-composer {
    overflow: visible;
    padding-right: 2.95rem;
  }

  #chat-composer .chat-input-shell {
    flex: 1 1 100%;
    max-width: 100%;
    padding-right: 0;
  }

  #chat-composer #chat-input {
    padding-right: 3.6rem !important;
  }

  #chat-composer .chat-input-actions {
    right: 0.75rem;
  }

  #chat-composer #send-button {
    position: absolute;
    top: 10px;
    right: 0;
    left: auto;
    z-index: 2;
    box-sizing: border-box;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 110px !important;
    background: linear-gradient(180deg, #22589e 0%, #1a4b8c 100%) !important;
    box-shadow:
      0 4px 10px rgba(26, 75, 140, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.14);
    overflow: hidden;
  }

  #chat-composer #send-button .btn-text,
  #chat-composer #send-button.sending .btn-text {
    width: 100%;
    grid-template-columns: 0 0 14px !important;
    column-gap: 0 !important;
    transform: none !important;
  }

  #chat-composer #send-button .btn-icon,
  #chat-composer #send-button.sending .btn-icon {
    width: 14px !important;
    height: 14px !important;
    margin-left: 0 !important;
    justify-self: center;
    transform: none !important;
  }

  #chat-composer #send-button:disabled .btn-icon {
    width: 14px !important;
    height: 14px !important;
    margin-left: 0 !important;
    justify-self: center;
  }
}

.file-preview-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: #f0fdf4;
  border: 1px solid #10b981;
  border-radius: 9999px;
  font-size: 0.75rem;
  max-width: 160px;
  transition: all 0.3s ease;
  color: #065f46;
}

.dark .file-preview-item {
  background: rgba(16, 185, 129, 0.1);
  border-color: #059669;
  color: #a7f3d0;
}

.file-preview-item.uploading {
  border-color: #3b82f6;
  animation: pulse-border 1.5s infinite;
}

.file-preview-item.processing {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.dark .file-preview-item.processing {
  background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
}

.file-preview-item.processed {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.dark .file-preview-item.processed {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
}

.file-preview-item.error {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.dark .file-preview-item.error {
  background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
}

.file-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

.file-icon.pdf {
  color: #ef4444;
}

.file-icon.word {
  color: #3b82f6;
}

.file-icon.image {
  color: #10b981;
}

.file-icon.geo {
  color: #f59e0b;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #374151;
  max-width: 120px;
}

.dark .file-name {
  color: #e5e7eb;
}

.file-status-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.file-status-icon.spinner {
  animation: spin 1s linear infinite;
}

.file-remove-btn {
  padding: 0.15rem;
  border-radius: 50%;
  background: #fee2e2;
  color: #ef4444;
  transition: all 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-remove-btn:hover {
  background: #fca5a5;
  color: #b91c1c;
}

.dark .file-remove-btn {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.dark .file-remove-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

@keyframes pulse-border {
  0%,
  100% {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }

  50% {
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

#attach-file-btn {
  transition: all 0.2s ease;
}

#attach-file-btn:hover {
  color: #1a4b8c;
}

.dark #attach-file-btn:hover {
  color: #3b82f6;
}

#attach-file-btn.has-files {
  color: #1a4b8c;
}

.dark #attach-file-btn.has-files {
  color: #3b82f6;
}

#text-size-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 220px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.dark #text-size-panel {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

#text-size-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.text-size-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.text-size-label {
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.dark .text-size-label {
  color: #f1f5f9;
}

.text-size-value {
  background: transparent;
  border: none;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  width: 38px;
  padding: 0;
  text-align: right;
  outline: none;
  cursor: text;
  appearance: textfield;
  -moz-appearance: textfield;
}

.dark .text-size-value {
  color: #60a5fa;
}

.text-size-value::-webkit-outer-spin-button,
.text-size-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.text-size-value:focus {
  color: #1d4ed8;
}

.dark .text-size-value:focus {
  color: #93c5fd;
}

.text-size-percent {
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  margin-left: 0;
}

.dark .text-size-percent {
  color: #60a5fa;
}

.text-size-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.text-size-slider-container .size-icon-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  color: #64748b;
  font-weight: 600;
  user-select: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dark .text-size-slider-container .size-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.text-size-slider-container .size-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
  color: #334155;
}

.dark .text-size-slider-container .size-icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

.text-size-slider-container .size-icon-btn:active {
  transform: scale(0.95);
}

.text-size-slider-container .size-icon-small {
  font-size: 12px;
  width: 28px;
  height: 28px;
}

.text-size-slider-container .size-icon-large {
  font-size: 17px;
  width: 28px;
  height: 28px;
}

#text-size-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  background: linear-gradient(90deg, #e2e8f0, #cbd5e1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.dark #text-size-slider {
  background: linear-gradient(90deg, #334155, #475569);
}

#text-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: linear-gradient(145deg, #60a5fa, #3b82f6);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5), 0 0 0 3px rgba(96, 165, 250, 0.2);
  transition: all 0.2s ease;
}

#text-size-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6), 0 0 0 4px rgba(96, 165, 250, 0.3);
}

#text-size-slider::-webkit-slider-thumb:active {
  transform: scale(0.95);
}

#text-size-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: linear-gradient(145deg, #60a5fa, #3b82f6);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.5), 0 0 0 3px rgba(96, 165, 250, 0.2);
  transition: all 0.2s ease;
}

#text-size-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

.text-size-reset {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.dark .text-size-reset {
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.text-size-reset:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
  border-color: rgba(0, 0, 0, 0.2);
}

.dark .text-size-reset:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.2);
}

.text-size-reset:active {
  transform: scale(0.98);
}

.text-size-reset .reset-full {
  display: inline;
}

.text-size-reset .reset-short {
  display: none;
}

@media (max-width: 768px) {
  .text-size-reset {
    width: auto;
    min-width: 60px;
    padding: 8px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  .text-size-reset .reset-full {
    display: none;
  }

  .text-size-reset .reset-short {
    display: inline;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
  }

  .dark .text-size-reset .reset-short {
    color: #60a5fa;
  }
}

/* =====================================================================
   PREMIUM CHATBOT ENTRANCE ANIMATION
   ===================================================================== */

/* Main entrance: subtle rise + fade-in + very light scale */
@keyframes chatbotCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.975);
    filter: blur(2px);
  }
  60% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Apply the card entrance animation to the chatbot container */
#main-content > .layout-content-container > .relative.flex-1.flex.flex-col {
  animation: chatbotCardEntrance 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Privacy notice gentle fade-in from below */
@keyframes privacyFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Privacy notice fade-in with delay */
#privacy-notice {
  min-height: 2.25rem;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  animation: privacyFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}

body.chatbot-intro-sequence-pending #privacy-notice {
  opacity: 0;
  visibility: hidden;
  animation: none !important;
}

@media (max-width: 768px) {
  #privacy-notice {
    min-height: 3.75rem;
  }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  #main-content > .layout-content-container > .relative.flex-1.flex.flex-col,
  #privacy-notice,
  #chatbot-shell {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   PREMIUM CHATBOT INITIAL ELEMENTS ANIMATIONS
   ===================================================================== */
@keyframes botScaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes botFadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-bot-icon {
  animation: botScaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.1s;
}

.animate-bot-bubble {
  animation: botBubbleLiftIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.25s;
}

.animate-bot-suggestions {
  animation: botSuggestionsLiftIn 0.88s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.4s;
}

@keyframes botBubbleLiftIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes botSuggestionsLiftIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@media (max-width: 639px) {
  #chat-messages {
    min-height: 0;
  }

  #chatbot-intro-stage {
    min-height: 0;
  }

  #initial-bot-bubble {
    max-width: 92% !important;
  }

  #example-questions-panel,
  #example-questions-panel.is-collapsed {
    width: 92% !important;
    max-width: 92% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #chat-messages {
    transition: none !important;
  }

  .animate-bot-icon,
  .animate-bot-bubble,
  .animate-bot-suggestions {
    animation: none !important;
  }

  #example-questions-panel.is-transitioning #example-questions-content,
  #example-questions-panel.is-transitioning #example-questions-content .example-question {
    animation: none !important;
  }
}

/* Animaciones del selector de idiomas globales */
#language-dropdown,
#language-dropdown-custom {
  transform-origin: top right;
}

#selected-language img,
#selected-language-mobile img,
#language-dropdown img,
#language-dropdown-custom img,
.lang-option img {
  display: block;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1rem;
  object-fit: contain;
  object-position: center;
}

#language-dropdown:not(.hidden),
#language-dropdown-custom:not(.hidden) {
  animation: langDropdownScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#language-dropdown:not(.hidden) a,
#language-dropdown-custom:not(.hidden) a {
  animation: langOptionFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#language-dropdown:not(.hidden) a:nth-child(1), #language-dropdown-custom:not(.hidden) a:nth-child(1) { animation-delay: 0.05s; }
#language-dropdown:not(.hidden) a:nth-child(2), #language-dropdown-custom:not(.hidden) a:nth-child(2) { animation-delay: 0.1s; }
#language-dropdown:not(.hidden) a:nth-child(3), #language-dropdown-custom:not(.hidden) a:nth-child(3) { animation-delay: 0.15s; }
#language-dropdown:not(.hidden) a:nth-child(4), #language-dropdown-custom:not(.hidden) a:nth-child(4) { animation-delay: 0.2s; }
#language-dropdown:not(.hidden) a:nth-child(5), #language-dropdown-custom:not(.hidden) a:nth-child(5) { animation-delay: 0.25s; }

@keyframes langDropdownScaleIn {
  0% {
    opacity: 0;
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes langOptionFadeIn {
  0% {
    opacity: 0;
    transform: none;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
