/* Live Chat Tab -- scoped styles */

#lc-container {
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: #f3f4f6;
  color: #111827;
  padding: 12px 24px 0;
  box-sizing: border-box;
}

:root {
      --bg: #f3f4f6;
      --surface: #ffffff;
      --surface-strong: #ffffff;
      --surface-soft: #f9fafb;
      --line: #e5e7eb;
      --text: #111827;
      --muted: #6b7280;
      --accent: #4f46e5;
      --accent-deep: #8f3d1d;
      --accent-soft: #f3d4c5;
      --olive-soft: #dcfce7;
      --olive-text: #16a34a;
      --gold-soft: #fef9c3;
      --gold-text: #854d0e;
      --success: #22c55e;
      --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
      --radius-xl: 12px;
      --radius-lg: 10px;
      --radius-md: 8px;
      --radius-sm: 6px;
    }

    * {
      box-sizing: border-box;
    }

    

    #lc-container.mobile-view-conversations .mobile-nav-btn[data-mobile-view="conversations"],
    #lc-container.mobile-view-chat .mobile-nav-btn[data-mobile-view="chat"],
    #lc-container.mobile-view-info .mobile-nav-btn[data-mobile-view="info"] {
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      color: #fff8f2;
      box-shadow: 0 12px 22px rgba(143, 61, 29, 0.18);
    }

    .lc-app {
      display: grid;
      grid-template-columns: 340px minmax(0, 1fr) 320px;
      height: 100%;
      flex: 1;
      min-height: 0;
      width: 100%;
      border-radius: 12px 12px 0 0;
      overflow: hidden;
      box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
      gap: 0;
      padding: 0;
      transition: grid-template-columns 0.14s ease-out;
    }

    .mobile-nav {
      display: none;
    }

    .mobile-nav-btn {
      border: none;
      background: rgba(255, 255, 255, 0.9);
      color: var(--muted);
      min-height: 52px;
      border-radius: 10px;
      font: 700 13px/1 Arial, sans-serif;
      letter-spacing: 0.03em;
      cursor: pointer;
      transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    }

    .app.info-collapsed {
      grid-template-columns: 340px minmax(0, 1fr) 52px;
    }

    .conversation-list,
    .chat-panel,
    .info-panel {
      background: var(--surface);
      min-width: 0;
      border-radius: 0;
      box-shadow: none;
      border: none;
      padding-right: 0;
    }

    .conversation-list {
      border-right: 1px solid var(--line);
    }

    .chat-panel {
      border-right: 1px solid var(--line);
    }

    .info-panel {
      transition: width 0.14s ease-out, min-width 0.14s ease-out, opacity 0.14s ease-out;
      width: 100%;
      min-width: 0;
      overflow: hidden;
      position: relative;
    }

    .info-panel.collapsed {
      width: 52px;
      min-width: 52px;
      opacity: 1;
      pointer-events: auto;
    }

    .info-panel.collapsed .info-#lc-container {
      display: none;
    }

    .info-rail {
      display: none !important;
      flex-direction: column;
      align-items: center;
      gap: 14px;
      padding: 16px 0;
    }

    .info-panel.collapsed .info-rail {
      display: none !important;
    }

    .info-panel.collapsed .info-toolbar {
      flex-direction: column;
      justify-content: flex-start;
      align-items: center;
      padding: 14px 7px;
      gap: 10px;
      min-height: 100%;
      border-bottom: none;
    }

    .info-panel.collapsed .info-toggle-btn {
      order: -1;
    }

    .info-panel.collapsed .info-toolbar-tabs {
      flex-direction: column;
      align-items: center;
      gap: 10px;
      order: 1;
    }

    .info-panel.collapsed .info-body {
      display: none;
    }

    .info-rail-btn,
    .info-mode-btn {
      border: none;
      background: var(--surface-soft);
      border-radius: 12px;
      width: 38px;
      height: 38px;
      cursor: pointer;
      color: #374151;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.15s, background 0.15s;
    }

    .info-mode-btn:hover { transform: translateY(-1px); }

    /* Profile tab */
    .btn-profile           { background: #eff6ff; color: #1d4ed8; }
    .btn-profile:hover     { background: #dbeafe; }
    .btn-profile.active    { background: #1d4ed8; color: #fff; box-shadow: 0 4px 12px rgba(29,78,216,0.28); }

    /* Assistant tab */
    .btn-assistant         { background: #f5f3ff; color: #7c3aed; }
    .btn-assistant:hover   { background: #ede9fe; }
    .btn-assistant.active  { background: #7c3aed; color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,0.28); }

    /* Sidebar */
    .sidebar {
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.2), transparent 26%),
        linear-gradient(180deg, var(--sidebar-panel) 0%, var(--sidebar-bg) 100%);
      color: var(--sidebar-text);
    }

    .sidebar-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 22px 20px;
      border-bottom: 1px solid var(--sidebar-line);
      font-size: 16px;
      font-weight: 700;
    }

    .icon-btn {
      border: none;
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      color: #fff8f2;
      width: 54px;
      height: 54px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 28px;
      line-height: 1;
      box-shadow: 0 14px 26px rgba(143, 61, 29, 0.28);
    }

    .sidebar-scroll {
      flex: 1;
      overflow: auto;
      padding-bottom: 90px;
    }

    .nav-group {
      padding: 12px 12px 6px;
      border-bottom: 1px solid var(--sidebar-line);
    }

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

    .nav-group-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--sidebar-muted);
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .nav-group-toggle {
      width: 28px;
      height: 28px;
      border: none;
      border-radius: 8px;
      background: rgba(255, 248, 239, 0.1);
      color: var(--sidebar-text);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 16px;
      line-height: 1;
      transition: transform 0.18s ease, background 0.18s ease;
    }

    .nav-group-toggle:hover {
      background: rgba(255, 248, 239, 0.16);
    }

    .nav-group.collapsed .nav-group-items {
      display: none;
    }

    .nav-group.collapsed .nav-group-toggle {
      transform: rotate(-90deg);
    }

    .sidebar-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 8px;
      border-radius: 10px;
      cursor: pointer;
      margin-bottom: 3px;
      color: var(--sidebar-text);
      font-size: 15px;
      background: transparent;
      font-weight: 500;
      border: 1px solid transparent;
    }

    .sidebar-item-left {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .sidebar-icon {
      width: 20px;
      text-align: center;
      opacity: 0.85;
      flex-shrink: 0;
    }

    .sidebar-item:hover {
      background: rgba(255, 248, 239, 0.08);
      border-color: rgba(255, 248, 239, 0.08);
    }

    .sidebar-item.active {
      background: rgba(255, 248, 239, 0.12);
      color: #fffaf4;
      font-weight: 700;
      border-color: rgba(255, 248, 239, 0.14);
      box-shadow: inset 0 0 0 1px rgba(255, 248, 239, 0.03);
    }

    .sidebar-count {
      font-size: 14px;
      color: var(--sidebar-muted);
    }

    .agent-profile {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 3;
      padding: 14px 16px;
      border-top: 1px solid var(--sidebar-line);
      display: flex;
      cursor: pointer;
      align-items: center;
      gap: 12px;
      background: rgba(17, 13, 9, 0.22);
      backdrop-filter: blur(12px);
    }

    .agent-avatar {
      width: 42px;
      height: 42px;
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      color: #fff7ef;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      font-weight: 700;
      flex-shrink: 0;
    }

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

    .agent-name {
      font-size: 14px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .agent-status {
      font-size: 12px;
      color: var(--sidebar-muted);
      margin-top: 4px;
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: inline-block;
      margin-right: 6px;
      vertical-align: middle;
    }

    .agent-profile-edit-btn {
      border: none;
      background: rgba(255, 248, 239, 0.12);
      color: var(--sidebar-text);
      width: 36px;
      height: 36px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 16px;
      flex-shrink: 0;
    }

    .agent-profile-edit-btn {
      border: none;
      background: #f3f4f6;
      color: #111827;
      width: 36px;
      height: 36px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 16px;
      flex-shrink: 0;
    }

    .agent-profile-edit-btn:hover {
      background: rgba(255, 248, 239, 0.18);
    }

    .agent-profile-drawer {
      position: fixed;
      top: 0;
      right: -420px;
      width: 400px;
      max-width: calc(100vw - 24px);
      height: 100%;
      background: rgba(255, 253, 248, 0.98);
      border-left: 1px solid rgba(28, 27, 24, 0.08);
      box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
      z-index: 9999;
      transition: right 0.25s ease;
      display: flex;
      flex-direction: column;
    }

    .agent-profile-drawer.open {
      right: 0;
    }

    .agent-profile-drawer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 18px 20px;
      border-bottom: 1px solid rgba(28, 27, 24, 0.08);
    }

    .agent-profile-close-btn {
      border: none;
      background: var(--surface-soft);
      width: 36px;
      height: 36px;
      border-radius: 10px;
      cursor: pointer;
      font-size: 16px;
    }

    .agent-profile-drawer-#lc-container {
      padding: 20px;
      overflow: auto;
    }

    .agent-profile-preview-wrap {
      display: flex;
      justify-content: center;
      margin-bottom: 20px;
    }

    .agent-profile-preview {
      width: 96px;
      height: 96px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      color: #fff7ef;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 34px;
      font-weight: 700;
      overflow: hidden;
    }

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

    .agent-profile-field {
      margin-bottom: 16px;
    }

    .agent-profile-field label {
      display: block;
      font-size: 14px;
      font-weight: 700;
      margin-bottom: 8px;
    }

    .agent-profile-field input {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px 14px;
      font: inherit;
    }

    .agent-profile-actions {
      display: flex;
      gap: 10px;
      margin-top: 20px;
    }

    .status-dot.online {
      background: #22c55e;
    }

    .status-dot.offline {
      background: #9ca3af;
    }

    /* toggle */
    .switch {
      position: relative;
      display: inline-block;
      width: 42px;
      height: 24px;
      flex-shrink: 0;
    }

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

    .slider {
      position: absolute;
      inset: 0;
      background: #d1d5db;
      border-radius: 999px;
      transition: 0.2s;
      cursor: pointer;
    }

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

    .switch input:checked + .slider {
      background: var(--success);
    }

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

    /* Conversation list */
    .conversation-list {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      min-height: 0;
    }

    .conversation-list-header {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      gap: 14px;
      padding: 22px 20px;
      border-bottom: 1px solid rgba(28, 27, 24, 0.08);
      min-height: 88px;
      background:
        linear-gradient(180deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0)),
        rgba(255, 253, 248, 0.9);
    }

    .conversation-list-title-hidden {
      display: none;
    }

    .conversation-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .conversation-tabs {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px;
      border-radius: 999px;
      background: rgba(239, 231, 216, 0.9);
      border: 1px solid rgba(28, 27, 24, 0.08);
      width: fit-content;
      max-width: 100%;
      overflow-x: auto;
    }

    .conversation-tab {
      border: none;
      background: transparent;
      color: var(--muted);
      padding: 4px 6px;
      border-radius: 999px;
      cursor: pointer;
      font: 400 11px/1 Arial, sans-serif;
      white-space: nowrap;
      transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    }

    .conversation-tab.active {
      background: #fff;
      color: var(--text);
      box-shadow: 0 8px 18px rgba(28, 27, 24, 0.08);
    }

    .conversation-tools {
      display: inline-flex;
      align-items: center;
      gap: 10px;
    }

    .conversation-tool-btn {
      width: 30px;
      height: 30px;
      border: none;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.9);
      color: var(--text);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 8px 18px rgba(28, 27, 24, 0.08);
      transition: transform 0.18s ease, background 0.18s ease;
    }

    .conversation-tool-btn:hover {
      transform: translateY(-1px);
      background: #fff;
    }

    .conversation-summary {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .summary-pill {
      border: 1px solid transparent;
      border-radius: 8px;
      padding: 6px 8px;
      background: rgba(255, 255, 255, 0.8);
      color: var(--muted);
      font: 400 12px/1 Arial, sans-serif;
      cursor: pointer;
      transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    }

    .summary-pill:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 18px rgba(28, 27, 24, 0.08);
    }

    .summary-pill.active {
      box-shadow: 0 10px 20px rgba(28, 27, 24, 0.08);
    }

    .summary-pill.mine {
      background: rgba(219, 234, 254, 0.86);
      border-color: rgba(96, 165, 250, 0.34);
      color: #2563eb;
    }

    .summary-pill.other {
      background: rgba(220, 252, 231, 0.86);
      border-color: rgba(52, 211, 153, 0.34);
      color: #0f766e;
    }

    .summary-pill.waiting {
      background: rgba(254, 243, 199, 0.92);
      border-color: rgba(99, 102, 241, 0.22);
      color: #b45309;
    }

    .waiting-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 14px;
      border-radius: 999px;
      background: var(--gold-soft);
      color: var(--gold-text);
      font-size: 14px;
      font-weight: 700;
      border: none;
      cursor: pointer;
      transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    }

    .waiting-badge:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 20px rgba(138, 98, 20, 0.16);
    }

    .waiting-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: currentColor;
    }

    .conversation-list-#lc-container {
      flex: 1;
      overflow: auto;
      padding: 14px;
      background: #faf7f3;
    }

    .conversation-list-body {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 14px;
      min-height: 0;
      background: #faf7f3;
    }

    .agent-footer {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 12px 14px;
      min-height: 60px;
      border-top: 1px solid var(--line);
      background: var(--surface);
      flex-shrink: 0;
    }

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

    .agent-footer .agent-name {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .agent-footer .agent-status {
      font-size: 11px;
      color: var(--muted);
      margin-top: 1px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .agent-footer-settings {
      border: none;
      background: none;
      color: #9ca3af;
      width: 30px;
      height: 30px;
      border-radius: 7px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: background 0.15s, color 0.15s;
    }

    .agent-footer-settings:hover {
      background: var(--surface-soft);
      color: var(--accent);
    }

    /* Sound-notifications mute toggle (mirrors settings button styling) */
    .agent-footer-bell {
      border: none;
      background: none;
      color: #9ca3af;
      width: 30px;
      height: 30px;
      border-radius: 7px;
      cursor: pointer;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      transition: background 0.15s, color 0.15s, opacity 0.15s;
    }
    .agent-footer-bell:hover {
      background: var(--surface-soft);
      color: var(--accent);
    }
    .agent-footer-bell.muted { opacity: 0.5; }

    /* Agent language preference pill */
    .agent-lang-wrap {
      position: relative;
    }

    .agent-lang-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      border-radius: 20px;
      padding: 4px 8px;
      font-size: 11px;
      font-weight: 700;
      color: #2563eb;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.13s;
    }
    .agent-lang-btn:hover { background: #dbeafe; }

    .agent-lang-menu {
      display: none;
      position: absolute;
      bottom: calc(100% + 6px);
      left: 0;
      width: 210px;
      background: #fff;
      border: 1px solid rgba(0,0,0,0.1);
      border-radius: 10px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.13);
      z-index: 300;
      overflow: hidden;
    }
    .agent-lang-menu.open { display: flex; flex-direction: column; }

    .agent-lang-menu-title {
      font-size: 10.5px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #9ca3af;
      padding: 8px 10px 4px;
      flex-shrink: 0;
    }

    .agent-lang-search {
      margin: 0 8px 6px;
      padding: 5px 9px;
      border: 1px solid #e5e7eb;
      border-radius: 6px;
      font-size: 12px;
      outline: none;
      color: #111827;
      background: #f9fafb;
      flex-shrink: 0;
    }
    .agent-lang-search:focus { border-color: #2563eb; background: #fff; }

    .agent-lang-opts {
      overflow-y: auto;
      max-height: 200px;
      padding: 0 4px 4px;
    }

    .agent-lang-opt {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      background: none;
      border: none;
      border-radius: 6px;
      padding: 6px 8px;
      font-size: 12.5px;
      color: #374151;
      cursor: pointer;
      text-align: left;
      transition: background 0.1s;
    }
    .agent-lang-opt:hover { background: #f3f4f6; }
    .agent-lang-opt.selected { background: #eff6ff; color: #2563eb; font-weight: 600; }
    .agent-lang-opt .opt-check { margin-left: auto; opacity: 0; color: #2563eb; }
    .agent-lang-opt.selected .opt-check { opacity: 1; }

    .conversation-card {
      position: relative;
      display: flex;
      gap: 12px;
      padding: 14px;
      border-radius: 10px;
      cursor: pointer;
      border: 1px solid rgba(28, 27, 24, 0.07);
      margin-bottom: 10px;
      background: rgba(255, 253, 248, 0.92);
      box-shadow: 0 2px 8px rgba(28, 27, 24, 0.05);
    }

    .conversation-card:not(.active):hover {
      background: rgba(79, 70, 229, 0.05);
      border-color: rgba(79, 70, 229, 0.2);
      box-shadow: 0 4px 12px rgba(143, 61, 29, 0.07);
      transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    }

    .conversation-card.active {
      background: linear-gradient(135deg, rgba(79, 70, 229, 0.09), rgba(255, 255, 255, 0.98));
      border-color: rgba(79, 70, 229, 0.35);
      border-left: 3px solid var(--accent);
      box-shadow: 0 8px 24px rgba(143, 61, 29, 0.13);
      transition: all 0.2s ease;
    }

    @keyframes pulseGlow {
      0% { box-shadow: 0 0 0 0 rgba(79,70,229,0.35); }
      70% { box-shadow: 0 0 0 8px rgba(79,70,229,0); }
      100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); }
    }

    .conversation-card.new-message {
      animation: pulseGlow 1.5s ease;
    }

    /* Info button on conversation card */
    .conv-info-btn {
      position: absolute;
      bottom: 8px;
      right: 8px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      border: none;
      background: transparent;
      color: #9ca3af;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      opacity: 0;
      transition: opacity 0.15s, color 0.15s;
      z-index: 2;
      padding: 0;
    }

    .conversation-card:hover .conv-info-btn,
    .conversation-card.active .conv-info-btn {
      opacity: 1;
    }

    .conv-info-btn:hover { color: #7c3aed; }

    /* Info popup */
    .conv-info-popup {
      position: absolute;
      z-index: 200;
      width: 300px;
      background: #fff;
      border: 1px solid rgba(28,27,24,0.1);
      border-radius: 12px;
      box-shadow: 0 8px 28px rgba(0,0,0,0.13);
      padding: 12px;
    }

    .conv-info-popup-title {
      font-weight: 600;
      font-size: 13px;
      color: #111827;
      margin-bottom: 8px;
      padding-bottom: 8px;
      border-bottom: 1px solid rgba(28,27,24,0.08);
    }

    .conv-info-row {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 5px 0;
      border-bottom: 1px solid rgba(28,27,24,0.05);
      font-size: 12px;
    }

    .conv-info-row:last-child { border-bottom: none; }

    .conv-info-label {
      font-weight: 500;
      color: #374151;
      white-space: nowrap;
      min-width: 100px;
      flex-shrink: 0;
    }

    .conv-info-value {
      color: #6b7280;
      font-family: monospace;
      font-size: 11px;
      flex: 1;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .conv-info-copy {
      border: none;
      background: none;
      color: #9ca3af;
      cursor: pointer;
      padding: 2px 3px;
      border-radius: 4px;
      display: flex;
      align-items: center;
      flex-shrink: 0;
      transition: color 0.12s, background 0.12s;
    }

    .conv-info-copy:hover {
      color: #7c3aed;
      background: #f5f3ff;
    }

    .avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(143, 61, 29, 0.14));
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 13px;
      color: #374151;
      flex-shrink: 0;
      overflow: hidden;
      border: none;
    }

    .conversation-flag {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
      display: block;
    }

    /* Subtle gray outline for all avatars */
    .avatar { outline: 1.5px solid rgba(0,0,0,0.08); }

    .conversation-content {
      min-width: 0;
      flex: 1;
    }

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

    .conversation-name {
      font-size: 13px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .conversation-time {
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
    }

    .conversation-preview {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 14px;
    }

    .conversation-status {
      margin-top: 8px;
    }

    .status-pill {
      display: inline-block;
      font-size: 12px;
      padding: 4px 8px;
      border-radius: 999px;
      font-weight: 700;
    }

    /* Chat panel */
    .chat-panel {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .chat-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 18px 20px;
      border-bottom: 1px solid rgba(28, 27, 24, 0.08);
      min-height: 88px;
      background:
        linear-gradient(180deg, rgba(79, 70, 229, 0.08), rgba(79, 70, 229, 0)),
        rgba(255, 253, 248, 0.92);
    }

    .chat-title {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .chat-title-main {
      font-size: 18px;
      font-weight: 700;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .chat-title-sub {
      font-size: 13px;
      color: var(--muted);
      margin-top: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

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

    .ghost-btn,
    .primary-btn,
    .danger-btn {
      border: none;
      border-radius: 12px;
      padding: 10px 14px;
      cursor: pointer;
      font: inherit;
      white-space: nowrap;
    }

    .ghost-btn {
      background: var(--surface-soft);
      color: var(--text);
    }

    .danger-btn {
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      color: #fff8f2;
      box-shadow: 0 12px 24px rgba(143, 61, 29, 0.18);
    }

    .chat-icon-btn {
      width: 36px;
      height: 36px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      transition: background 0.15s, transform 0.12s;
      color: #374151;
      background: var(--surface-soft);
    }

    .chat-icon-btn:hover { transform: translateY(-1px); }

    .btn-assign { background: #f0fdf4; color: #15803d; }
    .btn-assign:hover { background: #dcfce7; }

    .btn-requeue { background: #fefce8; color: #a16207; }
    .btn-requeue:hover { background: #fef08a; }

    .btn-transfer { background: #eff6ff; color: #1d4ed8; }
    .btn-transfer:hover { background: #dbeafe; }

    .btn-resolve { background: #ecfdf5; color: #047857; }
    .btn-resolve:hover { background: #d1fae5; }

    .btn-close { background: #f3f4f6; color: #475569; }
    .btn-close:hover { background: #e5e7eb; color: #1e293b; }

    .btn-assign:disabled,
    .btn-requeue:disabled,
    .btn-transfer:disabled,
    .btn-resolve:disabled,
    .btn-close:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      transform: none;
    }

    .chat-messages {
      flex: 1;
      overflow: auto;
      padding: 20px;
      background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.08), transparent 22%),
        linear-gradient(180deg, #f8f5ef 0%, #fdfbf7 100%);
    }

    .message-row {
      margin-bottom: 18px;
      display: flex;
    }

    .message-row.user {
      justify-content: flex-start;
    }

    .message-row.assistant {
      justify-content: flex-end;
    }

    .message-row.agent {
      justify-content: flex-end;
    }

    .message-bubble {
      max-width: 72%;
      padding: 14px 16px;
      border-radius: 16px;
      line-height: 1.5;
      font-size: 15px;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .message-row.user .message-bubble {
      background: #fdfaf7;
      color: var(--text);
      border-bottom-left-radius: 6px;
      border: 1px solid rgba(28, 27, 24, 0.07);
      box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }

    .message-row.assistant .message-bubble {
      background: linear-gradient(180deg, rgba(79, 70, 229, 0.08), rgba(255, 255, 255, 0.98));
      color: var(--text);
      border-bottom-right-radius: 6px;
      border: 1px solid rgba(79, 70, 229, 0.14);
    }

    .message-row.agent .message-bubble {
      background: var(--olive-soft);
      color: var(--text);
      border-bottom-right-radius: 6px;
      border: 1px solid rgba(49, 84, 61, 0.12);
    }

    .message-row.note-bubble {
      justify-content: flex-end;
    }

    .message-row.note-bubble .message-bubble {
      background: #fffbeb;
      color: #92400e;
      border: 1px solid #fcd34d;
      border-bottom-right-radius: 6px;
      position: relative;
    }

    .note-tag {
      display: inline-block;
      font-size: 10px;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      background: #fcd34d;
      color: #78350f;
      border-radius: 4px;
      padding: 1px 5px;
      margin-bottom: 4px;
    }

    .message-time {
      font-size: 11px;
      color: #b0a898;
      margin-top: 6px;
      text-align: right;
      letter-spacing: 0.01em;
    }

    /* User messages: timestamp left-aligned */
    .message-row.user .message-time {
      text-align: left;
      color: #b0a898;
    }

    .chat-composer {
      border-top: 1px solid rgba(28, 27, 24, 0.08);
      background: linear-gradient(to bottom, #fdfcf9, #fff);
      display: flex;
      flex-direction: column;
    }

    /* Note mode tint */
    .chat-composer.note-mode .composer-body textarea {
      background: #fffbeb;
    }
    .chat-composer.note-mode .composer-send {
      background: linear-gradient(135deg, #6366f1, #4338ca);
    }

    /* Toolbar */
    .composer-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 12px 6px;
      border-bottom: 1px solid rgba(28,27,24,0.06);
    }

    .composer-mode-wrap { position: relative; }

    .composer-mode-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      border: none;
      background: var(--surface-soft);
      border-radius: 8px;
      padding: 5px 9px;
      font: 600 12px/1 inherit;
      color: #374151;
      cursor: pointer;
      transition: background 0.13s;
    }
    .composer-mode-btn:hover { background: #e5e7eb; }

    .composer-mode-menu {
      display: none;
      position: absolute;
      bottom: calc(100% + 6px);
      left: 0;
      background: #fff;
      border: 1px solid rgba(28,27,24,0.1);
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.12);
      overflow: hidden;
      z-index: 100;
      min-width: 150px;
    }
    .composer-mode-menu.open { display: block; }

    .composer-mode-opt {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 9px 12px;
      border: none;
      background: none;
      font: 500 13px/1 inherit;
      color: #374151;
      cursor: pointer;
      text-align: left;
      transition: background 0.12s;
    }
    .composer-mode-opt:hover { background: #f9fafb; }
    .composer-mode-check { margin-left: auto; color: #7c3aed; opacity: 0; }
    .composer-mode-opt.active .composer-mode-check { opacity: 1; }

    .composer-tools {
      display: flex;
      align-items: center;
      gap: 2px;
    }

    .composer-tool-btn {
      width: 30px;
      height: 30px;
      border: none;
      background: none;
      border-radius: 7px;
      color: #6b7280;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.13s, color 0.13s;
    }
    .composer-tool-btn:hover { background: var(--surface-soft); color: #111827; }
    .composer-tool-ai { color: #7c3aed; }
    .composer-tool-ai:hover { background: #f5f3ff; color: #6d28d9; }

    /* Quick chips */
    .composer-quick {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      padding: 6px 12px;
    }

    .quick-chip {
      border: 1px solid rgba(28, 27, 24, 0.08);
      background: #fff;
      border-radius: 999px;
      padding: 8px 12px;
      font-size: 13px;
      cursor: pointer;
    }

    .composer-body {
      padding: 8px 12px 4px;
    }

    .composer-body textarea {
      width: 100%;
      min-height: 64px;
      max-height: 160px;
      resize: none;
      border: none;
      border-radius: 8px;
      padding: 10px;
      font: inherit;
      font-size: 13px;
      outline: none;
      background: #f9fafb;
      transition: background 0.15s;
    }

    .composer-body textarea:focus { background: #f3f4f6; }

    .composer-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 12px 10px;
      gap: 8px;
    }

    .composer-footer-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .composer-hint {
      font-size: 11px;
      color: #9ca3af;
      white-space: nowrap;
    }

    .composer-send {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 0 18px;
      height: 34px;
      border: none;
      border-radius: 20px;
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      color: #fff8f2;
      font-weight: 700;
      font-size: 13px;
      cursor: pointer;
      box-shadow: 0 4px 12px rgba(143, 61, 29, 0.22);
      transition: background 0.15s, box-shadow 0.15s;
      white-space: nowrap;
    }

    .composer-send:hover { box-shadow: 0 6px 16px rgba(143, 61, 29, 0.30); }

    .composer-send:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    /* ── Translate panel (composer) ─────────────────────────────────── */
    .tcp {
      border-top: 1px solid rgba(28,27,24,0.08);
      background: #f0f9ff;
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
    }

    .tcp-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px 8px;
      border-bottom: 1px solid #bae6fd;
      gap: 8px;
    }

    .tcp-lang-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      flex-wrap: wrap;
    }

    .tcp-lang-label {
      font-size: 11.5px;
      color: #0369a1;
      font-weight: 500;
      white-space: nowrap;
    }

    .tcp-select-wrap {
      position: relative;
    }

    .tcp-select {
      appearance: none;
      background: #fff;
      border: 1px solid #7dd3fc;
      border-radius: 6px;
      padding: 4px 24px 4px 8px;
      font-size: 12.5px;
      font-weight: 600;
      color: #0c4a6e;
      cursor: pointer;
      outline: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230369a1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 6px center;
    }
    .tcp-select:focus { border-color: #0284c7; }

    .tcp-chat-lang {
      font-size: 12.5px;
      font-weight: 700;
      color: #0c4a6e;
      background: #e0f2fe;
      border: 1px solid #7dd3fc;
      border-radius: 6px;
      padding: 4px 10px;
    }

    .tcp-close {
      background: none;
      border: none;
      padding: 4px;
      cursor: pointer;
      color: #0369a1;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .tcp-close:hover { background: #bae6fd; }

    .tcp-body {
      padding: 10px 14px 6px;
    }

    .tcp-preview-label {
      font-size: 10.5px;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: #0369a1;
      margin-bottom: 6px;
    }

    .tcp-preview {
      min-height: 56px;
      background: #fff;
      border: 1px solid #7dd3fc;
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 13.5px;
      line-height: 1.55;
      color: #111827;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .tcp-preview.placeholder { color: #94a3b8; font-style: italic; }
    .tcp-preview.translating::after {
      content: "";
      display: inline-block;
      width: 8px;
      height: 8px;
      border: 2px solid #bae6fd;
      border-top-color: #0284c7;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
      margin-left: 6px;
      vertical-align: middle;
    }

    .tcp-footer {
      padding: 5px 14px 10px;
    }
    .tcp-footer-hint {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      color: #0369a1;
    }

    /* ── Per-message "🌐 Translate" (Console-style compact) ─────────── */
    .msg-translate-wrap { margin-top: 6px; }

    .msg-translate-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-top: 4px;
      padding: 3px 9px;
      background: rgba(255,255,255,0.7);
      border: 1px solid rgba(0,0,0,0.06);
      border-radius: 5px;
      font-size: 10.5px;
      font-weight: 600;
      color: inherit;
      cursor: pointer;
      opacity: 0.7;
      transition: all 0.12s;
    }
    .msg-translate-btn:hover { opacity: 1; background: #fff; }
    .msg-translate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

    .msg-translated-block {
      margin-top: 6px;
      padding: 6px 10px;
      background: rgba(0,0,0,0.04);
      border-left: 2px solid #4f46e5;
      border-radius: 4px;
      opacity: 0.9;
      line-height: 1.3;
    }

    .msg-translated-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      opacity: 0.6;
      line-height: 1.2;
      margin: 0 0 3px;
    }

    .msg-translated-text {
      font-size: 13px;
      line-height: 1.35;
      color: inherit;
      white-space: pre-wrap;
      word-break: break-word;
      margin: 0;
    }

    /* Translated badge on user messages */
    .translate-badge {
      display: flex;
      align-items: center;
      gap: 3px;
      font-size: 10px;
      color: #9ca3af;
      margin-top: 4px;
      font-style: italic;
    }

    /* Spinner */
    @keyframes spin { to { transform: rotate(360deg); } }
    .translate-loading {
      display: inline-block;
      width: 10px;
      height: 10px;
      border: 2px solid rgba(0,0,0,0.1);
      border-top-color: #6b7280;
      border-radius: 50%;
      animation: spin 0.6s linear infinite;
    }

    /* Info panel */
    .info-panel-inner {
      height: 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .info-body {
      flex: 1;
      overflow-y: auto;
      min-height: 0;
      background: #fdfaf6;
    }

    .info-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 12px 14px;
      border-bottom: 1px solid rgba(28, 27, 24, 0.08);
      background:
        linear-gradient(180deg, rgba(79, 70, 229, 0.06), rgba(79, 70, 229, 0)),
        rgba(255, 253, 248, 0.92);
    }

    .info-toolbar-tabs {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .info-toggle-btn {
      border: none;
      background: var(--surface-soft);
      border-radius: 12px;
      width: 38px;
      height: 38px;
      cursor: pointer;
      color: #374151;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.15s, background 0.15s;
      flex-shrink: 0;
    }

    .info-toggle-btn:hover {
      transform: translateY(-1px);
      background: #f3f4f6;
    }

    /* Flip the chevron when panel is collapsed */
    .info-panel.collapsed .info-toggle-btn .info-toggle-icon {
      transform: rotate(180deg);
    }

    .info-mode-icon {
      width: 24px;
      height: 24px;
      display: block;
      color: #1f2937;
    }

    .busybot-orb {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background:
        radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.18), transparent 32%),
        radial-gradient(circle at 50% 50%, rgba(90, 127, 255, 0.45), rgba(18, 22, 32, 0.96) 72%);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: inset 0 1px 8px rgba(255, 255, 255, 0.12), 0 10px 20px rgba(31, 41, 55, 0.18);
      overflow: hidden;
      position: relative;
    }

    .busybot-orb.large {
      width: 74px;
      height: 74px;
      margin-bottom: 14px;
      box-shadow: inset 0 1px 10px rgba(255, 255, 255, 0.12), 0 18px 32px rgba(99, 102, 241, 0.18);
    }

    /* Smaller, flatter copilot icon — replaces the .busybot-orb.large
       hero in the Live Chats assistant panel. Lavender square + Lucide
       sparkle SVG, matches the rest of the admin's iconography. */
    .copilot-icon {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 14px;
      background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
      color: #7c3aed;
      box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
    }
    .copilot-icon svg { width: 22px; height: 22px; }

    .busybot-core {
      width: 12px;
      height: 23px;
      border-radius: 999px;
      background: linear-gradient(180deg, #7dd3fc 0%, #8b5cf6 55%, #60a5fa 100%);
      box-shadow: 0 0 18px rgba(129, 140, 248, 0.65);
    }

    .busybot-orb.large .busybot-core {
      width: 18px;
      height: 42px;
    }

    .info-#lc-container {
      overflow: auto;
      padding: 0;
      background:
        radial-gradient(circle at 50% 16%, rgba(143, 61, 29, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(250, 246, 239, 0.92));
    }

    .info-view {
      display: none;
      min-height: 100%;
    }

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

    .info-card {
      padding: 18px 20px;
      border-bottom: 1px solid rgba(28, 27, 24, 0.08);
    }

    .info-card-title {
      font-weight: 700;
      margin-bottom: 14px;
      font-size: 15px;
    }

    .info-row {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 12px;
      font-size: 14px;
    }

    .info-label {
      color: var(--muted);
      min-width: 110px;
    }

    .info-value {
      color: #111827;
      text-align: right;
      word-break: break-word;
    }

    #info-recent-chat-at {
      white-space: nowrap;
      font-size: 13px;
    }

    .visitor-hero {
      padding-top: 20px;
      background: rgba(255, 255, 255, 0.66);
    }

    .visitor-hero-top {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 16px;
    }

    .visitor-avatar {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(143, 61, 29, 0.14));
      color: #111827;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 26px;
      font-weight: 700;
      position: relative;
      flex-shrink: 0;
      overflow: hidden;
    }

    .visitor-avatar-dot {
      position: absolute;
      right: 2px;
      top: 2px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #22c55e;
      box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.96);
    }

    .visitor-meta {
      min-width: 0;
      flex: 1;
    }

    .visitor-title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .visitor-title {
      font-size: 15px;
      font-weight: 700;
      color: #111827;
      word-break: break-word;
      line-height: 1.3;
    }

    .visitor-subtitle {
      margin-top: 3px;
      color: var(--muted);
      font-size: 13px;
    }

    .visitor-facts {
      display: grid;
      gap: 7px;
      margin-bottom: 14px;
    }

    .visitor-fact {
      display: flex;
      align-items: center;
      gap: 10px;
      color: #111827;
      font-size: 14px;
    }

    .visitor-fact-icon {
      width: 18px;
      height: 18px;
      color: #4b5563;
      flex-shrink: 0;
    }

    .visitor-fact-text {
      flex: 1;
      min-width: 0;
      word-break: break-word;
    }

    .visitor-fact-flag {
      font-size: 18px;
      flex-shrink: 0;
    }

    .visitor-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 18px;
    }

    .visitor-stat-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 12px;
      background: rgba(244, 239, 229, 0.9);
      color: #111827;
      font-size: 13px;
      font-weight: 700;
    }

    .visitor-stat-icon {
      width: 16px;
      height: 16px;
      color: #4b5563;
      flex-shrink: 0;
    }

    .visitor-stat-pill.highlight {
      background: rgba(191, 219, 254, 0.92);
      color: #1d4ed8;
    }

    .recent-chat-text {
      color: #111827;
      font-size: 13px;
      line-height: 1.5;
      word-break: break-word;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .visitor-primary-action {
      width: 100%;
      border-radius: 12px;
      border: 1px solid rgba(28, 27, 24, 0.14);
      background: rgba(255, 255, 255, 0.92);
      padding: 8px 14px;
      font: inherit;
      font-size: 13px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: pointer;
      transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .visitor-primary-action:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 18px rgba(28, 27, 24, 0.08);
    }

    .copilot-shell {
      display: flex;
      flex-direction: column;
      min-height: 100%;
    }

    .copilot-hero {
      padding: 48px 20px 24px;
      text-align: center;
    }

    .copilot-hero h3 {
      margin: 0 0 16px;
      font-size: 22px;
      line-height: 1.2;
    }

    .copilot-list {
      margin: 0 auto;
      max-width: 250px;
      display: grid;
      gap: 14px;
      text-align: left;
      color: #6b7280;
      font-size: 15px;
    }

    .copilot-list-item {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .copilot-list-icon {
      width: 20px;
      height: 20px;
      color: #6b7280;
      flex-shrink: 0;
    }

    .copilot-actions {
      display: grid;
      gap: 12px;
      padding: 0 20px 18px;
    }

    .copilot-chip {
      width: fit-content;
      max-width: 100%;
      border-radius: 16px;
      border: 1px solid rgba(28, 27, 24, 0.14);
      background: rgba(255, 255, 255, 0.94);
      padding: 12px 16px;
      font: inherit;
      font-weight: 700;
      text-align: left;
      cursor: pointer;
    }

    .copilot-output {
      margin: 0 20px 18px;
      padding: 16px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.7);
      border: 1px solid rgba(28, 27, 24, 0.08);
      min-height: 110px;
      color: #374151;
      white-space: pre-wrap;
      line-height: 1.55;
    }

    .copilot-output strong {
      color: #111827;
    }

    .helper-note {
      color: #6b7280;
    }

    .copilot-composer {
      margin-top: auto;
      padding: 0 20px 24px;
    }

    .copilot-input-row {
      display: flex;
      align-items: flex-end;
      gap: 12px;
      padding: 12px;
      border-radius: 22px;
      border: 1px solid rgba(28, 27, 24, 0.12);
      background: rgba(255, 255, 255, 0.96);
      box-shadow: 0 12px 24px rgba(28, 27, 24, 0.08);
    }

    .copilot-prompt-input {
      flex: 1;
      min-height: 54px;
      max-height: 150px;
      border: none;
      resize: vertical;
      background: transparent;
      font: inherit;
      outline: none;
    }

    .copilot-send-btn {
      width: 54px;
      height: 54px;
      border: none;
      border-radius: 18px;
      background: linear-gradient(135deg, var(--accent), var(--accent-deep));
      color: #fff;
      cursor: pointer;
      font-size: 24px;
      flex-shrink: 0;
      box-shadow: 0 12px 24px rgba(143, 61, 29, 0.18);
    }

    .visit-meta-icons {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .visit-meta-pill {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: var(--surface-soft);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    .visit-meta-svg {
      width: 18px;
      height: 18px;
      display: block;
      color: #374151;
    }

    .visit-meta-img {
      width: 18px;
      height: 18px;
      display: block;
      object-fit: contain;
    }

    .brand-windows {
      color: #2563eb;
    }

    .brand-apple {
      color: #111827;
    }

    .brand-android {
      color: #16a34a;
    }

    .brand-linux {
      color: #111827;
    }

    .empty-state {
      padding: 28px;
      color: var(--muted);
      text-align: center;
    }

    /* ── Channel badges ─────────────────────────────────────────── */
    .channel-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 7px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.03em;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .channel-badge-icon {
      width: 12px;
      height: 12px;
      display: block;
      flex-shrink: 0;
    }

    .channel-badge.widget   { background: #fff7ed; color: #4f46e5; border: 1px solid rgba(79,70,229,0.22); }
    .channel-badge.telegram { background: #e7f3fe; color: #0088cc; border: 1px solid rgba(0,136,204,0.22); }
    .channel-badge.whatsapp { background: #e8fdf0; color: #25d366; border: 1px solid rgba(37,211,102,0.22); }
    .channel-badge.instagram{ background: #fdf0f8; color: #c13584; border: 1px solid rgba(193,53,132,0.22); }
    .channel-badge.email    { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
    .channel-badge.unknown  { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

    .avatar-wrap {
      position: relative;
      flex-shrink: 0;
    }

    .avatar-channel-dot {
      position: absolute;
      bottom: -2px;
      right: -2px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 2px solid #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
    }

    .avatar-channel-dot.telegram  { background: #0088cc; }
    .avatar-channel-dot.whatsapp  { background: #25d366; }
    .avatar-channel-dot.instagram { background: #c13584; }
    .avatar-channel-dot.widget    { background: #4f46e5; }
    .avatar-channel-dot.busybot   { background: #7c3aed; }
    .avatar-channel-dot.email     { background: #6b7280; }

    .chat-header-channel {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 4px;
    }

    @media (max-width: 1400px) {
      .lc-app {
        grid-template-columns: 300px minmax(0, 1fr) 280px;
      }
    }

    @media (max-width: 1100px) {
      .lc-app {
        grid-template-columns: 280px minmax(0, 1fr);
      }

      .info-panel {
        display: none;
      }
    }

    @media (max-width: 1100px) {
      #lc-container {
        overflow: hidden;
      }

      .lc-app {
        grid-template-columns: 1fr;
        grid-auto-rows: 1fr;
        gap: 0;
        padding: 4px 4px 68px;
        height: 100%;
      }

      .mobile-nav {
        position: fixed;
        left: 4px;
        right: 4px;
        bottom: 4px;
        z-index: 10001;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        padding: 4px;
        border-radius: 10px;
        background: rgba(255, 253, 248, 0.92);
        box-shadow: 0 18px 34px rgba(55, 38, 19, 0.14);
        border: 1px solid rgba(28, 27, 24, 0.08);
        backdrop-filter: blur(14px);
      }

      .conversation-list,
      .chat-panel,
      .info-panel {
        display: none;
        height: calc(100vh - 112px);
        min-height: 0;
        border-radius: 10px;
      }

      #lc-container.mobile-view-conversations .conversation-list {
        display: flex;
      }

      #lc-container.mobile-view-chat .chat-panel {
        display: flex;
      }

      #lc-container.mobile-view-info .info-panel {
        display: block;
        width: auto;
        min-width: 0;
        opacity: 1;
      }

      .sidebar {
        position: relative;
      }

      .sidebar-scroll,
      .conversation-list-body,
      .chat-messages,
      .info-#lc-container {
        padding-bottom: 24px;
      }

      .sidebar-top,
      .conversation-list-header,
      .chat-header,
      .info-toolbar {
        min-height: auto;
      }

      .sidebar-top {
        padding: 20px 18px;
      }

      .conversation-list-header,
      .chat-header,
      .info-toolbar {
        padding: 18px;
      }

      .conversation-toolbar {
        flex-direction: column;
        align-items: stretch;
      }

      .conversation-tabs {
        width: 100%;
      }

      .conversation-tools {
        justify-content: flex-end;
      }

      .chat-actions {
        width: 100%;
        justify-content: flex-start;
      }

      .chat-header {
        align-items: flex-start;
        flex-direction: column;
      }

      .chat-composer {
        padding: 10px;
      }

      .composer-box {
        align-items: stretch;
        flex-direction: column;
      }

      .composer-send {
        width: 100%;
      }

      .message-bubble {
        max-width: 88%;
      }
    }

    @media (max-width: 700px) {
      .mobile-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }