    * { box-sizing: border-box; }
    body {
      margin: 0;
      background: var(--bg-primary);
      color: var(--text-primary);
      transition: background 0.2s, color 0.2s;
      overflow: hidden;
      /* System font stack for crisp rendering on all platforms */
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
      /* Enhanced font rendering */
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-rendering: optimizeLegibility;
      font-feature-settings: "kern" 1, "liga" 1;
    }

    /* Sidebar empty state */
    .sidebarEmptyState {
      padding: 24px 16px;
      text-align: center;
      color: var(--text-muted);
    }
    .sidebarEmptyState .emptyIcon { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }
    .sidebarEmptyState .emptyText { font-size: 0.85rem; margin-bottom: 12px; }
    .sidebarEmptyState .emptyHint { font-size: 0.75rem; }
    .sidebarEmptyState .hintBtn {
      color: var(--accent);
      cursor: pointer;
      text-decoration: underline;
    }
    .sidebarEmptyState .hintBtn:hover { color: var(--accent-hover); }

    /* Shared containers sidebar section */
    .sidebarFolder--shared {
      margin-top: 8px;
      border-top: 1px solid var(--border-color);
      padding-top: 4px;
    }
    .sidebarFolder--shared .folderHeader {
      color: var(--text-secondary);
    }
    .sb-container-group {
      margin-bottom: 4px;
    }
    .sb-container-label {
      font-size: 0.75rem;
      color: var(--text-muted);
      padding: 4px 10px 2px;
      font-weight: 500;
      letter-spacing: 0.02em;
    }

    /* Container table indicator in dataset list */
    /* Batch execution status bar */
    /* Expandable chat item styles */
    }
    /* Compact chat sidebar header */

    /* Global search dropdown */
    /* Home page layout - responsive container */
    .homeContainer {
      width: 100%;
      max-width: min(95%, 1200px);  /* Scale with screen, max 1200px */
      margin: 0 auto;
      padding: 24px;
    }

    /* Quick Search section - full width on home */
    .homeSearchSection {
      padding: 20px 24px;
      border-radius: 12px;
      margin-bottom: 0;
    }
    .homeSearchSection .searchContainer {
      max-width: 100%;
    }
    .searchInputWrapper {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .searchInputWrapper .searchInput {
      flex: 1;
      font-size: 1rem;
      padding: 14px 18px;
      border-radius: 10px;
    }
    .searchInputWrapper .voiceBtn {
      flex-shrink: 0;
    }

    /* Search Help Button & Popover */
    .searchHelpBtn {
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: color 0.2s, background 0.2s;
    }
    .searchHelpBtn:hover {
      color: var(--accent);
      background: var(--bg-tertiary);
    }
    .searchHelpPopover {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 0;
      margin-bottom: 16px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.2);
      max-width: 500px;
    }
    .searchHelpHeader {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border-color);
      font-weight: 600;
    }
    .searchHelpClose {
      background: transparent;
      border: none;
      color: var(--text-muted);
      font-size: 20px;
      cursor: pointer;
      padding: 0 4px;
      line-height: 1;
    }
    .searchHelpClose:hover {
      color: var(--text-primary);
    }
    .searchHelpContent {
      padding: 16px;
      display: grid;
      gap: 16px;
    }
    .searchHelpSection {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .searchHelpTitle {
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--accent);
      margin-bottom: 4px;
    }
    .searchHelpExample {
      font-size: 0.85rem;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .searchHelpExample kbd {
      background: var(--bg-secondary);
      padding: 3px 8px;
      border-radius: 4px;
      font-family: monospace;
      font-size: 0.85em;
      border: 1px solid var(--border-color);
      white-space: nowrap;
    }
    .searchHelpList {
      margin: 0;
      padding-left: 20px;
      font-size: 0.85rem;
      color: var(--text-secondary);
    }
    .searchHelpList li {
      margin-bottom: 4px;
    }
    .searchHelpList kbd {
      background: var(--bg-secondary);
      padding: 1px 5px;
      border-radius: 3px;
      font-family: monospace;
      font-size: 0.9em;
      border: 1px solid var(--border-color);
    }

    /* Navigation tiles hover effects */
    .homeContainer .bgSecondary[onclick] {
      transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
      border: 1px solid transparent;
    }
    .homeContainer .bgSecondary[onclick]:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
      border-color: var(--border-color);
    }
    .searchResults.loading::after {
      content: 'Searching...';
      display: block;
      padding: 16px;
      color: var(--text-muted);
      font-size: 0.85rem;
      text-align: center;
    }
    .searchResultItem {
      padding: 14px 18px;
      border-bottom: 1px solid var(--border-color);
      cursor: pointer;
      display: flex;
      align-items: flex-start;
      gap: 12px;
      transition: background 0.15s, transform 0.1s;
    }
    .searchResultItem:last-child { border-bottom: none; }
    .searchResultItem:hover {
      background: var(--hover);
      transform: translateX(2px);
    }
    .searchResultItem.selected {
      background: var(--accent-light, rgba(59, 130, 246, 0.1));
      border-left: 3px solid var(--accent);
      padding-left: 15px;
    }
    .searchResultIcon {
      font-size: 1.2rem;
      flex-shrink: 0;
      width: 28px;
      text-align: center;
      padding-top: 2px;
    }
    .searchResultContent { flex: 1; min-width: 0; }
    .searchResultName {
      font-weight: 600;
      font-size: 0.95rem;
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .searchResultType {
      font-size: 0.65rem;
      padding: 2px 8px;
      border-radius: 4px;
      background: var(--bg-tertiary);
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .searchResultContext {
      font-size: 0.8rem;
      color: var(--text-muted);
      font-style: italic;
      margin-left: 4px;
    }
    .searchResultSummary {
      font-size: 0.8rem;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .searchResultMatch {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 4px;
    }
    .searchNoResults {
      padding: 16px;
      text-align: center;
      color: var(--text-muted);
      font-size: 0.85rem;
    }
    .searchHint {
      padding: 8px 14px;
      font-size: 0.75rem;
      color: var(--text-muted);
      border-top: 1px solid var(--border-color);
      background: var(--bg-tertiary);
    }
    .searchHint kbd {
      background: var(--bg-secondary);
      padding: 2px 6px;
      border-radius: 3px;
      font-family: inherit;
      border: 1px solid var(--border-color);
    }

    .btnPrimary {
      background: var(--accent);
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 600;
      font-size: 0.8rem;
      padding: 8px 16px;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }
    .btnPrimary:hover {
      filter: brightness(1.15);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
      transform: translateY(-1px);
    }
    .btnPrimary:active {
      transform: translateY(0) scale(0.98);
    }
    .btnPrimary:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      box-shadow: none;
    }
    .btnDanger {
      background: #dc2626;
      color: white;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 500;
      font-size: 0.8rem;
      padding: 6px 12px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .btnDanger:hover { background: #b91c1c; }
    .btnDanger:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .btnSmall {
      padding: 6px 12px;
      font-size: 0.75rem;
    }

    /* Data Tables */
      display: inline-block;
      width: 12px;
      height: 12px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: white;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      margin-right: 6px;
      vertical-align: middle;
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Toast notifications */
    .toast {
      position: fixed;
      bottom: 20px;
      right: 20px;
      padding: 12px 20px;
      border-radius: 8px;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
      z-index: 1000;
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.3s, transform 0.3s;
    }
    .toast.show { opacity: 1; transform: translateY(0); }
    .toast-error { background: #dc2626; color: white; }
    .toast-success { background: #16a34a; color: white; }

    /* Modal overlay */
    .modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.6);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }
    .modalContent {
      background: var(--bg-primary);
      padding: 24px;
      border-radius: 12px;
      width: 600px;
      min-width: 300px;
      min-height: 200px;
      max-width: 95vw;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 8px 32px rgba(0,0,0,0.3);
      resize: both;
      overflow: auto;
    }
    .modalContent h3 {
      margin: 0 0 16px 0;
    }
    .formLabel {
      display: block;
      font-weight: 500;
      margin-bottom: 4px;
      font-size: 0.875rem;
    }
    .formInput {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.875rem;
      font-family: inherit;
      resize: vertical;
    }
    .formInput:focus {
      outline: none;
      border-color: var(--accent);
    }

    /* Enrichment Modal */
    /* ───────────────────────────────────────────────────────────────── */
    /* Profile Charts Section */
    /* Light theme override for output */
    [data-theme="light"] .enrichment-output {
      background: #f5f5f5;
      color: #333;
      border: 1px solid #ddd;
      box-shadow: inset 0 2px 6px rgba(0,0,0,0.08);
    }
    .enrichment-result {
      font-family: var(--font-base);
      font-size: 0.85rem;
    }
    .enrichment-result-section {
      margin-bottom: 16px;
    }
    .enrichment-result-section strong {
      display: block;
      margin-bottom: 4px;
      color: var(--text-primary);
    }
    .enrichment-result-section p {
      margin: 0;
      color: var(--text-secondary);
    }
    .enrichment-result-section ul {
      margin: 4px 0 0 0;
      padding-left: 20px;
      color: var(--text-secondary);
    }
    .enrichment-result-section li {
      margin-bottom: 4px;
    }
    .enrichment-result-section code {
      background: var(--bg-tertiary);
      padding: 1px 4px;
      border-radius: 3px;
      font-size: 0.8rem;
    }
    .enrichment-modal-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      border-top: 1px solid var(--border);
      background: var(--bg-secondary);
      gap: 12px;
    }
    .enrichment-status {
      font-size: 0.85rem;
      color: var(--text-primary);
      flex: 1;
      font-weight: 500;
    }
    .enrichment-stats {
      font-size: 0.8rem;
      color: var(--text-secondary);
      white-space: nowrap;
    }

    /* Enrichment Setup Section - horizontal toolbar */
    }
    /* Fields and Classifications body inherits flex to allow table container to grow */
    #enrichmentFieldsBody,
    #enrichmentClassificationsBody {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
    }
    .enrichment-fields-search {
      margin-bottom: 10px;
    }
    .enrichment-fields-search input {
      width: 100%;
      max-width: 250px;
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.8rem;
    }
    .enrichment-quick-filters {
      margin-top: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }
    .filter-label {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-right: 4px;
    }
    .quick-filter-btn {
      padding: 4px 10px;
      font-size: 0.75rem;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--bg-secondary);
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.2s;
      font-weight: 500;
    }
    .quick-filter-btn:hover {
      background: var(--bg-tertiary);
      border-color: var(--text-muted);
    }
    .quick-filter-btn.active {
      background: #3b82f6;
      border-color: #3b82f6;
      color: white;
    }

    /* Table category filter buttons */
      margin-bottom: 16px;
    }
    .artifactListHeader h2 {
      margin: 0;
    }
    .artifactListTable {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.925rem;
      background: var(--bg-secondary);
      border-radius: 8px;
      overflow: hidden;
      color: var(--text-primary);
    }
    .artifactListTable th,
    .artifactListTable td {
      padding: 10px 14px;
      text-align: left;
      border-bottom: 1px solid var(--border-color);
    }
    .artifactListTable th {
      background: var(--bg-tertiary);
      font-weight: 600;
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-primary);
    }
    .artifactListTable tr:last-child td {
      border-bottom: none;
    }
    .artifactListTable tr:hover {
      background: var(--hover);
    }
    .artifactListTable .nameCell {
      font-weight: 600;
      font-size: 0.95rem;
      cursor: pointer;
      color: var(--accent);
    }
    .artifactListTable .nameCell:hover {
      text-decoration: underline;
    }
    .artifactListTable .timestampCell {
      font-size: 0.85rem;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    .artifactListTable .pathCell {
      font-family: var(--font-mono);
      font-size: 0.8rem;
      color: var(--text-secondary);
      max-width: 300px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    /* ── Sortable table headers ── */
      display: flex;
      flex-direction: column;
      align-items: stretch;
      min-width: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      position: relative;
    }
    /* Workspace Selector (bottom) - hidden when tables mode has its own in sidebar */
    .workspace-selector {
      position: absolute;
      bottom: 32px;
      left: 0;
      right: 0;
      padding: 8px 12px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }
    /* Hide bottom workspace selector when tables mode is active (JS adds class) */
    .sidebar.hide-bottom-workspace .workspace-selector {
      display: none;
    }
    .workspace-current {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 6px;
      cursor: pointer;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      transition: all 0.15s ease;
    }
    .workspace-current:hover {
      background: var(--bg-hover);
      border-color: var(--accent-color);
    }
    .workspace-icon {
      font-size: 14px;
    }
    .workspace-name {
      flex: 1;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .workspace-chevron {
      font-size: 10px;
      color: var(--text-secondary);
      transition: transform 0.2s ease;
    }
    .workspace-current.open .workspace-chevron {
      transform: rotate(180deg);
    }
    .workspace-dropdown {
      position: absolute;
      bottom: 100%;
      left: 12px;
      right: 12px;
      margin-bottom: 4px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
      max-height: 300px;
      overflow-y: auto;
      z-index: 1000;
    }
    .workspace-section {
      padding: 8px 0;
    }
    .workspace-section-header {
      padding: 4px 12px 8px;
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .workspace-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      cursor: pointer;
      transition: background 0.15s ease;
    }
    .workspace-item:hover {
      background: var(--bg-hover);
    }
    .workspace-item.active {
      background: var(--accent-color-alpha);
    }
    .workspace-item .ws-icon {
      font-size: 14px;
    }
    .workspace-item .ws-name {
      flex: 1;
      font-size: 0.85rem;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .workspace-item .ws-badge {
      font-size: 0.7rem;
      color: var(--text-muted);
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
    }
    .workspace-divider {
      height: 1px;
      background: var(--border-color);
      margin: 4px 0;
    }
    .workspace-action {
      padding: 10px 12px;
      font-size: 0.85rem;
      color: var(--accent-color);
      cursor: pointer;
      transition: background 0.15s ease;
    }
    .workspace-action:hover {
      background: var(--bg-hover);
    }
    /* Workspace Dialog */
    .workspace-dialog-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
    }
    .workspace-dialog {
      background: var(--bg-primary);
      border-radius: 12px;
      width: 400px;
      max-width: 90vw;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    .workspace-dialog-header {
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .workspace-dialog-header h3 {
      margin: 0;
      font-size: 1rem;
      color: var(--text-primary);
    }
    .workspace-dialog-close {
      background: none;
      border: none;
      font-size: 20px;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 4px 8px;
      border-radius: 4px;
    }
    .workspace-dialog-close:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
    }
    .workspace-dialog-body {
      padding: 20px;
    }
    .workspace-dialog-input {
      width: 100%;
      padding: 10px 12px;
      font-size: 0.9rem;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--input-bg);
      color: var(--text-primary);
      box-sizing: border-box;
    }
    .workspace-dialog-input:focus {
      outline: none;
      border-color: var(--accent-color);
    }
    .workspace-dialog-footer {
      padding: 16px 20px;
      border-top: 1px solid var(--border-color);
      display: flex;
      gap: 12px;
      justify-content: flex-end;
    }

    /* Quick Dialog (inline popup) */
    .quickDialog {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000;
    }
    .quickDialogContent {
      background: var(--bg-primary);
      border-radius: 12px;
      padding: 20px;
      min-width: 320px;
      max-width: 400px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
      border: 1px solid var(--border-color);
    }
    .quickDialogContent h3 {
      margin: 0 0 16px 0;
      font-size: 1.1rem;
      color: var(--text-primary);
    }
    .quickDialogContent .formInput {
      width: 100%;
      margin-bottom: 8px;
      box-sizing: border-box;
    }
    .quickDialogContent .formInput.error {
      border-color: #dc2626;
    }
    .quickDialogHint {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-bottom: 16px;
    }
    .quickDialogActions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
    }

    /* Sidebar Footer with Version */
    .sidebar-footer {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 8px 12px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .version-badge {
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--text-secondary);
      background: var(--bg-tertiary);
      padding: 3px 10px;
      border-radius: 10px;
      letter-spacing: 0.5px;
    }
    .mainHeader {
      padding: 8px 14px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      flex-shrink: 0;
      height: 44px;
      box-sizing: border-box;
    }
    .headerLeft { display: flex; align-items: center; gap: 10px; }
    .headerRight { display: flex; align-items: center; gap: 6px; }
    .mainBody {
      flex: 1;
      width: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 16px;
      min-width: 0;
      min-height: 0;
      box-sizing: border-box;
    }
    .chatMessages { display: flex; flex-direction: column; gap: 16px; }
    .mainFooter {
      padding: 6px 16px 12px 16px;
      border-top: 1px solid var(--border-color);
      flex-shrink: 0;
    }

    /* Message Styles */
    pre code { border-radius: 8px; }
    .messageContent pre { margin: 8px 0; }
    .messageContent code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; }
    .messageContent pre code { padding: 16px; display: block; overflow-x: auto; }
    .messageContent { max-width: 100%; overflow-wrap: break-word; word-wrap: break-word; }
    .messageContent del, .messageContent s, .followup-content-body del, .followup-content-body s { text-decoration: none; }
    .messageContent pre { max-width: 100%; overflow-x: auto; }
    .messageContent > * { max-width: 100%; box-sizing: border-box; }
    .messageContent table { table-layout: fixed; }
    .messageContent section, .messageContent div, .messageContent article {
      max-width: 100%;
      overflow-x: auto;
    }
    .messageContent table {
      border-collapse: collapse;
      margin: 12px 0;
      width: 100%;
      font-size: 0.9em;
    }
    .messageContent th, .messageContent td {
      border: 1px solid var(--border-color);
      padding: 8px 12px;
      text-align: left;
    }
    .messageContent th { background: var(--bg-tertiary); font-weight: 600; }
    .messageContent tr:nth-child(even) { background: var(--bg-secondary); }
    .messageContent ul, .messageContent ol { margin: 8px 0; padding-left: 24px; }
    .messageContent ul { list-style-type: disc; }
    .messageContent ol { list-style-type: decimal; }
    .messageContent li { margin: 4px 0; }
    .messageContent ul ul { list-style-type: circle; }

    /* Rendered HTML blocks */
    .rendered-html {
      margin: 12px 0;
      padding: 16px;
      background: var(--bg-tertiary);
      border-radius: 8px;
      border: 1px solid var(--border);
      color: var(--text-primary);
    }
    /* Override LLM-generated inline styles to respect theme */
    .rendered-html *,
    .messageContent * {
      color: inherit;
    }
    .rendered-html [style*="background"],
    .messageContent [style*="background"] {
      background: var(--bg-secondary) !important;
    }
    .rendered-html [style*="color:"],
    .messageContent [style*="color:"] {
      color: var(--text-primary) !important;
    }
    .rendered-html h1, .rendered-html h2, .rendered-html h3,
    .rendered-html h4, .rendered-html h5, .rendered-html h6,
    .messageContent h1, .messageContent h2, .messageContent h3,
    .messageContent h4, .messageContent h5, .messageContent h6 {
      color: var(--text-primary);
      margin: 16px 0 8px 0;
    }
    .rendered-html p, .messageContent p {
      margin: 8px 0;
    }
    .rendered-html table {
      width: 100%;
      border-collapse: collapse;
      margin: 8px 0;
    }
    .rendered-html th, .rendered-html td {
      padding: 8px 12px;
      border: 1px solid var(--border);
      text-align: left;
      background: transparent;
    }
    .rendered-html th {
      background: var(--bg-secondary) !important;
      font-weight: 600;
    }
    .rendered-html tr:hover { background: var(--bg-secondary); }
    .rendered-html .highlight, .rendered-html [class*="highlight"] {
      background: rgba(168, 85, 247, 0.2) !important;
    }
    .rendered-html .insight, .rendered-html [class*="insight"] {
      background: var(--bg-secondary) !important;
      border-left: 3px solid var(--accent);
      padding: 12px;
      margin: 12px 0;
      border-radius: 0 8px 8px 0;
    }

    /* Sanitized HTML blocks (processed by backend sanitizer) */
    .sanitized-html {
      color: var(--text-primary);
      line-height: 1.6;
    }
    .sanitized-html section {
      margin: 16px 0;
      padding: 16px;
      background: var(--bg-secondary);
      border-radius: 8px;
      border: 1px solid var(--border-color);
    }
    .sanitized-html h1, .sanitized-html h2, .sanitized-html h3,
    .sanitized-html h4, .sanitized-html h5, .sanitized-html h6 {
      color: var(--text-primary) !important;
      margin: 16px 0 8px 0;
      font-weight: 600;
    }
    .sanitized-html h2 { color: var(--accent) !important; font-size: 1.3em; }
    .sanitized-html h3 { font-size: 1.15em; }
    .sanitized-html p { margin: 8px 0; color: var(--text-primary); }
    .sanitized-html ul, .sanitized-html ol { margin: 8px 0; padding-left: 24px; }
    .sanitized-html li { margin: 4px 0; color: var(--text-primary); }

    /* Barq content blocks (followup components) */
      padding: 4px 0;
      background: transparent;
      border: none;
    }

    /* ── Insights — card layout (matches explain-card styling) ── */
    .insights-content {
      padding: 0;
      background: transparent;
      border: none;
      font-size: 0.93rem;
      line-height: 1.6;
    }
    .insights-content .insights-section {
      padding: 10px 14px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      border-left: 2px solid var(--insights-border, rgba(99,102,241,0.35));
      border-radius: 6px;
      margin-bottom: 0;
    }
    .insights-content .insights-section + .insights-section {
      margin-top: 6px;
    }
    .insights-content .insights-section[data-insight="patterns"]  { --insights-color: #60a5fa; --insights-border: rgba(59,130,246,0.35); }
    .insights-content .insights-section[data-insight="anomalies"] { --insights-color: #fbbf24; --insights-border: rgba(245,158,11,0.35); }
    .insights-content .insights-section[data-insight="segments"]  { --insights-color: #a78bfa; --insights-border: rgba(139,92,246,0.35); }
    .insights-content .insights-section[data-insight="temporal"]  { --insights-color: #4ade80; --insights-border: rgba(34,197,94,0.35); }
    .insights-content .insights-section[data-insight="quality"]   { --insights-color: #f87171; --insights-border: rgba(239,68,68,0.35); }
    .insights-content .insights-section[data-insight="hypotheses"]{ --insights-color: #22d3ee; --insights-border: rgba(6,182,212,0.35); }
    .insights-content .insights-section > summary {
      margin: 0 0 6px 0;
      padding: 0;
      font-weight: 600;
      font-size: 1rem;
      color: var(--insights-color, var(--accent));
      list-style: none;
      cursor: pointer;
      border: none;
      display: flex;
      align-items: center;
      gap: 8px;
      user-select: none;
    }
    .insights-content .insights-section:not([open]) > summary {
      margin-bottom: 0;
    }
    .insights-content .insights-section > summary::-webkit-details-marker { display: none; }
    .insights-content .insights-section > summary::before {
      content: '▶';
      font-size: 0.7rem;
      transition: transform 0.2s;
      color: var(--text-secondary, #94a3b8);
    }
    .insights-content .insights-section[open] > summary::before {
      transform: rotate(90deg);
    }
    .insights-content .insights-section-body {
      color: var(--text-primary);
    }
    .insights-content .insights-section-body p {
      margin: 0 0 6px 0;
    }
    .insights-content .insights-section-body p:last-child {
      margin-bottom: 0;
    }
    .insights-content .insights-number {
      font-weight: 600;
      font-size: 0.9rem;
      color: #93c5fd;
    }
    .insights-content .insights-up {
      color: #4ade80;
      font-weight: 600;
    }
    .insights-content .insights-down {
      color: #f87171;
      font-weight: 600;
    }
    .insights-content .insights-warn {
      color: #fbbf24;
      font-weight: 600;
    }
    .light-theme .insights-content .insights-section { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
    .light-theme .insights-content .insights-number { color: #2563eb; }
    .light-theme .insights-content .insights-up { color: #16a34a; }
    .light-theme .insights-content .insights-down { color: #dc2626; }
    .light-theme .insights-content .insights-warn { color: #d97706; }

    /* ── Explain — colored card layout ─────────────────────────── */
    .explain-content {
      padding: 0;
      background: transparent;
      border: none;
      font-size: 0.93rem;
      line-height: 1.6;
    }
    .explain-content .explain-card {
      padding: 10px 14px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      border-left: 2px solid var(--explain-color, rgba(99,102,241,0.35));
      border-radius: 6px;
      margin-bottom: 0;
    }
    .explain-content .explain-card + .explain-card {
      margin-top: 6px;
    }
    .explain-content .explain-card[data-type="finding"]  { --explain-color: rgba(59,130,246,0.45); }
    .explain-content .explain-card[data-type="details"]  { --explain-color: rgba(139,92,246,0.45); }
    .explain-content .explain-card[data-type="context"]  { --explain-color: rgba(34,197,94,0.45); }
    .explain-content .explain-card h4 {
      margin: 0 0 6px 0;
      font-size: 1rem;
      font-weight: 600;
      color: var(--explain-color, var(--accent));
      border: none;
      padding: 0;
    }
    .explain-content .explain-card p {
      margin: 0 0 6px 0;
      color: var(--text-primary);
    }
    .explain-content .explain-card p:last-child {
      margin-bottom: 0;
    }
    .explain-content .explain-number {
      font-weight: 600;
      font-size: 0.9rem;
      color: #93c5fd;
    }
    .light-theme .explain-content .explain-number { color: #2563eb; }
    .light-theme .explain-content .explain-card { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }

    /* Audit Details — lightweight collapsible sections */
    .audit-details {
      font-size: 0.92rem;
      line-height: 1.55;
      padding: 4px 0;
      background: transparent;
    }
    .audit-details .audit-section {
      border: 1px solid transparent;
      border-left: 2px solid rgba(99,102,241,0.35);
      border-radius: 6px;
      margin-bottom: 0;
      background: transparent;
      overflow: hidden;
    }
    .audit-details .audit-section[open] {
      background: rgba(255,255,255,0.04);
      border-color: rgba(255,255,255,0.06);
      padding-bottom: 4px;
    }
    .audit-details .audit-section + .audit-section {
      margin-top: 6px;
    }
    /* Color-coded section variants */
    .audit-details .audit-section[data-section="source"]  { --audit-section-color: #3b82f6; border-left-color: rgba(59,130,246,0.45); }
    .audit-details .audit-section[data-section="query"]   { --audit-section-color: #a78bfa; border-left-color: rgba(167,139,250,0.45); }
    .audit-details .audit-section[data-section="exec"]    { --audit-section-color: #22c55e; border-left-color: rgba(34,197,94,0.45); }
    .audit-details .audit-section[data-section="perf"]    { --audit-section-color: #f59e0b; border-left-color: rgba(245,158,11,0.45); }
    .audit-details .audit-section[data-section="sdk"]     { --audit-section-color: #f97316; border-left-color: rgba(249,115,22,0.45); }
    .audit-details .audit-section[data-section="limits"]  { --audit-section-color: #ef4444; border-left-color: rgba(239,68,68,0.45); }
    .audit-details .audit-section > summary {
      cursor: pointer;
      padding: 5px 8px;
      font-weight: 600;
      font-size: 1rem;
      color: var(--audit-section-color, var(--accent));
      list-style: none;
      display: flex;
      align-items: center;
      gap: 8px;
      user-select: none;
    }
    .audit-details .audit-section > summary::-webkit-details-marker { display: none; }
    .audit-details .audit-section > summary::before {
      content: '▶';
      font-size: 0.6rem;
      transition: transform 0.2s;
      color: var(--audit-section-color, var(--text-muted));
    }
    .audit-details .audit-section[open] > summary::before {
      transform: rotate(90deg);
    }
    .audit-details .audit-section-body {
      padding: 6px 10px 10px;
      color: var(--text-primary);
    }
    .audit-details .audit-section-body p {
      margin: 0 0 8px 0;
    }
    .audit-details .audit-section-body p:last-child {
      margin-bottom: 0;
    }
    /* Key-value table for audit details */
    .audit-kv {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.86rem;
    }
    .audit-kv tr { border-bottom: 1px solid rgba(255,255,255,0.06); }
    .audit-kv tr:last-child { border-bottom: none; }
    .audit-kv td { padding: 7px 10px; color: var(--text-primary); vertical-align: top; }
    .audit-kv .audit-kv-key {
      width: 150px;
      font-weight: 600;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    /* Colored value badges/pills */
    .audit-badge {
      display: inline-block;
      padding: 1px 8px;
      border-radius: 10px;
      font-size: 0.82rem;
      font-weight: 600;
    }
    .audit-badge-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
    .audit-badge-green  { background: rgba(34,197,94,0.15);  color: #4ade80; }
    .audit-badge-amber  { background: rgba(245,158,11,0.15); color: #fbbf24; }
    .audit-badge-red    { background: rgba(239,68,68,0.15);  color: #f87171; }
    .audit-badge-purple { background: rgba(167,139,250,0.15); color: #a78bfa; }
    .light-theme .audit-badge-blue   { background: rgba(37,99,235,0.12); color: #2563eb; }
    .light-theme .audit-badge-green  { background: rgba(22,163,74,0.12);  color: #16a34a; }
    .light-theme .audit-badge-amber  { background: rgba(217,119,6,0.12); color: #d97706; }
    .light-theme .audit-badge-red    { background: rgba(220,38,38,0.12); color: #dc2626; }
    .light-theme .audit-badge-purple { background: rgba(124,58,237,0.12); color: #7c3aed; }
    .light-theme .audit-kv tr { border-bottom: 1px solid rgba(0,0,0,0.06); }
    .light-theme .audit-details .audit-section[open] { background: rgba(0,0,0,0.02); }
    /* Code blocks inside audit sections */
    .audit-details pre {
      background: var(--code-bg);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 12px 14px;
      overflow-x: auto;
      font-size: 0.84rem;
      line-height: 1.5;
      margin: 6px 0;
    }
    .audit-details pre code {
      font-family: var(--font-mono);
      color: var(--text-primary);
    }
    /* Inline code */
    .audit-details code:not(pre code) {
      background: rgba(255,255,255,0.08);
      padding: 1px 5px;
      border-radius: 3px;
      font-size: 0.84rem;
      font-family: var(--font-mono);
    }
    .light-theme .audit-details code:not(pre code) {
      background: rgba(0,0,0,0.06);
    }
    /* Lists inside audit sections */
    .audit-details ul, .audit-details ol {
      margin: 4px 0;
      padding-left: 20px;
    }
    .audit-details li {
      margin-bottom: 4px;
    }
    /* Performance meter bar */
    .audit-meter {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      width: 100%;
    }
    .audit-meter-bar {
      flex: 1;
      height: 6px;
      background: rgba(255,255,255,0.08);
      border-radius: 3px;
      overflow: hidden;
      max-width: 120px;
    }
    .audit-meter-fill {
      height: 100%;
      border-radius: 3px;
      background: var(--audit-meter-color, #22c55e);
    }
    .light-theme .audit-meter-bar { background: rgba(0,0,0,0.08); }
    .result-table {
      margin: 12px 0;
    }
    .result-table .table-footer {
      font-size: 0.85em;
      color: var(--text-muted);
      margin-top: 8px;
      font-style: italic;
    }

    /* Barq tables (sanitized) */
    .barq-table {
      width: 100%;
      border-collapse: collapse;
      margin: 12px 0;
      background: var(--bg-secondary);
      border-radius: 8px;
      overflow: hidden;
    }
    .barq-table th {
      background: var(--bg-tertiary) !important;
      color: var(--text-primary) !important;
      font-weight: 600;
      padding: 12px;
      text-align: left;
      border-bottom: 2px solid var(--border-color);
    }
    .barq-table td {
      padding: 10px 12px;
      color: var(--text-primary) !important;
      border-bottom: 1px solid var(--border-color);
    }
    .barq-table tr:nth-child(even) { background: var(--bg-tertiary); }
    .barq-table tr:hover { background: var(--hover); }
    .barq-table td:first-child { font-weight: 500; }

    /* Force theme colors on all sanitized content */
    .sanitized-html * {
      color: inherit;
    }
    .sanitized-html [style*="background-color: #fff"],
    .sanitized-html [style*="background-color:#fff"],
    .sanitized-html [style*="background: #fff"],
    .sanitized-html [style*="background:#fff"],
    .sanitized-html [style*="background-color: white"],
    .sanitized-html [style*="background: white"] {
      background: var(--bg-secondary) !important;
    }
    .sanitized-html [style*="color: #000"],
    .sanitized-html [style*="color:#000"],
    .sanitized-html [style*="color: black"],
    .sanitized-html [style*="color:black"] {
      color: var(--text-primary) !important;
    }

    /* Insight/highlight boxes in sanitized content
       Exclude structured insights-* pane elements so they use their own CSS */
    .sanitized-html [class*="insight"]:not(.insights-content):not(.insights-section):not(.insights-section-body),
    .sanitized-html [class*="strategic"],
    .sanitized-html [class*="key-"] {
      background: rgba(168, 85, 247, 0.15) !important;
      border-left: 3px solid var(--accent);
      padding: 12px 16px;
      margin: 12px 0;
      border-radius: 0 8px 8px 0;
      color: var(--text-primary) !important;
    }

    /* ECharts container styling */
    .sanitized-html [id^="chart"],
    .sanitized-html .echarts-container,
    .rendered-html [id^="chart"],
    .rendered-html .echarts-container {
      min-height: 380px;
      width: 100%;
      margin: 16px 0;
      background: var(--bg-secondary);
      border-radius: 8px;
      border: 1px solid var(--border-color);
    }
    /* Ensure chart canvas is visible */
    .sanitized-html canvas,
    .rendered-html canvas {
      display: block;
    }

    /* ── Multi-chart tiling ──
       Responsive CSS grid for multi-chart layouts.
       auto-fit collapses empty tracks. minmax(300px, 500px) caps chart width.
       Extra space distributed evenly around charts. */
    .sanitized-html div:has(> [id^="chart"] + [id^="chart"]),
    .sanitized-html div:has(> .echarts-container + .echarts-container),
    .rendered-html div:has(> [id^="chart"] + [id^="chart"]),
    .rendered-html div:has(> .echarts-container + .echarts-container),
    .followup-content-body div:has(> [id^="chart"] + [id^="chart"]),
    .followup-content-body div:has(> .echarts-container + .echarts-container),
    .messageContent div:has(> [id^="chart"] + [id^="chart"]),
    .messageContent div:has(> .echarts-container + .echarts-container) {
      display: grid !important;
      grid-template-columns: repeat(auto-fit, minmax(300px, 500px)) !important;
      justify-content: center;
      gap: 12px;
    }
    /* Each chart in a tiled grid: fill cell, consistent height */
    .sanitized-html div:has(> [id^="chart"] + [id^="chart"]) > [id^="chart"],
    .sanitized-html div:has(> .echarts-container + .echarts-container) > .echarts-container,
    .rendered-html div:has(> [id^="chart"] + [id^="chart"]) > [id^="chart"],
    .rendered-html div:has(> .echarts-container + .echarts-container) > .echarts-container,
    .followup-content-body div:has(> [id^="chart"] + [id^="chart"]) > [id^="chart"],
    .followup-content-body div:has(> .echarts-container + .echarts-container) > .echarts-container,
    .messageContent div:has(> [id^="chart"] + [id^="chart"]) > [id^="chart"],
    .messageContent div:has(> .echarts-container + .echarts-container) > .echarts-container {
      width: 100% !important;
      min-width: 0 !important;
      min-height: 380px !important;
      margin: 0 !important;
    }

    /* ── Chart size cycle overrides ──
       Applied via class on .followup-content-body (from followup header button) */

    /* Large: wider grid columns + taller charts */
    .chart-size-large div:has(> [id^="chart"] + [id^="chart"]),
    .chart-size-large div:has(> .echarts-container + .echarts-container) {
      grid-template-columns: repeat(auto-fit, minmax(450px, 700px)) !important;
    }
    .chart-size-large [id^="chart"],
    .chart-size-large .echarts-container {
      min-height: 500px !important;
    }

    /* Full width: single column + tallest charts */
    .chart-size-full div:has(> [id^="chart"] + [id^="chart"]),
    .chart-size-full div:has(> .echarts-container + .echarts-container) {
      grid-template-columns: 1fr !important;
    }
    .chart-size-full [id^="chart"],
    .chart-size-full .echarts-container {
      min-height: 600px !important;
    }

    /* ── Per-chart expand button ── */
    .chart-expand-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      z-index: 5;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      padding: 4px 6px;
      cursor: pointer;
      opacity: 0.6;
      transition: opacity 0.2s;
      color: var(--text-secondary);
      line-height: 1;
    }
    .chart-expand-btn:hover {
      opacity: 1;
      background: var(--bg-tertiary);
    }

    /* System messages (slash command output) */
    .system-message {
      padding: 10px 16px;
      margin: 8px 0;
      border-left: 3px solid var(--accent-color, #6366f1);
      background: rgba(99, 102, 241, 0.06);
      border-radius: 0 6px 6px 0;
      font-size: 0.88rem;
      line-height: 1.6;
      color: var(--text-primary);
    }
    .system-message code {
      background: rgba(255, 255, 255, 0.08);
      padding: 1px 5px;
      border-radius: 3px;
      font-size: 0.85em;
    }

    /* Chart drill-down popover */
    .chart-drilldown-popover {
      position: relative;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.25);
      padding: 8px 12px;
      min-width: 180px;
      max-width: 300px;
      font-size: 0.82rem;
      animation: cdd-fade-in 0.12s ease-out;
    }
    @keyframes cdd-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
      background: transparent !important;
      border: none !important;
    }
    .recommend-section {
      margin-bottom: 0;
      padding: 0;
      background: transparent;
      border: 1px solid transparent;
      border-left: 2px solid rgba(99,102,241,0.35);
      border-radius: 6px;
      overflow: hidden;
    }
    .recommend-section[open] {
      background: rgba(255,255,255,0.04);
      border-color: rgba(255,255,255,0.06);
      padding-bottom: 4px;
    }
    .recommend-section + .recommend-section {
      margin-top: 6px;
    }
    .recommend-section.recommend-actions   { --recommend-color: #22c55e; border-left-color: rgba(34,197,94,0.45); }
    .recommend-section.recommend-queries   { --recommend-color: #3b82f6; border-left-color: rgba(59,130,246,0.45); }
    .recommend-section.recommend-monitors  { --recommend-color: #f59e0b; border-left-color: rgba(245,158,11,0.45); }
    .recommend-section.recommend-strategic { --recommend-color: #8b5cf6; border-left-color: rgba(139,92,246,0.45); }
    .recommend-section > summary {
      cursor: pointer;
      padding: 5px 8px;
      font-weight: 600;
      font-size: 1rem;
      color: var(--recommend-color, var(--accent));
      list-style: none;
      display: flex;
      align-items: center;
      gap: 8px;
      user-select: none;
    }
    .recommend-section > summary::-webkit-details-marker { display: none; }
    .recommend-section > summary::before {
      content: '▶';
      font-size: 0.6rem;
      transition: transform 0.2s;
      color: var(--recommend-color, var(--text-muted));
    }
    .recommend-section[open] > summary::before {
      transform: rotate(90deg);
    }
    .recommend-section-body {
      padding: 6px 10px 10px;
    }
    /* Legacy h4 header (non-collapsible fallback) */
    .recommend-section h4 {
      margin: 0 0 8px 0;
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--recommend-color, var(--accent));
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .recommend-icon {
      font-size: 1.1rem;
    }
    .recommend-list {
      list-style: none;
      margin: 0;
      padding: 0;
    }
    .recommend-item {
      position: relative;
      padding: 10px 14px 10px 36px;
      margin: 8px 0;
      background: transparent;
      font-size: 0.93rem;
      line-height: 1.5;
    }
    .recommend-item::before {
      content: '•';
      position: absolute;
      left: 12px;
      color: var(--accent);
      font-weight: bold;
    }
    /* Clickable items */
    .recommend-clickable .recommend-item {
      cursor: pointer;
      transition: all 0.15s ease;
      background: var(--bg-secondary);
      border-radius: 6px;
    }
    .recommend-clickable .recommend-item:hover {
      background: rgba(59, 130, 246, 0.15);
      transform: translateX(4px);
    }
    .recommend-clickable .recommend-item::after {
      content: '→';
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      opacity: 0;
      transition: opacity 0.15s;
    }
    .recommend-clickable .recommend-item:hover::after {
      opacity: 1;
      color: var(--accent);
    }
    /* Query items - more space for icon */
    .recommend-query::before {
      content: '💬';
      font-size: 0.9rem;
      left: 10px;
    }
    /* Monitor metric items */
    .recommend-metric::before {
      content: '📊';
      font-size: 0.9rem;
      left: 10px;
    }
    /* Section-specific styles */
    .recommend-actions .recommend-item::before {
      content: '✓';
      color: #22c55e;
    }
    .recommend-strategic .recommend-item::before {
      content: '◆';
      color: #f59e0b;
    }
    .light-theme .recommend-section[open] { background: rgba(0,0,0,0.02); }

    /* Utility Classes */
    .bgSecondary { background: var(--bg-secondary); }
    .bgTertiary { background: var(--bg-tertiary); }
    .textSecondary { color: var(--text-secondary); }
    .textMuted { color: var(--text-muted); }
    .borderThemed { border-color: var(--border-color); }
    .userMsg { background: var(--user-msg-bg); }
    .btnSecondary {
      background: var(--bg-tertiary);
      color: var(--text-primary);
      transition: all 0.2s ease;
      border: 1.5px solid var(--border-color);
      padding: 8px 16px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }
    .btnSecondary:hover {
      background: var(--bg-secondary);
      border-color: rgba(148, 163, 184, 0.4);
      filter: brightness(1.05);
    }
    .btnSecondary:active {
      transform: scale(0.98);
    }

    /* Followup Panel - Component Navigation */
    .followup-panel {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 4px 0;
      /* Right padding to align with chatbox (accounts for voice+send buttons ~82px including buffer) */
      padding-right: 82px;
      margin-bottom: 4px;
      border-bottom: 1px solid var(--border-color);
    }
    .followup-nav {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: thin;
      scroll-behavior: smooth;
      position: relative;
    }
    /* Right-edge fade indicator when buttons overflow */
    .followup-nav.has-overflow:not(.scrolled-end) {
      mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
      -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent);
    }
    .followup-panel.hidden {
      display: none;
    }
    .followup-panel-title {
      font-size: 0.65rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      white-space: nowrap;
    }
    .followup-buttons {
      display: flex;
      gap: 4px;
      flex-wrap: nowrap;
      flex-shrink: 0;
      align-items: center;
    }
    .followup-btn {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(255,255,255,0.06);
      color: var(--text-secondary);
      border: 1px solid rgba(255,255,255,0.10);
      border-radius: 6px;
      padding: 4px 6px;
      font-size: 0.75rem;
      cursor: pointer;
      transition: all 0.15s ease;
      opacity: 0.9;
      min-width: 28px;
      min-height: 28px;
    }
    /* Per-type colored backgrounds */
    .followup-btn[data-followup="chart"]     { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.25); }
    .followup-btn[data-followup="table"]     { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.25); }
    .followup-btn[data-followup="map"]       { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.25); }
    .followup-btn[data-followup="explain"]   { background: rgba(234,179,8,0.15);  border-color: rgba(234,179,8,0.25); }
    .followup-btn[data-followup="insights"]  { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.25); }
    .followup-btn[data-followup="recommend"] { background: rgba(34,197,94,0.15);  border-color: rgba(34,197,94,0.25); }
    .followup-btn[data-followup="technical"] { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.25); }
    .followup-btn:hover {
      opacity: 1;
      transform: translateY(-1px);
      filter: brightness(1.3);
    }
    .followup-btn:active {
      transform: scale(0.95);
    }
    .followup-btn .followup-icon {
      font-size: 0.95rem;
    }

    /* Followup button states */
    .followup-btn.loading {
      opacity: 0.8;
      cursor: wait;
    }
    .followup-btn.loading::after {
      content: '';
      position: absolute;
      bottom: 2px;
      left: 50%;
      transform: translateX(-50%);
      width: 5px;
      height: 5px;
      background: #f59e0b;
      border-radius: 50%;
      animation: followup-blink 0.8s ease-in-out infinite;
    }
    @keyframes followup-blink {
      0%, 100% { opacity: 0.3; }
      50% { opacity: 1; }
    }

    /* Generated state - green dot at bottom */
    .followup-btn.generated {
      border-color: #22c55e;
      opacity: 1;
    }
    .followup-btn.generated::after {
      content: '';
      position: absolute;
      bottom: 2px;
      left: 50%;
      transform: translateX(-50%);
      width: 5px;
      height: 5px;
      background: #22c55e;
      border-radius: 50%;
    }

    /* Disabled state - keep pointer-events for tooltips */
    .followup-btn.disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }

    /* Panel processing state */
    .followup-panel.processing .followup-panel-title {
      opacity: 0.5;
    }
    .followup-panel.processing .followup-btn {
      pointer-events: none;
      opacity: 0.4;
    }

    /* Elapsed time badge */
    .followup-time {
      position: absolute;
      top: -12px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 0.6rem;
      color: #22c55e;
      background: var(--bg-primary);
      padding: 1px 4px;
      border-radius: 3px;
      white-space: nowrap;
      border: 1px solid #22c55e;
      font-weight: 500;
    }

    /* Followup Panel Layout */
    .followup-nav {
      display: flex;
      align-items: center;
      gap: 8px;
      flex: 1;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: thin;
    }

    /* Auto-generate defaults (right side) */
    .followup-defaults {
      display: flex;
      align-items: center;
      gap: 3px;
      padding-left: 8px;
      border-left: 1px solid var(--border-color);
      flex-shrink: 0;
    }
    .followup-defaults-title {
      font-size: 0.6rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.3px;
      white-space: nowrap;
    }
    .followup-checkbox {
      display: flex;
      align-items: center;
      gap: 2px;
      cursor: pointer;
      padding: 2px 4px;
      border-radius: 4px;
      font-size: 0.85rem;
      transition: background 0.15s;
      user-select: none;
    }
    .followup-checkbox:hover {
      background: var(--hover);
    }
    .followup-checkbox input[type="checkbox"] {
      width: 14px;
      height: 14px;
      cursor: pointer;
      accent-color: var(--accent);
    }
    .followup-checkbox.checked {
      background: rgba(59, 130, 246, 0.15);
    }

    /* ── Popup wrapper (shared by Auto and Query Hints popups) ── */
    .popup-wrapper {
      position: relative;
    }

    /* Popup panel — vertical list above the button */
    .auto-popup-panel,
    .query-hints-popup {
      position: absolute;
      bottom: 100%;
      right: 0;
      margin-bottom: 6px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
      z-index: 1000;
      min-width: 280px;
      padding: 6px 0;
    }
    .popup-header {
      padding: 6px 12px 6px;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 1px solid var(--border-color);
      margin-bottom: 4px;
    }

    /* Auto popup — each checkbox row */
    .auto-popup-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 12px;
      cursor: pointer;
      transition: background 0.15s;
      user-select: none;
      font-size: 0.85rem;
      color: var(--text-primary);
    }
    .auto-popup-item:hover {
      background: var(--hover);
    }
    .auto-popup-item input[type="checkbox"] {
      width: 14px;
      height: 14px;
      cursor: pointer;
      accent-color: var(--accent);
      margin: 0;
    }
    .auto-popup-item .followup-auto-icon {
      font-size: 0.9rem;
      opacity: 0.6;
    }
    .auto-popup-item input[type="checkbox"]:checked ~ .followup-auto-icon {
      opacity: 1;
    }
    .auto-popup-item input[type="checkbox"]:checked ~ .auto-popup-label {
      color: var(--text-primary);
    }
    /* Per-type followup model select */
    .followupTypeModelSelect {
      margin-left: auto;
      font-size: 0.7rem;
      padding: 1px 4px;
      max-width: 105px;
      background: var(--bg-secondary);
      color: var(--text-muted);
      border: 1px solid transparent;
      border-radius: 3px;
      cursor: pointer;
      flex-shrink: 0;
    }
    .followupTypeModelSelect:hover,
    .followupTypeModelSelect:focus {
      border-color: var(--border-color);
      color: var(--text-primary);
    }

    /* Query hints popup — sections and radio items */
    .query-hints-section {
      padding: 4px 0;
    }
    .query-hints-section + .query-hints-section {
      border-top: 1px solid var(--border-color);
    }
    .query-hints-section-title {
      padding: 4px 12px;
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .query-hints-radio {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      cursor: pointer;
      font-size: 0.85rem;
      color: var(--text-primary);
      transition: background 0.15s;
    }
    .query-hints-radio:hover {
      background: var(--hover);
    }
    .query-hints-radio input[type="radio"] {
      width: 14px;
      height: 14px;
      cursor: pointer;
      accent-color: var(--accent);
      margin: 0;
    }
    .query-hints-desc {
      font-size: 0.78rem;
      color: var(--text-secondary);
      margin-left: auto;
    }

    /* Followup button status indicator - elapsed time on top */
    .followup-status {
      position: absolute;
      top: -10px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 0.55rem;
      color: var(--text-muted);
      white-space: nowrap;
      background: var(--bg-primary);
      padding: 0 2px;
      border-radius: 2px;
    }
    .followup-btn.generated .followup-status {
      color: #22c55e;
    }
    .followup-btn.loading .followup-status {
      color: #f59e0b;
    }

    /* Big separator between major sections (dataset|NLP/SQL|buttons) */
    .followup-sep-big {
      width: 2px;
      height: 24px;
      background: var(--border-color);
      margin: 0 8px;
      opacity: 0.7;
    }

    /* Separator between followup button groups */
    .followup-sep {
      width: 1px;
      height: 20px;
      background: var(--border-color);
      margin: 0 5px;
      opacity: 0.6;
    }

    /* Dataset selector font */
    .dataset-select {
      font-size: 0.9rem !important;
      font-weight: 500;
    }

    /* Version tooltip */
    .version-tooltip {
      position: fixed;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 12px 16px;
      font-size: 0.85rem;
      z-index: 10000;
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
      min-width: 160px;
    }
    .version-tooltip .version-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
      padding-bottom: 6px;
      border-bottom: 1px solid var(--border-color);
    }
    .version-tooltip .version-title {
      font-weight: 600;
    }
    .version-tooltip .version-close-icon {
      background: none;
      border: none;
      padding: 2px;
      cursor: pointer;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
    }
    .version-tooltip .version-close-icon:hover {
      color: var(--text-primary);
      background: var(--hover);
    }
    .version-tooltip .version-hint {
      margin-top: 8px;
      padding-top: 6px;
      border-top: 1px solid var(--border-color);
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    /* Chat input form */
    .chat-input-form {
      display: flex;
      gap: 6px;
      align-items: flex-end;
    }
    .chat-textarea-wrapper {
      flex: 1;
      position: relative;
      display: flex;
      flex-direction: column;
    }
    .chat-resize-handle {
      position: absolute;
      top: 2px;
      right: 8px;
      width: 20px;
      height: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: ns-resize;
      color: var(--text-muted);
      font-size: 9px;
      letter-spacing: -1px;
      user-select: none;
      opacity: 0.5;
      transition: opacity 0.15s, color 0.15s;
      z-index: 5;
    }
    .chat-resize-handle:hover {
      opacity: 1;
      color: var(--accent);
    }
    .chat-resize-handle.dragging {
      opacity: 1;
      color: var(--accent);
    }
    .chat-textarea {
      flex: 1;
      padding: 14px 14px 10px 14px;
      min-height: 44px;
      max-height: 50vh;
      height: 44px;
      resize: none !important;
      line-height: 1.4;
      overflow-y: auto;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
    }
    .chat-input-buttons {
      display: flex;
      flex-direction: row;
      gap: 4px;
      align-items: center;
      flex-shrink: 0;
    }
    .chat-icon-btn {
      width: 34px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-secondary);
      transition: all 0.15s;
    }
    .chat-icon-btn:hover {
      background: var(--hover);
      border-color: var(--accent);
      color: var(--accent);
    }
    .chat-icon-btn.hidden {
      display: none;
    }
    .chat-send-btn {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }
    .chat-send-btn:hover {
      background: var(--accent-hover, #2563eb);
      border-color: var(--accent-hover, #2563eb);
      color: white;
    }
    .chat-stop-btn {
      background: #ef4444;
      border-color: #ef4444;
      color: white;
    }
    .chat-stop-btn:hover {
      background: #dc2626;
      border-color: #dc2626;
    }

    /* Followup content container (appended to message) */
    .followup-content-section {
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px solid var(--border-color);
    }
    .followup-content-item {
      margin-top: 0;
      padding: 8px 10px;
      background: rgba(255,255,255,0.03);
      border-radius: 6px;
      border-left: 2px solid rgba(99,102,241,0.2);
    }
    /* Section-based panes: kill ALL wrapper backgrounds so only inner cards are visible */
    .followup-content-item:has(.insights-content),
    .followup-content-item:has(.explain-content),
    .followup-content-item:has(.audit-details),
    .followup-content-item:has(.recommend-content) {
      background: transparent !important;
      border-left: none !important;
      padding: 0 !important;
    }
    .followup-content-item:has(.insights-content) > .followup-content-body,
    .followup-content-item:has(.explain-content)  > .followup-content-body,
    .followup-content-item:has(.audit-details)    > .followup-content-body,
    .followup-content-item:has(.recommend-content) > .followup-content-body {
      background: transparent !important;
    }
    .followup-content-item:has(.insights-content) > .followup-content-header,
    .followup-content-item:has(.explain-content)  > .followup-content-header,
    .followup-content-item:has(.audit-details)    > .followup-content-header,
    .followup-content-item:has(.recommend-content) > .followup-content-header {
      margin: 0 0 4px 0;
    }
    .followup-content-item.loading {
      opacity: 0.85;
    }
    .followup-loading {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 20px 16px;
      color: #22c55e;
      font-size: 0.9rem;
      font-weight: 500;
      background: rgba(34, 197, 94, 0.08);
      border-radius: 8px;
      border: 1px solid rgba(34, 197, 94, 0.2);
      margin: 8px 0;
    }
    .followup-loading .loading-spinner {
      width: 18px;
      height: 18px;
      border: 2px solid rgba(34, 197, 94, 0.3);
      border-top-color: #22c55e;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    .followup-content-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
      gap: 8px;
      background: rgba(255,255,255,0.05);
      padding: 5px 8px;
      border-radius: 4px;
      margin: -4px -6px 6px -6px;
    }
    .followup-content-title {
      font-weight: 600;
      color: var(--accent);
      font-size: 1.05rem;
      flex: 1;
    }
    .followup-content-meta {
      font-size: 0.9rem;
      color: #22c55e;  /* Green for visibility */
      font-weight: 500;
    }
    html[data-theme="light"] .followup-content-meta {
      color: #15803d;  /* Darker green for light mode */
    }
    .followup-regenerate-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      border: 1px solid var(--border-color);
      color: var(--text-muted);
      padding: 3px 6px;
      border-radius: 4px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .followup-regenerate-btn:hover {
      background: var(--hover);
      color: var(--accent);
      border-color: var(--accent);
    }
    .followup-content-item.loading .followup-regenerate-btn {
      display: none !important;
    }
    .followup-content-body {
      color: var(--text-primary);
      line-height: 1.5;
    }

    /* Chart containers in followup content */
    .followup-content-body [id^="chart"],
    .followup-content-body .echarts-container,
    .followup-content-body div[_echarts_instance_] {
      min-height: 350px;
      width: 100%;
    }

    /* Tables in followup content */
    .followup-content-body .result-table + .result-table,
    .followup-content-body table + table {
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px solid var(--border-color);
    }
    .followup-content-body table {
      width: 100%;
      border-collapse: collapse;
      margin: 8px 0;
    }
    /* Plain HTML tables (not Grid.js) */
    .followup-content-body table:not(.barq-grid-table) th {
      padding: 8px 12px;
      text-align: left;
      font-weight: 600;
      color: var(--text-primary);
      border-bottom: 1px solid var(--border-color);
      font-size: 0.85rem;
    }
    .followup-content-body table:not(.barq-grid-table) td {
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
      color: var(--text-primary);
      font-size: 0.9rem;
    }
    .followup-content-body table:not(.barq-grid-table) tr:last-child td {
      border-bottom: none;
    }
    /* Grid.js dark theme overrides (mermaid theme is light by default) */
    .gridjs-wrapper {
      border-color: rgba(255,255,255,0.08);
    }
    .gridjs-table {
      background: transparent;
    }
    .gridjs-thead th,
    .gridjs-th {
      background: rgba(255,255,255,0.04);
      color: var(--text-primary);
      border-color: rgba(255,255,255,0.08);
      font-size: 0.85rem;
    }
    .gridjs-td {
      background: transparent;
      color: var(--text-primary);
      border-color: rgba(255,255,255,0.06);
      font-size: 0.9rem;
    }
    .gridjs-tr:hover td {
      background: rgba(255,255,255,0.04);
    }
    .gridjs-footer {
      background: transparent;
      border-color: rgba(255,255,255,0.08);
      color: var(--text-secondary);
    }
    .gridjs-pagination .gridjs-pages button {
      background: transparent;
      color: var(--text-primary);
      border-color: rgba(255,255,255,0.1);
    }
    .gridjs-pagination .gridjs-pages button.gridjs-currentPage {
      background: var(--accent);
      color: #fff;
    }
    .gridjs-search input {
      background: var(--bg-secondary);
      color: var(--text-primary);
      border-color: rgba(255,255,255,0.1);
    }
    .followup-content-body caption {
      padding: 8px 12px;
      font-weight: 600;
      color: var(--text-primary);
      text-align: left;
      border-bottom: 1px solid var(--border-color);
    }

    /* Section headers in followup content */
    .followup-content-body h3,
    .followup-content-body h4 {
      margin-top: 16px;
      margin-bottom: 8px;
      padding-bottom: 4px;
      border-bottom: 1px solid var(--border-color);
      color: var(--text-primary);
      font-size: 0.9rem;
    }
    .followup-content-body h3:first-child,
    .followup-content-body h4:first-child {
      margin-top: 0;
    }

    /* Side-by-side table grid for multiple tables */
    .table-grid,
    .followup-content-body .table-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
      gap: 16px;
      margin: 8px 0;
    }
    .table-grid-item {
      min-width: 0; /* Prevent grid blowout */
      overflow-x: auto;
    }
    .table-grid-item .barq-table-title,
    .table-grid-item .barq-grid-wrapper {
      margin: 0;
    }
    /* Reset margin on tables inside grid */
    .table-grid .result-table,
    .table-grid table {
      margin: 0;
    }
    .table-grid .result-table + .result-table,
    .table-grid table + table {
      margin-top: 0;
      padding-top: 0;
      border-top: none;
    }
    /* Two-column grid for exactly 2 tables */
    .table-grid-2 {
      grid-template-columns: repeat(2, 1fr);
    }
    /* Stack on smaller screens */

    /* Inline tables in message content */
    .messageContent .table-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
      gap: 16px;
      margin: 12px 0;
    }
    .messageContent .table-grid-item {
      background: var(--bg-secondary);
      border-radius: 6px;
      padding: 12px;
      overflow-x: auto;
    }

    /* Selected message highlight (for followup panel context) */
    #exploreChat {
      outline: none;  /* Remove default focus ring, we show selection instead */
    }
    #exploreChat:focus-visible .bgSecondary[data-msg-id].explore-selected {
      outline-width: 3px;  /* Thicker outline when keyboard focused */
    }
    #exploreChat .bgSecondary[data-msg-id] {
      cursor: pointer;
      transition: outline 0.15s, background 0.15s;
      border-radius: 8px;
    }
    #exploreChat .bgSecondary[data-msg-id]:hover {
      outline: 1px solid var(--border-color);
      outline-offset: -1px;
    }
    #exploreChat .bgSecondary[data-msg-id].explore-selected {
      outline: 2px solid var(--accent);
      outline-offset: -2px;
      background: var(--active);
    }

    /* Legacy followup buttons (inline in messages) */
    .followupBtn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border: 1px solid var(--border);
      border-radius: 20px;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      font-size: 0.8rem;
      cursor: pointer;
      transition: all 0.2s;
    }
    .followupBtn:hover {
      background: var(--bg-secondary);
      border-color: var(--accent);
      color: var(--accent);
    }
    .followupBtn.active {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }
    .followupBtn.loading {
      opacity: 0.7;
      cursor: wait;
    }
    .followupBtn .followupIcon { font-size: 1rem; }
    .followupBtn .followupLabel { font-weight: 500; }

    /* ─────────────────────────────────────────────────────
       Message Collapse/Expand
       ───────────────────────────────────────────────────── */

    /* Message group wrapper - wraps user msg + assistant msg + followup panes */
    .message-group {
      position: relative;
      margin-bottom: 4px;
    }

    /* Collapse toggle on left side */
    .msg-collapse-toggle {
      position: absolute;
      left: -20px;
      top: 8px;
      width: 16px;
      height: 16px;
      cursor: pointer;
      opacity: 0.4;
      transition: opacity 0.2s, transform 0.2s;
      z-index: 10;
    }
    .msg-collapse-toggle:hover {
      opacity: 1;
    }
    .msg-collapse-toggle svg {
      width: 14px;
      height: 14px;
      fill: none;
      stroke: var(--text-muted);
      stroke-width: 2;
      transition: transform 0.2s;
    }
    .message-group.collapsed .msg-collapse-toggle svg {
      transform: rotate(-90deg);
    }

    /* Collapsed state - show minimal bar */
    .message-group.collapsed .msg-group-content {
      display: none;
    }
    .message-group .msg-collapsed-bar {
      display: none;
    }
    .message-group.collapsed .msg-collapsed-bar {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: var(--bg-secondary);
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-muted);
      font-size: 0.8rem;
    }
    .message-group.collapsed .msg-collapsed-bar:hover {
      background: var(--bg-tertiary);
      color: var(--text-secondary);
    }
    .msg-collapsed-bar .collapsed-preview {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .msg-collapsed-bar .collapsed-count {
      background: var(--accent);
      color: white;
      padding: 2px 6px;
      border-radius: 10px;
      font-size: 0.7rem;
    }

    /* ─────────────────────────────────────────────────────
       Pane Collapse/Expand (for followup items)
       ───────────────────────────────────────────────────── */

    .followup-content-item .pane-collapse-toggle {
      cursor: pointer;
      margin-right: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 4px;
      background: transparent;
      transition: all 0.2s;
      position: relative;
      z-index: 10;
    }
    .followup-content-item .pane-collapse-toggle:hover {
      opacity: 0.8;
    }
    .followup-content-item .pane-collapse-toggle svg {
      width: 14px;
      height: 14px;
      transition: transform 0.2s;
    }
    /* Collapsed state - triangle rotates (color handled by JS) */
    .followup-content-item.pane-collapsed .pane-collapse-toggle svg {
      transform: rotate(-90deg);
    }
    .followup-content-item.pane-collapsed .followup-content-body {
      display: none !important;
    }
    /* Collapsed state: minimal single-line bar */
    .followup-content-item.pane-collapsed {
      padding: 6px 12px;
      margin-top: 4px;
    }
    .followup-content-item.pane-collapsed .followup-content-header {
      margin-bottom: 0;
    }
    .followup-content-item.pane-collapsed .followup-content-meta,
    .followup-content-item.pane-collapsed .followup-regenerate-btn {
      display: none;
    }

    /* Message collapsed state */
    .msg-collapsed .thinkingSection,
    .msg-collapsed .toolsSection,
    .msg-collapsed .textContent,
    .msg-collapsed .endTs {
      display: none !important;
    }
    .msg-collapsed {
      padding-bottom: 8px !important;
    }

    /* Chat timestamps and elapsed times - light green for visibility */
    .startTs,
    .endTs,
    .thinkingElapsed,
    .toolsElapsed,
    .toolTime {
      color: #5b9a6f !important;  /* Muted green for dark mode */
      font-weight: 500;
      font-size: 0.9rem !important;
    }
    html[data-theme="light"] .startTs,
    html[data-theme="light"] .endTs,
    html[data-theme="light"] .thinkingElapsed,
    html[data-theme="light"] .toolsElapsed,
    html[data-theme="light"] .toolTime {
      color: #15803d !important;  /* Darker green for light mode */
    }

    /* Pane header actions (regenerate, close) */
    .pane-header-actions {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-left: auto;
    }
    .pane-close-btn {
      width: 24px;
      height: 24px;
      padding: 4px;
      background: transparent;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }
    .pane-close-btn:hover {
      background: var(--hover, rgba(107, 114, 128, 0.15));
    }
    .pane-close-btn svg {
      width: 14px;
      height: 14px;
      stroke: var(--text-muted, #6b7280);
      fill: none;
      stroke-width: 2.5;
    }
    .pane-close-btn:hover svg {
      stroke: var(--text-primary, #e0e0e0);
    }
    .followup-regenerate-btn {
      width: 24px;
      height: 24px;
      padding: 4px;
      background: transparent;
      border: none;
      border-radius: 4px;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.7;
      transition: all 0.2s;
    }
    .followup-regenerate-btn:hover {
      background: var(--hover);
      color: var(--accent);
      opacity: 1;
    }
    .followup-regenerate-btn svg {
      width: 16px;
      height: 16px;
      stroke: #3b82f6;
      stroke-width: 2.5;
    }
    .followup-context-btn {
      width: 24px;
      height: 24px;
      padding: 4px;
      background: transparent;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.7;
      transition: all 0.2s;
    }
    .followup-context-btn:hover {
      background: rgba(168, 85, 247, 0.2);
      opacity: 1;
    }
    .followup-context-btn svg {
      width: 16px;
      height: 16px;
      stroke: #a855f7;
      stroke-width: 2.5;
    }

    /* ─────────────────────────────────────────────────────
       Resizable Panes (Map, Chart, Table)
       ───────────────────────────────────────────────────── */

    .followup-content-item.resizable {
      resize: vertical;
      overflow: auto;
      min-height: 150px;
      max-height: 80vh;
      position: relative;
      padding-bottom: 12px;  /* Space for resize handle */
    }
    .followup-content-item.resizable .followup-content-header {
      position: sticky;
      top: -12px;  /* Offset pane padding */
      z-index: 10;
      background: var(--bg-tertiary);
      padding-top: 4px;
      padding-bottom: 6px;
      margin-top: -4px;
    }
    /* NOTE: No explicit height here. Child elements (maps, charts) must use
       min-height for sizing — never height:100% which would resolve to 0. */
    .followup-content-item.resizable .followup-content-body {
      overflow: visible;
      display: flex;
      flex-direction: column;
    }
    /* Visual resize handle at bottom - bright green bar */
    .followup-content-item.resizable::after {
      content: '═══';
      position: absolute;
      bottom: 2px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 12px;
      color: #22c55e;
      letter-spacing: -1px;
      pointer-events: none;
      font-weight: bold;
    }
    /* Collapsed resizable panes — !important needed to beat inline height set by browser resize handle */
    .followup-content-item.resizable.pane-collapsed {
      resize: none !important;
      height: auto !important;
      min-height: auto !important;
      max-height: none !important;
      overflow: visible !important;
    }
    /* ── Map panes: flex layout so map fills the resizable pane ────── */
    /* When a resizable pane contains a map, switch to flex so the map
       grows/shrinks with the pane instead of staying at a fixed min-height. */
    .followup-content-item.resizable:has(.leaflet-container) {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .followup-content-item.resizable:has(.leaflet-container) .followup-content-header {
      flex-shrink: 0;
      position: relative;
      top: 0;
    }
    .followup-content-item.resizable:has(.leaflet-container) .followup-content-body {
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }
    /* Override LLM-generated inline height so the map fills the flex parent */
    .followup-content-item.resizable:has(.leaflet-container) .leaflet-container {
      height: 100% !important;
      min-height: 200px;
    }
    /* Map wrapper should fill the pane body completely */
    /* Only target the wrapper, not all map-* elements which would break grid layout */
    .followup-content-body .map-compare-wrapper {
      width: 100% !important;
      height: 100% !important;
      min-height: 100%;
    }
    /* Inside flex map panes, leaflet-container fills available height.
       Leaflet adds .leaflet-container class during L.map() init. */
    .followup-content-body .leaflet-container {
      width: 100% !important;
      min-height: 300px;
      height: 100%;
      border: 2px solid #30363d;
      border-radius: 6px;
    }

    /* Map pane borders for clear separation between split maps */
    .followup-content-item:has(.leaflet-container) {
      border: 1px solid #444c56;
    }

    /* Map wrapper border */
    .followup-content-body .map-compare-wrapper {
      border: 2px solid #30363d;
      border-radius: 6px;
    }
    /* Wrapper div that LLM generates - fill parent for maps, min-height for others */
    .followup-content-body .sanitized-html {
      min-height: 100%;
      flex: 1;
    }
    .followup-content-body .sanitized-html > div:first-child {
      min-height: inherit;
      height: 100%;
    }
    /* Chart containers */
    .followup-content-body [id^="chart-"],
    .followup-content-body .echarts-container,
    .followup-content-body div[_echarts_instance_] {
      min-height: 350px;
    }
    /* Ensure inner echarts div also has proper size */
    .followup-content-body .echarts,
    .followup-content-body [data-option] {
      width: 100%;
      min-height: 350px;
    }
    /* Table wrapper should fill resizable pane body */
    .followup-content-item.resizable .followup-content-body > .barq-grid-wrapper,
    .followup-content-item.resizable .followup-content-body > .sanitized-html > .barq-grid-wrapper {
      flex: 1;
      min-height: 0;
    }

    /* ─────────────────────────────────────────────────────
       Expand All Button
       ───────────────────────────────────────────────────── */

    .expand-all-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 8px;
      background: transparent;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      color: var(--text-muted);
      font-size: 0.7rem;
      cursor: pointer;
      transition: all 0.2s;
    }
    .expand-all-btn:hover {
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      border-color: var(--text-muted);
    }
    .expand-all-btn svg {
      width: 12px;
      height: 12px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
    }

    /* Expand/Collapse controls on left side of explore chat */
    .expand-collapse-controls {
      position: absolute;
      left: 8px;
      top: 12px;
      z-index: 100;
      display: flex;
      flex-direction: column;
      gap: 4px;
      opacity: 0.7;
      transition: opacity 0.2s;
    }
    .expand-collapse-controls:hover {
      opacity: 1;
    }
    .expand-collapse-side-btn {
      width: 22px;
      height: 22px;
      padding: 0;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .expand-collapse-side-btn:hover {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }
    .expand-collapse-side-btn svg {
      width: 14px;
      height: 14px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2.5;
    }
    /* Position the mainBody to allow absolute positioning of child */
    #exploreBody {
      position: relative;
    }

    /* Voice Input Button */
    .voiceBtn {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 2px solid var(--border-color);
      background: var(--bg-secondary);
      color: var(--text-secondary);
      font-size: 1.2rem;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .voiceBtn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }
    .voiceBtn.recording,
    #voiceBtn.recording {
      border-color: #ef4444;
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
      animation: pulse 1.5s infinite;
    }
    .voiceBtn.recording::after,
    #voiceBtn.recording::after {
      content: '';
      position: absolute;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: 2px solid #ef4444;
      animation: ripple 1.5s infinite;
    }
    @keyframes pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.05); }
    }
    @keyframes ripple {
      0% { transform: scale(1); opacity: 1; }
      100% { transform: scale(1.5); opacity: 0; }
    }

    /* Hands-free mode - green pulsing indicator */
    .chat-icon-btn.hands-free,
    .voiceBtn.hands-free {
      border-color: #22c55e;
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
      animation: hands-free-pulse 2s infinite;
    }
    .chat-icon-btn.hands-free.recording,
    .voiceBtn.hands-free.recording {
      border-color: #22c55e;
      background: rgba(34, 197, 94, 0.25);
      color: #22c55e;
    }
    .chat-icon-btn.hands-free::before,
    .voiceBtn.hands-free::before {
      content: '';
      position: absolute;
      top: -4px;
      right: -4px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: #22c55e;
      animation: hands-free-dot 1s infinite;
    }
    @keyframes hands-free-pulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
      50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    }
    @keyframes hands-free-dot {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

    .voiceBtn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .voiceStatus {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-left: 8px;
    }
    .voiceStatus.error { color: #ef4444; }

    /* Refresh button */
    .refreshBtn.refreshing {
      animation: spin 1s linear infinite;
    }
    @keyframes spin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }

    /* Activity indicators - Engine vs LLM */
    .activity-engine {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
    }
    .activity-engine::before {
      content: '';
      width: 14px;
      height: 14px;
      border: 2px solid #f59e0b;
      border-top-color: transparent;
      border-radius: 50%;
      animation: engine-spin 0.8s linear infinite;
    }
    @keyframes engine-spin {
      to { transform: rotate(360deg); }
    }
    .activity-cancelled {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
      color: #fbbf24;
    }
    .activity-cancelled::before {
      content: '⊘';
      font-size: 14px;
    }
    .activity-llm {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
    }
    .activity-llm::before {
      content: '';
      width: 8px;
      height: 8px;
      background: #a855f7;
      border-radius: 50%;
      animation: llm-pulse 1s ease-in-out infinite;
      box-shadow: 0 0 8px #a855f7;
    }
    @keyframes llm-pulse {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.4); opacity: 0.6; }
    }
    /* Three-dot loading animation for LLM */
    .activity-llm-dots {
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }
    .activity-llm-dots span {
      width: 6px;
      height: 6px;
      background: #a855f7;
      border-radius: 50%;
      animation: llm-dot-bounce 1.2s ease-in-out infinite;
    }
    .activity-llm-dots span:nth-child(2) { animation-delay: 0.2s; }
    .activity-llm-dots span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes llm-dot-bounce {
      0%, 60%, 100% { transform: translateY(0); }
      30% { transform: translateY(-4px); }
    }

    /* Undo Toast - for soft delete with undo */
    .undo-toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 12px 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.3);
      z-index: 10000;
      animation: toast-slide-up 0.2s ease-out;
    }
    .undo-toast.hiding {
      animation: toast-slide-down 0.2s ease-in forwards;
    }
    @keyframes toast-slide-up {
      from { transform: translateX(-50%) translateY(100%); opacity: 0; }
      to { transform: translateX(-50%) translateY(0); opacity: 1; }
    }
    @keyframes toast-slide-down {
      from { transform: translateX(-50%) translateY(0); opacity: 1; }
      to { transform: translateX(-50%) translateY(100%); opacity: 0; }
    }
    .undo-toast-message {
      color: var(--text-primary);
      font-size: 0.9rem;
    }
    .undo-toast-btn {
      background: #3b82f6;
      color: white;
      border: none;
      padding: 6px 12px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 0.85rem;
      font-weight: 500;
    }
    .undo-toast-btn:hover {
      background: #2563eb;
    }
    .undo-toast-progress {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 3px;
      background: #3b82f6;
      border-radius: 0 0 8px 8px;
      animation: toast-progress 5s linear forwards;
    }
    @keyframes toast-progress {
      from { width: 100%; }
      to { width: 0%; }
    }

    .inputThemed {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      padding: 8px 12px;
      border-radius: 6px;
      font-size: 0.85rem;
    }
    .inputThemed::placeholder { color: var(--text-muted); }
    .inputThemed:focus { outline: none; border-color: var(--accent); }

    /* Form styles */
    .registerForm {
      max-width: 520px;
      margin: 0 auto;
      padding: 16px;
    }
    .registerFormCard {
      background: var(--bg-secondary);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      padding: 20px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.04);
    }
    .light-theme .registerFormCard {
      background: #fff;
      border-color: #94a3b8;
      box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
    }
    .registerFormHeader {
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border-color);
    }
    .registerFormHeader h2 {
      margin: 0 0 4px 0;
      font-size: 1.1rem;
      color: var(--text-primary);
    }
    .registerFormHeader p {
      margin: 0;
      color: var(--text-muted);
      font-size: 0.82rem;
    }
    .regAdvancedToggle {
      font-size: 0.8rem;
      color: var(--text-muted);
      cursor: pointer;
      padding: 8px 0 4px;
      user-select: none;
      transition: color 0.15s;
    }
    .regAdvancedToggle:hover { color: var(--accent); }
    .regAdvancedToggle span { display: inline-block; margin-right: 4px; font-size: 0.7rem; }
    .regAdvancedSection {
      padding: 12px 0 0;
      border-top: 1px solid var(--border-color);
      margin-top: 8px;
    }

    /* Registration error display */
    .register-error {
      background: rgba(239, 68, 68, 0.1);
      border: 1px solid var(--danger);
      border-radius: 8px;
      padding: 16px;
      margin-bottom: 20px;
    }
    .register-error-header {
      font-weight: 600;
      color: var(--danger);
      margin-bottom: 8px;
      font-size: 0.95rem;
    }
    .register-error-message {
      color: var(--text-primary);
      margin-bottom: 8px;
      font-size: 0.9rem;
    }
    .register-error-code {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-bottom: 8px;
    }
    .register-error-code code {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
      font-family: monospace;
    }
    .register-error-suggestions {
      background: var(--bg-tertiary);
      border-radius: 6px;
      padding: 12px;
      margin-top: 12px;
    }
    .register-error-suggestions-title {
      font-weight: 500;
      color: var(--text-primary);
      margin-bottom: 8px;
      font-size: 0.85rem;
    }
    .register-error-suggestions ul {
      margin: 0;
      padding-left: 20px;
      font-size: 0.85rem;
      color: var(--text-secondary);
    }
    .register-error-suggestions li {
      margin-bottom: 4px;
    }
    .register-error-suggestions .suggested-path {
      color: var(--accent);
      text-decoration: underline;
      cursor: pointer;
      font-family: monospace;
      font-size: 0.8rem;
    }
    .register-error-suggestions .suggested-path:hover {
      color: var(--accent-hover);
    }
    .register-error-actions {
      display: flex;
      gap: 8px;
      margin-top: 12px;
    }
    .register-error-browse {
      padding: 6px 12px;
      font-size: 0.85rem;
    }
    .register-error-dismiss {
      padding: 6px 12px;
      background: transparent;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 0.8rem;
    }
    .register-error-dismiss:hover {
      background: var(--hover);
      color: var(--text-primary);
    }

    .formSection {
      margin-bottom: 14px;
    }
    .formSection:last-child { margin-bottom: 0; }
    .formSectionTitle {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 10px;
    }
    .formField {
      margin-bottom: 12px;
    }
    .formField:last-child { margin-bottom: 0; }
    .formLabel {
      display: block;
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--text-primary);
      margin-bottom: 6px;
    }
    .formLabel .required { color: var(--error); }
    .formInput {
      width: 100%;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      padding: 8px 10px;
      border-radius: 8px;
      font-size: 0.85rem;
      transition: border-color 0.15s, box-shadow 0.15s;
      box-sizing: border-box;
    }
    .formInput::placeholder { color: var(--text-muted); }
    .formInput:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }
    .formSelect {
      width: 100%;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      padding: 8px 10px;
      border-radius: 8px;
      font-size: 0.85rem;
      cursor: pointer;
    }
    .formSelect:focus {
      outline: none;
      border-color: var(--accent);
    }
    .formHint {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-top: 6px;
      line-height: 1.4;
    }
    .formHint code {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.75rem;
    }
    .formRow {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }
    .formActions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 16px;
      padding-top: 14px;
      border-top: 1px solid var(--border-color);
    }
    .sourceTypeCards {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 16px;
    }
    .sourceTypeCard {
      background: var(--bg-primary);
      border: 2px solid var(--border-color);
      border-radius: 8px;
      padding: 16px;
      cursor: pointer;
      text-align: center;
      transition: border-color 0.15s, background 0.15s;
    }
    .sourceTypeCard:hover {
      border-color: var(--accent);
      background: var(--hover);
    }
    .sourceTypeCard.selected {
      border-color: var(--accent);
      background: rgba(59, 130, 246, 0.1);
    }
    .sourceTypeCard .icon {
      font-size: 1.5rem;
      margin-bottom: 8px;
    }
    .sourceTypeCard .title {
      font-weight: 500;
      font-size: 0.9rem;
      color: var(--text-primary);
    }
    .sourceTypeCard .desc {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 4px;
    }

    /* Tool calls section */
    .toolsSection {
      background: var(--bg-tertiary);
      border-radius: 6px;
      padding: 8px 12px;
      border: 1px solid var(--border-color);
    }
    .toolsSection summary { list-style: none; cursor: pointer; }
    .toolsSection summary::-webkit-details-marker { display: none; }
    .toolsSection .toolsContent { color: var(--text-primary); }
    .toolLine {
      padding: 4px 0;
      display: flex;
      gap: 8px;
      align-items: flex-start;
      border-bottom: 1px solid var(--border-color);
    }
    .toolLine:last-child {
      border-bottom: none;
    }
    .toolLine .toolDesc {
      flex: 1;
      line-height: 1.4;
      color: var(--text-primary);
    }
    .toolLine .toolMeta {
      color: var(--text-secondary);
    }
    .toolLine .toolStatus {
      flex-shrink: 0;
      width: 16px;
      text-align: center;
    }
    .toolLine .toolTime {
      flex-shrink: 0;
      font-size: 0.8rem;
      color: var(--text-secondary);
    }

    /* Mode-specific content */
    .modeContent { display: none; flex: 1; min-width: 0; min-height: 0; width: 100%; }
    .modeContent.active { display: flex; flex-direction: column; align-items: stretch; width: 100%; height: 100%; flex: 1; overflow: hidden; }

    /* Content wrapper for detail views */
    .contentWrapper {
      padding: 20px;
      width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    /* Placeholder content */
    .placeholder {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      gap: 12px;
    }
    .placeholder .icon { font-size: 3rem; opacity: 0.5; }
    .placeholder .title { font-size: 1.25rem; font-weight: 500; color: var(--text-primary); }
    .placeholder .desc { font-size: 0.9rem; text-align: center; max-width: 400px; color: var(--text-secondary); }

    /* ================================================================================
       MODERN SETTINGS DESIGN SYSTEM
       ================================================================================ */

    /* Settings page container - perfectly centered */
    .settings-section {
      max-width: 100%;
      width: 100%;
      padding: 20px;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      box-sizing: border-box;
      margin: 0 auto;
    }

    /* Ensure settings main body is centered */
    #settingsMode .mainBody {
      display: flex !important;
      flex-direction: column !important;
      align-items: center !important;
      justify-content: flex-start;
      padding: 20px;
      width: 100%;
      overflow-y: auto;
    }

    /* Unified settings card - premium glassmorphism */
    .settings-card {
      width: 100%;
      max-width: 960px;
      margin: 0 auto;
      background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.95) 0%,
        rgba(15, 23, 42, 0.98) 100%);
      backdrop-filter: blur(40px);
      -webkit-backdrop-filter: blur(40px);
      border: 1px solid rgba(148, 163, 184, 0.15);
      border-radius: 24px;
      padding: 48px;
      box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
      position: relative;
      overflow: hidden;
    }

    /* Subtle gradient overlay */
    .settings-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 200px;
      background: linear-gradient(180deg,
        rgba(59, 130, 246, 0.05) 0%,
        transparent 100%);
      pointer-events: none;
    }

    /* Settings section title - hero style */
    .settings-section h3 {
      margin: 0 0 32px 0;
      font-size: 1.75rem;
      font-weight: 800;
      background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      letter-spacing: -0.02em;
      position: relative;
      padding-bottom: 20px;
      border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    }

    /* Add decorative element */
    .settings-section h3::after {
      content: '';
      position: absolute;
      bottom: -2px;
      left: 0;
      width: 60px;
      height: 2px;
      background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    }

    /* Settings group - form field container */
    .settings-group {
      margin-bottom: 32px;
      position: relative;
      z-index: 1;
    }

    /* Horizontal layout variant */
    .settings-group.horizontal {
      display: grid;
      grid-template-columns: 200px 1fr;
      gap: 24px;
      align-items: start;
    }

    /* Settings label - modern typography */
    .settings-label {
      display: block;
      font-size: 0.8rem;
      color: #94a3b8;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      font-weight: 700;
      margin-bottom: 12px;
    }

    .settings-group.horizontal .settings-label {
      margin-bottom: 0;
      padding-top: 12px;
    }

    /* Settings hint text - improved readability */
    .settings-hint {
      display: block;
      font-size: 0.85rem;
      color: #64748b;
      margin-top: 8px;
      line-height: 1.6;
    }

    .settings-group.horizontal .settings-hint {
      grid-column: 2;
      margin-top: -16px;
    }

    /* Premium input styling */
    .inputThemed,
    .settings-group select,
    .settings-group input[type="text"],
    .settings-group input[type="number"],
    .settings-group input[type="email"],
    .settings-group input[type="password"] {
      background: rgba(30, 41, 59, 0.6);
      border: 2px solid rgba(148, 163, 184, 0.15);
      border-radius: 12px;
      color: var(--text-primary);
      padding: 14px 16px;
      font-size: 0.95rem;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      font-family: inherit;
      box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .inputThemed:hover,
    .settings-group select:hover,
    .settings-group input:hover {
      border-color: rgba(148, 163, 184, 0.3);
      background: rgba(30, 41, 59, 0.8);
    }

    .inputThemed:focus,
    .settings-group select:focus,
    .settings-group input:focus {
      outline: none;
      border-color: var(--accent);
      background: rgba(30, 41, 59, 0.9);
      box-shadow:
        0 0 0 4px rgba(59, 130, 246, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(59, 130, 246, 0.2);
      transform: translateY(-1px);
    }

    /* Modern checkbox styling */
    .settings-group input[type="checkbox"] {
      width: 22px;
      height: 22px;
      cursor: pointer;
      accent-color: var(--accent);
      border-radius: 6px;
    }

    /* Styled range slider */
    .settings-group input[type="range"] {
      cursor: pointer;
      accent-color: var(--accent);
      height: 6px;
      border-radius: 3px;
    }

    /* Premium section dividers */
    .settings-divider {
      margin: 48px 0;
      border: none;
      height: 1px;
      background: linear-gradient(90deg,
        transparent 0%,
        rgba(148, 163, 184, 0.2) 50%,
        transparent 100%);
      position: relative;
    }

    .settings-divider::after {
      content: '';
      position: absolute;
      top: -2px;
      left: 50%;
      transform: translateX(-50%);
      width: 4px;
      height: 4px;
      background: var(--accent);
      border-radius: 50%;
      box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
    }

    /* Settings subsection card - for grouping related items */
    .settings-subsection {
      background: rgba(30, 41, 59, 0.4);
      border: 1px solid rgba(148, 163, 184, 0.1);
      border-radius: 16px;
      padding: 32px;
      margin-bottom: 24px;
      position: relative;
      transition: all 0.3s ease;
    }

    .settings-subsection:hover {
      border-color: rgba(148, 163, 184, 0.2);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

    .settings-subsection h4 {
      margin: 0 0 24px 0;
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .settings-subsection h4::before {
      content: '';
      width: 4px;
      height: 20px;
      background: linear-gradient(180deg, var(--accent) 0%, #06b6d4 100%);
      border-radius: 2px;
      box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    }

    /* User Management specific styles - wider card for table */
    #settings-users .adminPanel {
      padding: 0;
      max-width: 100%;
    }

    /* Profile specific enhancements */
    .profileHeader {
      background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.08) 0%,
        rgba(139, 92, 246, 0.08) 100%);
      border: 1px solid rgba(148, 163, 184, 0.1);
      border-radius: 16px;
      padding: 32px;
      margin-bottom: 32px;
    }

    .profileMetaRow {
      background: rgba(30, 41, 59, 0.4);
      border: 1px solid rgba(148, 163, 184, 0.1);
      border-radius: 16px;
      padding: 28px;
    }
    #settingsSidebar .sidebarItem {
      padding: 8px 12px;
      cursor: pointer;
      border-radius: 4px;
    }
    #settingsSidebar .sidebarItem:hover {
      background: var(--bg-hover);
    }
    #settingsSidebar .sidebarItem.active {
      background: var(--bg-active);
      font-weight: 500;
    }

    /* Users mode */
    .usersHeaderLeft {
      align-items: center;
      flex-wrap: wrap;
      gap: 16px;
    }
    .usersTitleBlock {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .usersHeaderStatus {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .usersPill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border: 1px solid rgba(59, 130, 246, 0.4);
      background: rgba(59, 130, 246, 0.12);
      color: #93c5fd;
      font-weight: 600;
    }
    .usersPill-live {
      border-color: rgba(16, 185, 129, 0.4);
      background: rgba(16, 185, 129, 0.12);
      color: #6ee7b7;
    }
    .usersSync {
      font-size: 0.75rem;
    }
    .usersPage {
      display: flex;
      flex-direction: column;
      gap: 16px;
      width: 100%;
    }
    .usersStats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
    }
    .usersStatCard {
      position: relative;
      overflow: hidden;
      border-radius: 12px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      padding: 12px 14px;
    }
    .usersStatCard::after {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, rgba(59, 130, 246, 0.9), transparent);
    }
    .usersStatLabel {
      font-size: 0.7rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .usersStatValue {
      font-size: 1.4rem;
      font-weight: 600;
      margin-top: 4px;
    }
    .usersStatTrend {
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-top: 4px;
    }
    .usersFilters {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: flex-end;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 12px;
    }
    .usersFilterGroup {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 140px;
      flex: 1;
    }
    .usersFilterSearch {
      flex: 2;
      min-width: 220px;
    }
    .usersFilterLabel {
      font-size: 0.7rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .usersFilterInput {
      min-height: 34px;
    }
    .usersFilterBtn {
      align-self: flex-end;
    }
    .usersGrid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 320px;
      gap: 16px;
      align-items: start;
    }
    .usersSection {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .usersSectionHeader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .usersSectionTitle {
      font-size: 0.95rem;
      font-weight: 600;
    }
    .usersSectionMeta {
      font-size: 0.75rem;
    }
    .usersSectionActions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .usersSide {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .userCell {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .userAvatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      font-weight: 600;
      border: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    .userAvatarAccent {
      background: rgba(59, 130, 246, 0.2);
      border-color: rgba(59, 130, 246, 0.4);
      color: #bfdbfe;
    }
    .userAvatarSlate {
      background: rgba(148, 163, 184, 0.2);
      border-color: rgba(148, 163, 184, 0.4);
      color: #e2e8f0;
    }
    .userAvatarSky {
      background: rgba(56, 189, 248, 0.2);
      border-color: rgba(56, 189, 248, 0.4);
      color: #bae6fd;
    }
    .userAvatarPlum {
      background: rgba(168, 85, 247, 0.2);
      border-color: rgba(168, 85, 247, 0.4);
      color: #e9d5ff;
    }
    .userInfo {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
    }
    .userName {
      font-weight: 600;
      font-size: 0.85rem;
    }
    .userEmail {
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .userRole {
      display: inline-flex;
      align-items: center;
      padding: 4px 8px;
      border-radius: 8px;
      font-size: 0.75rem;
      border: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font-weight: 600;
    }
    .userRoleAdmin {
      background: rgba(59, 130, 246, 0.15);
      border-color: rgba(59, 130, 246, 0.4);
      color: #bfdbfe;
    }
    .userStatus {
      display: inline-flex;
      align-items: center;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border: 1px solid transparent;
      font-weight: 600;
    }
    .userStatusActive {
      background: rgba(34, 197, 94, 0.15);
      color: #86efac;
      border-color: rgba(34, 197, 94, 0.35);
    }
    .userStatusPending {
      background: rgba(234, 179, 8, 0.15);
      color: #fde68a;
      border-color: rgba(234, 179, 8, 0.35);
    }
    .userStatusDisabled {
      background: rgba(239, 68, 68, 0.15);
      color: #fecaca;
      border-color: rgba(239, 68, 68, 0.35);
    }
    .userMeta {
      font-size: 0.8rem;
      font-weight: 500;
    }
    .userMetaNote {
      font-size: 0.7rem;
      color: var(--text-muted);
    }
    .userProviders {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .userProvider {
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border-radius: 6px;
      padding: 3px 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      font-weight: 600;
    }
    .userProviderGoogle {
      background: rgba(234, 179, 8, 0.12);
      border-color: rgba(234, 179, 8, 0.4);
      color: #fde68a;
    }
    .userProviderPassword {
      background: rgba(59, 130, 246, 0.12);
      border-color: rgba(59, 130, 246, 0.4);
      color: #bfdbfe;
    }
    .userActions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .userActionBtn {
      padding: 6px 10px;
      font-size: 0.72rem;
    }
    .usersInviteList {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .usersInviteItem {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 0;
      border-bottom: 1px dashed var(--border-color);
    }
    .usersInviteItem:last-child {
      border-bottom: none;
    }
    .usersInviteName {
      font-size: 0.85rem;
      font-weight: 600;
    }
    .usersInviteMeta {
      font-size: 0.7rem;
      color: var(--text-muted);
    }
    .usersPolicyList {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .usersPolicyItem {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 0.8rem;
      color: var(--text-secondary);
    }
    .usersPolicyValue {
      font-weight: 600;
      color: var(--text-primary);
    }
    .usersActivityList {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .usersActivityItem {
      border-radius: 10px;
      padding: 10px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
    }
    .usersActivityText {
      font-size: 0.8rem;
      color: var(--text-primary);
      margin-bottom: 4px;
    }
    .usersActivityMeta {
      font-size: 0.7rem;
      color: var(--text-muted);
    }
    .usersProfileCard {
      gap: 14px;
    }
    .usersProfileHeader {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .usersProfileInfo {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .usersProfileName {
      font-size: 0.9rem;
      font-weight: 600;
    }
    .usersProfileEmail {
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .usersProfileDetails {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .usersProfileRow {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .usersProfileLabel {
      font-size: 0.7rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .usersProfileProviders {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .usersProfileSecurity {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .usersProfileSecurityHeader {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .usersProfileMeta {
      font-size: 0.7rem;
    }
    .usersSessionList {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .usersSessionItem {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
      border-radius: 10px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
    }
    .usersSessionTitle {
      font-size: 0.8rem;
      font-weight: 600;
    }
    .usersSessionMeta {
      font-size: 0.7rem;
      color: var(--text-muted);
    }
    .usersSessionBadge {
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 3px 6px;
      border-radius: 999px;
      background: rgba(16, 185, 129, 0.15);
      border: 1px solid rgba(16, 185, 129, 0.35);
      color: #86efac;
      font-weight: 600;
    }
    .usersProfileActions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    /* Upload drop zone styles */
    .dropZone {
      border: 2px dashed var(--border-color);
      border-radius: 8px;
      padding: 40px 20px;
      text-align: center;
      transition: all 0.2s ease;
      cursor: pointer;
      background: var(--bg-secondary);
    }
    .dropZone:hover, .dropZone.dragover {
      border-color: var(--accent-color);
      background: rgba(59, 130, 246, 0.05);
    }
    .dropZone .dropIcon {
      font-size: 3rem;
      margin-bottom: 12px;
      opacity: 0.6;
    }
    .dropZone .dropTitle {
      font-size: 1.1rem;
      font-weight: 500;
      margin-bottom: 8px;
      color: var(--text-primary);
    }
    .dropZone .dropHint {
      font-size: 0.85rem;
      color: var(--text-muted);
    }
    .dropZone input[type="file"] {
      display: none;
    }
    .selectedFile {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      background: var(--bg-tertiary);
      border-radius: 6px;
      margin-top: 12px;
    }
    .selectedFile .fileIcon {
      font-size: 1.5rem;
    }
    .selectedFile .fileInfo {
      flex: 1;
      text-align: left;
    }
    .selectedFile .fileName {
      font-weight: 500;
      color: var(--text-primary);
    }
    .selectedFile .fileSize {
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .selectedFile .removeFile {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.2rem;
      padding: 4px 8px;
    }
    .selectedFile .removeFile:hover {
      color: var(--error-color);
    }

    /* Table type selection cards */
    .tableTypeCards {
      display: flex;
      gap: 12px;
      margin-top: 8px;
    }
    .tableTypeCard {
      flex: 1;
      padding: 16px;
      border: 2px solid var(--border-color);
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      text-align: center;
    }
    .tableTypeCard:hover {
      border-color: var(--text-muted);
    }
    .tableTypeCard.selected {
      border-color: var(--accent-color);
      background: rgba(59, 130, 246, 0.05);
    }
    .tableTypeCard .icon {
      font-size: 1.5rem;
      margin-bottom: 8px;
    }
    .tableTypeCard .title {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    .tableTypeCard .desc {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 4px;
    }

    /* Upload progress */
    .uploadProgress {
      margin-top: 16px;
      padding: 16px;
      background: var(--bg-tertiary);
      border-radius: 8px;
    }
    .uploadProgress .progressHeader {
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .uploadProgress .progressLabel {
      font-weight: 500;
      color: var(--text-primary);
    }
    .uploadProgress .progressPercent {
      color: var(--accent-color);
    }
    .uploadProgress .progressBar {
      height: 6px;
      background: var(--bg-secondary);
      border-radius: 3px;
      overflow: hidden;
    }
    .uploadProgress .progressFill {
      height: 100%;
      background: var(--accent-color);
      border-radius: 3px;
      transition: width 0.3s ease;
    }
    .uploadProgress .progressStatus {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-top: 8px;
    }

    /* Schema preview table */
    .schemaPreview {
      margin-top: 16px;
      background: var(--bg-tertiary);
      border-radius: 8px;
      overflow: hidden;
    }
    .schemaPreview .schemaHeader {
      padding: 12px 16px;
      font-weight: 500;
      color: var(--text-primary);
      background: var(--bg-secondary);
      border-bottom: 1px solid var(--border-color);
    }
    .schemaPreview table {
      width: 100%;
      border-collapse: collapse;
    }
    .schemaPreview th, .schemaPreview td {
      padding: 8px 12px;
      text-align: left;
      border-bottom: 1px solid var(--border-color);
    }
    .schemaPreview th {
      background: var(--bg-secondary);
      font-weight: 500;
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .schemaPreview td {
      font-size: 0.85rem;
    }
    .schemaPreview .colName {
      font-family: monospace;
      color: var(--accent-color);
    }
    .schemaPreview .colType {
      color: var(--text-muted);
      font-family: monospace;
    }

    /* @source creation UI */
    .sourceCreatorCard {
      background: var(--bg-secondary);
      border-radius: 12px;
      padding: 24px;
      margin: 20px;
      border: 1px solid var(--border-color);
    }
    .sourceCreatorHeader {
      margin-bottom: 24px;
    }
    .sourceCreatorHeader h2 {
      margin: 0 0 8px 0;
      font-size: 1.25rem;
    }
    .sourceCreatorHeader p {
      margin: 0;
      color: var(--text-muted);
    }

    /* Column mapping table */
    .mappingTable {
      width: 100%;
      border-collapse: collapse;
      margin: 16px 0;
    }
    .mappingTable th {
      padding: 8px 12px;
      text-align: left;
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--text-muted);
      background: var(--bg-tertiary);
      border-bottom: 1px solid var(--border-color);
    }
    .mappingTable td {
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
      vertical-align: middle;
    }
    .mappingTable .includeCol {
      width: 40px;
      text-align: center;
    }
    .mappingTable .sourceCol {
      font-family: monospace;
      color: var(--text-muted);
    }
    .mappingTable .outputCol input,
    .mappingTable .typeCol select {
      width: 100%;
      padding: 6px 8px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.85rem;
    }
    .mappingTable .exprCol input {
      width: 100%;
      padding: 6px 8px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-family: monospace;
      font-size: 0.85rem;
    }
    .mappingTable tr.excluded {
      opacity: 0.5;
    }
    .mappingTable tr.excluded .sourceCol,
    .mappingTable tr.excluded .outputCol,
    .mappingTable tr.excluded .typeCol,
    .mappingTable tr.excluded .exprCol {
      text-decoration: line-through;
    }

    /* Computed columns section */
    .computedColumnsSection {
      margin-top: 20px;
      padding: 16px;
      background: var(--bg-tertiary);
      border-radius: 8px;
    }
    .computedColumnsHeader {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
    }
    .computedColumnsHeader h3 {
      margin: 0;
      font-size: 0.95rem;
    }
    .computedColumnRow {
      display: flex;
      gap: 12px;
      margin-bottom: 8px;
      align-items: center;
    }
    .computedColumnRow input,
    .computedColumnRow select {
      padding: 6px 8px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.85rem;
    }
    .computedColumnRow .colNameInput {
      width: 150px;
    }
    .computedColumnRow .colTypeSelect {
      width: 100px;
    }
    .computedColumnRow .colExprInput {
      flex: 1;
      font-family: monospace;
    }
    .computedColumnRow .removeBtn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.2rem;
      padding: 4px;
    }
    .computedColumnRow .removeBtn:hover {
      color: var(--error-color);
    }

    /* Source preview */
    .sourcePreview {
      margin-top: 20px;
      padding: 16px;
      background: var(--bg-tertiary);
      border-radius: 8px;
    }
    .sourcePreview h3 {
      margin: 0 0 12px 0;
      font-size: 0.95rem;
    }
    .sourcePreview pre {
      margin: 0;
      padding: 12px;
      background: var(--bg-primary);
      border-radius: 4px;
      overflow-x: auto;
      font-family: monospace;
      font-size: 0.85rem;
      line-height: 1.5;
    }

    /* ─────────────────────────────────────────────────────────────────
     * Notebook Mode
     * ───────────────────────────────────────────────────────────────── */

    .notebook-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      gap: 8px;
      text-align: center;
      padding: 32px;
    }

    #notebookBody {
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    #jupyterFrame {
      flex: 1;
      border: none;
      width: 100%;
      height: 100%;
      background: var(--bg-secondary);
    }

    #notebookLoading .spinner {
      width: 40px;
      height: 40px;
      border: 3px solid var(--border-color);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    #notebookError {
      color: var(--text-primary);
    }

    #notebookPlaceholder {
      color: var(--text-primary);
    }

    #notebookPlaceholder .btnPrimary {
      background: var(--accent);
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 500;
      transition: background 0.2s;
    }

    #notebookPlaceholder .btnPrimary:hover {
      background: #2563eb;
    }

    /* Column Notes Editor */
    .notes-editor-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2100;
    }
    .notes-editor-backdrop {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.6);
    }
    .notes-editor-content {
      position: relative;
      background: var(--bg-primary);
      border-radius: 12px;
      width: 800px;
      min-width: 400px;
      min-height: 400px;
      max-width: 95vw;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
      border: 1px solid var(--border);
      overflow: visible;
    }
    [data-theme="light"] .notes-editor-content {
      box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.08);
    }
    .notes-editor-body {
      overflow-y: auto;
      flex: 1;
    }
    .notes-editor-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
      cursor: move;
    }
    .notes-editor-header h3 {
      margin: 0;
      font-size: 1rem;
      font-weight: 600;
    }
    .notes-editor-body {
      flex: 1;
      overflow-y: auto;
      padding: 16px 20px;
    }
    .notes-editor-footer {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      padding: 12px 20px;
      border-top: 1px solid var(--border);
    }
    .notes-field-group {
      margin-bottom: 16px;
    }
    .notes-field-group label {
      display: block;
      font-weight: 500;
      margin-bottom: 6px;
      font-size: 0.875rem;
      color: var(--text-primary);
    }
    .notes-field-group input,
    .notes-field-group textarea {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.875rem;
      font-family: inherit;
    }
    .notes-field-group textarea {
      min-height: 80px;
      resize: vertical;
    }
    .notes-field-group input:focus,
    .notes-field-group textarea:focus {
      outline: none;
      border-color: var(--accent);
    }
    /* Columns tab content - flex layout to fill space */
    #notesTabColumns {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
    .notes-columns-section {
      margin-top: 20px;
      border-top: 1px solid var(--border);
      padding-top: 16px;
    }
    .notes-columns-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
    }
    .notes-columns-header h4 {
      margin: 0;
      font-size: 0.9rem;
      font-weight: 600;
    }
    .notes-column-search {
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.8rem;
      width: 200px;
    }
    /* Notes columns table container */
    .notes-columns-table-container {
      flex: 1;
      min-height: 150px;
      max-height: calc(100vh - 350px);
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
    }
    .notes-columns-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }
    .notes-columns-table thead {
      position: sticky;
      top: 0;
      z-index: 1;
    }
    .notes-columns-table th {
      background: rgba(255,255,255,0.04);
      padding: 10px 12px;
      text-align: left;
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: #a1a1aa;
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    [data-theme="light"] .notes-columns-table th {
      background: #f4f4f5;
      color: #52525b;
      border-bottom-color: #e4e4e7;
    }
    .notes-column-row {
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .notes-column-row:last-child {
      border-bottom: none;
    }
    .notes-column-row:hover {
      background: rgba(255,255,255,0.03);
    }
    [data-theme="light"] .notes-column-row {
      border-bottom-color: #e4e4e7;
    }
    [data-theme="light"] .notes-column-row:hover {
      background: #f9fafb;
    }
    .notes-column-row td {
      padding: 10px 12px;
      vertical-align: top;
    }
    .notes-column-name code {
      background: rgba(59,130,246,0.12);
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 0.8rem;
      color: #60a5fa;
      border: 1px solid rgba(59,130,246,0.2);
    }
    .notes-column-ai-desc {
      color: #a1a1aa;
      font-size: 0.82rem;
      line-height: 1.5;
    }
    .notes-column-user-notes {
      padding-right: 8px !important;
    }
    .notes-column-input {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid rgba(255,255,255,0.12);
      border-radius: 4px;
      background: rgba(255,255,255,0.05);
      color: #e4e4e7;
      font-size: 0.82rem;
    }
    .notes-column-input:focus {
      outline: none;
      border-color: var(--accent);
      background: rgba(255,255,255,0.08);
    }
    .notes-column-input::placeholder {
      color: #71717a;
    }
    [data-theme="light"] .notes-column-name code {
      background: rgba(59,130,246,0.08);
      color: #2563eb;
      border-color: rgba(59,130,246,0.15);
    }
    [data-theme="light"] .notes-column-ai-desc {
      color: #52525b;
    }
    [data-theme="light"] .notes-column-input {
      border-color: rgba(0,0,0,0.15);
      background: #fff;
      color: #18181b;
    }
    [data-theme="light"] .notes-column-input:focus {
      background: #fff;
    }
    [data-theme="light"] .notes-column-input::placeholder {
      color: #a1a1aa;
    }
    .notes-tabs {
      display: flex;
      gap: 4px;
      padding: 0 20px;
      border-bottom: 1px solid var(--border);
    }
    .notes-tab {
      padding: 10px 16px;
      background: none;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      font-size: 0.875rem;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
    }
    .notes-tab:hover {
      color: var(--text-primary);
    }
    .notes-tab.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }

    /* External Table Panes (collapsible sections) */
    .table-insights-pane,
    .table-usage-section {
      background: var(--bg-secondary);
      border-radius: 8px;
      margin-bottom: 16px;
      border: 1px solid var(--border-color);
    }
    .table-pane-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 14px;
      cursor: pointer;
      user-select: none;
      transition: background 0.15s;
    }
    .table-pane-header:hover {
      background: var(--bg-tertiary);
    }
    .table-pane-icon {
      font-size: 1rem;
    }
    .table-pane-title {
      font-weight: 600;
      font-size: 0.9rem;
      flex: 1;
    }
    .table-pane-count {
      background: var(--accent);
      color: white;
      font-size: 0.7rem;
      padding: 2px 8px;
      border-radius: 10px;
      font-weight: 500;
    }
    .table-pane-toggle {
      color: var(--text-muted);
      font-size: 0.75rem;
    }
    .table-pane-content {
      padding: 0 14px 14px;
    }
    .table-insights-list {
      margin: 0;
      padding-left: 20px;
      color: #86efac;
      line-height: 1.6;
      font-size: 0.88rem;
    }
    .table-insights-list li {
      margin: 6px 0;
    }

    /* Namespace Hierarchy for Tables List */
      gap: 12px;
    }
    .table-usage-example {
      background: var(--bg-tertiary);
      border-radius: 6px;
      overflow: hidden;
    }
    .table-usage-label {
      padding: 6px 12px;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-secondary);
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }
    .table-usage-code {
      margin: 0;
      padding: 10px 12px;
      font-size: 0.75rem;
      line-height: 1.5;
      background: transparent;
      color: var(--text-primary);
      overflow-x: auto;
    }

    /* Explore Mode Selector Row */
    .explore-mode-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 0;
      margin-bottom: 4px;
    }
    /* Dataset Selector */
    .explore-dataset-selector {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .dataset-select {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 4px 8px;
      font-size: 0.75rem;
      color: var(--text-primary);
      cursor: pointer;
      min-width: 120px;
      max-width: 240px;
      transition: all 0.15s ease;
    }
    .dataset-select:hover {
      border-color: var(--accent);
    }
    .dataset-select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }
    .dataset-select option {
      background: var(--bg-secondary);
      color: var(--text-primary);
    }
    .dataset-select optgroup {
      font-weight: 600;
      color: var(--text-muted);
    }
    .dataset-config-btn {
      background: transparent;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      padding: 4px 6px;
      cursor: pointer;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
    }
    .dataset-config-btn:hover {
      background: var(--hover);
      color: var(--text-primary);
      border-color: var(--accent);
    }

    /* Engine Selector (mirrors dataset selector) */
    .explore-engine-selector {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-left: 8px;
    }
    .engine-select {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 4px 8px;
      font-size: 0.75rem;
      color: var(--text-primary);
      cursor: pointer;
      min-width: 80px;
      max-width: 140px;
      transition: all 0.15s ease;
    }
    .engine-select:hover {
      border-color: var(--accent);
    }
    .engine-select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }
    .engine-select option {
      background: var(--bg-secondary);
      color: var(--text-primary);
    }
    .engine-config-btn {
      background: transparent;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      padding: 4px 6px;
      cursor: pointer;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
    }
    .engine-config-btn:hover {
      background: var(--hover);
      color: var(--text-primary);
      border-color: var(--accent);
    }

    /* Dataset preparation status */
    .dataset-status {
      font-size: 0.9rem;
      padding: 2px 6px;
      border-radius: 4px;
      margin-left: 4px;
      white-space: nowrap;
      max-width: 100px;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1;
    }
    .dataset-status.preparing {
      background: var(--info);
      color: white;
      animation: pulse 1.5s infinite;
    }
    .dataset-status.ready {
      background: var(--success);
      color: white;
    }
    .dataset-status.warning {
      background: var(--warning);
      color: var(--text-primary);
    }
    .dataset-status.error {
      background: var(--danger);
      color: white;
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.6; }
    }

    /* Dataset badge in user messages */
    .user-msg-dataset {
      position: absolute;
      top: -2px;
      right: 0;
      font-size: 0.75rem;
      color: rgba(255,255,255,0.85);
      background: rgba(0,0,0,0.25);
      padding: 2px 8px;
      border-radius: 3px;
      font-weight: 500;
    }

    /* Compact user messages */
    .userMsg {
      padding: 8px 12px !important;
    }

    .explore-mode-selector {
      display: flex;
      align-items: center;
      gap: 4px;
      background: var(--bg-tertiary);
      border-radius: 6px;
      padding: 2px;
    }
    .mode-radio {
      display: flex;
      align-items: center;
      cursor: pointer;
      user-select: none;
    }
    .mode-radio input[type="radio"] {
      display: none;
    }
    .mode-label {
      padding: 4px 10px;
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--text-muted);
      border-radius: 4px;
      transition: all 0.15s ease;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .mode-radio input[type="radio"]:checked + .mode-label {
      background: var(--accent);
      color: white;
    }
    .mode-radio:hover .mode-label {
      color: var(--text-primary);
    }
    .mode-radio input[type="radio"]:checked + .mode-label:hover {
      color: white;
    }

    /* Options Toggle Button */
    .options-toggle-btn {
      display: flex;
      align-items: center;
      gap: 4px;
      background: transparent;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 4px 8px;
      cursor: pointer;
      color: var(--text-muted);
      transition: all 0.15s ease;
    }
    .options-toggle-btn:hover {
      background: var(--hover);
      color: var(--text-primary);
      border-color: var(--accent);
    }
    .options-toggle-btn.active {
      background: var(--active);
      color: var(--accent);
      border-color: var(--accent);
    }
    .options-toggle-btn .toggle-arrow {
      font-size: 0.6rem;
      transition: transform 0.2s ease;
    }
    .options-toggle-btn.collapsed .toggle-arrow {
      transform: rotate(-90deg);
    }

    /* Collapsible Followup Panel */
    .followup-panel.collapsible {
      max-height: 200px;
      overflow: hidden;
      transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease, opacity 0.2s ease;
    }
    .followup-panel.collapsed {
      max-height: 0;
      padding-top: 0;
      padding-bottom: 0;
      margin-bottom: 0;
      border-bottom: none;
      opacity: 0;
    }

    /* SQL Result Table Styles */
    .sql-result-table-container {
      overflow-x: auto;
      max-height: 300px;
      overflow-y: auto;
      margin: 8px 0;
    }
    .sql-result-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.75rem;
    }
    .sql-result-table th,
    .sql-result-table td {
      padding: 6px 10px;
      text-align: left;
      border: 1px solid var(--border-color);
    }
    .sql-result-table th {
      background: var(--bg-tertiary);
      font-weight: 600;
      color: var(--text-secondary);
      position: sticky;
      top: 0;
    }
    .sql-result-table tr:hover td {
      background: var(--hover);
    }
    .sql-result-truncated {
      font-size: 0.7rem;
      color: var(--text-muted);
      font-style: italic;
      padding: 4px 0;
    }
    .tool-status.running {
      color: #fbbf24;
    }
    .tool-status.success {
      color: #22c55e;
    }
    .tool-status.error {
      color: #f87171;
    }
    .tool-output.error {
      color: #f87171;
    }
    .loading-dots::after {
      content: '';
      animation: loading-dots 1.5s infinite;
    }
    @keyframes loading-dots {
      0%, 20% { content: '.'; }
      40% { content: '..'; }
      60%, 100% { content: '...'; }
    }

    /* SQL Mode - Larger Chatbox */
    .chat-textarea.sql-mode {
      min-height: 120px;
      max-height: 50vh;
      font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
      font-size: 0.85rem;
      line-height: 1.4;
    }

    /* Collapsible Chatbox Pane */
    .mainFooter {
      position: relative;
      transition: all 0.3s ease;
    }
    .mainFooter.collapsed .explore-input-area {
      display: none;
    }
    .mainFooter.collapsed {
      padding: 4px 8px;
    }
    .mainFooter.collapsed .followup-panel {
      margin-bottom: 0;
      border-bottom: none;
    }
    .mainFooter.collapsed .footer-toggle-btn .toggle-icon {
      transform: rotate(180deg);
    }

    /* Input area container */
    .explore-input-area {
      display: block;
      position: relative;
    }

    /* Explore suggestions dropdown panel */
    .explore-suggestions-panel {
      position: absolute;
      bottom: 100%;
      left: 0;
      right: 0;
      margin-bottom: 8px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
      max-height: min(550px, 65vh);
      overflow: hidden;
      z-index: 100;
    }
    .explore-suggestions-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 12px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-tertiary);
    }
    .explore-suggestions-close {
      background: none;
      border: none;
      color: var(--text-muted);
      font-size: 1.2rem;
      cursor: pointer;
      padding: 0 4px;
      line-height: 1;
    }
    .explore-suggestions-close:hover {
      color: var(--text-primary);
    }
    .explore-suggestions-list {
      max-height: min(450px, 55vh);
      overflow-y: auto;
      padding: 8px;
    }
    .explore-suggestion-item {
      padding: 10px 12px;
      margin: 4px 0;
      background: var(--bg-primary);
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.85rem;
      line-height: 1.4;
      transition: background 0.15s;
      display: flex;
      align-items: start;
      gap: 8px;
    }
    .explore-suggestion-item:hover {
      background: var(--hover);
    }
    .explore-suggestion-item .suggestion-icon {
      color: var(--accent);
      flex-shrink: 0;
    }
    .explore-suggestion-item .suggestion-number {
      color: var(--text-muted);
      font-size: 0.75rem;
      min-width: 20px;
      flex-shrink: 0;
    }
    .explore-suggestions-generate {
      background: linear-gradient(135deg, #6366f1, #8b5cf6);
      border: none;
      color: #fff;
      padding: 4px 10px;
      border-radius: 4px;
      font-size: 0.75rem;
      cursor: pointer;
      transition: opacity 0.15s;
    }
    .explore-suggestions-generate:hover {
      opacity: 0.9;
    }
    .explore-suggestions-generate:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .explore-suggestions-count {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      padding: 3px 6px;
      border-radius: 4px;
      font-size: 0.75rem;
      cursor: pointer;
      min-width: 50px;
    }
    .explore-suggestions-count:focus {
      outline: none;
      border-color: var(--accent);
    }

    /* Explore suggestions footer (multi-select controls) */
    .explore-suggestions-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 12px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-tertiary);
    }
    .explore-suggestions-run {
      background: linear-gradient(135deg, #22c55e, #16a34a);
      border: none;
      color: #fff;
      padding: 5px 12px;
      border-radius: 4px;
      font-size: 0.8rem;
      cursor: pointer;
      transition: opacity 0.15s;
      font-weight: 500;
    }
    .explore-suggestions-run:hover:not(:disabled) {
      opacity: 0.9;
    }
    .explore-suggestions-run:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      background: var(--bg-secondary);
      color: var(--text-muted);
    }
    .explore-suggestions-clear {
      background: transparent;
      border: 1px solid var(--border-color);
      color: var(--text-muted);
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 0.7rem;
      cursor: pointer;
      transition: all 0.15s;
    }
    .explore-suggestions-clear:hover {
      background: var(--hover);
      color: var(--text);
      border-color: var(--text-muted);
    }
    .explore-suggestions-more {
      background: linear-gradient(135deg, #6366f1, #8b5cf6);
      border: none;
      color: #fff;
      padding: 4px 10px;
      border-radius: 4px;
      font-size: 0.75rem;
      cursor: pointer;
      transition: opacity 0.15s;
      font-weight: 500;
    }
    .explore-suggestions-more:hover {
      opacity: 0.9;
    }
    /* Checkbox styling in suggestion items */
    .explore-suggestion-item input[type="checkbox"] {
      flex-shrink: 0;
      cursor: pointer;
      accent-color: var(--accent);
      margin-right: 4px;
    }
    .explore-suggestion-item.selected {
      background: var(--hover);
      border-left: 3px solid var(--accent);
    }

    /* Table batch query controls (in table details Explore Insights tab) */
    .table-batch-controls {
      background: var(--bg-tertiary);
    }
    .table-followup-actions {
      background: var(--bg-tertiary);
    }
    .table-query-item {
      transition: background 0.15s, border-left-color 0.15s;
    }
    .table-query-item.selected {
      background: var(--hover) !important;
      border-left: 3px solid var(--accent);
      padding-left: 9px;
    }
    .table-query-item input[type="checkbox"] {
      flex-shrink: 0;
      cursor: pointer;
      accent-color: var(--accent);
    }
    .followup-checkbox {
      transition: background 0.15s;
    }
    .followup-checkbox:hover {
      background: var(--hover) !important;
    }
    .followup-checkbox input:checked + span {
      font-weight: 500;
    }

    /* Footer toggle button - top center */
    .footer-toggle-btn {
      position: absolute;
      top: -6px;
      left: 50%;
      transform: translateX(-50%);
      background: none;
      border: none;
      padding: 0 12px;
      cursor: pointer;
      color: var(--text-muted);
      font-size: 0.9rem;
      opacity: 0.5;
      transition: all 0.15s ease;
      z-index: 10;
    }
    .footer-toggle-btn:hover {
      opacity: 1;
      color: var(--accent);
    }
    .footer-toggle-btn .toggle-icon {
      display: inline-block;
      transition: transform 0.2s ease;
    }

    /* Updated Followup Panel Layout */
    .followup-panel {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 2px 0;
      margin-bottom: 4px;
      border-bottom: 1px solid rgba(128, 128, 128, 0.15);
    }
    .followup-panel.hidden {
      display: none;
    }
    .followup-nav {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      scrollbar-width: thin;
    }
    .followup-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* Auto toggle button */
    .auto-toggle-btn {
      display: flex;
      align-items: center;
      gap: 5px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 4px 10px;
      cursor: pointer;
      color: var(--text-primary);
      font-size: 0.8rem;
      font-weight: 500;
      transition: all 0.15s ease;
    }
    .auto-toggle-btn:hover {
      background: var(--hover);
      color: var(--text-primary);
      border-color: var(--accent);
    }
    .auto-toggle-btn.active {
      background: var(--active);
      color: var(--accent);
      border-color: var(--accent);
    }
    .auto-toggle-btn .toggle-arrow {
      font-size: 0.6rem;
      opacity: 0.6;
      transition: transform 0.2s ease;
    }
    .auto-toggle-btn.active .toggle-arrow {
      /* No rotation - arrow stays pointing right */
    }

    /* (auto-generate-panel replaced by .auto-popup-panel above) */

    /* Dataset Config Dialog */
    .dataset-config-dialog {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 1000;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .dataset-config-backdrop {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
    }
    .dataset-config-content {
      position: relative;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      width: 90%;
      max-width: 500px;
      max-height: 80vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
    .dataset-config-header {
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-color);
      position: relative;
    }
    .dataset-config-header h3 {
      margin: 0 0 4px 0;
      font-size: 1.1rem;
      font-weight: 600;
    }
    .dataset-config-subtitle {
      margin: 0;
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .dataset-config-close {
      position: absolute;
      top: 12px;
      right: 12px;
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: var(--text-muted);
      line-height: 1;
      padding: 4px 8px;
    }
    .dataset-config-close:hover {
      color: var(--text-primary);
    }
    .dataset-config-body {
      flex: 1;
      overflow-y: auto;
      padding: 16px 20px;
    }
    .dataset-config-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .dataset-config-group {
      margin-bottom: 12px;
    }
    .dataset-config-group-title {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
      padding-bottom: 4px;
      border-bottom: 1px solid var(--border-color);
    }
    .dataset-config-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      background: var(--bg-secondary);
      border-radius: 6px;
      cursor: pointer;
      transition: background 0.15s ease;
    }
    .dataset-config-item:hover {
      background: var(--hover);
    }
    .dataset-config-item input[type="checkbox"] {
      width: 16px;
      height: 16px;
      cursor: pointer;
    }
    .dataset-config-item-name {
      flex: 1;
      font-size: 0.9rem;
    }
    .dataset-config-item-type {
      font-size: 0.7rem;
      color: var(--text-muted);
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
    }
    .dataset-config-delete-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.1rem;
      line-height: 1;
      padding: 2px 6px;
      border-radius: 4px;
      opacity: 0;
      transition: opacity 0.15s, color 0.15s;
    }
    .dataset-config-item:hover .dataset-config-delete-btn {
      opacity: 1;
    }
    .dataset-config-delete-btn:hover {
      color: var(--error, #ef4444);
      background: rgba(239, 68, 68, 0.1);
    }
    .dataset-config-footer {
      padding: 12px 20px;
      border-top: 1px solid var(--border-color);
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }
    .dataset-config-footer .btn-secondary {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      color: var(--text-primary);
      padding: 8px 16px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.85rem;
    }
    .dataset-config-footer .btn-secondary:hover {
      background: var(--hover);
    }
    .dataset-config-footer .btn-primary {
      background: var(--accent);
      border: none;
      color: white;
      padding: 8px 20px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.85rem;
      font-weight: 500;
    }
    .dataset-config-footer .btn-primary:hover {
      opacity: 0.9;
    }

    /* ─────────────────────────────────────────────────────────────────
       Batch Selection in Config Dialog
       ───────────────────────────────────────────────────────────────── */

    .dataset-config-item.batch-selected {
      border-left: 3px solid var(--accent);
      background: var(--active, rgba(59, 130, 246, 0.08));
      padding-left: 9px; /* 12px - 3px border */
    }
    .dataset-config-item.batch-selected .dataset-config-item-name {
      color: var(--accent);
      font-weight: 500;
    }

    /* ── Action Bar (replaces footer when batch items selected) ── */

    .dataset-config-action-bar {
      padding: 10px 20px;
      border-top: 1px solid var(--accent);
      display: flex;
      align-items: center;
      gap: 8px;
      background: color-mix(in srgb, var(--accent) 5%, var(--bg-primary));
      animation: batchBarSlideUp 0.15s ease-out;
    }
    @keyframes batchBarSlideUp {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .dataset-config-action-bar .action-count {
      font-size: 0.82rem;
      color: var(--text-muted);
      margin-right: auto;
    }
    .dataset-config-action-bar .btn-danger {
      background: rgba(239, 68, 68, 0.12);
      border: 1px solid rgba(239, 68, 68, 0.25);
      color: #ef4444;
      padding: 5px 12px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 500;
      transition: background 0.15s;
    }
    .dataset-config-action-bar .btn-danger:hover { background: rgba(239, 68, 68, 0.22); }
    .dataset-config-action-bar .btn-danger:disabled { opacity: 0.35; cursor: not-allowed; }

    .dataset-config-action-bar .btn-classify {
      background: rgba(99, 102, 241, 0.12);
      border: 1px solid rgba(99, 102, 241, 0.25);
      color: #818cf8;
      padding: 5px 12px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 500;
      transition: background 0.15s;
    }
    .dataset-config-action-bar .btn-classify:hover { background: rgba(99, 102, 241, 0.22); }
    .dataset-config-action-bar .btn-classify:disabled { opacity: 0.35; cursor: not-allowed; }

    .dataset-config-action-bar .btn-clear {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 0.8rem;
      padding: 5px 8px;
    }
    .dataset-config-action-bar .btn-clear:hover { color: var(--text-primary); }

    /* ─────────────────────────────────────────────────────────────────
       Floating Batch Status Box (bottom-right toast)
       ───────────────────────────────────────────────────────────────── */

    .batch-status-box {
      position: fixed;
      bottom: 24px;
      right: 24px;
      width: 360px;
      max-height: 400px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 10px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
      z-index: 10001;
      display: flex;
      flex-direction: column;
      animation: slideInRight 0.3s ease;
      overflow: hidden;
    }
    @keyframes batchSlideOut {
      from { opacity: 1; transform: translateX(0); }
      to { opacity: 0; transform: translateX(100px); }
    }
    .batch-status-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border-color);
    }
    .batch-status-title {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    .batch-status-close {
      background: none;
      border: none;
      color: var(--text-muted);
      font-size: 18px;
      cursor: pointer;
      padding: 2px 6px;
      line-height: 1;
    }
    .batch-status-close:hover { color: var(--text-primary); }

    .batch-status-progress {
      padding: 8px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .batch-status-progress .batch-status-bar {
      flex: 1;
      height: 5px;
      background: var(--bg-tertiary);
      border-radius: 3px;
      overflow: hidden;
    }
    .batch-status-progress .batch-status-bar-fill {
      height: 100%;
      background: var(--accent);
      border-radius: 3px;
      transition: width 0.3s ease;
    }
    .batch-status-bar-fill.has-errors { background: #f97316; }
    .batch-status-count {
      font-size: 0.78rem;
      color: var(--text-muted);
      white-space: nowrap;
      min-width: 50px;
      text-align: right;
    }

    .batch-status-items {
      flex: 1;
      overflow-y: auto;
      padding: 4px 14px 10px;
      max-height: 260px;
    }
    .batch-status-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 3px 0;
      font-size: 0.78rem;
      color: var(--text-muted);
    }
    .batch-status-item .status-icon {
      width: 14px;
      text-align: center;
      flex-shrink: 0;
      font-size: 0.8rem;
    }
    .batch-status-item.done { color: #22c55e; }
    .batch-status-item.done .status-icon::before { content: "\2713"; }
    .batch-status-item.active { color: var(--accent); }
    .batch-status-item.active .status-icon::before { content: "\25CF"; animation: batchPulse 1s infinite; }
    .batch-status-item.queued .status-icon::before { content: "\25CB"; }
    .batch-status-item.error { color: #ef4444; }
    .batch-status-item.error .status-icon::before { content: "\2717"; }
    @keyframes batchPulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }
    .batch-status-item .item-name {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .batch-status-item .item-detail {
      font-size: 0.72rem;
      color: var(--text-muted);
      flex-shrink: 0;
      max-width: 140px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* ─────────────────────────────────────────────────────────────────
       File Browser Modal
       ───────────────────────────────────────────────────────────────── */

    .modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.6);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }
    /* File browser needs higher z-index to appear above other modals */
    #fileBrowserModal.modal-overlay {
      z-index: 11000;
    }
    .modal-content {
      background: var(--bg-primary);
      border-radius: 12px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.3);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-color);
    }
    .modal-header h3 {
      margin: 0;
      font-size: 1.1rem;
    }
    .modal-close {
      background: none;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
      color: var(--text-muted);
      padding: 0;
      line-height: 1;
    }
    .modal-close:hover {
      color: var(--text-primary);
    }
    .modal-body {
      flex: 1;
      overflow-y: auto;
      padding: 16px 20px;
    }
    .modal-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 20px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }

    /* ═══════════════════════════════════════════════════════════════
       Professional File Browser Styles
       ═══════════════════════════════════════════════════════════════ */

    .fb-modal {
      width: 800px;
      min-width: 500px;
      max-width: 95vw;
      min-height: 400px;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      border-radius: 12px;
      overflow: hidden;
      resize: both;
    }

    .fb-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 18px;
      background: var(--bg-tertiary);
      border-bottom: 1px solid var(--border-color);
    }
    .fb-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 1rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    .fb-title svg {
      color: var(--accent);
    }
    .fb-close {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border: none;
      background: transparent;
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-muted);
      transition: all 0.15s;
    }
    .fb-close:hover {
      background: var(--hover);
      color: var(--text-primary);
    }

    .fb-toolbar {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 18px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }
    .fb-nav-buttons {
      display: flex;
      gap: 4px;
    }
    .fb-nav-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-secondary);
      transition: all 0.15s;
    }
    .fb-nav-btn:hover:not(:disabled) {
      background: var(--hover);
      color: var(--text-primary);
    }
    .fb-nav-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    .fb-breadcrumb {
      display: flex;
      align-items: center;
      gap: 2px;
      flex: 1;
      overflow-x: auto;
      font-size: 0.85rem;
    }
    .fb-crumb {
      padding: 4px 8px;
      border-radius: 4px;
      cursor: pointer;
      color: var(--text-secondary);
      white-space: nowrap;
      transition: all 0.15s;
    }
    .fb-crumb:hover {
      background: var(--hover);
      color: var(--accent);
    }
    .fb-crumb-root {
      font-weight: 500;
      color: var(--accent);
    }
    .fb-crumb-current {
      color: var(--text-primary);
      font-weight: 500;
    }
    .fb-crumb-sep {
      color: var(--text-muted);
      font-size: 0.8rem;
    }

    .fb-address-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 18px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }
    .fb-root-select {
      min-width: 140px;
      padding: 8px 12px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font-size: 0.85rem;
    }
    .fb-path-input-wrapper {
      display: flex;
      flex: 1;
      gap: 6px;
    }
    .fb-path-input {
      flex: 1;
      padding: 8px 12px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font-size: 0.85rem;
      font-family: 'SF Mono', Monaco, monospace;
    }
    .fb-path-input:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }
    .fb-go-btn {
      padding: 8px 14px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.15s;
    }
    .fb-go-btn:hover {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }

    .fb-filter-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 18px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-primary);
      font-size: 0.8rem;
    }
    .fb-filter-label {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--text-muted);
    }
    .fb-filter-select {
      padding: 5px 10px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font-size: 0.8rem;
    }
    .fb-custom-pattern {
      width: 140px;
      padding: 5px 8px;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font-size: 0.8rem;
    }
    .fb-item-count {
      margin-left: auto;
      color: var(--text-muted);
      font-size: 0.75rem;
    }

    .fb-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      background: var(--bg-primary);
    }
    .fb-list-header {
      display: grid;
      grid-template-columns: 28px 1fr 80px 90px;
      gap: 8px;
      padding: 8px 18px;
      background: var(--bg-tertiary);
      border-bottom: 1px solid var(--border-color);
      font-size: 0.7rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
    }
    .fb-col-icon { }
    .fb-col-name { }
    .fb-col-size { text-align: right; }
    .fb-col-modified { text-align: right; }

    .fb-list {
      flex: 1;
      overflow-y: auto;
      min-height: 280px;
    }

    .fb-item {
      display: grid;
      grid-template-columns: 28px 1fr 80px 90px;
      gap: 8px;
      align-items: center;
      padding: 10px 18px;
      border-bottom: 1px solid var(--border-color);
      cursor: pointer;
      transition: background 0.1s;
    }
    .fb-item:hover {
      background: var(--hover);
    }
    .fb-item.selected {
      background: rgba(59, 130, 246, 0.15);
    }
    .fb-item.selected .fb-item-name {
      color: var(--accent);
      font-weight: 500;
    }
    .fb-item-icon {
      display: flex;
      align-items: center;
      flex-shrink: 0;
    }
    .fb-item-name {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 0.9rem;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .fb-item-size {
      font-size: 0.8rem;
      color: var(--text-muted);
      text-align: right;
    }
    .fb-item-modified {
      font-size: 0.8rem;
      color: var(--text-muted);
      text-align: right;
    }
    .fb-item-dir .fb-item-name {
      font-weight: 500;
    }
    .fb-item-dir:hover .fb-item-name {
      color: var(--accent);
    }

    .fb-loading,
    .fb-empty,
    .fb-error {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      height: 240px;
      color: var(--text-muted);
      font-size: 0.9rem;
    }
    .fb-error {
      color: #f87171;
    }
    .fb-spinner {
      width: 28px;
      height: 28px;
      border: 3px solid var(--border-color);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: fb-spin 0.8s linear infinite;
    }
    @keyframes fb-spin {
      to { transform: rotate(360deg); }
    }

    .fb-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 18px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-tertiary);
    }
    .fb-selection {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.85rem;
      overflow: hidden;
    }
    .fb-selection-label {
      color: var(--text-muted);
      flex-shrink: 0;
    }
    .fb-selection-path {
      color: var(--text-primary);
      font-family: 'SF Mono', Monaco, monospace;
      font-size: 0.8rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 400px;
    }
    .fb-actions {
      display: flex;
      gap: 10px;
    }

    /* Input with browse button */
    .inputWithButton {
      display: flex;
      gap: 8px;
    }
    .inputWithButton .formInput {
      flex: 1;
    }
    .inputWithButton .browseBtn {
      flex-shrink: 0;
      padding: 8px 12px;
      font-size: 0.85rem;
    }

    /* ═══════════════════════════════════════════════════════════════
       Monitor Builder Modal - styled like main chat
       ═══════════════════════════════════════════════════════════════ */
    .monitor-builder-modal {
      width: 550px;
      min-width: 400px;
      max-width: 90vw;
      height: 500px;
      min-height: 400px;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      position: relative;
      resize: both;
      overflow: auto;
    }
    .monitor-builder-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background: var(--bg-tertiary);
      border-bottom: 1px solid var(--border-color);
      flex-shrink: 0;
    }
    .monitor-builder-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.95rem;
      font-weight: 600;
    }
    .monitor-builder-title .icon {
      font-size: 1.1rem;
    }
    .monitor-builder-close {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border: none;
      background: transparent;
      border-radius: 6px;
      cursor: pointer;
      color: var(--text-muted);
      transition: all 0.15s;
    }
    .monitor-builder-close:hover {
      background: var(--hover);
      color: var(--text-primary);
    }
    .monitor-builder-context {
      padding: 10px 16px;
      background: rgba(168, 85, 247, 0.08);
      border-bottom: 1px solid var(--border-color);
      font-size: 0.8rem;
      flex-shrink: 0;
    }
    .monitor-builder-context-label {
      color: var(--text-muted);
      font-size: 0.75rem;
    }
    .monitor-builder-context-metric {
      color: var(--text-primary);
      font-weight: 500;
      margin-top: 2px;
    }
    .monitor-builder-chat {
      flex: 1;
      overflow-y: auto;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      background: var(--bg-primary);
    }
    /* Messages styled like main chat */
    .monitor-builder-msg {
      padding: 12px 16px;
      border-radius: 12px;
      font-size: 0.9rem;
      line-height: 1.5;
      max-width: 85%;
    }
    .monitor-builder-msg.user {
      background: var(--bg-tertiary);
      color: var(--text-primary);
      align-self: flex-end;
      border: 1px solid var(--border-color);
    }
    .monitor-builder-msg.assistant {
      background: var(--bg-secondary);
      color: var(--text-primary);
      align-self: flex-start;
      border: 1px solid var(--border-color);
    }
    .monitor-builder-msg.system {
      background: transparent;
      color: var(--text-muted);
      align-self: center;
      font-size: 0.8rem;
      text-align: center;
      padding: 8px 12px;
      border: none;
      max-width: 100%;
    }
    /* Input styled like main chat */
    .monitor-builder-input {
      display: flex;
      gap: 8px;
      padding: 12px 16px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
      flex-shrink: 0;
    }
    .monitor-builder-input input {
      flex: 1;
      padding: 12px 14px;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.9rem;
    }
    .monitor-builder-input input:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    }
    .monitor-builder-input input::placeholder {
      color: var(--text-muted);
    }
    .monitor-builder-input button {
      padding: 12px 20px;
      background: var(--accent);
      color: white;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 500;
      font-size: 0.9rem;
      transition: all 0.15s;
    }
    .monitor-builder-input button:hover {
      filter: brightness(1.1);
    }
    .monitor-builder-input button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    /* Resize handle indicator */
    .monitor-builder-modal::after {
      content: '';
      position: absolute;
      bottom: 4px;
      right: 4px;
      width: 12px;
      height: 12px;
      background: linear-gradient(135deg, transparent 50%, var(--text-muted) 50%, var(--text-muted) 60%, transparent 60%, transparent 70%, var(--text-muted) 70%, var(--text-muted) 80%, transparent 80%);
      opacity: 0.4;
      pointer-events: none;
    }
    /* Monitor created notification */
    .monitor-created-notification {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 16px;
      background: linear-gradient(90deg, rgba(34, 197, 94, 0.15) 0%, var(--bg-tertiary) 100%);
      border: 1px solid rgba(34, 197, 94, 0.3);
      border-radius: 8px;
      margin: 12px 0;
      font-size: 0.9rem;
    }
    .monitor-created-notification .icon {
      font-size: 1.2rem;
    }
    .monitor-created-notification .name {
      font-weight: 600;
      color: #22c55e;
    }

    /* ─────────────────────────────────────────────────────────────────
       Column Metadata Editor Modal
       ───────────────────────────────────────────────────────────────── */
    .col-meta-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .col-meta-backdrop {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
    }
    .col-meta-content {
      position: relative;
      width: 680px;
      max-width: 95vw;
      max-height: 90vh;
      background: var(--bg-primary);
      border-radius: 12px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    [data-theme="light"] .col-meta-content {
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    }
    .col-meta-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }
    .col-meta-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 1.1rem;
      font-weight: 600;
    }
    .col-meta-type-badge {
      font-size: 0.75rem;
      padding: 2px 8px;
      background: var(--bg-tertiary);
      border-radius: 4px;
      font-family: monospace;
      color: var(--text-secondary);
    }
    .col-meta-close {
      background: none;
      border: none;
      font-size: 1.5rem;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px 8px;
      line-height: 1;
      border-radius: 4px;
    }
    .col-meta-close:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    .col-meta-body {
      flex: 1;
      overflow-y: auto;
      padding: 16px 20px;
    }
    .col-meta-info-bar {
      display: flex;
      gap: 24px;
      padding: 10px 14px;
      background: var(--bg-secondary);
      border-radius: 8px;
      margin-bottom: 16px;
    }
    .col-meta-info-item {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .col-meta-info-label {
      color: var(--text-muted);
      font-size: 0.85rem;
    }
    .col-meta-info-value {
      font-weight: 500;
    }
    .col-meta-section {
      margin-bottom: 20px;
      padding: 14px;
      background: var(--bg-secondary);
      border-radius: 8px;
      border: 1px solid var(--border-color);
    }
    .col-meta-section-title {
      font-weight: 600;
      font-size: 0.9rem;
      margin-bottom: 12px;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .col-meta-section-hint {
      font-weight: 400;
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .col-meta-governance-badge {
      font-size: 0.65rem;
      padding: 2px 6px;
      background: #ef4444;
      color: white;
      border-radius: 3px;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .col-meta-row {
      display: flex;
      gap: 16px;
      margin-bottom: 12px;
    }
    .col-meta-row:last-child {
      margin-bottom: 0;
    }
    .col-meta-field {
      flex: 1;
    }
    .col-meta-field-full {
      flex: 1 1 100%;
    }
    .col-meta-field label {
      display: block;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-secondary);
      margin-bottom: 6px;
    }
    .col-meta-field input,
    .col-meta-field select,
    .col-meta-field textarea {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.9rem;
      font-family: inherit;
    }
    .col-meta-field input:focus,
    .col-meta-field select:focus,
    .col-meta-field textarea:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
    }
    .col-meta-field textarea {
      resize: vertical;
      min-height: 60px;
    }
    .col-meta-field-hint {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 4px;
    }
    .col-meta-checkbox-group {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .col-meta-checkbox {
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
      padding: 4px 10px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      font-size: 0.85rem;
      transition: all 0.15s;
    }
    .col-meta-checkbox:hover {
      border-color: var(--accent);
    }
    .col-meta-checkbox:has(input:checked) {
      background: rgba(var(--accent-rgb), 0.1);
      border-color: var(--accent);
      color: var(--accent);
    }
    .col-meta-checkbox input {
      width: auto;
      margin: 0;
    }
    .col-meta-checkbox-inline {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 0;
    }
    .col-meta-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }
    .col-meta-footer-info {
      font-size: 0.8rem;
      color: var(--text-muted);
    }
    .col-meta-footer-actions {
      display: flex;
      gap: 10px;
    }
    /* Source badges */
    .source-badge {
      display: inline-block;
      font-size: 0.65rem;
      padding: 2px 5px;
      border-radius: 3px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      margin-right: 4px;
    }
    .source-badge.source-sme {
      background: #10b981;
      color: white;
    }
    .source-badge.source-llm {
      background: #8b5cf6;
      color: white;
    }

    /* Clickable column row in schema table */
    .schema-row-clickable {
      cursor: pointer;
      transition: background 0.15s;
    }
    .schema-row-clickable:hover {
      background: var(--bg-tertiary) !important;
    }
    .schema-row-clickable td:first-child {
      position: relative;
    }
    .schema-row-clickable td:first-child::before {
      content: '✏️';
      position: absolute;
      right: 8px;
      top: 50%;
      transform: translateY(-50%);
      opacity: 0;
      transition: opacity 0.15s;
      font-size: 0.75rem;
    }
    .schema-row-clickable:hover td:first-child::before {
      opacity: 1;
    }
    /* Column metadata badges in schema table */
    .col-schema-badges {
      display: flex;
      gap: 4px;
      margin-top: 4px;
    }
    .col-schema-badge {
      font-size: 0.65rem;
      padding: 1px 5px;
      border-radius: 3px;
      font-weight: 500;
    }
    .col-schema-badge.semantic-measure {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
    }
    .col-schema-badge.semantic-dimension {
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
    }
    .col-schema-badge.semantic-timestamp {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
    }
    .col-schema-badge.semantic-key {
      background: rgba(168, 85, 247, 0.15);
      color: #a855f7;
    }
    .col-schema-badge.semantic-attribute {
      background: rgba(107, 114, 128, 0.15);
      color: #6b7280;
    }
    .col-schema-badge.classification-pii {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
    }
    .col-schema-badge.classification-phi {
      background: rgba(220, 38, 38, 0.15);
      color: #dc2626;
    }
    .col-schema-badge.classification-pci {
      background: rgba(220, 38, 38, 0.15);
      color: #dc2626;
    }
    .col-schema-badge.classification-sensitive {
      background: rgba(249, 115, 22, 0.15);
      color: #f97316;
    }
    .col-schema-badge.classification-confidential {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
    }
    .col-schema-badge.classification-internal {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
    }
    .col-schema-badge.classification-restricted {
      background: rgba(185, 28, 28, 0.15);
      color: #b91c1c;
    }
    .col-schema-badge.classification-public {
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
    }
    .col-schema-badge.deprecated {
      background: rgba(107, 114, 128, 0.15);
      color: #6b7280;
      text-decoration: line-through;
    }

    /* Schema Table Enhancements */
    .schema-metadata-table tr:hover {
      background: var(--hover);
    }
    .schema-row-deprecated {
      opacity: 0.6;
    }
    .schema-row-deprecated td {
      text-decoration: line-through;
    }
    .schema-confidence {
      font-size: 0.65rem;
      color: var(--text-muted);
      margin-left: 4px;
    }
    .schema-source-sme {
      font-size: 0.6rem;
      background: rgba(34, 197, 94, 0.2);
      color: #22c55e;
      padding: 1px 4px;
      border-radius: 3px;
      margin-left: 4px;
    }
    .schema-source-llm {
      font-size: 0.6rem;
      background: rgba(168, 85, 247, 0.2);
      color: #a855f7;
      padding: 1px 4px;
      border-radius: 3px;
      margin-left: 4px;
    }

    /* Schema Import Dialog */
    .schema-import-dialog {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 24px;
      width: 700px;
      max-width: 90vw;
      max-height: 80vh;
      overflow: auto;
      z-index: 1001;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
    .schema-import-dialog h3 {
      margin: 0 0 16px 0;
      font-size: 1.1rem;
    }
    .schema-import-preview {
      background: var(--bg-tertiary);
      border-radius: 8px;
      padding: 12px;
      max-height: 300px;
      overflow: auto;
      font-family: monospace;
      font-size: 0.75rem;
      white-space: pre;
      margin: 12px 0;
    }
    .schema-import-validation {
      margin: 12px 0;
      padding: 12px;
      border-radius: 8px;
    }
    .schema-import-validation.valid {
      background: rgba(34, 197, 94, 0.1);
      border: 1px solid rgba(34, 197, 94, 0.3);
    }
    .schema-import-validation.invalid {
      background: rgba(239, 68, 68, 0.1);
      border: 1px solid rgba(239, 68, 68, 0.3);
    }
    .schema-import-error {
      color: #ef4444;
      font-size: 0.85rem;
    }
    .schema-import-success {
      color: #22c55e;
      font-size: 0.85rem;
    }

    /* Schema Aggregation Column */
    .schema-aggr {
      font-family: monospace;
      font-size: 0.75rem;
      color: var(--text-muted);
      letter-spacing: 1px;
    }
    .schema-aggr-default {
      color: var(--accent);
      font-weight: 600;
    }
    .schema-aggr span {
      cursor: help;
    }

    /* ─────────────────────────────────────────────────────────────────
       Table Section Separators
       ───────────────────────────────────────────────────────────────── */
    .table-section-separator {
      height: 1px;
      background: linear-gradient(to right, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
      margin: 20px 0;
    }

    /* ─────────────────────────────────────────────────────────────────
       Table Relations Section
       ───────────────────────────────────────────────────────────────── */
    .table-relations-section {
      margin-bottom: 16px;
    }
    .relations-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .relations-empty {
      padding: 16px;
      text-align: center;
    }
    .relation-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 12px;
      transition: border-color 0.15s;
    }
    .relation-card:hover {
      border-color: var(--accent);
    }
    .relation-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
    }
    .relation-type-badge {
      font-size: 0.65rem;
      padding: 2px 6px;
      border-radius: 3px;
      font-weight: 600;
      text-transform: uppercase;
    }
    .relation-type-foreign_key {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
    }
    .relation-type-semantic {
      background: rgba(168, 85, 247, 0.15);
      color: #a855f7;
    }
    .relation-type-derived {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
    }
    .relation-name {
      font-weight: 600;
      flex: 1;
    }
    .relation-actions {
      display: flex;
      gap: 4px;
    }
    .relation-action-btn {
      background: none;
      border: none;
      padding: 4px 6px;
      cursor: pointer;
      opacity: 0.6;
      border-radius: 4px;
      font-size: 0.85rem;
    }
    .relation-action-btn:hover {
      opacity: 1;
      background: var(--bg-tertiary);
    }
    /* Inline delete confirmation bar */
    .relation-confirm-delete,
    .relation-confirm-delete-all {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.8rem;
    }
    .relation-confirm-label {
      color: #ef4444;
      font-weight: 600;
    }
    .relation-confirm-yes,
    .relation-confirm-no {
      border: none;
      border-radius: 4px;
      padding: 2px 10px;
      font-size: 0.78rem;
      cursor: pointer;
      font-weight: 600;
    }
    .relation-confirm-yes {
      background: #ef4444;
      color: #fff;
    }
    .relation-confirm-yes:hover {
      background: #dc2626;
    }
    .relation-confirm-no {
      background: var(--bg-tertiary);
      color: var(--text-secondary);
    }
    .relation-confirm-no:hover {
      background: var(--border-color);
    }
    /* Subtle danger button for delete-all */
    .btnDanger-subtle {
      background: none;
      border: 1px solid rgba(239, 68, 68, 0.3);
      color: #ef4444;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 500;
    }
    .btnDanger-subtle:hover {
      background: rgba(239, 68, 68, 0.1);
      border-color: #ef4444;
    }
    .relation-body {
      font-size: 0.9rem;
    }
    .relation-mapping {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 6px;
    }
    .relation-mapping code {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.8rem;
    }
    .relation-arrow {
      color: var(--text-muted);
    }
    .relation-target {
      font-weight: 500;
      color: var(--accent);
    }
    .relation-desc {
      color: var(--text-secondary);
      font-size: 0.85rem;
      margin-bottom: 6px;
    }
    .relation-meta {
      display: flex;
      gap: 12px;
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .relation-cardinality {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 3px;
    }
    .relation-validated {
      color: #22c55e;
    }

    /* Relation Editor Modal */
    .relation-editor-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 10000;
      display: none;
      align-items: center;
      justify-content: center;
    }
    .relation-editor-backdrop {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
    }
    .relation-editor-content {
      position: relative;
      width: 580px;
      max-width: 95vw;
      max-height: 90vh;
      background: var(--bg-primary);
      border-radius: 12px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .relation-editor-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }
    .relation-editor-header h3 {
      margin: 0;
      font-size: 1.1rem;
    }
    .relation-editor-close {
      background: none;
      border: none;
      font-size: 1.5rem;
      color: var(--text-muted);
      cursor: pointer;
      padding: 4px 8px;
      line-height: 1;
      border-radius: 4px;
    }
    .relation-editor-close:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    .relation-editor-body {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
    }
    .relation-editor-row {
      display: flex;
      gap: 16px;
      margin-bottom: 16px;
    }
    .relation-editor-row:last-child {
      margin-bottom: 0;
    }
    .relation-editor-field {
      flex: 1;
    }
    .relation-editor-field-full {
      flex: 1 1 100%;
    }
    .relation-editor-field label {
      display: block;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-secondary);
      margin-bottom: 6px;
    }
    .relation-hint {
      font-weight: 400;
      color: var(--text-muted);
      font-size: 0.8rem;
    }
    .relation-editor-field input,
    .relation-editor-field select,
    .relation-editor-field textarea {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-size: 0.9rem;
      font-family: inherit;
    }
    .relation-editor-field input:focus,
    .relation-editor-field select:focus,
    .relation-editor-field textarea:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
    }
    .relation-editor-field input[readonly] {
      background: var(--bg-tertiary);
      color: var(--text-muted);
    }
    .relation-editor-field textarea {
      resize: vertical;
      min-height: 60px;
    }
    .relation-editor-footer {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      padding: 12px 20px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }

    /* Schema inline editing controls */
    .schema-save-buttons {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px;
      background: rgba(59, 130, 246, 0.08);
      border: 1px solid rgba(59, 130, 246, 0.3);
      border-radius: 8px;
      margin-bottom: 10px;
    }
    .schema-save-btn {
      padding: 8px 16px;
      font-size: 0.9rem;
      border: 1px solid #3b82f6;
      border-radius: 6px;
      background: #3b82f6;
      color: white;
      cursor: pointer;
      transition: all 0.2s;
      font-weight: 600;
    }
    .schema-save-btn:hover {
      background: #2563eb;
      border-color: #2563eb;
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    }
    .schema-save-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }
    .schema-cancel-btn {
      padding: 8px 16px;
      font-size: 0.9rem;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.2s;
    }
    .schema-cancel-btn:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    .schema-save-hint {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-style: italic;
      margin-left: auto;
    }
    .schema-inline-edit-select {
      width: 100%;
      padding: 5px 8px;
      font-size: 0.85rem;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
      cursor: pointer;
    }
    .schema-inline-edit-select:focus {
      outline: none;
      border-color: #3b82f6;
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }
    .schema-inline-edit-input {
      width: 100%;
      padding: 5px 8px;
      font-size: 0.85rem;
      border: 1px solid var(--border-color);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
    }
    .schema-inline-edit-input:focus {
      outline: none;
      border-color: #3b82f6;
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }

    /* Badge-styled dropdowns for inline editing */
    .schema-inline-edit-select.badge-select {
      padding: 3px 20px 3px 8px;
      font-size: 0.75rem;
      font-weight: 500;
      border-radius: 4px;
      appearance: none;
      background-repeat: no-repeat;
      background-position: right 4px center;
      background-size: 12px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E");
    }
    .schema-inline-edit-select.badge-select.semantic-measure {
      background-color: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
      border-color: rgba(59, 130, 246, 0.3);
    }
    .schema-inline-edit-select.badge-select.semantic-dimension {
      background-color: rgba(34, 197, 94, 0.15);
      color: #22c55e;
      border-color: rgba(34, 197, 94, 0.3);
    }
    .schema-inline-edit-select.badge-select.semantic-timestamp {
      background-color: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
      border-color: rgba(245, 158, 11, 0.3);
    }
    .schema-inline-edit-select.badge-select.semantic-key {
      background-color: rgba(168, 85, 247, 0.15);
      color: #a855f7;
      border-color: rgba(168, 85, 247, 0.3);
    }
    .schema-inline-edit-select.badge-select.semantic-attribute {
      background-color: rgba(107, 114, 128, 0.15);
      color: #6b7280;
      border-color: rgba(107, 114, 128, 0.3);
    }
    .schema-inline-edit-select.badge-select.classification-pii {
      background-color: rgba(239, 68, 68, 0.15);
      color: #ef4444;
      border-color: rgba(239, 68, 68, 0.3);
      font-weight: 600;
    }
    .schema-inline-edit-select.badge-select.classification-phi {
      background-color: rgba(220, 38, 38, 0.15);
      color: #dc2626;
      border-color: rgba(220, 38, 38, 0.3);
      font-weight: 600;
    }
    .schema-inline-edit-select.badge-select.classification-pci {
      background-color: rgba(220, 38, 38, 0.15);
      color: #dc2626;
      border-color: rgba(220, 38, 38, 0.3);
      font-weight: 600;
    }
    .schema-inline-edit-select.badge-select.classification-sensitive {
      background-color: rgba(249, 115, 22, 0.15);
      color: #f97316;
      border-color: rgba(249, 115, 22, 0.3);
    }
    .schema-inline-edit-select.badge-select.classification-confidential {
      background-color: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
      border-color: rgba(245, 158, 11, 0.3);
    }
    .schema-inline-edit-select.badge-select.classification-internal {
      background-color: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
      border-color: rgba(59, 130, 246, 0.3);
    }
    .schema-inline-edit-select.badge-select.classification-restricted {
      background-color: rgba(185, 28, 28, 0.15);
      color: #b91c1c;
      border-color: rgba(185, 28, 28, 0.3);
    }
    .schema-inline-edit-select.badge-select.classification-public {
      background-color: rgba(34, 197, 94, 0.15);
      color: #22c55e;
      border-color: rgba(34, 197, 94, 0.3);
    }
    .schema-inline-edit-select.badge-select.badge-select-empty {
      background-color: rgba(107, 114, 128, 0.08);
      color: var(--text-muted);
      border-color: var(--border-color);
      font-style: italic;
    }

    /* Partition table row styling */
    .table-row-even {
      background: var(--bg-secondary);
    }
    .table-row-odd {
      background: var(--bg-primary);
    }
    .table-row-even:hover,
    .table-row-odd:hover {
      background: var(--bg-tertiary);
    }

    /* Notebook keyboard shortcuts popup */
    .notebook-shortcuts-popup {
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 8px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 12px;
      min-width: 320px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
      z-index: 1000;
    }
    .shortcuts-header {
      font-weight: 600;
      font-size: 0.9rem;
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border-color);
      color: var(--text-primary);
    }
    .shortcuts-section {
      margin-bottom: 12px;
    }
    .shortcuts-section:last-child {
      margin-bottom: 0;
    }
    .shortcuts-title {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
      margin-bottom: 6px;
      font-weight: 600;
    }
    .shortcut-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 0;
      font-size: 0.8rem;
    }
    .shortcut-row kbd {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      padding: 2px 6px;
      font-family: monospace;
      font-size: 0.75rem;
      color: var(--text-primary);
      margin-right: 2px;
    }
    .shortcut-row span {
      color: var(--text-secondary);
      margin-left: auto;
      text-align: right;
    }

    /* Login / Auth layout */
    .authBody {
      background: var(--bg-primary);
      overflow: hidden;
    }
    .authLayout {
      display: grid;
      grid-template-columns: 1.2fr 0.8fr;
      min-height: 100vh;
      min-height: 100dvh;
    }
    @supports (height: 100dvh) {
      .authLayout {
        min-height: 100dvh;
      }
    }
    .authHero {
      position: relative;
      background: radial-gradient(circle at 20% 20%, rgba(59,130,246,0.35), transparent 50%),
                  radial-gradient(circle at 80% 10%, rgba(16,185,129,0.25), transparent 40%),
                  linear-gradient(135deg, #0f172a, #111827 55%, #1f2937);
      padding: 64px;
      display: flex;
      align-items: flex-end;
      color: #e5e7eb;
    }
    .authHeroOverlay {
      max-width: 520px;
    }
    .authHeroBadge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 12px;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(148, 163, 184, 0.35);
      font-size: 0.8rem;
      margin-bottom: 24px;
      animation: float 3s ease-in-out infinite;
    }
    .authHero h1 {
      font-size: clamp(2rem, 5vw, 3rem);
      line-height: 1.1;
      margin: 0 0 16px;
      font-weight: 800;
      letter-spacing: -0.02em;
      background: linear-gradient(135deg, #f8fafc, #cbd5f5);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .authHero p {
      margin: 0 0 24px;
      color: #cbd5f5;
      font-size: 1rem;
    }
    .authHeroStats {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
    }
    .authHeroStat {
      background: rgba(15, 23, 42, 0.6);
      border: 1px solid rgba(148, 163, 184, 0.2);
      padding: 12px 16px;
      border-radius: 12px;
      min-width: 120px;
      transition: all var(--duration-normal) var(--ease-in-out);
      cursor: default;
    }
    .authHeroStat:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    }
    .authHeroStatLabel {
      display: block;
      font-size: 0.75rem;
      color: #94a3b8;
      margin-bottom: 4px;
    }
    .authHeroStatValue {
      font-weight: 600;
      font-size: 1rem;
      color: #f8fafc;
    }
    .authPanel {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 48px 32px;
      position: relative;
      background: var(--bg-primary);
    }
    .authPanelInner {
      width: min(420px, 90%);
    }
    .authLogo {
      font-weight: 800;
      font-size: 2rem;
      margin-bottom: 40px;
      color: var(--text-primary);
      letter-spacing: -0.02em;
      position: relative;
      display: inline-block;
      animation: fadeInUp 0.6s var(--ease-in-out);
    }
    .authLogo::after {
      content: '';
      position: absolute;
      bottom: -8px;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--accent), rgba(59, 130, 246, 0));
      border-radius: 2px;
      transform-origin: left;
      animation: expandBar 0.8s var(--ease-in-out) 0.3s both;
    }
    .authCard {
      background: var(--bg-glass);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--surface-border);
      border-radius: 20px;
      padding: 32px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                  0 2px 8px rgba(0, 0, 0, 0.15),
                  inset 0 1px 0 rgba(255, 255, 255, 0.05);
      animation: fadeInUp 0.6s var(--ease-in-out) 0.3s both;
      position: relative;
    }
    .authCard::before {
      content: '';
      position: absolute;
      inset: -1px;
      border-radius: 20px;
      padding: 1px;
      background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.2),
        rgba(139, 92, 246, 0.1),
        transparent 50%);
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask-composite: exclude;
      pointer-events: none;
      opacity: 0.5;
    }
    .authCard h2 {
      margin: 0 0 8px;
      font-size: 1.75rem;
      font-weight: 700;
      letter-spacing: -0.01em;
      animation: fadeInUp 0.6s var(--ease-in-out) 0.4s both;
    }
    .authSubtitle {
      margin: 0 0 24px;
      color: var(--text-secondary);
      font-size: 1rem;
      line-height: 1.6;
      animation: fadeInUp 0.6s var(--ease-in-out) 0.5s both;
    }
    .authForm {
      display: flex;
      flex-direction: column;
      gap: 20px;
      animation: fadeInUp 0.6s var(--ease-in-out) 0.6s both;
    }
    /* Auth method containers */
    .authMethods {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .authMethods--oauth {
      gap: 10px;
    }
    .authMethods--credentials {
      gap: 16px;
    }
    /* Form field groups */
    .authFieldGroup {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .authLabel {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-primary);
      letter-spacing: 0.01em;
    }
    .authInput {
      width: 100%;
      padding: 12px 16px;
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.95rem;
      font-family: var(--font-base);
      transition: all var(--duration-normal) var(--ease-in-out);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
    .authInput::placeholder {
      color: var(--text-muted);
    }
    .authInput:hover {
      border-color: rgba(59, 130, 246, 0.3);
    }
    .authInput:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-glow), 0 1px 2px rgba(0, 0, 0, 0.05);
      background: var(--bg-secondary);
    }
    .authInput:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .authPasswordWrapper {
      position: relative;
      width: 100%;
      display: block;
    }
    .authPasswordInput {
      width: 100% !important;
      padding-right: 48px !important;
      margin: 0 !important;
    }
    .authPasswordToggle {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 6px;
      transition: all 0.2s ease;
      opacity: 0.7;
      z-index: 10;
      height: 32px;
      width: 32px;
    }
    .authPasswordToggle:hover {
      opacity: 1;
      color: var(--text-primary);
      background: rgba(59, 130, 246, 0.1);
    }
    .authPasswordToggle:active {
      transform: translateY(-50%) scale(0.95);
    }
    .authPasswordToggle:focus {
      outline: none;
    }
    .authPasswordToggle:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      opacity: 1;
    }
    .authPasswordToggleIcon {
      width: 18px;
      height: 18px;
      display: block;
    }
    .authPasswordToggle .eye-icon-closed {
      display: none;
    }
    .authPasswordToggle.showing .eye-icon-open {
      display: none;
    }
    .authPasswordToggle.showing .eye-icon-closed {
      display: block;
    }
    .authRow {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.85rem;
      color: var(--text-secondary);
    }
    .authRemember {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .authLink {
      color: var(--accent);
      text-decoration: none;
    }
    .authLink:hover {
      text-decoration: underline;
    }
    .authSubmit {
      width: 100%;
      padding: 14px 24px;
      border-radius: 12px;
      font-size: 0.95rem;
      font-weight: 600;
      transition: all var(--duration-normal) var(--ease-in-out);
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }
    .authSubmit:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
    }
    .authSubmit:active {
      transform: translateY(0);
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    }
    .authSubmit:focus-visible {
      outline: 3px solid var(--accent-glow);
      outline-offset: 2px;
    }
    .authSubmit:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }
    .authDivider {
      text-align: center;
      position: relative;
      margin: 8px 0;
      color: var(--text-muted);
      font-size: 0.8rem;
      font-weight: 500;
    }
    .authDivider span {
      background: var(--bg-glass);
      padding: 0 16px;
      position: relative;
      z-index: 1;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      font-size: 0.75rem;
    }
    .authDivider::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(
        90deg,
        transparent,
        var(--border-color) 20%,
        var(--border-color) 80%,
        transparent
      );
      z-index: 0;
    }
    .authGoogleBtn {
      width: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 14px 24px;
      border-radius: 12px;
      font-size: 0.95rem;
      font-weight: 600;
      transition: all var(--duration-normal) var(--ease-in-out);
      position: relative;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    }
    .authGoogleBtn::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, transparent, var(--surface-highlight), transparent);
      opacity: 0;
      transition: opacity 0.3s;
    }
    .authGoogleBtn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.08);
      border-color: var(--accent);
    }
    .authGoogleBtn:hover::before {
      opacity: 1;
    }
    .authGoogleBtn:active {
      transform: translateY(0);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    .authGoogleBtn:focus-visible {
      outline: 3px solid var(--accent-glow);
      outline-offset: 2px;
    }
    .authGoogleBtn.loading {
      pointer-events: none;
      opacity: 0.7;
    }
    .authError {
      display: none;
      padding: 12px 16px;
      border-radius: 12px;
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.08));
      border: 1px solid rgba(239, 68, 68, 0.3);
      border-left: 3px solid #ef4444;
      color: #fca5a5;
      font-size: 0.85rem;
      font-weight: 500;
      animation: slideDown 0.3s var(--ease-in-out);
      box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
      position: relative;
    }
    .authError::before {
      content: '⚠️';
      margin-right: 8px;
      font-size: 1rem;
    }
    .authNotice {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 12px;
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06));
      border: 1px solid rgba(59, 130, 246, 0.2);
      font-size: 0.85rem;
      color: var(--text-secondary);
      position: relative;
      overflow: hidden;
    }
    .authNotice::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      width: 3px;
      height: 100%;
      background: var(--accent);
      border-radius: 12px 0 0 12px;
    }
    .authNotice::after {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
      animation: shimmer 3s infinite;
      pointer-events: none;
    }
    .authNoticeLabel {
      display: flex;
      align-items: center;
      gap: 6px;
      text-transform: uppercase;
      font-size: 0.7rem;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      font-weight: 600;
    }
    .authNoticeLabel::before {
      content: '🔒';
      font-size: 0.85rem;
    }
    .authNoticeValue {
      font-weight: 700;
      font-size: 0.85rem;
      color: var(--accent);
      font-family: var(--font-mono);
      background: rgba(59, 130, 246, 0.1);
      padding: 2px 8px;
      border-radius: 6px;
    }
    .authAlt {
      margin-top: 4px;
      display: flex;
      justify-content: center;
      gap: 6px;
      font-size: 0.8rem;
      color: var(--text-secondary);
    }
    .authLegal {
      margin-top: 8px;
      text-align: center;
      font-size: 0.7rem;
      color: var(--text-muted);
      line-height: 1.4;
    }

    /* Auth animations and keyframes */
    .authHero {
      animation: fadeIn 0.8s var(--ease-in-out);
    }
    .authPanel {
      animation: slideInRight 0.8s var(--ease-in-out);
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    @keyframes slideInRight {
      from {
        opacity: 0;
        transform: translateX(30px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }
    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    @keyframes expandBar {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-5px); }
    }
    @keyframes shimmer {
      0%, 100% { transform: translateX(-100%); opacity: 0; }
      50% { transform: translateX(100%); opacity: 0.5; }
    }
    @keyframes slideIn {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    @keyframes slideOut {
      from {
        opacity: 1;
        transform: translateY(0);
      }
      to {
        opacity: 0;
        transform: translateY(-10px);
      }
    }
    @keyframes slideDown {
      from {
        opacity: 0;
        transform: translateY(-10px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Auth accessibility styles */
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border-width: 0;
    }
    *:focus-visible {
      outline: 3px solid var(--accent);
      outline-offset: 3px;
      border-radius: 4px;
    }
    *:focus:not(:focus-visible) {
      outline: none;
    }
    .authLink:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-radius: 3px;
      background: var(--accent-glow);
      padding: 2px 4px;
      margin: -2px -4px;
    }
    .authLink {
      text-decoration: underline;
      text-decoration-thickness: 1px;
      text-underline-offset: 2px;
    }
    .authLink:hover {
      text-decoration-thickness: 2px;
    }

    /* Reduced motion support */

    /* High contrast mode support */

    .cookieBanner {
      position: fixed;
      left: 24px;
      right: 24px;
      bottom: 24px;
      padding: 14px 16px;
      border-radius: 14px;
      border: 1px solid var(--border-color);
      background: rgba(15, 23, 42, 0.9);
      color: var(--text-primary);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      z-index: 3000;
      box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    }
    .light-theme .cookieBanner {
      background: rgba(255, 255, 255, 0.95);
    }
    .cookieBannerContent {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .cookieBannerTitle {
      font-weight: 600;
      font-size: 0.9rem;
    }
    .cookieBannerText {
      font-size: 0.8rem;
      color: var(--text-secondary);
      max-width: 520px;
    }
    .cookieBannerActions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .cookieBtn {
      padding: 6px 12px;
      font-size: 0.75rem;
    }

    /* Profile section styles - enhanced for premium feel */
    .profileAvatar {
      width: 72px;
      height: 72px;
      border-radius: 50%;
      background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
      border: 3px solid rgba(59, 130, 246, 0.3);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 1.75rem;
      font-weight: 800;
      color: white;
      box-shadow:
        0 8px 24px rgba(59, 130, 246, 0.4),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2);
      position: relative;
    }

    .profileAvatar::after {
      content: '';
      position: absolute;
      inset: -3px;
      border-radius: 50%;
      padding: 3px;
      background: linear-gradient(135deg, #3b82f6, #8b5cf6);
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      mask-composite: exclude;
      opacity: 0.5;
    }
    .profileHeaderInfo {
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex: 1;
    }
    .profileDisplayName {
      font-size: 1.35rem;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }
    .profileEmail {
      font-size: 0.9rem;
      color: var(--text-secondary);
    }
    .profileForm {
      display: flex;
      flex-direction: column;
      gap: 20px;
    }
    .profileLabel {
      display: block;
      font-size: 0.75rem;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      font-weight: 600;
      margin-bottom: 8px;
    }
    .profileInput {
      width: 100%;
      min-height: 42px;
      padding: 10px 14px;
      background: var(--bg-secondary);
      border: 1.5px solid var(--border-color);
      border-radius: 10px;
      color: var(--text-primary);
      font-size: 0.95rem;
      transition: all 0.25s ease;
    }
    .profileInput:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }
    .profileMetaRow {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 16px;
      padding: 20px;
      border-radius: 12px;
      background: rgba(59, 130, 246, 0.05);
      border: 1px solid rgba(59, 130, 246, 0.15);
    }
    .profileMetaItem {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .profileProviders {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .profileProvider {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border-radius: 8px;
      padding: 5px 10px;
      border: 1px solid rgba(59, 130, 246, 0.3);
      background: rgba(59, 130, 246, 0.15);
      color: var(--accent);
      font-weight: 700;
    }
    .profileMetaValue {
      font-size: 0.9rem;
      color: var(--text-primary);
      font-weight: 600;
    }
    .profileActions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      padding-top: 8px;
    }
    .profileActions .btnPrimary,
    .profileActions .btnSecondary {
      padding: 12px 24px;
      font-size: 0.9rem;
      font-weight: 600;
    }
    .profileStatus {
      font-size: 0.85rem;
      min-height: 20px;
      padding: 8px 0;
    }
    .authFooter {
      position: absolute;
      bottom: 24px;
      font-size: 0.75rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    /* Tablet landscape */

    /* Tablet portrait */

    /* Mobile */

    /* Small mobile */

    /* Touch device hover overrides */

/* ================================================================================
   ADMIN PANEL STYLES
   ================================================================================ */

/* Admin Panel Container */
.adminPanel {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.adminPanel.hidden {
  display: none;
}

/* Admin Header */
.adminHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.adminHeaderText {
  flex: 1;
}

.adminTitle {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0;
}

.adminSubtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Admin Toolbar */
.adminToolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}

.searchBox {
  flex: 1;
  position: relative;
}

.searchIcon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.searchInput {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.searchInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filterSelect {
  padding: 12px 40px 12px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  min-width: 150px;
}

/* User Table - responsive with horizontal scroll */
.userTableContainer {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  /* Smooth scrolling on touch devices */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

/* Custom scrollbar styling */
.userTableContainer::-webkit-scrollbar {
  height: 8px;
}

.userTableContainer::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.3);
  border-radius: 4px;
}

.userTableContainer::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
  transition: background 0.2s;
}

.userTableContainer::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.userTable {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.userTable thead {
  background: rgba(59, 130, 246, 0.08);
  border-bottom: 1px solid var(--border-color);
}

.userTable tbody {
  overflow: visible;
}

.userTable th {
  padding: 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.userTable tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  transition: background-color 0.2s ease;
}

.userTable tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.userTable tbody tr:last-child {
  border-bottom: none;
}

.userTable td {
  padding: 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  vertical-align: middle;
}

/* Actions column needs special overflow handling */
.userTable td:last-child {
  position: relative;
  overflow: visible;
}

.statusIndicator {
  font-size: 1.2rem;
}

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

.userAvatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
}

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

.userEmail {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.roleBadge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.roleBadge--admin {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.roleBadge--user {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

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

.providerTag {
  padding: 2px 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--accent);
}

.lastLogin {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Actions Dropdown - fixed z-index for visibility */
.actionsDropdown {
  position: relative;
  z-index: 100;
  display: inline-block;
}

.actionsBtn {
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.actionsBtn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--accent);
}

.actionsMenu {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 99999;
  min-width: 180px;
  overflow: hidden;
  white-space: nowrap;
}

/* Ensure menu appears above everything */
.userTable tbody tr {
  position: relative;
  z-index: 1;
}

/* Ensure table cells in actions column don't clip the dropdown */
.userTable tbody tr td:last-child {
  overflow: visible !important;
}

.userTable tbody tr:has(.actionsMenu.show) {
  z-index: 100000;
}

.actionsDropdown:has(.actionsMenu.show) {
  z-index: 100000;
}

.actionsMenu.show {
  display: block !important;
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.actionItem {
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.actionItem:hover {
  background: rgba(59, 130, 246, 0.1);
}

.actionItem--danger {
  color: #ef4444;
}

.actionItem--danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.userTableFooter {
  padding: 16px;
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Modal Styles */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

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

.modalDialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.modalDialog--small {
  max-width: 400px;
}

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

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

.modalTitle {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modalClose {
  padding: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modalClose:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.modalBody {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 200px);
}

.formGroup {
  margin-bottom: 20px;
}

.formLabel {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.formInput,
.formSelect {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.formInput:focus,
.formSelect:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.formHint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.formError {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  color: #ef4444;
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: none;
}

.formError.show {
  display: block;
}

.modalFooter {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
}

.btnSmall {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.deleteConfirmModal .btnDanger {
  padding: 12px 24px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.deleteConfirmModal .btnDanger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.deleteConfirmModal .btnDanger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.deleteWarning {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

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

.generatedPassword {
  display: none;
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 10px;
}

.generatedPassword.show {
  display: block;
}

.generatedPasswordText {
  font-family: monospace;
  font-size: 0.95rem;
  color: #22c55e;
  font-weight: 600;
  word-break: break-all;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 0.9rem;
  z-index: 10000;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

/* ================================================================================
   SECURITY SETTINGS STYLES
   ================================================================================ */

/* ================================================================================
   PREMIUM SECURITY SECTION STYLES
   ================================================================================ */

/* Session item - modern card design */
.sessionItem {
  padding: 20px 24px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.sessionItem::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, #06b6d4 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sessionItem:hover {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.sessionItem:hover::before {
  opacity: 1;
}

.sessionInfo {
  flex: 1;
}

.sessionDevice {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sessionDetails {
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sessionCurrent {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

/* Login history item - modern card design */
.loginItem {
  padding: 20px 24px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.loginItem::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #22c55e 0%, #10b981 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loginItem:hover {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.loginItem:hover::before {
  opacity: 1;
}

.loginStatus {
  font-size: 1.5rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.loginInfo {
  flex: 1;
}

.loginTimestamp {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.loginDetails {
  font-size: 0.85rem;
  color: #64748b;
}

.loginFailed {
  border-left-color: transparent;
}

.loginFailed::before {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  opacity: 1;
}

.loginFailedReason {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 6px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.1);
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-block;
}

/* ================================================================================
   RESPONSIVE DESIGN - ALL SCREEN SIZES
   ================================================================================ */

/* Extra Large Screens (1920px+) */

/* Large Screens (1440px - 1919px) */

/* Desktop (1024px - 1439px) */

/* Tablet Landscape (768px - 1023px) */

/* Tablet Portrait & Mobile (max-width: 768px) */

/* Mobile Landscape (641px - 767px) */

/* Mobile Portrait (481px - 640px) */

/* Small Mobile (max-width: 480px) */

/* Suggested Questions in AI Insights */
.suggested-question {
  cursor: pointer;
  padding: 6px 10px;
  margin: 4px 0;
  background: var(--bg-primary);
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.suggested-question:hover {
  background: var(--hover);
  border-color: var(--accent);
  transform: translateX(3px);
}

.suggested-questions-list {
  max-height: 220px;
  overflow-y: auto;
}

/* ============================================
   User Profile Dropdown
   ============================================ */

/* User Profile Dropdown */
.userProfileContainer {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 9999;
}

/* Adjust header controls to make room for profile button */
.mainHeader .headerRight {
  margin-right: 44px !important;
}
.mainHeader .headerRight .btnSecondary {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.userProfileButton {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.userProfileButton:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.userAvatar {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
}

.userDropdown {
  position: absolute;
  top: 52px;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 260px;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.userDropdownHeader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
}

.userDropdownAvatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
  user-select: none;
}

.userDropdownInfo {
  flex: 1;
  min-width: 0;
}

.userDropdownName {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userDropdownEmail {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userDropdownDivider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
}

.userDropdownMenu {
  padding: 8px;
}

.userDropdownItem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.15s ease;
}

.userDropdownItem:hover {
  background: var(--hover);
}

.userDropdownIcon {
  font-size: 18px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.userDropdownLogout {
  color: #ef4444;
}

.userDropdownLogout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Dark mode adjustments */

/* Mobile responsive */

/* Light theme overrides for settings */
.light-theme .settings-card {
  background: linear-gradient(135deg,
    rgba(249, 250, 251, 0.98) 0%,
    rgba(255, 255, 255, 0.95) 100%);
  border: 1px solid rgba(17, 24, 39, 0.1);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.light-theme .settings-card::before {
  background: linear-gradient(180deg,
    rgba(37, 99, 235, 0.03) 0%,
    transparent 100%);
}

.light-theme .settings-section h3 {
  background: linear-gradient(135deg, #111827 0%, #4b5563 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.light-theme .profileAvatar {
  border: 3px solid rgba(37, 99, 235, 0.2);
  box-shadow:
    0 8px 24px rgba(37, 99, 235, 0.25),
    0 4px 8px rgba(37, 99, 235, 0.15);
}

.light-theme .profileInput,
.light-theme .settings-group select,
.light-theme .settings-group input[type="text"],
.light-theme .settings-group input[type="number"],
.light-theme .settings-group input[type="email"],
.light-theme .settings-group input[type="password"] {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.light-theme .profileInput:hover,
.light-theme .settings-group select:hover,
.light-theme .settings-group input:hover {
  background: var(--bg-tertiary);
}

.light-theme .profileInput:focus,
.light-theme .settings-group select:focus,
.light-theme .settings-group input:focus {
  border-color: var(--accent);
  background: var(--bg-primary);
}

/* ═══════════════════════════════════════════════════════════════
   Query Stats Panel - Resizable floating panel
   ═══════════════════════════════════════════════════════════════ */

.stats-panel {
  position: fixed;
  z-index: 9999;
  display: none;
  flex-direction: column;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  min-width: 300px;
  min-height: 200px;
}

.stats-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  cursor: move;
  flex-shrink: 0;
  user-select: none;
}

.stats-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stats-panel-title .icon {
  font-size: 1rem;
}

.stats-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.stats-panel-close:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.stats-panel-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stats-panel-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.stats-panel-copy:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.stats-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  font-size: 0.85rem;
}

.stats-panel-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, var(--border-color) 50%);
  opacity: 0.6;
}

.stats-panel-resize-handle:hover {
  opacity: 1;
}

/* Stats content styling */
.stats-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.stats-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.stats-section-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

.stats-group {
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.stats-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}

.stats-group.sampling-stats {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.stats-group.sampling-stats .stats-group-title {
  color: var(--accent);
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.82rem;
}

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

.stats-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-mono);
}

.stats-value.highlight {
  color: var(--accent);
  font-weight: 600;
}

.stats-json {
  margin: 0;
  padding: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.stats-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
  font-style: italic;
}

/* Stats button active state */
.followup-btn.stats-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent);
}

.followup-btn.stats-btn.active .followup-icon {
  color: var(--accent);
}

/* Light theme adjustments */
.light-theme .stats-panel {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.light-theme .stats-group.sampling-stats {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
}

/* ─────────────────────────────────────────────────────────────────
   Light Theme - Split Pane Visual Separation
   ───────────────────────────────────────────────────────────────── */

/* Followup content panes - stronger borders in light mode */
.light-theme .followup-content-item {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  border-left: 3px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.light-theme .followup-content-item {
  background: rgba(0,0,0,0.02);
}

/* Multiple panes - add spacing and stronger visual separation */
.light-theme .followup-content-item + .followup-content-item {
  margin-top: 12px;
  border-top: 1px solid #b8c5d1;
}

/* Followup content section container */
.light-theme .followup-content-section {
  border-top: 2px solid #d1d9e3;
}

/* Resizable panes - stronger border for resize handle visibility */
.light-theme .followup-content-item.resizable {
  border: 1px solid #b8c5d1;
  border-left: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Resize handle indicator - more visible in light mode */
.light-theme .followup-content-item.resizable::after {
  background: linear-gradient(to bottom,
    transparent,
    rgba(0, 0, 0, 0.1) 30%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.1) 70%,
    transparent
  );
}

/* Pane headers - subtle background bar */
.light-theme .followup-content-header {
  background: rgba(0,0,0,0.03);
}

/* Map container in light mode - dark border for clear separation */
.light-theme .followup-content-body .leaflet-container {
  border: 2px solid #374151;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Map wrapper in light mode */
.light-theme .followup-content-body .map-compare-wrapper {
  border: 2px solid #374151;
  border-radius: 6px;
}

/* Map panes in light mode - stronger visual separation */
.light-theme .followup-content-item:has(.leaflet-container) {
  border: 2px solid #4b5563;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Grid wrapper in panes - subtle border */
.light-theme .followup-content-body .barq-grid-wrapper {
  border: 1px solid #d1d9e3;
  border-radius: 6px;
}

/* Table info row */
.light-theme .barq-table-info {
  border-top: 1px solid #e5e9ef;
  padding-top: 8px;
  margin-top: 8px;
}

/* Pane collapse toggle - more visible */
.light-theme .followup-content-item .pane-collapse-toggle {
  background: #f3f6f9;
  border: 1px solid #d1d9e3;
}

.light-theme .followup-content-item .pane-collapse-toggle:hover {
  background: #e5e9ef;
}

/* Pane close button - neutral gray in light mode */
.light-theme .pane-close-btn:hover {
  background: rgba(107, 114, 128, 0.12);
}

.light-theme .pane-close-btn svg {
  stroke: #6b7280;
}

.light-theme .pane-close-btn:hover svg {
  stroke: #374151;
}

/* Horizontal separator between stacked panes */
.light-theme .followup-content-section > .followup-content-item:not(:first-child)::before {
  content: '';
  display: block;
  position: absolute;
  top: -7px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(to right, transparent, #b8c5d1 20%, #b8c5d1 80%, transparent);
}

/* ─────────────────────────────────────────────────────────────────
   Light Theme - Activity Bar / Sidebar Icons
   ───────────────────────────────────────────────────────────────── */

/* Activity bar - slightly darker background for better contrast */
.light-theme .activityBar {
  background: #dfe3e8;
  border-right: 1px solid #c7cdd4;
}

/* Activity bar buttons - darker icons for better visibility */
.light-theme .actBtn {
  color: #374151;
}

.light-theme .actBtn:hover {
  color: #111827;
  background: rgba(0, 0, 0, 0.08);
}

.light-theme .actBtn.active {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}

.light-theme .actBtn.active::before {
  background: #2563eb;
}

/* Activity bar tooltips */
.light-theme .actBtn[title]::after {
  background: #1f2937;
  color: #ffffff;
}

/* Activity bar separator */
.light-theme .actSep {
  background: #c7cdd4;
}

/* Sidebar icons in general */
.light-theme .actBtn svg {
  stroke: currentColor;
}

/* Bottom activity buttons (settings, etc.) */
.light-theme .actBtn[title="Settings"],
.light-theme .actBtn[title="Help"],
.light-theme .actBtn[title="User"] {
  color: #374151;
}

.light-theme .actBtn[title="Settings"]:hover,
.light-theme .actBtn[title="Help"]:hover,
.light-theme .actBtn[title="User"]:hover {
  color: #111827;
}

/* ─────────────────────────────────────────────────────────────────
   Light Theme - Chat Input Box & Footer Toolbar
   ───────────────────────────────────────────────────────────────── */

/* Main footer area - light background */
.light-theme .mainFooter {
  background: #f8fafc;
  border-top: 1px solid #d1d9e3;
}

/* Chat textarea - light input box */
.light-theme .chat-textarea {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #111827;
  border-radius: 8px;
}

.light-theme .chat-textarea::placeholder {
  color: #64748b;
}

.light-theme .chat-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
  outline: none;
}

.light-theme .chat-textarea.sql-mode {
  background: #fefbf3;
  border-color: #d4a574;
}

/* Chat textarea wrapper */
.light-theme .chat-textarea-wrapper {
  background: transparent;
}

/* Resize handle */
.light-theme .chat-resize-handle {
  color: #9ca3af;
}

.light-theme .chat-resize-handle:hover {
  color: #2563eb;
}

/* Chat icon buttons - toolbar buttons */
.light-theme .chat-icon-btn {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #374151;
}

.light-theme .chat-icon-btn:hover {
  background: #f3f6f9;
  border-color: #2563eb;
  color: #2563eb;
}

/* Send button - keep accent color */
.light-theme .chat-send-btn {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.light-theme .chat-send-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* Stop button - keep red */
.light-theme .chat-stop-btn {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.light-theme .chat-stop-btn:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Mode toggle (NLP/SQL toggle) */
.light-theme .mode-toggle {
  background: #e5e9ef;
  border-radius: 6px;
  padding: 2px;
}

.light-theme .mode-label {
  color: #374151;
}

.light-theme .mode-radio:hover .mode-label {
  color: #111827;
}

.light-theme .mode-radio input[type="radio"]:checked + .mode-label {
  background: #2563eb;
  color: #ffffff;
}

/* Options toggle button */
.light-theme .options-toggle-btn {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #374151;
}

.light-theme .options-toggle-btn:hover {
  background: #f3f6f9;
  border-color: #2563eb;
  color: #2563eb;
}

.light-theme .options-toggle-btn.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: #2563eb;
  color: #2563eb;
}

/* Followup panel in footer */
.light-theme .followup-panel {
  border-bottom: 1px solid #d1d9e3;
}

/* Followup buttons in toolbar */
.light-theme .followup-btn {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #374151;
}

.light-theme .followup-btn:hover {
  background: #f3f6f9;
  border-color: #2563eb;
  color: #2563eb;
}

.light-theme .followup-btn.generated {
  border-color: #22c55e;
}

/* Auto toggle button */
.light-theme .auto-toggle-btn {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #374151;
}

.light-theme .auto-toggle-btn:hover {
  background: #f3f6f9;
  border-color: #2563eb;
  color: #2563eb;
}

.light-theme .auto-toggle-btn.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: #2563eb;
  color: #2563eb;
}

/* Footer toggle button */
.light-theme .footer-toggle-btn {
  color: #64748b;
}

.light-theme .footer-toggle-btn:hover {
  color: #2563eb;
}

/* Explore suggestions panel (dropdown) */
.light-theme .explore-suggestions-panel {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.light-theme .explore-suggestions-header {
  background: #f3f6f9;
  border-bottom: 1px solid #d1d9e3;
}

.light-theme .explore-suggestions-close {
  color: #64748b;
}

.light-theme .explore-suggestions-close:hover {
  color: #111827;
}

.light-theme .explore-suggestion-item {
  background: #f8fafc;
  color: #111827;
}

.light-theme .explore-suggestion-item:hover {
  background: #e5e9ef;
}

.light-theme .explore-suggestion-item .suggestion-number {
  color: #64748b;
}

/* Generate button in suggestions */
.light-theme .explore-suggestions-generate {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* Chat input form */
.light-theme .chat-input-form {
  background: transparent;
}

/* Followup checkbox styling */
.light-theme .followup-checkbox {
  color: #374151;
}

.light-theme .followup-checkbox span {
  color: #374151;
}

.light-theme .followup-checkbox input:checked + span {
  color: #111827;
  font-weight: 500;
}

/* Explore input area container */
.light-theme .explore-input-area {
  background: transparent;
}

/* Input themed - generic themed inputs */
.light-theme .inputThemed {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #111827;
}

.light-theme .inputThemed::placeholder {
  color: #64748b;
}

.light-theme .inputThemed:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Ensure mainFooter textarea is styled correctly */
.light-theme .mainFooter textarea,
.light-theme .mainFooter input[type="text"] {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #111827;
}

.light-theme .mainFooter textarea:focus,
.light-theme .mainFooter input[type="text"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Dataset selector */
.light-theme .dataset-select,
.light-theme .engine-select {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #111827;
}

.light-theme .dataset-select:hover,
.light-theme .engine-select:hover {
  border-color: #2563eb;
}

.light-theme .dataset-select:focus,
.light-theme .engine-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.light-theme .dataset-select option,
.light-theme .engine-select option {
  background: #ffffff;
  color: #111827;
}

/* Dataset/Engine config buttons */
.light-theme .dataset-config-btn,
.light-theme .engine-config-btn {
  background: #ffffff;
  border: 1px solid #c7d2dd;
  color: #374151;
}

.light-theme .dataset-config-btn:hover,
.light-theme .engine-config-btn:hover {
  background: #f3f6f9;
  border-color: #2563eb;
  color: #2563eb;
}

/* Popup panels (auto + query hints) */
.light-theme .auto-popup-panel,
.light-theme .query-hints-popup {
  background: #ffffff;
  border-color: #d1d9e3;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.light-theme .popup-header,
.light-theme .query-hints-section-title {
  color: #64748b;
  border-color: #e5e7eb;
}
.light-theme .auto-popup-item,
.light-theme .query-hints-radio {
  color: #374151;
}
.light-theme .auto-popup-item:hover,
.light-theme .query-hints-radio:hover {
  background: #f3f6f9;
}
.light-theme .query-hints-section + .query-hints-section {
  border-color: #e5e7eb;
}
.light-theme .followupTypeModelSelect {
  background: #f3f6f9;
  color: #64748b;
}
.light-theme .followupTypeModelSelect:hover,
.light-theme .followupTypeModelSelect:focus {
  border-color: #c7d2dd;
  color: #374151;
}

/* Followup separators */
.light-theme .followup-sep {
  background: #d1d9e3;
}

.light-theme .followup-sep-big {
  background: #c7d2dd;
}

/* Mode selector container */
.light-theme .explore-mode-selector {
  background: #e5e9ef;
}

/* ─────────────────────────────────────────────────────────────────
   Light Theme - Sidebar & Exploration Items
   ───────────────────────────────────────────────────────────────── */

/* Sidebar background */
.light-theme .sidebar {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

/* Sidebar header */
.light-theme .sidebarHeader {
  border-bottom: 1px solid #e2e8f0;
}

.light-theme .sidebarHeader h2 {
  color: #0f172a;
}

/* Sidebar search input */
.light-theme .sidebarSearchInput,
.light-theme .sidebarSearch input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

.light-theme .sidebarSearchInput::placeholder,
.light-theme .sidebarSearch input::placeholder {
  color: #64748b;
}

/* Sidebar group titles (OLDER, etc.) */
.light-theme .sidebarGroup {
  color: #475569;
}

/* Sidebar items */
.light-theme .sidebarItem {
  color: #1e293b;
}

.light-theme .sidebarItem:hover {
  background: rgba(0, 0, 0, 0.04);
}

.light-theme .sidebarItem.active {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.light-theme .sidebarItem .itemTitle {
  color: #0f172a;
}

.light-theme .sidebarItem .itemMeta {
  color: #475569;
}

/* Light theme: description & insights use darker green for readability */
.light-theme .table-insights-list { color: #166534; }

/* Chat items in sidebar */
.light-theme .chatItem {
  color: #1e293b;
}

.light-theme .chatItem:hover {
  background: rgba(0, 0, 0, 0.04);
}

.light-theme .chatItem.active {
  background: rgba(37, 99, 235, 0.1);
}

.light-theme .chatItemTitle {
  color: #0f172a;
}

.light-theme .chatItemMeta {
  color: #475569;
}

/* Session items */
.light-theme .sessionItem {
  color: #1e293b;
}

.light-theme .sessionItem:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Sidebar empty state */
.light-theme .sidebarEmptyState {
  color: #475569;
}

.light-theme .sidebarEmptyState .emptyText {
  color: #1e293b;
}

/* Sidebar action buttons */
.light-theme .sidebarActionBtn {
  color: #475569;
}

.light-theme .sidebarActionBtn:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.06);
}

/* ─────────────────────────────────────────────────────────────────
   Light Theme - AI Insights Panel
   ───────────────────────────────────────────────────────────────── */

/* Insights panel heading */
.light-theme .explore-suggestions-panel h3,
.light-theme .explore-suggestions-header span {
  color: #0f172a;
}

/* Insight item text */
.light-theme .explore-suggestion-item {
  color: #1e293b;
}

/* Compact header */
.light-theme .sidebarCompactHeader {
  color: #475569;
}

/* ─────────────────────────────────────────────────────────────────
   Light Theme - Profile Detail Panel
   ───────────────────────────────────────────────────────────────── */
.light-theme .profileDetailOverlay {
  background: rgba(0, 0, 0, 0.3);
}
.light-theme .profileDetailPanel {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.light-theme .pdStatVal {
  color: #0f172a;
}
.light-theme .profileDetailSamples code {
  background: #f1f5f9;
  color: #334155;
}
.light-theme .profile-outlier-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}
.light-theme .profileOutlierStrip {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.12);
}

/* ═══════════════════════════════════════════════════════════════════
   Data Containers UI
   ═══════════════════════════════════════════════════════════════════ */

/* Prepare popup menu (dataset vs container chooser) */
.prepare-popup-menu {
  position: fixed; z-index: 9999;
  background: var(--bg-primary); border: 1px solid var(--border-color);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  min-width: 240px; padding: 4px 0;
  animation: prepareMenuFadeIn 0.12s ease-out;
}
@keyframes prepareMenuFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.prepare-popup-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; transition: background 0.1s;
}
.prepare-popup-item:hover { background: rgba(99,102,241,0.08); }
.prepare-popup-item:first-child { border-radius: 8px 8px 0 0; }
.prepare-popup-item:last-child { border-radius: 0 0 8px 8px; }
.prepare-popup-icon { font-size: 1.2rem; flex-shrink: 0; }
.prepare-popup-label { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.prepare-popup-desc { font-size: 0.78rem; color: var(--text-secondary); margin-top: 1px; }

/* Detail view */
.dc-detail { padding: 16px 20px; }
.dc-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.dc-detail-title { margin: 0; font-size: 1.2rem; font-weight: 600; }
.dc-detail-workspace { font-size: 0.82rem; color: var(--text-primary); opacity: 0.7; }
.dc-detail-desc { margin: 6px 0 0; font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; }
.dc-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }
.dc-detail-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.85rem; color: var(--text-primary); opacity: 0.8; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.dc-detail-meta strong { color: var(--text-primary); }

/* Sections */
.dc-section { margin-bottom: 16px; }
.dc-section-title { font-size: 0.85rem; font-weight: 600; margin: 0 0 8px; color: var(--text-primary); }
.dc-detail { overflow-y: auto; max-height: calc(100vh - 140px); }
.dc-detail .dc-pane { margin-bottom: 10px; }
.dc-detail .dc-pane > summary {
  background: rgba(99,102,241,0.08); border-bottom: 1px solid rgba(99,102,241,0.15);
}
.dc-detail .dc-pane[open] > summary { border-bottom: 1px solid rgba(99,102,241,0.2); }
.dc-detail .dc-pane > summary:hover { background: rgba(99,102,241,0.14); }
.dc-detail .dc-pane-title { color: var(--accent-color); font-weight: 700; font-size: 0.92rem; }
.dc-detail .dc-pane .dc-pane-body { padding: 8px 14px 12px; }
.light-theme .dc-detail .dc-pane > summary { background: rgba(99,102,241,0.06); border-bottom-color: rgba(99,102,241,0.12); }
.light-theme .dc-detail .dc-pane[open] > summary { background: rgba(99,102,241,0.1); }
.light-theme .dc-detail .dc-pane-title { color: #4f46e5; }

/* Table */
.dc-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dc-table th { text-align: left; padding: 6px 10px; font-weight: 600; font-size: 0.8rem; color: var(--text-primary); opacity: 0.7; border-bottom: 1px solid var(--border-color); text-transform: uppercase; letter-spacing: 0.3px; }
.dc-table td { padding: 6px 10px; border-bottom: 1px solid rgba(128,128,128,0.08); color: var(--text-primary); }
.dc-table td a { color: var(--accent-color); text-decoration: none; }
.dc-table td a:hover { text-decoration: underline; }
.dc-table tbody tr:hover { background: rgba(128,128,128,0.04); }

.dc-empty { font-size: 0.85rem; color: var(--text-primary); opacity: 0.6; padding: 8px 0; }

/* Tags */
.dc-tag { display: inline-block; font-size: 0.78rem; padding: 2px 7px; border-radius: 3px; background: rgba(99,102,241,0.1); color: var(--accent-color); margin-right: 4px; }

/* Questions (clickable action items) */
.dc-questions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dc-question-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--bg-primary); border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
}
.dc-question-item:hover {
  background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.25);
}
.dc-question-item .dc-q-number { font-size: 0.78rem; color: var(--text-muted); min-width: 18px; }
.dc-question-item .dc-q-text {
  flex: 1; font-size: 0.88rem; color: var(--text-primary); line-height: 1.4;
}
.dc-question-item:hover .dc-q-text { color: var(--accent-color); }
.dc-question-item .dc-q-icon { font-size: 0.75rem; color: var(--text-muted); opacity: 0; transition: opacity 0.15s; }
.dc-question-item:hover .dc-q-icon { opacity: 1; }
.light-theme .dc-question-item:hover { background: rgba(99,102,241,0.06); }

/* Danger button — matches btnSecondary proportions */

/* Builder */
.dc-builder { padding: 16px 20px; max-width: 820px; }
.dc-builder-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dc-builder-header h2 { margin: 0; font-size: 1.2rem; }
.dc-builder-form { display: grid; grid-template-columns: 1fr 28px; gap: 10px; }
.dc-pane, .dc-builder-footer { grid-column: 1; }

/* Step indicator nav (right column) */
.dc-step-nav {
  grid-column: 2; grid-row: 1 / -1;
  position: sticky; top: 20px; height: fit-content;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding-top: 8px;
}
.dc-step-arrow {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 0.75rem; padding: 4px; line-height: 1;
}
.dc-step-arrow:hover { color: var(--accent-color); }
.dc-step-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border-color); cursor: pointer; transition: all 0.2s;
  position: relative;
}
.dc-step-dot:hover { background: var(--text-secondary); }
.dc-step-dot.active {
  background: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
}
.dc-step-dot.active::after {
  content: ''; position: absolute; right: 14px; top: 2px;
  width: 0; height: 0;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-right: 6px solid var(--accent-color);
  pointer-events: none;
}

/* Collapsible panes */
.dc-pane {
  border: 1px solid var(--border-color); border-left: 3px solid var(--accent-color);
  border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,0.03); box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
.dc-pane[open] { background: rgba(255,255,255,0.05); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.dc-pane.dc-pane-active {
  border-color: rgba(99,102,241,0.5); border-left: 3px solid var(--accent-color);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2), 0 2px 10px rgba(0,0,0,0.14);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.light-theme .dc-pane { background: #f8f9fb; border-color: #d1d5db; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.light-theme .dc-pane[open] { background: #f1f3f6; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.light-theme .dc-pane.dc-pane-active {
  background: rgba(99,102,241,0.07); border-color: rgba(99,102,241,0.4); border-left: 3px solid var(--accent-color);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15), 0 2px 8px rgba(0,0,0,0.08);
}
.dc-pane > summary {
  cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 0.95rem;
  list-style: none; display: flex; align-items: center; gap: 8px; user-select: none;
  color: var(--text-primary);
}
.dc-pane > summary::-webkit-details-marker { display: none; }
.dc-pane > summary::before {
  content: '\25B6'; font-size: 0.55rem; transition: transform 0.2s;
  color: var(--text-muted); flex-shrink: 0;
}
.dc-pane[open] > summary::before { transform: rotate(90deg); }
.dc-pane-title { flex-shrink: 0; }
.dc-pane-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-color); color: #fff; font-size: 0.65rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; flex-shrink: 0;
}
.dc-pane-summary {
  font-size: 0.82rem; font-weight: 400; color: var(--text-primary); opacity: 0.6;
  margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 55%;
}
.dc-pane[open] > summary .dc-pane-summary { display: none; }
.dc-pane-body { padding: 4px 14px 14px; }
.dc-pane-guide {
  font-size: 0.82rem; color: var(--text-primary); opacity: 0.65; margin-bottom: 10px;
  line-height: 1.45; font-style: italic;
}
.dc-pane-actions { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.dc-pane-btn { font-size: 0.8rem !important; padding: 4px 12px !important; }
.dc-pane-actions-bar {
  margin-left: auto; display: flex; gap: 4px; flex-shrink: 0;
}
.dc-pane-bar-btn {
  font-size: 0.75rem !important; padding: 2px 8px !important;
  border-radius: 4px !important; line-height: 1.4;
}

/* Fields (bigger fonts) */
.dc-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.dc-field label { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.dc-field input, .dc-field textarea, .dc-field select {
  padding: 7px 10px; border: 1px solid var(--border-color); border-radius: 4px;
  background: var(--bg-primary); color: var(--text-primary); font-size: 0.88rem;
}
.dc-field input::placeholder, .dc-field textarea::placeholder {
  color: var(--text-primary); opacity: 0.45;
}
.dc-field textarea { resize: vertical; font-family: inherit; }
.dc-field-row { display: flex; gap: 12px; }
.dc-required { color: #ef4444; }

/* Table card grid in builder */
.dc-tbl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.dc-tbl-card {
  border: 1px solid var(--border-color); border-radius: 6px; padding: 8px 10px;
  background: rgba(255,255,255,0.02); font-size: 0.82rem;
  transition: border-color 0.15s, background 0.15s;
}
.dc-tbl-card:hover { border-color: var(--accent-color); background: rgba(99,102,241,0.04); }
.dc-tbl-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; }
.dc-tbl-card-name {
  color: var(--accent-color); text-decoration: none; font-weight: 600; font-size: 0.85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.dc-tbl-card-name:hover { text-decoration: underline; }
.dc-tbl-card-ws { font-size: 0.72rem; color: var(--text-primary); opacity: 0.5; margin-top: 1px; }
.dc-tbl-card-stats { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 5px; font-size: 0.75rem; }
.dc-tbl-card-enrich { color: var(--success, #22c55e); font-size: 0.72rem; }
.dc-tbl-card-bottom {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
  padding-top: 5px; border-top: 1px solid rgba(128,128,128,0.1);
}
.light-theme .dc-tbl-card { background: #fff; border-color: #d1d5db; }
.light-theme .dc-tbl-card:hover { border-color: var(--accent-color); background: rgba(99,102,241,0.04); }

/* Legacy table list (kept for detail view) */
.dc-tbl-list { border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden; }
.dc-tbl-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-bottom: 1px solid rgba(128,128,128,0.08); font-size: 0.85rem;
}
.dc-tbl-row:last-child { border-bottom: none; }
.dc-tbl-row:hover { background: rgba(128,128,128,0.04); }
.dc-tbl-name { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-tbl-name a { color: var(--accent-color); text-decoration: none; }
.dc-tbl-name a:hover { text-decoration: underline; }
.dc-tbl-meta { display: flex; gap: 6px; align-items: center; font-size: 0.78rem; color: var(--text-primary); opacity: 0.7; flex-shrink: 0; }
.dc-tbl-stats { color: var(--success, #22c55e); }
.dc-picker-stats { color: var(--success, #22c55e); }
.dc-tbl-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.dc-card-action {
  font-size: 0.78rem; color: var(--accent-color); text-decoration: none; cursor: pointer;
  padding: 2px 6px; border-radius: 3px; transition: background 0.15s;
}
.dc-card-action:hover { background: rgba(99,102,241,0.08); text-decoration: none; }
.dc-role-select { padding: 3px 6px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-primary); color: var(--text-primary); font-size: 0.8rem; }
.dc-empty-tables {
  border: 2px dashed var(--border-color); border-radius: 8px; padding: 20px;
  text-align: center; color: var(--text-primary); opacity: 0.6; font-size: 0.85rem; line-height: 1.6;
}

/* Category badges */
.dc-cat-badge { font-size: 0.72rem; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px; }
.dc-cat-events { background: rgba(59,130,246,0.12); color: #3b82f6; }
.dc-cat-entities { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.dc-cat-reference { background: rgba(16,185,129,0.12); color: #10b981; }
.dc-cat-aggregates { background: rgba(245,158,11,0.12); color: #f59e0b; }

/* Table picker popup (modal overlay for adding existing tables) */
.dc-picker-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.15); display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.dc-picker-popup { pointer-events: auto; }
.dc-picker-popup {
  background: var(--bg-secondary); border-radius: 10px; width: 420px; max-width: 90vw;
  max-height: 70vh; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25); border: 1px solid var(--border-color);
}
.dc-picker-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border-color);
}
.dc-picker-header h3 { margin: 0; font-size: 0.95rem; }
.dc-picker-drag-handle { cursor: move; user-select: none; }
.dc-picker-search {
  margin: 8px 12px; padding: 6px 10px; border: 1px solid var(--border-color);
  border-radius: 4px; background: var(--bg-primary); color: var(--text-primary);
  font-size: 0.85rem;
}
.dc-picker-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.dc-picker-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; cursor: pointer; border-bottom: 1px solid rgba(128,128,128,0.06);
  transition: background 0.12s;
}
.dc-picker-item:hover { background: rgba(99,102,241,0.06); }
.dc-picker-item-name { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.dc-picker-item-meta { display: flex; gap: 6px; align-items: center; font-size: 0.78rem; color: var(--text-primary); opacity: 0.7; }
.dc-picker-item-ws { font-size: 0.72rem; color: var(--text-primary); opacity: 0.5; margin-top: 1px; }

/* Picker category filter buttons */
.dc-picker-filters {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 12px;
  border-bottom: 1px solid rgba(128,128,128,0.1);
}
.dc-picker-filter-btn {
  padding: 3px 10px; border: 1px solid var(--border-color); border-radius: 12px;
  background: transparent; color: var(--text-primary); opacity: 0.7;
  font-size: 0.75rem; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.dc-picker-filter-btn:hover { opacity: 1; border-color: var(--accent-color); background: rgba(99,102,241,0.06); }
.dc-picker-filter-btn.active {
  background: var(--accent-color); color: #fff; border-color: var(--accent-color); opacity: 1;
}
.light-theme .dc-picker-filter-btn { border-color: #c5cad2; }
.light-theme .dc-picker-filter-btn:hover { border-color: var(--accent-color); }
.light-theme .dc-picker-filter-btn.active { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }

/* Remove button (used by tables and other rows) */
.dc-rel-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 6px; font-size: 0.85rem; flex: 0 0 auto; }
.dc-rel-remove:hover { color: #ef4444; }

/* Question rows */
.dc-question-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.dc-question-input { flex: 1; padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 3px; background: var(--bg-primary); color: var(--text-primary); font-size: 0.85rem; }

/* Builder footer */
.dc-builder-footer { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-color); }

/* AI progress popup (positioned near trigger) */
.dc-ai-progress-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.15); }
.dc-ai-progress {
  position: fixed; z-index: 10001;
  background: var(--bg-secondary); border: 1px solid var(--accent-color); border-radius: 8px;
  padding: 14px 18px; box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px;
  animation: dc-progress-fadein 0.2s ease-out;
}
@keyframes dc-progress-fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dc-ai-progress-spinner {
  width: 18px; height: 18px; border: 2px solid var(--border-color);
  border-top-color: var(--accent-color); border-radius: 50%;
  animation: dc-spin 0.8s linear infinite; flex-shrink: 0;
}
@keyframes dc-spin { to { transform: rotate(360deg); } }
.dc-ai-progress-text { font-size: 0.82rem; color: var(--text-primary); line-height: 1.4; }

/* Notes toolbar */
.dc-notes-toolbar { display: flex; gap: 6px; margin-bottom: 6px; }

/* Light theme: container edit areas need contrast */
.light-theme .dc-field input, .light-theme .dc-field textarea, .light-theme .dc-field select {
  background: #fff; border-color: #c5cad2;
}
.light-theme .dc-field input:focus, .light-theme .dc-field textarea:focus, .light-theme .dc-field select:focus {
  border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}
.light-theme .dc-question-input { background: #fff; border-color: #c5cad2; }
.light-theme .dc-role-select { background: #fff; border-color: #c5cad2; }
.light-theme .dc-tbl-list { border-color: #d1d5db; }
.light-theme .dc-tbl-row { border-bottom-color: #e5e7eb; }
.light-theme .dc-tbl-row:hover { background: rgba(99,102,241,0.04); }
.light-theme .dc-empty-tables { border-color: #c5cad2; }
.light-theme .dc-picker-search { background: #fff; border-color: #c5cad2; }
.light-theme .dc-builder-footer { border-top-color: #d1d5db; }
.light-theme .dc-detail-meta { border-bottom-color: #d1d5db; }

/* ===== Container List View (main area card grid) ===== */
.cl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 16px;
}
.cl-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cl-card:hover {
  border-color: var(--accent-color);
  background: rgba(99,102,241,0.04);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* Top row: name left, stat icons right */
.cl-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cl-card-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* Stat pills row */
.cl-card-stats {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.cl-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--text-primary);
  opacity: 0.55;
  background: rgba(128,128,128,0.08);
  padding: 2px 6px;
  border-radius: 4px;
}
.cl-stat svg { opacity: 0.7; }
/* Description */
.cl-card-desc {
  font-size: 0.8rem;
  color: var(--text-primary);
  opacity: 0.6;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Table name pills */
.cl-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cl-pill {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(99,102,241,0.1);
  color: var(--accent-color);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-pill-more {
  background: rgba(128,128,128,0.1);
  color: var(--text-primary);
  opacity: 0.55;
}
/* Footer: owner · date pinned at bottom */
.cl-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(128,128,128,0.08);
  font-size: 0.72rem;
  color: var(--text-primary);
  opacity: 0.4;
}
.cl-dot { opacity: 0.35; }

/* Light theme */
.light-theme .cl-card { background: #fff; border-color: #d1d5db; }
.light-theme .cl-card:hover { border-color: var(--accent-color); background: rgba(99,102,241,0.04); }
.light-theme .cl-stat { background: rgba(0,0,0,0.05); }
.light-theme .cl-pill { background: rgba(99,102,241,0.08); }

/* ── Export Dropdown Menu (shared) ──────────────────────────────── */
.exportMenu {
  position: fixed;
  z-index: 9999;
  background: var(--bg-primary, #0d1117);
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 200px;
  padding: 4px 0;
  animation: exportMenuFadeIn 0.12s ease-out;
}
@keyframes exportMenuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.exportMenuItem {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  font-size: 0.85rem; color: var(--text-primary);
  transition: background 0.1s;
}
.exportMenuItem:hover { background: rgba(99,102,241,0.08); }
.exportMenuItem:first-child { border-radius: 8px 8px 0 0; }
.exportMenuItem:last-child { border-radius: 0 0 8px 8px; }
.exportMenuIcon { font-size: 1.0em; flex-shrink: 0; width: 20px; text-align: center; }

/* Light theme */
.light-theme .exportMenu { background: #fff; border-color: #d1d5db; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.light-theme .exportMenuItem:hover { background: rgba(99,102,241,0.06); }

/* ── Export Dialog (full session export) ───────────────────────── */
.exportDialogOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.15s ease;
}
.exportDialogBox {
  background: var(--bg-secondary, #161b22);
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  border-radius: 14px;
  width: 90%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  animation: slideUp 0.2s ease;
  overflow: hidden;
}
.exportDialogHeader {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
.exportDialogTitle {
  font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 0;
}
.exportDialogClose {
  background: none; border: none; color: var(--text-secondary); cursor: pointer;
  font-size: 1.4rem; width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.exportDialogClose:hover { background: rgba(255,255,255,0.06); }
.exportDialogBody { padding: 16px 20px; }
.exportDialogSection { margin-bottom: 16px; }
.exportDialogSection:last-child { margin-bottom: 0; }
.exportDialogLabel {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  color: var(--text-secondary); letter-spacing: 0.05em; margin-bottom: 8px;
}
.exportDialogFormats { display: flex; gap: 10px; }
.exportFormatOption { cursor: pointer; flex: 1; }
.exportFormatOption input[type="radio"] { display: none; }
.exportFormatCard {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 8px;
  border: 1.5px solid var(--border-color, rgba(255,255,255,0.1));
  font-size: 0.85rem; color: var(--text-primary);
  transition: border-color 0.15s, background 0.15s;
}
.exportFormatOption input[type="radio"]:checked + .exportFormatCard {
  border-color: rgba(99,102,241,0.7);
  background: rgba(99,102,241,0.08);
}
.exportFormatCard:hover { border-color: rgba(99,102,241,0.4); }
.exportFormatIcon { display: flex; align-items: center; }
.exportCheckRow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s;
}
.exportCheckRow:hover { background: rgba(255,255,255,0.03); }
.exportCheckRowFixed { opacity: 0.7; cursor: default; }
.exportCheckRowFixed:hover { background: transparent; }
.exportCheckRow input[type="checkbox"] {
  accent-color: #6366f1; width: 16px; height: 16px; flex-shrink: 0;
}
.exportCheckIcon { font-size: 1.05em; flex-shrink: 0; width: 22px; text-align: center; }
.exportCheckLabel { flex: 1; font-size: 0.85rem; color: var(--text-primary); }
.exportCheckMeta {
  font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap;
}
.exportCheckEmpty {
  font-size: 0.82rem; color: var(--text-secondary);
  padding: 8px 10px; font-style: italic;
}
.exportCheckNew { color: #818cf8; font-style: italic; }
.exportCheckDisabled { opacity: 0.4; cursor: not-allowed; }
.exportCheckDisabled:hover { background: transparent; }
.exportCheckDisabled .exportCheckLabel { text-decoration: line-through; }
.exportDialogFooter {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
/* Light theme */
.light-theme .exportDialogBox { background: #fff; border-color: #d1d5db; box-shadow: 0 20px 48px rgba(0,0,0,0.15); }
.light-theme .exportDialogClose:hover { background: rgba(0,0,0,0.05); }
.light-theme .exportCheckRow:hover { background: rgba(0,0,0,0.02); }
.light-theme .exportFormatOption input[type="radio"]:checked + .exportFormatCard { background: rgba(99,102,241,0.06); }
.light-theme .sessionContextMenu { background: #fff; border-color: #d1d5db; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.light-theme .sessionContextMenuItem:hover { background: rgba(99,102,241,0.06); }
