* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica", "Arial", sans-serif;
  background-color: #f5f5f5;
  color: #2e2e38;
}

.app-container {
  display: flex;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logo .header-breadcrumb {
  width: 100%;
  margin-left: 43px;
  margin-top: -2px;
}

.logo .header-breadcrumb .breadcrumb-home-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.header-logo {
  background-color: #1a1a24;
  border-color: #000;
  border-style: none;
  border-width: 0;
  display: flex;
  height: 2.8571428571rem;
  min-width: 2.8571428571rem;
  width: 2.8571428571rem;
}

.header-logo a {
  display: inline-flex;
  height: 100%;
  padding: 0.3571428571rem 5px;
  text-decoration: none;
  width: 100%;
  align-items: center;
  border-radius: 0.1785714286rem;
  box-sizing: border-box;
  justify-content: center;
}

.app-title {
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Header Nav Tabs ── */
.header-nav-tabs {
  display: flex;
  gap: 0;
  align-self: flex-end;
  margin-bottom: -1px;
  width: 100%;
  margin-top: 10px;
}
.header-nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 30px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.015em;
  text-decoration: none;
  color: #747480;
  border: 1px solid #d0d0d6;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 6px 6px 0 0;
  background: #e8e8ee;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  cursor: pointer;
  position: relative;
  min-width: 170px;
}
.header-nav-tab + .header-nav-tab {
  margin-left: -1px;
}
.header-nav-tab:hover {
  color: #2e2e38;
  background: #f0f0f4;
}
.header-nav-tab.active {
  color: #2e2e38;
  background: #ffffff;
  border: 1px solid #d0d0d6;
  border-bottom: 1px solid #ffffff;
  font-weight: 600;
  z-index: 1;
}
body.dark .header-nav-tab {
  color: #999;
  background: #2e2e3a;
  border-color: #444;
  border-bottom-color: #333;
}
body.dark .header-nav-tab:hover {
  color: #d0d0d8;
  background: #363645;
}
body.dark .header-nav-tab.active {
  color: #ffe600;
  background: #23232f;
  border-color: #444;
  border-bottom-color: #23232f;
  font-weight: 600;
}

.icon {
  font-size: 20px;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Top Header */
.top-header {
  background-color: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #999;
}

.header-breadcrumb a {
  color: #747480;
  text-decoration: none;
}

.header-breadcrumb a:hover {
  color: #2e2e38;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #747480;
}

.breadcrumb a {
  color: #747480;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #2e2e38;
}

.separator {
  color: #c4c4c4;
}

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

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-label {
  font-size: 14px;
  color: #747480;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2e2e38;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.more-menu {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #747480;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Settings Container */
.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  width: 100%;
}

.settings-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #2e2e38;
  margin-top: 25px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 32px;
}

.tab {
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 15px;
  color: #747480;
  cursor: pointer;
  position: relative;
  font-weight: 500;
}

.tab.active {
  color: #2e2e38;
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #2e2e38;
}

/* Tabs — Dark Mode */
body.dark .tabs {
  border-bottom-color: #3a3a48;
}
body.dark .tab {
  color: #94a3b8;
}
body.dark .tab:hover {
  color: #e0e0e0;
}
body.dark .tab.active {
  color: #ffe600;
}
body.dark .tab.active::after {
  background-color: #ffe600;
}

/* Profile Image Section */
.profile-image-section {
  position: relative;
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
}

.profile-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

/* Personal Info */
.personal-info {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2e2e38;
}

.section-description {
  font-size: 14px;
  color: #747480;
  margin-bottom: 24px;
}

.info-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: #747480;
  font-size: 18px;
}

.form-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  color: #2e2e38;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #2e2e38;
}

.form-input::placeholder {
  color: #c4c4c4;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-secondary {
  background-color: #f5f5f5;
  color: #2e2e38;
  border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
  background-color: #ebebeb;
}

.btn-primary {
  background-color: #2e2e38;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1e1e28;
}

.btn-primary:disabled {
  background-color: #9e9ea8;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Design Section */
.design-section {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 12px;
}

.section-label {
  font-size: 12px;
  color: #747480;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.design-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2e2e38;
}

.design-description {
  font-size: 14px;
  color: #747480;
  line-height: 1.6;
}

footer {
  background-color: #fff;
  border-color: #e6e6e9;
  border-width: 1px 0 0 0;
  padding-top: 0.7142857143rem;
  padding-right: 2.2857142857rem;
  padding-bottom: 0.7142857143rem;
  padding-left: 2.2857142857rem;
  color: #2e2e38;
}

.text-link {
  color: #2e2e38;
  display: inline-flex;
  font-style: normal;
  background: transparent;
  outline: none;
  position: relative;
  text-decoration: none;
  align-items: center;
  border: none;
  padding: 0px;
  border-radius: 2px;
  font-size: 14px;
}

.body-3-light {
  font-weight: 300;
  font-size: 0.857rem;
}

.mt-5 {
  margin-top: 5px;
}

/* ETR Dashboard */
.etr-dashboard {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  margin-bottom: 40px;
}

.chart-container {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 24px;
  min-height: 360px;
  position: relative;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2e2e38;
}

.chart-wrapper {
  position: relative;
  height: 500px;
}

.sidebar-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: #2e2e38;
  margin: 0;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #2e2e38;
  background-color: #fff;
  outline: none;
}

.search-input:focus {
  border-color: #2e2e38;
}

.btn-add {
  width: 100%;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.ticker-item:last-child {
  border-bottom: none;
}

.ticker-symbol {
  font-weight: 600;
  font-size: 14px;
  color: #2e2e38;
  min-width: 50px;
}

.ticker-name {
  font-size: 13px;
  color: #747480;
  flex: 1;
}

.ticker-remove {
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.ticker-remove:hover {
  color: #e74c3c;
}

.disclaimer-banner {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 4px;
  font-size: 0.82em;
  line-height: 1.5;
  color: #92400e;
}

/* Dark Mode */
body.dark {
  background-color: #1a1a24;
  color: #e0e0e0;
  --log-bg: #1e1e2e;
  --log-fg: #94a3b8;
}

body.dark .top-header {
  background-color: #23232f;
  border-bottom-color: #333;
}

body.dark .header-breadcrumb {
  color: #777;
}

body.dark .header-breadcrumb a {
  color: #999;
}

body.dark .header-breadcrumb a:hover {
  color: #ffe600;
}

body.dark .breadcrumb a,
body.dark .breadcrumb {
  color: #999;
}

body.dark .breadcrumb a:hover {
  color: #e0e0e0;
}

body.dark .breadcrumb-home-icon {
  filter: invert(1);
}

body.dark .separator {
  color: #555;
}

body.dark .settings-title {
  color: #e0e0e0;
}

body.dark .personal-info,
body.dark .design-section {
  background-color: #23232f;
}

body.dark .section-title,
body.dark .design-title {
  color: #e0e0e0;
}

body.dark .section-description,
body.dark .design-description,
body.dark .section-label {
  color: #999;
}

body.dark .btn-primary {
  background-color: #ffe600;
  color: #1a1a24;
}

body.dark .btn-primary:hover {
  background-color: #e6cf00;
}

body.dark .btn-primary:disabled {
  background-color: #444;
  color: #ccc;
  opacity: 0.7;
}

body.dark .disclaimer-banner {
  background: #2a2518;
  border-left-color: #b45309;
  color: #fbbf24;
}

body.dark .btn-secondary {
  background-color: #2e2e38;
  color: #e0e0e0;
  border-color: #444;
}

body.dark .btn-secondary:hover {
  background-color: #3a3a48;
}

body.dark .form-input {
  background-color: #2e2e38;
  border-color: #444;
  color: #e0e0e0;
}

body.dark .form-input:focus {
  border-color: #ffe600;
}

body.dark footer {
  background-color: #23232f;
  border-color: #333;
  color: #e0e0e0;
}

body.dark .text-link {
  color: #e0e0e0;
}

body.dark .ey-footer-text {
  fill: #ffffff;
}


body.dark .toggle-label {
  color: #999;
}

body.dark .slider {
  background-color: #4a4a5a;
}

body.dark input:checked + .slider {
  background-color: #555;
}

body.dark .app-title {
  color: #e0e0e0;
}

body.dark .chart-container,
body.dark .panel {
  background-color: #23232f;
}

body.dark .chart-title {
  color: #e0e0e0;
}

body.dark .panel-title {
  color: #e0e0e0;
}

body.dark .search-input {
  background-color: #2e2e38;
  border-color: #444;
  color: #e0e0e0;
}

body.dark .search-input:focus {
  border-color: #ffe600;
}

body.dark .ticker-symbol {
  color: #e0e0e0;
}

body.dark .ticker-name {
  color: #999;
}

body.dark .ticker-item {
  border-bottom-color: #333;
}

body.dark .ticker-remove {
  color: #666;
}

body.dark .ticker-remove:hover {
  color: #e74c3c;
}

/* ═══════════════════════════════════════════════════════ */
/* Ask Tammy - Chat Widget                               */
/* ═══════════════════════════════════════════════════════ */

/* Floating Orb Button */
.ai-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe600, #2e2e38);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 230, 0, 0.4);
  animation: tammy-pulse 2s infinite;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.2s;
}

.ai-chat-btn:hover {
  transform: scale(1.1);
}

.ai-chat-btn svg {
  width: 24px;
  height: 24px;
  color: white;
}

.ai-chat-btn .btn-text {
  font-size: 0.5rem;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@keyframes tammy-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 230, 0, 0.4); }
  50% { box-shadow: 0 0 35px rgba(46, 46, 56, 0.6); }
}

/* Chat Box */
.chat-box {
  position: fixed;
  bottom: 112px;
  right: 24px;
  width: 480px;
  height: 700px;
  min-width: 380px;
  min-height: 450px;
  max-width: 90vw;
  max-height: calc(100vh - 140px);
  background: rgba(35, 35, 47, 0.98);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 998;
  resize: both;
}

.chat-box::-webkit-resizer {
  background: linear-gradient(135deg, #ffe600, #2e2e38);
  border-radius: 4px;
}

.chat-box.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Full-page chat mode (used by index_tammy.html) */
body.tammy-fullpage .ai-chat-btn { display: none; }
body.tammy-fullpage .chat-box {
  top: 0; left: 0; bottom: 0; right: 0;
  width: 100vw; height: 100vh;
  max-width: 100vw; max-height: 100vh;
  min-width: 0; min-height: 0;
  border-radius: 0; border: none;
  box-shadow: none; resize: none;
  transform: none;
}
body.tammy-fullpage .chat-box.active { transform: none; }
body.tammy-fullpage .chat-box .chat-messages { font-size: 0.82rem; }

.chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.1), rgba(46, 46, 56, 0.3));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe600, #2e2e38);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-avatar svg {
  width: 20px;
  height: 20px;
  color: white;
}

.chat-info h3 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 2px;
}

.chat-info span {
  font-size: 0.75rem;
  color: #10b981;
  transition: color 0.3s;
}

.chat-info span.status-busy {
  animation: status-pulse 1.2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-maximize {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-maximize:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.chat-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Maximized chat box */
.chat-box.maximized {
  bottom: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  resize: none;
}

.chat-product-select {
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-product-select select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.85rem;
  outline: none;
}

.chat-product-select select:focus {
  border-color: #ffe600;
}

.chat-product-select select option {
  background: #23232f;
  color: #e0e0e0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.chat-message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.chat-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe600, #2e2e38);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-message-avatar svg {
  width: 14px;
  height: 14px;
  color: white;
}

.chat-message-content {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  border-top-left-radius: 4px;
  padding: 12px 16px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e2e8f0;
  max-width: 85%;
}

.chat-input {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 8px;
}

.chat-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 16px;
  color: #e2e8f0;
  font-size: 0.85rem;
  outline: none;
}

.chat-input input:focus {
  border-color: #ffe600;
}

.chat-input input::placeholder {
  color: #64748b;
}

.chat-input button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffe600, #2e2e38);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input button:hover {
  opacity: 0.9;
}

/* Department Gate Overlay */
.chat-dept-gate {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(30, 30, 42, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 0 0 16px 16px;
}

.dept-gate-inner {
  text-align: center;
  padding: 24px;
  color: #e2e8f0;
  width: 100%;
  max-width: 280px;
}

.dept-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.95em;
  outline: none;
  text-align: center;
}

.dept-input:focus {
  border-color: #ffe600;
  box-shadow: 0 0 0 2px rgba(255, 230, 0, 0.15);
}

.dept-input::placeholder {
  color: #94a3b8;
}

.chat-sources {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.78rem;
  color: #94a3b8;
}

.chat-sources summary {
  cursor: pointer;
  font-weight: 500;
  color: #ffe600;
}

.chat-source-item {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-source-item:last-child {
  border-bottom: none;
}

.chat-source-item a {
  color: #ffe600;
  text-decoration: none;
}

.chat-source-item a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .settings-container {
    padding: 20px 16px;
  }

  .profile-image {
    height: 200px;
  }

  .tabs {
    gap: 16px;
  }

  .tab {
    font-size: 14px;
  }

  .etr-dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .etr-dashboard {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════ */
/* Admin: Embedding / Ingestion Section                   */
/* ═══════════════════════════════════════════════════════ */
.embed-label {
  font-size: 13px;
  font-weight: 500;
  color: #747480;
  margin-bottom: 6px;
  display: block;
}

.embed-status-panel {
  margin-top: 20px;
  padding: 16px;
  background: #f7f7f8;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
}

.embed-status-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.embed-status-icon {
  font-size: 18px;
}

.embed-status-text {
  font-size: 14px;
  font-weight: 500;
  color: #2e2e38;
}

.embed-progress-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.embed-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffe600, #2e2e38);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.embed-log {
  max-height: 180px;
  overflow-y: auto;
  font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #555;
  background: var(--log-bg, #f0f0f2);
  padding: 10px 12px;
  border-radius: 6px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── File Upload Area ──────────────────────────────── */
.upload-drop-zone {
  border: 2px dashed #c0c0c8;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #fafafb;
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
  border-color: #ffe600;
  background: #fffef0;
}
.upload-drop-icon { font-size: 28px; margin-bottom: 4px; }
.upload-drop-text { font-size: 13px; color: #555; }
.upload-drop-text a { color: #2e2e38; font-weight: 600; text-decoration: underline; }
.upload-drop-hint { font-size: 11px; color: #999; margin-top: 4px; }
.upload-file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f0f0f2;
  border-radius: 6px;
  font-size: 12px;
}
.upload-file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #2e2e38;
}
.upload-file-item .file-size {
  color: #888;
  margin: 0 10px;
  white-space: nowrap;
}
.upload-file-item .file-remove {
  cursor: pointer;
  color: #c00;
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
}
.upload-status {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'SF Mono', 'Consolas', monospace;
  white-space: pre-wrap;
}
.upload-status.success { background: #e6f9ed; color: #0a6b2e; }
.upload-status.error   { background: #fde8e8; color: #b91c1c; }
.upload-status.info    { background: #f0f0f2; color: #555; }

/* Dark mode overrides */
body.dark .upload-drop-zone {
  background: #1e1e2e;
  border-color: #444;
}
body.dark .upload-drop-zone:hover,
body.dark .upload-drop-zone.drag-over {
  border-color: #ffe600;
  background: #2a2a1e;
}
body.dark .upload-drop-text { color: #ccc; }
body.dark .upload-drop-text a { color: #ffe600; }
body.dark .upload-drop-hint { color: #777; }
body.dark .upload-file-item { background: #16161e; }
body.dark .upload-file-item .file-name { color: #e0e0e0; }
body.dark .upload-status.success { background: #0a2e1a; color: #6ee7a8; }
body.dark .upload-status.error   { background: #2e0a0a; color: #fca5a5; }
body.dark .upload-status.info    { background: #1e1e2e; color: #94a3b8; }

/* Dark mode overrides */
body.dark .embed-status-panel {
  background: #1e1e2e;
  border-color: #333;
}

body.dark .embed-status-text {
  color: #e0e0e0;
}

body.dark .embed-label {
  color: #999;
}

body.dark .embed-progress-bar {
  background: #333;
}

body.dark .embed-log {
  background: #16161e;
  color: #94a3b8;
}

/* ═══════════════════════════════════════════════════ */
/* Tab Content                                        */
/* ═══════════════════════════════════════════════════ */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* ═══════════════════════════════════════════════════ */
/* PDF Extractor                                      */
/* ═══════════════════════════════════════════════════ */
.pdf-upload-zone {
  border: 2px dashed #c5c5d0;
  border-radius: 12px;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-top: 16px;
}
.pdf-upload-zone:hover,
.pdf-upload-zone.drag-over {
  border-color: #ffe600;
  background: rgba(255, 230, 0, 0.04);
}
.pdf-upload-icon {
  color: #747480;
  margin-bottom: 12px;
}
.pdf-upload-text {
  font-size: 1rem;
  color: #555;
  margin-bottom: 4px;
}
.pdf-upload-text a {
  color: #2e2e38;
  font-weight: 600;
  text-decoration: underline;
}
.pdf-upload-hint {
  font-size: 0.82rem;
  color: #999;
}

/* Spinner */
.pdf-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0,0,0,0.1);
  border-top-color: #ffe600;
  border-radius: 50%;
  animation: pdf-spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes pdf-spin {
  to { transform: rotate(360deg); }
}

/* Result Card */
.pdf-result-card {
  margin-bottom: 16px;
}

/* Stats Row */
.pdf-result-stats {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}
.pdf-stat {
  flex: 1;
  background: #f0f0f5;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.pdf-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #2e2e38;
}
.pdf-stat-label {
  display: block;
  font-size: 0.8rem;
  color: #747480;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Download Row */
.pdf-download-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.pdf-format-select {
  flex: 1;
  max-width: 200px;
}

/* ═══════════════════════════════════════════════════ */
/* PDF Extractor — Dark Mode                          */
/* ═══════════════════════════════════════════════════ */
body.dark .pdf-upload-zone {
  border-color: #444;
}
body.dark .pdf-upload-zone:hover,
body.dark .pdf-upload-zone.drag-over {
  border-color: #ffe600;
  background: rgba(255, 230, 0, 0.06);
}
body.dark .pdf-upload-icon { color: #94a3b8; }
body.dark .pdf-upload-text { color: #c5c5d0; }
body.dark .pdf-upload-text a { color: #ffe600; }
body.dark .pdf-upload-hint { color: #666; }
body.dark .pdf-spinner { border-color: rgba(255,255,255,0.1); border-top-color: #ffe600; }
body.dark .pdf-stat { background: #1e1e2e; }
body.dark .pdf-stat-value { color: #e0e0e0; }
body.dark .pdf-stat-label { color: #94a3b8; }

/* ─── Answer Points with Rating Buttons ──────────────────────────────────── */
.answer-points { display: flex; flex-direction: column; gap: 6px; }

.answer-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: opacity 0.2s, border-color 0.2s, background 0.2s;
}
.answer-point .point-text { flex: 1; line-height: 1.5; }
.answer-point .point-rating {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  align-items: center;
}

.rate-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75em;
  padding: 2px 5px;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
}
.rate-btn:hover { opacity: 1; transform: scale(1.15); }
.rate-btn.active { opacity: 1; background: rgba(255,255,255,0.12); }
.rate-btn.rate-up.active { border-color: #10b981; background: rgba(16,185,129,0.15); }
.rate-btn.rate-neutral.active { border-color: #f59e0b; background: rgba(245,158,11,0.15); }
.rate-btn.rate-down.active { border-color: #ef4444; background: rgba(239,68,68,0.15); }

.answer-point.rated-up { border-left-color: #10b981; }
.answer-point.rated-neutral { border-left-color: #f59e0b; }
.answer-point.rated-down { border-left-color: #ef4444; }
.answer-point-hidden {
  opacity: 0.3;
  text-decoration: line-through;
  pointer-events: auto;
}

/* Admin toggle in chat product bar */
.admin-toggle {
  display: inline-flex;
  align-items: center;
  color: #94a3b8;
  font-size: 0.8em;
}
.admin-toggle input[type="checkbox"] {
  accent-color: #ffe600;
}

/* ═══════════════════════════════════════════════════════ */
/* Official Answers Tab                                   */
/* ═══════════════════════════════════════════════════════ */

.oqa-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.oqa-filters {
  display: flex;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
}
.oqa-filter-select {
  max-width: 180px;
  padding-left: 12px !important;
  font-size: 0.82em;
}
.oqa-search-wrap { flex: 1; min-width: 180px; }
.oqa-search-input { padding-left: 14px !important; font-size: 0.82em; }
.oqa-toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.oqa-toolbar-status {
  margin-top: 8px;
  font-size: 0.85em;
  padding: 4px 0;
}

/* Edit panel */
.oqa-edit-panel { margin-bottom: 0; font-size: 0.88em; }
.oqa-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.oqa-close-btn {
  font-size: 22px;
  line-height: 1;
  padding: 4px 10px;
  border: none;
  background: none;
  cursor: pointer;
  color: #747480;
}
.oqa-close-btn:hover { color: #2e2e38; }
body.dark .oqa-close-btn { color: #999; }
body.dark .oqa-close-btn:hover { color: #e0e0e0; }
.oqa-status-radios {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 4px;
}
.oqa-radio {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 14px;
}
.oqa-radio input[type="radio"] { accent-color: #2e2e38; }
body.dark .oqa-radio input[type="radio"] { accent-color: #ffe600; }
.oqa-edit-actions { display: flex; gap: 10px; align-items: center; }
.oqa-edit-meta {
  font-size: 0.82em;
  color: #747480;
  margin-left: auto;
}

/* Badges */
.oqa-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78em;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}
.oqa-badge-active { background: #dcfce7; color: #166534; }
.oqa-badge-draft { background: #fef3c7; color: #92400e; }
.oqa-badge-deprecated { background: #f3f4f6; color: #6b7280; }
body.dark .oqa-badge-active { background: #14532d; color: #86efac; }
body.dark .oqa-badge-draft { background: #451a03; color: #fbbf24; }
body.dark .oqa-badge-deprecated { background: #374151; color: #9ca3af; }

/* Data table */
.oqa-table-section { padding: 16px 32px 24px; }
.oqa-table-wrap { overflow-x: auto; }
.oqa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78em;
  line-height: 1.4;
}
.oqa-th {
  text-align: left;
  padding: 7px 6px;
  font-weight: 600;
  font-size: 0.92em;
  border-bottom: 2px solid #e0e0e0;
  color: #2e2e38;
  white-space: nowrap;
  user-select: none;
}
body.dark .oqa-th {
  color: #e0e0e0;
  border-bottom-color: #444;
}
.oqa-td {
  padding: 6px 6px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  color: #2e2e38;
}
body.dark .oqa-td {
  color: #d0d0d8;
  border-bottom-color: #333;
}
.oqa-row { cursor: pointer; transition: background 0.1s; }
.oqa-row:hover { background: #f9fafb; }
body.dark .oqa-row:hover { background: #2e2e3a; }
.oqa-td-question, .oqa-td-answer {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oqa-td-date { white-space: nowrap; font-size: 0.88em; color: #747480; }
.oqa-td-actions { white-space: nowrap; }
.oqa-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #747480;
  transition: color 0.15s, background 0.15s;
}
.oqa-action-btn:hover { color: #2e2e38; background: #f0f0f0; }
body.dark .oqa-action-btn { color: #888; }
body.dark .oqa-action-btn:hover { color: #ffe600; background: #3a3a48; }
.oqa-empty {
  padding: 32px 8px;
  text-align: center;
  color: #999;
  font-size: 0.92em;
}

/* Pagination */
.oqa-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.oqa-page-info { font-size: 0.82em; color: #747480; margin-right: 8px; }
.oqa-page-btn {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.82em;
  cursor: pointer;
  color: #2e2e38;
}
.oqa-page-btn:hover { background: #f0f0f0; }
.oqa-page-active {
  background: #2e2e38;
  color: #fff;
  border-color: #2e2e38;
}
.oqa-page-active:hover { background: #1e1e28; }
body.dark .oqa-page-btn {
  border-color: #444;
  color: #d0d0d8;
}
body.dark .oqa-page-btn:hover { background: #3a3a48; }
body.dark .oqa-page-active {
  background: #ffe600;
  color: #1a1a24;
  border-color: #ffe600;
}
body.dark .oqa-page-active:hover { background: #e6cf00; }
