﻿:root {
  --bg-deep: #0c0e14;
  --bg-surface: #13161f;
  --bg-card: #1a1e2a;
  --bg-card-hover: #1f2435;
  --bg-elevated: #252a3a;
  --border: #2a2f42;
  --border-light: #353b52;
  --text-primary: #e8eaf0;
  --text-secondary: #8b90a5;
  --text-muted: #5c6180;
  --accent: #4f8cff;
  --accent-glow: rgba(79, 140, 255, 0.15);
  --accent-bright: #6fa0ff;
  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.1);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --purple: #a78bfa;
  --purple-bg: rgba(167, 139, 250, 0.1);
  --w-bg: #ffffff;
  --w-surface: #f4f6f9;
  --w-border: #e2e6ee;
  --w-text: #1a1d26;
  --w-text-secondary: #6b7280;
  --w-accent: #4f8cff;
  --w-bubble-ai: #f0f4ff;
  --w-bubble-user: #4f8cff;
}

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

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

.demo-switcher {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--bg-deep) 60%, transparent);
}

.demo-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
  align-self: center;
  margin-right: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.demo-tab {
  font-family: "DM Sans", sans-serif;
  padding: 8px 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.demo-tab:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.demo-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard {
  display: grid;
  grid-template-columns: 25% 40% 35%;
  grid-template-rows: 60px 1fr;
  height: 100vh;
  padding-top: 0;
}

.topbar {
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.topbar-logo {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent-bright), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.topbar-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
}

.topbar-nav {
  display: flex;
  gap: 4px;
}

.topbar-nav a {
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.topbar-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.topbar-nav a.active {
  color: var(--accent-bright);
  background: var(--accent-glow);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-profile-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border-radius: 20px;
  background: var(--orange-bg);
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
}

.topbar-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 2s infinite;
}

.topbar-badge.is-ok {
  background: var(--green-bg);
  color: var(--green);
}

.topbar-badge.is-ok .dot {
  background: var(--green);
}

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

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  overflow: visible;
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.topbar-avatar span {
  line-height: 1;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sidebar-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.sidebar-filters {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: "DM Sans", sans-serif;
}

.filter-chip:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.sidebar-search-wrap {
  padding: 0 16px 10px 16px;
}

.sidebar-search-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.sidebar-search-input::placeholder {
  color: var(--text-muted);
}

.sidebar-search-input:focus {
  border-color: var(--accent);
}

.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.conv-item {
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.conv-item:hover {
  background: var(--bg-card);
}

.conv-item.active {
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.conv-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.conv-item-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.conv-item-time {
  font-size: 11px;
  color: var(--text-muted);
}

.conv-item-preview {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-tag.ai {
  background: var(--green-bg);
  color: var(--green);
}

.status-tag.handoff {
  background: var(--orange-bg);
  color: var(--orange);
}

.status-tag.support {
  background: var(--purple-bg);
  color: var(--purple);
}

.status-tag.closed {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.priority-dot.high {
  background: var(--red);
}

.priority-dot.medium {
  background: var(--orange);
}

.priority-dot.low {
  background: var(--green);
}
.transcript-panel {
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.transcript-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
}

.transcript-header-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.transcript-header-top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.transcript-conv-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent-bright);
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.transcript-subject {
  min-width: 0;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transcript-issue-summary {
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transcript-status {
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.transcript-assignee {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
}

.transcript-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overscroll-behavior: contain;
}

.msg {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msgIn 0.2s ease;
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@keyframes msgIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.msg.user {
  align-self: flex-end;
}

.msg.ai {
  align-self: flex-start;
}

.msg.system {
  align-self: center;
}

.msg.user.operator {
  align-self: flex-start;
}

.msg-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-sender .ai-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.msg.user .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.ai .msg-bubble {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg.system .msg-bubble {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
}

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
}

.msg.user .msg-time {
  text-align: right;
}

.sources-panel {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.sources-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.source-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

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

.source-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.source-text {
  color: var(--text-secondary);
  line-height: 1.4;
}

.source-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.transcript-actions {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.transcript-input {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.transcript-input-field {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  outline: none;
}

.transcript-input-field::placeholder {
  color: var(--text-muted);
}

.transcript-input-field:focus {
  border-color: var(--accent);
}

.support-shortcut-hints {
  padding: 0 20px 10px;
  background: var(--bg-surface);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.support-shortcut-chip {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}

.support-shortcut-chip:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.shortcut-row-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.shortcut-action-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  padding: 6px;
  display: none;
  z-index: 20;
}

.shortcut-action-menu.open {
  display: block;
}

.shortcut-action-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.shortcut-action-menu button:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.widget-rating-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.widget-rating-option {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.widget-rating-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow) inset;
}

.widget-rating-face {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.widget-rating-option.good .widget-rating-face { background: #56d661; }
.widget-rating-option.medium .widget-rating-face { background: #e2c13a; }
.widget-rating-option.bad .widget-rating-face { background: #ef5a5a; }

.rating-system-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  min-width: 240px;
}

.rating-system-face {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.rating-system-face.good { background: #56d661; }
.rating-system-face.medium { background: #e2c13a; }
.rating-system-face.bad { background: #ef5a5a; }

.rating-system-title {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.rating-system-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.action-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  transition: all 0.15s;
}

.action-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.action-btn.primary:hover {
  background: var(--accent-bright);
}

.action-btn.danger {
  color: var(--red);
}

.action-btn.danger:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

.detail-panel {
  background: var(--bg-surface);
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--border);
  min-height: 0;
}

.detail-section h3 {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.detail-kv {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 10px;
  font-size: 12px;
}

.detail-kv dt {
  color: var(--text-muted);
}

.detail-kv dd {
  color: var(--text-primary);
}

.summary-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
}

.summary-card h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-bright);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.summary-card p,
.summary-card li {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.summary-card ul {
  padding-left: 16px;
  margin-top: 4px;
}

.summary-card li {
  margin-bottom: 3px;
}

.summary-card .summary-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi-value {
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 10px;
  color: var(--green);
}

.kpi-sub.warn {
  color: var(--orange);
}

.ai-config-page {
  grid-column: 1 / -1;
  overflow-y: auto;
  padding: 28px 36px;
  display: none;
}

.ai-config-page.active {
  display: block !important;
}

.config-header {
  margin-bottom: 28px;
}

.config-header h2 {
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.config-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 100%;
  width: 100%;
  align-items: start;
}

.config-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  transition: border-color 0.15s;
}

.config-card:hover {
  border-color: var(--border-light);
}

.config-card.full-width {
  grid-column: 1 / -1;
}

#aiConfigPage .config-grid .ai-card-profile {
  grid-column: 1;
  grid-row: 2;
}

#aiConfigPage .config-grid .ai-card-rag {
  grid-column: 2;
  grid-row: 2 / span 2;
}

#aiConfigPage .config-grid .ai-card-limits {
  grid-column: 1;
  grid-row: 3;
}

@media (max-width: 1200px) {
  #aiConfigPage .config-grid .ai-card-profile,
  #aiConfigPage .config-grid .ai-card-rag,
  #aiConfigPage .config-grid .ai-card-limits {
    grid-column: auto;
    grid-row: auto;
  }
}

.config-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.config-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.config-card-icon.blue {
  background: var(--accent-glow);
}

.config-card-icon.green {
  background: var(--green-bg);
}

.config-card-icon.orange {
  background: var(--orange-bg);
}

.config-card-icon.purple {
  background: var(--purple-bg);
}

.config-card-icon.red {
  background: var(--red-bg);
}

.config-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.config-card-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Reports page: tabs + topics view + compact general charts */
.reports-subtabs {
  display: flex;
  gap: 8px;
  margin: 2px 0 16px;
  flex-wrap: wrap;
}

.reports-subtab {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.reports-subtab.active {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.08);
}

.reports-subpanel {
  display: none;
}

.reports-subpanel.active {
  display: block;
}

.reports-general-kpi-row {
  max-width: 1200px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
}

#reportsPage .reports-general-grid {
  max-width: 1200px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px !important;
}

#reportsPage .reports-general-grid .config-card {
  padding: 12px;
}

#reportsPage .reports-general-grid canvas {
  display: block;
  width: 520px !important;
  height: 156px !important;
  max-width: 100%;
  margin: 0 auto;
}

.reports-topics-hero {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 24px 18px;
  margin-bottom: 18px;
  background: linear-gradient(160deg, #121733 0%, #0f132b 58%, #141025 100%);
}

.reports-topics-title {
  color: #a38bff;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 10px;
}

.reports-topics-subtitle {
  color: #8f9bb4;
  font-size: 14px;
}

.reports-topics-kpi-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.reports-topics-kpi-row-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reports-topics-kpi-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 14px 12px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.reports-topics-kpi-value {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  color: #90a0ff;
}

.reports-topics-kpi-value.green { color: #20d49e; }
.reports-topics-kpi-value.orange { color: #f7b62c; }
.reports-topics-kpi-value.pink { color: #f34eb2; }
.reports-topics-kpi-value.cyan { color: #22c8e8; }
.reports-topics-kpi-value.purple { color: #a56bff; }
.reports-topics-kpi-value.red { color: #ff5a5f; }

.reports-topics-kpi-label {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.reports-topics-section {
  margin-bottom: 18px;
}

.reports-topics-section h3 {
  margin: 0 0 8px;
  font-size: 30px;
}

.reports-topics-section p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.reports-topics-empty {
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 12px;
}

.reports-topics-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reports-topics-category-row {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 14px;
}

.reports-topics-category-label {
  color: var(--text-primary);
  font-size: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reports-topics-category-bar-wrap {
  height: 35px;
  border-radius: 10px;
  background: rgba(126, 133, 173, 0.18);
  overflow: hidden;
  border: 1px solid rgba(126, 133, 173, 0.2);
  position: relative;
}

.reports-topics-category-bar {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.reports-topics-category-percent {
  color: var(--text-muted);
  font-size: 20px;
  text-align: right;
}

.reports-topics-chart-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 10px 14px;
}

#reportsTopicsConversationsChart {
  display: block;
  width: 100% !important;
  height: 210px !important;
  max-width: 100%;
}

.reports-topics-heatmap {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 12px;
  overflow-x: auto;
}

.reports-topics-heatmap-grid {
  display: grid;
  grid-template-columns: 64px repeat(24, 1fr);
  gap: 4px;
  min-width: 880px;
}

.reports-topics-heatmap-cell {
  min-height: 21px;
  border-radius: 5px;
  background: rgba(107, 114, 128, 0.12);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

.reports-topics-heatmap-label {
  color: var(--text-secondary);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reports-topics-heatmap-day {
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 6px;
}

.reports-topics-contacts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.reports-topics-contact-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.reports-topics-contact-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.reports-topics-contact-main {
  min-width: 0;
  flex: 1;
}

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

.reports-topics-contact-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.reports-topics-contact-count {
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  color: #90a0ff;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .reports-topics-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .reports-topics-kpi-row-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reports-topics-contacts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  #reportsPage .reports-general-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .reports-general-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reports-topics-category-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .reports-topics-category-percent {
    text-align: left;
  }
  .reports-topics-contacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .reports-topics-title {
    font-size: 32px;
  }
  .reports-topics-kpi-row,
  .reports-topics-kpi-row-four,
  .reports-general-kpi-row {
    grid-template-columns: 1fr;
  }
  .reports-topics-contacts {
    grid-template-columns: 1fr;
  }
  #reportsPage .reports-general-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.config-field {
  margin-bottom: 14px;
}

.config-field:last-child {
  margin-bottom: 0;
}

.config-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.config-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.config-input:focus {
  border-color: var(--accent);
}

.config-input::placeholder {
  color: var(--text-muted);
}

textarea.config-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.config-input-mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.config-row .config-field {
  flex: 1;
  margin-bottom: 0;
}

.config-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%235c6180' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.config-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.config-toggle-row:last-child {
  border-bottom: none;
}

.config-toggle-label {
  font-size: 13px;
  color: var(--text-primary);
}

.config-toggle-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.config-range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-range {
  flex: 1;
  accent-color: var(--accent);
}

.config-range-value {
  min-width: 36px;
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-primary);
}

.model-suggestion-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-suggestion-list-large {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}

.model-suggestion-chip {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 11px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
}

.model-suggestion-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  border: none;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.toggle-switch.on {
  background: var(--accent);
}

.toggle-switch.on::after {
  transform: translateX(18px);
}

.config-preview {
  background: var(--bg-surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 16px;
  margin-top: 12px;
}

.config-preview-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.config-preview-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 80%;
}

.config-case-card {
  background: var(--bg-surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 10px;
}

.config-case-card:last-child {
  margin-bottom: 0;
}

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

.config-case-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.config-case-tag.orange {
  background: var(--orange-bg);
  color: var(--orange);
}

.config-case-tag.red {
  background: var(--red-bg);
  color: var(--red);
}

.config-case-tag.purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.config-case-tag.green {
  background: var(--green-bg);
  color: var(--green);
}

.config-case-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.config-save-bar {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 1000px;
}

.config-save-bar .saved-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
}

.no-agent-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.no-agent-tab {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
}

.no-agent-tab.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.no-agent-panel {
  display: none;
}

.no-agent-panel.active {
  display: block;
}

.timezone-picker-wrap {
  position: relative;
}

.timezone-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: none;
  overflow: hidden;
}

.timezone-suggestions.show {
  display: block;
}

.timezone-option {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.timezone-option:last-child {
  border-bottom: 0;
}

.timezone-option:hover {
  background: var(--bg-card);
}

.workhours-enable-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.workhours-days-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
}

.workhours-day-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.workhours-day-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workhours-day-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.workhours-day-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workhours-interval-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workhours-time-input {
  width: 122px;
}

.workhours-offline {
  font-size: 13px;
  color: var(--text-muted);
}

.workhours-add-link {
  border: 0;
  background: transparent;
  color: var(--accent-bright);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  font-weight: 600;
}

.inline-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 3px 8px;
  background: var(--accent-glow);
  color: var(--accent-bright);
  border-radius: 4px;
}

.dash-conversations {
  display: contents;
}

.dash-conversations.hidden .sidebar,
.dash-conversations.hidden .transcript-panel,
.dash-conversations.hidden .detail-panel {
  display: none;
}

.customers-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  min-height: calc(100vh - 96px);
}

.customers-left-nav {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: fit-content;
}

.customers-left-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 2px;
  padding: 6px 10px;
}

.customers-left-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.customers-left-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.customers-left-item.active {
  background: var(--accent-glow);
  color: var(--accent-bright);
  border-color: var(--accent);
}

.customers-main {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
}

.customers-view {
  display: none;
  padding: 14px;
}

.customers-view.active {
  display: block;
}

.customers-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.customers-header-row h2 {
  font-size: 36px;
  line-height: 1.1;
  font-family: "Fraunces", serif;
  font-weight: 500;
  color: var(--text-primary);
}

.customers-header-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.customers-count-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.customers-toolbar-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
}

.customers-search-input {
  width: min(420px, 100%);
  border: 1px solid var(--accent);
  border-radius: 24px;
  padding: 10px 14px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
}

.customers-search-input::placeholder {
  color: var(--text-muted);
}

.customers-status-filter {
  margin-left: auto;
  position: relative;
}

.customers-status-toggle {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent-bright);
  border-radius: 10px;
  padding: 9px 14px;
  min-width: 120px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.customers-status-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  padding: 8px;
  z-index: 20;
}

.customers-status-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.customers-status-item:hover {
  background: var(--bg-card);
}

.customers-status-item.active {
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.customers-th-help-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.customers-th-help-button {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.customers-visitor-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.customers-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: calc(100vh - 260px);
}

.customers-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.customers-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.customers-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.customers-table tr:hover td {
  background: var(--bg-card-hover);
}

.customers-person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.customers-avatar-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.customers-avatar-status {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
}

.cvi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cvi-icon-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.cvi-icon-svg {
  width: 9px;
  height: 9px;
  display: block;
}

.customers-avatar-status.active {
  background: #59c836;
}

.customers-avatar-status.chat {
  background: #59c836;
  color: #fff;
}

.customers-avatar-status.customer {
  background: #9ca3af;
  color: #fff;
}

.customers-avatar-status.auto_message {
  background: #f59e0b;
  color: #fff;
}

.customers-avatar-status.blocked {
  background: #ef4444;
  color: #fff;
}

.customers-avatar-status.inactive {
  background: #6b7280;
  color: #fff;
}

.customers-subtle {
  color: var(--text-secondary);
  font-size: 13px;
}

.customers-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.customers-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.customers-tag.role-admin {
  color: var(--orange);
  background: var(--orange-bg);
}

.customers-tag.role-support {
  color: var(--accent-bright);
  background: var(--accent-glow);
}

.customers-tag.status-available {
  color: var(--green);
  background: var(--green-bg);
}

.customers-tag.status-busy {
  color: var(--orange);
  background: var(--orange-bg);
}

.customers-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.customers-legend-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.customers-legend-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.customers-legend-row:last-child {
  border-bottom: 0;
}

.customers-legend-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.customers-legend-text strong {
  color: var(--text-primary);
}

.customers-legend-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.customers-legend-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.customers-legend-avatar {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.customers-legend-online-dot {
  position: absolute;
  top: -1px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #63c739;
  border: 1px solid var(--bg-surface);
}

.customers-legend-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.customers-legend-badge svg {
  width: 10px;
  height: 10px;
  display: block;
}

.customers-legend-icon.active {
  background: #bad7ca;
}

.customers-legend-icon.active .customers-legend-avatar {
  color: #4d7566;
}

.customers-legend-icon.chat {
  background: #9ddce5;
}

.customers-legend-icon.chat .customers-legend-avatar {
  color: #2d6e86;
}

.customers-legend-badge.chat {
  background: #63c739;
  color: #fff;
}

.customers-legend-icon.customer {
  background: #d5c39e;
}

.customers-legend-icon.customer .customers-legend-avatar {
  color: #8b6f3e;
}

.customers-legend-badge.customer {
  background: #c5c9d2;
  color: #fff;
}

.customers-legend-icon.auto_message {
  background: #f0d4c4;
}

.customers-legend-icon.auto_message .customers-legend-avatar {
  color: #b6783f;
}

.customers-legend-badge.auto_message {
  background: #b6bbc7;
  color: #fff;
}

.customers-legend-icon.blocked {
  background: #cdb9ee;
}

.customers-legend-icon.blocked .customers-legend-avatar {
  color: #765ab8;
}

.customers-legend-icon.blocked .customers-legend-online-dot {
  display: none;
}

.customers-legend-badge.blocked {
  background: #fff;
  color: #ef4444;
}

.customers-legend-icon.inactive {
  background: #e5e7eb;
}

.customers-legend-icon.inactive .customers-legend-avatar {
  color: #9aa0aa;
}

.widget-demo-page {
  padding-top: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f0f2f5 0%, #e4e7ec 100%);
  position: relative;
}

.fake-website {
  max-width: 900px;
  margin: 40px auto;
  padding: 40px;
}

.widget-side-panel {
  display: grid;
  gap: 16px;
  margin: 28px 0 36px;
}

.widget-side-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.widget-side-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  background: #f8fafc;
}

.widget-identity {
  display: grid;
  gap: 8px;
  padding: 12px 16px 16px;
}

.widget-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--w-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.widget-field-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--w-border);
  background: #fff;
  font-size: 13px;
  color: var(--w-text);
  outline: none;
}

.widget-field-input:focus {
  border-color: var(--w-accent);
}

.widget-identity .action-btn {
  width: fit-content;
  margin-top: 4px;
}

.widget-identity-hint {
  font-size: 11px;
  color: var(--w-text-secondary);
}

.fake-website h1 {
  font-family: "Fraunces", serif;
  font-size: 32px;
  color: #1a1d26;
  margin-bottom: 12px;
}

.fake-website p {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.fake-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
}

.fake-card h3 {
  font-size: 16px;
  color: #1a1d26;
  margin-bottom: 8px;
}

.fake-card .placeholder {
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
}

.fake-card .placeholder.short {
  width: 60%;
}

.fake-card .placeholder.medium {
  width: 80%;
}

.embed-card {
  margin-top: 40px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.embed-card h3 {
  font-size: 14px;
  color: #1a1d26;
  margin-bottom: 12px;
}

.embed-code {
  background: #f6f8fa;
  padding: 14px;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #333;
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  line-height: 1.6;
}
.widget-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f8cff, #3b6de0);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(79, 140, 255, 0.35), 0 0 0 0 rgba(79, 140, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: triggerPulse 3s ease infinite;
}

@keyframes triggerPulse {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(79, 140, 255, 0.35), 0 0 0 0 rgba(79, 140, 255, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(79, 140, 255, 0.35), 0 0 0 8px rgba(79, 140, 255, 0);
  }
}

.widget-trigger:hover {
  transform: scale(1.08);
}

.widget-trigger svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.widget-trigger .notif-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  border: 2px solid #f0f2f5;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
}

.in-app-toast-host {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.in-app-toast {
  pointer-events: auto;
  width: 320px;
  max-width: calc(100vw - 28px);
  text-align: left;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.in-app-toast.closing {
  opacity: 0;
  transform: translateY(-4px);
}

.in-app-toast-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.in-app-toast-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.widget-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 10001;
  width: 380px;
  height: 560px;
  background: var(--w-bg);
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  border: 1px solid var(--w-border);
}

.widget-panel.hidden {
  opacity: 0;
  transform: scale(0.92) translateY(12px);
  pointer-events: none;
}

.widget-header {
  background: linear-gradient(135deg, #4f8cff, #3b6de0);
  padding: 18px 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.widget-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12), transparent 60%);
}

.widget-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
  z-index: 1;
}

.widget-header-avatar svg {
  width: 22px;
  height: 22px;
}

.widget-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.widget-header-avatar .avatar-ai,
.widget-header-avatar .avatar-human {
  display: none;
  align-items: center;
  justify-content: center;
}

.widget-panel.ai .avatar-ai {
  display: flex;
}

.widget-panel.human .avatar-human {
  display: flex;
}

.widget-header-info {
  position: relative;
  z-index: 1;
}

.widget-header-name {
  font-weight: 600;
  font-size: 15px;
}

.widget-header-status {
  font-size: 12px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
}

.widget-header-status .online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

.widget-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background 0.15s;
}

.widget-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.widget-disclaimer {
  padding: 8px 16px;
  text-align: center;
  font-size: 11px;
  color: var(--w-text-secondary);
  background: var(--w-surface);
  border-bottom: 1px solid var(--w-border);
  flex-shrink: 0;
}

.widget-history-open-btn {
  width: 100%;
  border: 1px solid var(--w-border);
  background: #fff;
  color: var(--w-text);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
}

.widget-history-open-btn:hover {
  border-color: #c8d1e5;
  background: var(--w-surface);
}

.widget-typing-row {
  margin: 4px 16px 6px;
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 10px;
  min-height: 20px;
  flex-shrink: 0;
}

.widget-start-new-chat-btn {
  margin: 8px 16px 0;
  border: 1px solid var(--w-border);
  background: var(--w-bg);
  color: var(--w-text);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.widget-start-new-chat-btn:hover {
  border-color: #c8d1e5;
  background: var(--w-surface);
}

.widget-typing-row .w-typing {
  padding: 0;
}

.widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--w-bg);
  min-height: 0;
  overscroll-behavior: contain;
}

.w-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 82%;
  animation: msgIn 0.3s ease;
}

.w-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.w-msg.ai {
  align-self: flex-start;
}

.w-msg.user {
  align-self: flex-end;
}

.w-msg.system {
  align-self: center;
  max-width: 90%;
}

.w-msg.user.operator {
  align-self: flex-start;
}

.w-msg-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #dce4f5;
  background: #eef3ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4f8cff;
  font-size: 14px;
  font-weight: 700;
}

.w-msg-avatar-btn {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
}

.w-msg-avatar-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.35);
}

.w-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.w-msg-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--w-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.w-msg-label .badge {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e8f0fe;
  color: #4f8cff;
}

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

.w-msg.ai .w-msg-bubble {
  background: var(--w-bubble-ai);
  color: var(--w-text);
  border-radius: 14px 14px 14px 4px;
  border: 1px solid #dce4f5;
}

.w-msg.user .w-msg-bubble {
  background: var(--w-bubble-user);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

.w-msg.system .w-msg-bubble {
  background: #fff8e6;
  color: #92600a;
  font-size: 12px;
  border-radius: 12px;
  padding: 8px 14px;
  text-align: center;
  border: 1px solid #f5e6c0;
}

.w-msg-time {
  font-size: 10px;
  color: var(--w-text-secondary);
  font-family: "JetBrains Mono", monospace;
}

.w-msg.user .w-msg-time {
  text-align: right;
}

.w-msg-attachment {
  margin-top: 6px;
  font-size: 12px;
}

.w-msg-attachment a {
  color: var(--w-accent);
  text-decoration: none;
}

.w-msg-redirect-link {
  color: var(--w-accent);
  font-weight: 600;
  text-decoration: underline;
  word-break: break-word;
}

.w-msg-attachment img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid var(--w-border);
  cursor: zoom-in;
}

.w-msg-attachment video {
  display: block;
  max-width: 240px;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid var(--w-border);
  background: #000;
}

.msg-attachment {
  margin-top: 6px;
  font-size: 12px;
}

.msg-attachment a {
  color: var(--accent-bright);
  text-decoration: none;
}

.msg-attachment img {
  display: block;
  max-width: 260px;
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.image-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 24px;
}

.image-preview-backdrop.open {
  display: flex;
}

.image-preview-img {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #0b1020;
}

.image-preview-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
}

.w-typing {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  align-self: flex-start;
}

.w-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b0b8cc;
  animation: typing 1.4s ease infinite;
}

.w-typing.support {
  align-items: center;
  gap: 6px;
}

.w-typing-label {
  font-size: 11px;
  color: var(--w-text-secondary);
  margin-left: 6px;
}

.w-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.w-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

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

.widget-handoff-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  margin: 0 16px;
  background: #fff8e6;
  color: #92600a;
  border: 1px solid #f0dea0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  transition: all 0.15s;
  flex-shrink: 0;
}

.widget-handoff-btn:hover {
  background: #fff0cc;
}

.widget-handoff-btn svg {
  width: 14px;
  height: 14px;
  fill: #92600a;
}

.widget-operator-card {
  position: absolute;
  z-index: 10020;
  width: min(320px, calc(100% - 24px));
  background: #ffffff;
  border: 1px solid #dce4f5;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  padding: 12px;
  opacity: 1;
  transform: translateX(0) scale(1);
  transition: opacity 0.18s ease, transform 0.22s ease;
}

.widget-operator-card.hidden {
  opacity: 0;
  transform: translateX(8px) scale(0.98);
  pointer-events: none;
}

.widget-operator-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.widget-operator-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: #eef3ff;
  border: 1px solid #dce4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #4f8cff;
  flex-shrink: 0;
}

.widget-operator-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.widget-operator-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--w-text);
}

.widget-operator-card-role {
  font-size: 12px;
  color: var(--w-text-secondary);
}

.widget-operator-card-bio {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #4b5563;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widget-history-modal {
  position: absolute;
  inset: 0;
  z-index: 10030;
  background: rgba(10, 14, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.widget-history-modal.hidden {
  display: none;
}

.widget-history-card {
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: #fff;
  border: 1px solid var(--w-border);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.widget-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-history-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--w-text);
}

.widget-history-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--w-border);
  background: #fff;
  color: var(--w-text-secondary);
  cursor: pointer;
  font-size: 14px;
}

.widget-history-close:hover {
  background: var(--w-surface);
  color: var(--w-text);
}

.widget-history-search {
  width: 100%;
  border: 1px solid var(--w-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--w-text);
  background: var(--w-surface);
  outline: none;
}

.widget-history-search:focus {
  border-color: var(--w-accent);
}

.widget-history-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.widget-history-filter {
  border: 1px solid var(--w-border);
  background: #fff;
  color: var(--w-text-secondary);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.widget-history-filter.active {
  border-color: var(--w-accent);
  background: #eef3ff;
  color: var(--w-accent);
}

.widget-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

@media (max-width: 767px) {
  .widget-operator-card {
    width: calc(100% - 16px);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    transition: opacity 0.16s ease, transform 0.2s ease;
  }
  .widget-operator-card.hidden {
    transform: translateY(8px) scale(0.99);
  }
}

.widget-notify-row {
  padding: 8px 16px 0;
  background: var(--w-bg);
}

.widget-notify-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--w-text-secondary);
  cursor: pointer;
}

.widget-notify-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--w-accent);
}

.widget-clipboard-preview {
  margin: 8px 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.widget-clip-item {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--w-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--w-surface);
}

.widget-clip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.widget-clip-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.widget-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--w-border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--w-bg);
  flex-shrink: 0;
}

.widget-input {
  flex: 1;
  border: 1px solid var(--w-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
  color: var(--w-text);
  background: var(--w-surface);
  outline: none;
  transition: border-color 0.15s;
}

.widget-input::placeholder {
  color: #b0b8cc;
}

.widget-input:focus {
  border-color: var(--w-accent);
}

.widget-send {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--w-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.widget-send:hover {
  background: #3b6de0;
}

.widget-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.widget-attach {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--w-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.widget-attach:hover {
  background: var(--w-surface);
  border-color: #b0b8cc;
}

.widget-attach svg {
  width: 16px;
  height: 16px;
  fill: #9ca3af;
}

.widget-footer {
  padding: 6px;
  text-align: center;
  font-size: 10px;
  color: #b0b8cc;
  background: var(--w-surface);
  border-top: 1px solid var(--w-border);
  flex-shrink: 0;
}

.widget-footer a {
  color: var(--w-accent);
  text-decoration: none;
}

.widget-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: var(--w-surface);
  border-bottom: 1px solid var(--w-border);
}

.widget-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--w-border);
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--w-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.widget-tab:hover {
  border-color: #cfd5e2;
  color: var(--w-text);
}

.widget-tab.active {
  background: var(--w-accent);
  color: #fff;
  border-color: var(--w-accent);
}

.widget-view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.widget-view.active {
  display: flex;
}

.widget-conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--w-border);
  background: var(--w-surface);
}

.widget-conv-filters {
  display: flex;
  gap: 6px;
  padding: 8px 16px 12px;
  background: var(--w-surface);
  border-bottom: 1px solid var(--w-border);
}

.widget-filter {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--w-border);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: var(--w-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.widget-filter:hover {
  border-color: #cfd5e2;
  color: var(--w-text);
}

.widget-filter.active {
  background: var(--w-accent);
  color: #fff;
  border-color: var(--w-accent);
}

.widget-conv-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--w-text);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.widget-conv-note {
  font-size: 11px;
  color: var(--w-text-secondary);
}

.widget-conv-list,
.widget-solution-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--w-bg);
}

.widget-conv-item,
.widget-solution-item {
  border: 1px solid var(--w-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.widget-conv-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.widget-conv-id {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #9aa0af;
}

.widget-conv-preview {
  font-size: 13px;
  color: var(--w-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-conv-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}

.widget-conv-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.widget-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4f8cff;
}

.widget-solution-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--w-text);
  margin-bottom: 4px;
}

.widget-solution-meta {
  font-size: 11px;
  color: var(--w-text-secondary);
}

.widget-solution-item button.action-btn {
  padding: 6px 8px;
  font-size: 11px;
}

.bar {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
}

.bar.orange {
  background: var(--orange);
}

.bar.red {
  background: var(--red);
}

.bar.purple {
  background: var(--purple);
}

.bar.muted {
  background: var(--text-muted);
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.cost-row.total {
  border-bottom: none;
  font-weight: 600;
}

.cost-label {
  color: var(--text-secondary);
}

.cost-value {
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.cost-value.accent {
  color: var(--accent-bright);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

.widget-messages::-webkit-scrollbar-thumb {
  background: #d4d8e4;
}

.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(5, 8, 14, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.profile-modal-card {
  width: min(460px, 96vw);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  padding: 18px;
}

.profile-modal-title {
  font-family: "Fraunces", serif;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.profile-modal-subtitle {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 14px;
}

.profile-avatar-editor {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.profile-avatar-preview {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-crop {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  background: var(--bg-surface);
}

.profile-avatar-crop-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

#profileAvatarCropCanvas {
  width: 220px;
  height: 220px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: block;
  margin: 0 auto 10px;
  background: #0e1118;
}

#profileAvatarCropCanvas.dragging {
  cursor: grabbing;
}

.profile-avatar-crop-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-avatar-crop-controls label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 52px;
}

.profile-avatar-crop-controls input[type="range"] {
  width: 100%;
}
.catalog-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.85);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.catalog-modal-card {
  width: min(960px, 100%);
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.catalog-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.catalog-modal-title {
  font-weight: 600;
  font-size: 18px;
}

.catalog-modal-subtitle {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.catalog-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.catalog-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catalog-modal-field-check {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}

.catalog-modal-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 600;
}

.catalog-modal-field input,
.catalog-modal-field select,
.catalog-modal-field textarea {
  font-size: 14px;
}

.catalog-modal-field-file .catalog-modal-helper {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.catalog-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.catalog-modal-status {
  min-height: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.catalog-modal-status.catalog-modal-status--error {
  color: var(--orange);
}

.catalog-modal-status.catalog-modal-status--success {
  color: var(--green);
}
