    /* Tailwind utility replacements (removed CDN for performance) */
    .flex { display: flex; }
    .inline-flex { display: inline-flex; }
    .grid { display: grid; }
    .hidden { display: none; }
    .block { display: block; }

    :root {
      --bg-primary: #111827;
      --bg-secondary: #1f2937;
      --bg-tertiary: #374151;
      --bg-actbar: #0f172a;
      --text-primary: #ffffff;
      --text-secondary: #9ca3af;
      --text-muted: #6b7280;
      --border-color: #374151;
      --user-msg-bg: rgba(30, 58, 138, 0.3);
      --code-bg: #1e1e1e;
      --accent: #3b82f6;
      --hover: rgba(59, 130, 246, 0.1);
      --active: rgba(59, 130, 246, 0.2);
      /* Enhanced auth design tokens */
      --bg-glass: rgba(26, 31, 53, 0.7);
      --accent-glow: rgba(59, 130, 246, 0.4);
      --surface-border: rgba(148, 163, 184, 0.15);
      --surface-highlight: rgba(255, 255, 255, 0.05);
      /* Animation timing */
      --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
      --duration-fast: 150ms;
      --duration-normal: 250ms;
      --duration-slow: 400ms;
      /* Font stacks */
      --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
      --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    }
    .light-theme {
      --bg-primary: #ffffff;
      --bg-secondary: #f3f4f6;
      --bg-tertiary: #e5e7eb;
      --bg-actbar: #e5e7eb;
      --text-primary: #0f172a;
      --text-secondary: #1e293b;
      --text-muted: #475569;
      --border-color: #d1d5db;
      --user-msg-bg: rgba(219, 234, 254, 0.7);
      --code-bg: #f5f5f5;
      --accent: #2563eb;
      --hover: rgba(37, 99, 235, 0.1);
      --active: rgba(37, 99, 235, 0.15);
      /* Enhanced auth design tokens */
      --bg-glass: rgba(255, 255, 255, 0.7);
      --accent-glow: rgba(37, 99, 235, 0.25);
      --surface-border: rgba(17, 24, 39, 0.08);
      --surface-highlight: rgba(255, 255, 255, 0.8);
    }
    * { 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;
    }

    /* Layout - using CSS Grid for reliable sizing */
    .appContainer {
      display: grid;
      grid-template-columns: 48px auto 4px 1fr;
      height: 100vh; /* Fallback for older browsers */
      height: 100dvh; /* dvh = dynamic viewport height, accounts for mobile/tablet browser chrome */
      width: 100vw;
      overflow: hidden;
    }

    /* Activity Bar */
    .activityBar {
      width: 48px;
      background: var(--bg-actbar);
      border-right: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      padding: 8px 0;
    }
    .actBtn {
      width: 48px;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      cursor: pointer;
      border: none;
      background: transparent;
      color: var(--text-muted);
      position: relative;
      transition: color 0.15s, background 0.15s;
    }
    .actBtn:hover { color: var(--text-primary); background: var(--hover); }
    .actBtn.active {
      color: var(--accent);
      background: var(--active);
    }
    .actBtn.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 8px;
      bottom: 8px;
      width: 2px;
      background: var(--accent);
      border-radius: 0 2px 2px 0;
    }
    .actBtn[title]::after {
      content: attr(title);
      position: absolute;
      left: 52px;
      top: 50%;
      transform: translateY(-50%);
      background: var(--bg-tertiary);
      color: var(--text-primary);
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 0.75rem;
      white-space: nowrap;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s;
      z-index: 100;
    }
    .actBtn:hover[title]::after { opacity: 1; }
    .actSpacer { flex: 1; }
    .actSep {
      height: 1px;
      margin: 6px 10px;
      background: var(--border-color);
      opacity: 0.5;
    }
    /* Sidebar */
    .sidebar {
      width: 260px;
      background: var(--bg-secondary);
      border-right: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      transition: width 0.2s;
      overflow: hidden;
      position: relative;
    }
    .sidebar.collapsed {
      width: 0 !important;
      min-width: 0 !important;
      border-right: none;
    }
    .sidebar.collapsed .sidebarContent {
      display: none;
    }

    /* Sidebar Collapse Button - HIDDEN (using inline button now) */
    .sidebarCollapseBtn {
      display: none !important; /* Replaced by inline collapse button */
    }

    /* Inline collapse button in sidebar header */
    .sidebarCollapseInline {
      width: 24px;
      height: 24px;
      background: transparent;
      border: 1px solid var(--border-color, #30363d);
      border-radius: 4px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      color: var(--text-secondary, #8b949e);
      transition: all 0.15s ease;
      opacity: 0.6;
    }
    .sidebarCollapseInline:hover {
      opacity: 1;
      background: var(--bg-tertiary, #262d38);
      color: var(--text-primary, #e0e0e0);
      border-color: var(--border-color-hover, #6b7280);
    }

    /* Header actions container (wraps + and collapse buttons) */
    .header-actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* Sidebar Expand Button (shown via JS when sidebar is collapsed) */
    .sidebarExpandBtn {
      display: none; /* JS controls visibility */
      position: absolute;
      left: 36px; /* 48px (activity bar) - 12px (half button) */
      top: 20px; /* At header level */
      width: 24px;
      height: 24px;
      background: var(--accent);
      border: 2px solid var(--bg-primary);
      border-radius: 50%;
      cursor: pointer;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      color: white;
      z-index: 20;
      box-shadow: 0 2px 8px rgba(0,0,0,0.3);
      transition: transform 0.2s, background 0.2s;
    }
    .sidebarExpandBtn:hover {
      background: var(--accent-hover, #2563eb);
      transform: scale(1.1);
    }

    .sidebar.resizing { transition: none; }  /* Disable transition during drag */

    /* Sidebar Resize Handle */
    .sidebarResizeHandle {
      width: 4px;
      background: transparent;
      cursor: ew-resize;
      position: relative;
      z-index: 10;
    }
    .sidebarResizeHandle:hover,
    .sidebarResizeHandle.active {
      background: var(--accent);
    }
    .sidebarResizeHandle::before {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: -4px;
      right: -4px;
    }
    .sidebarHeader {
      padding: 14px 12px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      height: 56px;
      box-sizing: border-box;
    }
    .sidebarHeader h2 { font-size: 0.875rem; font-weight: 600; margin: 0; flex: 1; line-height: 1.5; }
    .sidebarActions { display: flex; gap: 4px; }
    .sidebarActionBtn {
      width: 26px;
      height: 26px;
      border: none;
      border-radius: 4px;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.85rem;
      transition: background 0.15s, color 0.15s;
    }
    .sidebarActionBtn:hover {
      background: var(--accent);
      color: white;
    }
    .sidebarCompactHeader {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
    }
    .sidebarSearchInput {
      flex: 1;
      padding: 6px 10px;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.8rem;
      min-width: 0;
    }
    .sidebarSearchInput::placeholder { color: var(--text-muted); }
    /* 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); }
    /* Sidebar status indicators - colored dots */
    .statusReady, .statusPending, .statusNew {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 6px;
      vertical-align: middle;
    }
    .statusReady { background: #22c55e; } /* Green - ready */
    .statusPending { background: #f59e0b; } /* Yellow/orange - needs attention */
    .statusNew { background: var(--text-muted); opacity: 0.5; } /* Gray - new */
    .sidebarSearch {
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
    }
    .sidebarSearch input {
      width: 100%;
      padding: 6px 10px;
      border-radius: 6px;
      border: 1px solid var(--border-color);
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.8rem;
    }
    .sidebarSearch input::placeholder { color: var(--text-muted); }
    .sidebarList {
      flex: 1;
      overflow-y: auto;
      padding: 8px 0 40px 0; /* Bottom padding for sidebar footer */
    }
    .sidebarGroup {
      padding: 4px 12px;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .sidebarItem {
      padding: 6px 12px;
      cursor: pointer;
      border-left: 2px solid transparent;
      transition: background 0.1s, border-color 0.1s;
    }
    .sidebarItem:hover { background: var(--hover); }
    .sidebarItem.active {
      background: var(--active);
      border-left-color: var(--accent);
    }
    .sidebarItem .itemRow {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 0.85rem;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sidebarItem .itemTitle {
      font-size: 0.9rem;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sidebarItem .itemMeta {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-weight: 400;
      flex-shrink: 0;
    }

    /* Sidebar folder hierarchy */
    .sidebarFolder {
      margin-bottom: 2px;
    }
    .folderHeader {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 10px;
      cursor: pointer;
      border-radius: 4px;
      transition: background 0.15s;
    }
    .folderHeader:hover {
      background: var(--hover);
    }
    .folderChevron {
      font-size: 0.7rem;
      color: var(--text-muted);
      width: 12px;
    }
    .folderIcon {
      font-size: 0.85rem;
    }
    .folderName {
      flex: 1;
      font-size: 0.85rem;
      font-weight: 500;
    }
    .folderCount {
      font-size: 0.7rem;
      color: var(--text-muted);
      background: var(--bg-secondary);
      padding: 2px 6px;
      border-radius: 10px;
    }
    .folderContents {
      margin-left: 18px;
      border-left: 1px solid var(--border-color);
      padding-left: 4px;
    }
    .folderContents .sidebarItem {
      padding: 6px 10px;
    }

    /* Batch execution status bar */
    .batch-status-bar {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      margin: 8px;
      padding: 10px 12px;
    }
    .batch-status-timer {
      font-size: 0.8rem;
      color: var(--text-secondary);
      font-family: monospace;
      font-weight: 500;
      margin-bottom: 6px;
    }
    .batch-status-content {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }
    .batch-status-icon {
      font-size: 0.9rem;
      animation: pulse 1.5s infinite;
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }
    .batch-status-text {
      flex: 1;
      font-size: 0.85rem;
      font-weight: 500;
      color: var(--text-primary);
    }
    .batch-cancel-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: rgba(239, 68, 68, 0.15);
      border: 1px solid #ef4444;
      color: #ef4444;
      padding: 4px 10px;
      border-radius: 4px;
      font-size: 0.75rem;
      cursor: pointer;
      transition: all 0.15s;
    }
    .batch-cancel-btn:hover {
      background: #ef4444;
      color: white;
      border-color: #ef4444;
    }
    .batch-progress-track {
      height: 6px;
      background: var(--bg-tertiary);
      border-radius: 3px;
      overflow: hidden;
    }
    .batch-progress-fill {
      height: 100%;
      width: 0%;
      background: #22c55e;
      border-radius: 3px;
      transition: width 0.3s ease;
    }

    /* Expandable chat item styles */
    .chatItem {
      border-left: 2px solid transparent;
      transition: background 0.1s, border-color 0.1s;
    }
    .chatItem:hover { background: var(--hover); }
    .chatItem.active {
      background: var(--active);
      border-left-color: var(--accent);
    }
    .chatItemHeader {
      padding: 8px 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .chatItemExpand {
      font-size: 1rem;
      color: var(--text-muted);
      transition: transform 0.2s;
      flex-shrink: 0;
      align-self: flex-start;
      margin-top: 2px;
    }
    .chatItem.expanded .chatItemExpand {
      transform: rotate(90deg);
    }
    .chatItemContent {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .chatItemTitle {
      font-size: 0.9rem;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chatItemMeta {
      font-size: 0.75rem;
      color: var(--text-muted);
      display: flex;
      gap: 8px;
    }
    .chatItemActions {
      display: flex;
      gap: 4px;
      opacity: 0;
      transition: opacity 0.1s;
    }
    .chatItem:hover .chatItemActions {
      opacity: 1;
    }
    .chatActionBtn {
      background: none;
      border: none;
      padding: 4px 6px;
      cursor: pointer;
      color: #ef4444;
      border-radius: 4px;
      font-size: 0.75rem;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .chatActionBtn svg {
      stroke: #ef4444;
      width: 10px;
      height: 10px;
    }
    .chatActionBtn:hover {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
    }
    .chatItemMessages {
      display: none;
      padding: 4px 12px 8px 28px;
      flex-direction: column;
      gap: 2px;
    }
    .chatItem.expanded .chatItemMessages {
      display: flex;
    }
    .messageItem {
      padding: 6px 8px;
      cursor: pointer;
      border-radius: 4px;
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 0.95rem;
    }
    .messageItem:hover {
      background: var(--hover);
    }
    .messageItemIcon {
      color: var(--text-muted);
      font-size: 0.8rem;
      flex-shrink: 0;
      margin-top: 2px;
    }
    .messageItemText {
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text-secondary);
    }
    .messageItemTime {
      font-size: 0.75rem;
      color: var(--text-muted);
      flex-shrink: 0;
    }
    /* Compact chat sidebar header */
    .chatSidebarHeader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 12px;
      border-bottom: 1px solid var(--border-color);
      height: 56px;
      box-sizing: border-box;
    }
    .chatSidebarHeader h3 {
      font-size: 0.85rem;
      font-weight: 600;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--text-primary);
    }
    .chatSidebarHeader h3 span {
      font-size: 1rem;
    }
    .newChatBtn {
      width: 26px;
      height: 26px;
      padding: 0;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      cursor: pointer;
      font-size: 1rem;
      font-weight: 400;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
    }
    .newChatBtn:hover {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }

    /* New Chat Dropdown Menu */
    .newChatDropdown {
      position: relative;
    }
    .newChatMenu {
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 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);
      min-width: 160px;
      z-index: 1000;
      overflow: hidden;
    }
    .newChatMenuItem {
      padding: 10px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      font-size: 0.85rem;
      color: var(--text-primary);
      transition: background 0.15s;
    }
    .newChatMenuItem:hover {
      background: var(--hover);
    }
    .newChatMenuItem .menuIcon {
      font-size: 1rem;
      width: 20px;
      text-align: center;
    }
    .newChatMenuDivider {
      height: 1px;
      background: var(--border-color);
      margin: 4px 0;
    }

    /* Chat item icon */
    .chatItemIcon {
      font-size: 0.9rem;
      flex-shrink: 0;
      opacity: 0.7;
    }

    /* Global search dropdown */
    .searchContainer {
      position: relative;
    }
    .searchResults {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      min-height: 150px;
      max-height: 85vh;  /* Allow nearly full viewport height on large screens */
      height: var(--search-results-height, 400px);  /* Default height, resizable */
      overflow-y: auto;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-top: none;
      border-radius: 0 0 12px 12px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.2);
      z-index: 100;
      display: none;
      resize: vertical;  /* Enable native resize */
    }
    .searchResults.active { display: flex; flex-direction: column; }
    .searchResultsList {
      flex: 1;
      overflow-y: auto;
    }
    /* Resize handle at bottom */
    .searchResizeHandle {
      height: 8px;
      background: linear-gradient(to bottom, transparent, var(--border-color));
      cursor: ns-resize;
      flex-shrink: 0;
      border-radius: 0 0 12px 12px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .searchResizeHandle::after {
      content: '';
      width: 40px;
      height: 4px;
      background: var(--text-muted);
      border-radius: 2px;
      opacity: 0.4;
    }
    .searchResizeHandle:hover::after {
      opacity: 0.7;
    }
    .searchResults.resizing {
      user-select: none;
    }
    .searchFooter {
      flex-shrink: 0;
      border-top: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      border-radius: 0 0 12px 12px;
    }

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

    /* 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 */
    .dataTable {
      width: 100%;
      max-width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
      background: var(--bg-secondary);
      border-radius: 8px;
      table-layout: fixed;
      overflow: hidden;
    }
    .tableWrapper {
      overflow-x: auto;
      max-width: 100%;
    }
    .dataTable th, .dataTable td {
      padding: 10px 12px;
      text-align: left;
      border-bottom: 1px solid var(--border-color);
      word-break: break-word;
      overflow-wrap: break-word;
    }
    .dataTable th {
      background: var(--bg-tertiary);
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-secondary);
    }
    .dataTable tr:last-child td { border-bottom: none; }
    .dataTable tr:hover { background: var(--hover); }
    .dataTable code {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.8rem;
    }

    /* Search term highlighting */
    .searchHighlight {
      background: linear-gradient(to bottom, #fef08a 0%, #fde047 100%);
      color: #1a1a1a;
      padding: 1px 3px;
      border-radius: 3px;
      font-weight: 500;
      box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    [data-theme="dark"] .searchHighlight {
      background: linear-gradient(to bottom, #854d0e 0%, #a16207 100%);
      color: #fef9c3;
    }

    /* Spinner for loading states */
    .enrichSpinner {
      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 */
    .enrichment-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
    }
    .enrichment-modal-backdrop {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.6);
    }
    .enrichment-modal-content {
      position: relative;
      background: var(--bg-primary);
      border-radius: 12px;
      width: 900px;
      height: 75vh;
      min-width: 500px;
      min-height: 400px;
      max-width: 95vw;
      max-height: 95vh;
      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"] .enrichment-modal-content {
      box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.08);
    }
    .enrichment-modal-body {
      overflow-y: auto;
      flex: 1;
    }
    /* Modal resize handles - triangle corners */
    .modal-resize-handle {
      position: absolute;
      bottom: 0;
      width: 14px;
      height: 14px;
      z-index: 9999;
      background: #888;
      user-select: none;
      -webkit-user-select: none;
      pointer-events: auto !important;
      cursor: pointer;
    }
    .modal-resize-handle[data-corner="se"],
    .modal-resize-handle:not([data-corner]) {
      right: 0;
      cursor: nwse-resize;
      clip-path: polygon(100% 0, 100% 100%, 0 100%);
    }
    .modal-resize-handle[data-corner="sw"] {
      left: 0;
      cursor: nesw-resize;
      clip-path: polygon(0 0, 100% 100%, 0 100%);
    }
    .modal-resize-handle:hover {
      background: var(--accent);
    }
    /* Edge resize handles */
    .modal-resize-edge {
      position: absolute;
      z-index: 10000;
      background: transparent;
      user-select: none;
      -webkit-user-select: none;
      pointer-events: auto !important;
    }
    .modal-resize-edge:hover {
      background: rgba(59, 130, 246, 0.25);
    }
    .modal-resize-edge[data-edge="bottom"] {
      bottom: 0;
      left: 16px;
      right: 16px;
      height: 8px;
      cursor: ns-resize;
    }
    .modal-resize-edge[data-edge="left"] {
      left: 0;
      top: 44px;  /* Below header */
      bottom: 16px;
      width: 8px;
      cursor: ew-resize;
    }
    .modal-resize-edge[data-edge="right"] {
      right: 0;
      top: 44px;  /* Below header */
      bottom: 16px;
      width: 8px;
      cursor: ew-resize;
    }
    /* Prevent selection during modal drag/resize */
    body.modal-interacting {
      user-select: none !important;
      -webkit-user-select: none !important;
    }
    body.modal-interacting * {
      user-select: none !important;
      -webkit-user-select: none !important;
    }
    .enrichment-modal-header {
      cursor: move;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 16px;
      border-bottom: 1px solid var(--border);
    }
    .enrichment-modal-header h3 {
      margin: 0;
      font-size: 0.9rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
    }
    .enrichment-modal-controls {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .enrichment-elapsed {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--accent);
      background: var(--bg-tertiary);
      padding: 2px 8px;
      border-radius: 4px;
    }
    .enrichment-close-btn {
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      font-size: 1.3rem;
      cursor: pointer;
      line-height: 1;
      padding: 4px 8px;
      border-radius: 6px;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
    }
    .enrichment-close-btn:hover {
      background: var(--bg-secondary);
      color: var(--text-primary);
      border-color: var(--text-muted);
      transform: scale(1.05);
    }
    .enrichment-close-btn:active {
      transform: scale(0.98);
    }
    .enrichment-footer-buttons {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .enrichment-footer-btn {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      color: var(--text-secondary);
      font-size: 0.8rem;
      cursor: pointer;
      padding: 6px 14px;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
      border-radius: 4px;
    }
    .enrichment-footer-btn:hover:not(:disabled) {
      background: var(--bg-secondary);
      color: var(--text-primary);
      border-color: var(--accent-color);
    }
    .enrichment-footer-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .enrichment-modal-body {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 4px 16px 16px;
      min-height: 0;
    }
    /* Progress section - flex container for growing panes */
    #enrichmentProgressSection {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow-y: auto;
    }
    /* Results sections - flex container for growing panes */
    #enrichmentResultSections {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow-y: auto;
    }

    /* ───────────────────────────────────────────────────────────────── */
    /* Enrichment Tab UI                                                 */
    /* ───────────────────────────────────────────────────────────────── */
    .enrichment-summary-header {
      padding: 12px 14px;
      background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(147,51,234,0.08) 100%);
      border: 1px solid rgba(59,130,246,0.2);
      border-radius: 8px;
      margin-bottom: 12px;
    }
    .enrichment-summary-text {
      font-size: 0.9rem;
      line-height: 1.5;
      color: var(--text-primary);
      margin-bottom: 6px;
    }
    .enrichment-summary-stats {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }
    .enrichment-summary-stats span {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .enrichment-summary-stats .stat-value {
      font-weight: 600;
      color: var(--text-primary);
    }
    .enrichment-summary-stats .stat-warning {
      color: #ef4444;
      font-weight: 600;
    }
    .enrichment-summary-stats .stat-success {
      color: #22c55e;
      font-weight: 600;
    }

    .enrichment-tab-bar {
      display: flex;
      gap: 2px;
      padding: 4px;
      background: var(--bg-secondary);
      border-radius: 8px;
      margin-bottom: 8px;
      flex-wrap: wrap;
    }
    .enrichment-tab {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-size: 0.8rem;
      font-weight: 500;
      cursor: pointer;
      border-radius: 6px;
      transition: all 0.15s ease;
      white-space: nowrap;
    }
    .enrichment-tab:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    .enrichment-tab.active {
      background: var(--accent);
      color: white;
    }
    .enrichment-tab-badge {
      font-size: 0.7rem;
      background: rgba(255,255,255,0.2);
      padding: 1px 6px;
      border-radius: 8px;
      min-width: 16px;
      text-align: center;
    }
    .enrichment-tab:not(.active) .enrichment-tab-badge {
      background: var(--bg-tertiary);
      color: var(--text-secondary);
    }
    .enrichment-tab-elapsed {
      font-size: 0.75rem;
      color: var(--accent);
      font-weight: 600;
      display: flex;
      align-items: center;
      font-family: monospace;
    }

    .enrichment-tab-panels {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow: hidden;
    }
    .enrichment-tab-panel {
      display: none;
      flex: 1;
      overflow-y: auto;
      padding: 8px 4px;
      min-height: 0;
    }
    .enrichment-tab-panel.active {
      display: flex;
      flex-direction: column;
    }
    .enrichment-tab-panel-actions {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 8px;
    }

    .enrichment-section {
      margin-bottom: 12px;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      flex-shrink: 0;
    }
    /* Allow output and fields sections to grow and fill space */
    .enrichment-section.enrichment-output-pane,
    .enrichment-section.enrichment-fields-pane {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .enrichment-section-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      background: var(--bg-secondary);
      cursor: pointer;
      user-select: none;
    }
    .enrichment-section-header:hover {
      background: var(--bg-tertiary);
    }
    .enrichment-section-icon {
      font-size: 0.9rem;
    }
    .enrichment-section-title {
      font-weight: 500;
      font-size: 0.85rem;
    }
    .enrichment-badge {
      background: var(--accent);
      color: white;
      font-size: 0.7rem;
      padding: 2px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
    }
    /* Inline badges for classifications table */
    .enrichment-badge-inline {
      display: inline-block;
      font-size: 0.7rem;
      padding: 2px 8px;
      border-radius: 10px;
      font-weight: 500;
      white-space: nowrap;
    }
    /* Semantic type badge colors */
    .badge-key { background: #7c3aed; color: white; }
    .badge-dimension { background: #2563eb; color: white; }
    .badge-measure { background: #059669; color: white; }
    .badge-timestamp { background: #d97706; color: white; }
    .badge-attribute { background: #6b7280; color: white; }
    /* Classification badge colors */
    .badge-pii { background: #dc2626; color: white; }
    .badge-phi { background: #be185d; color: white; }
    .badge-pci { background: #9333ea; color: white; }
    .badge-sensitive { background: #ea580c; color: white; }
    .badge-confidential { background: #c2410c; color: white; }
    .badge-restricted { background: #b91c1c; color: white; }
    .badge-internal { background: #0369a1; color: white; }
    .badge-public { background: #16a34a; color: white; }
    .badge-default { background: #4b5563; color: white; }

    /* Profile Charts Section */
    .enrichment-profile-pane {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .enrichment-profile-content {
      max-height: none;
      flex: 1;
      min-height: 0;
      overflow-y: auto;
    }
    .enrichment-profile-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 12px;
      padding: 4px;
    }
    .enrichment-profile-card {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px;
      font-size: 0.8rem;
    }
    .profile-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      padding-bottom: 6px;
      border-bottom: 1px solid var(--border);
    }
    .profile-col-name {
      font-weight: 600;
      font-size: 0.75rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 140px;
    }
    .profile-col-type {
      font-size: 0.65rem;
      padding: 2px 6px;
      border-radius: 3px;
      text-transform: uppercase;
    }
    .type-numeric { background: #3b82f6; color: white; }
    .type-categorical { background: #10b981; color: white; }
    .profile-stats-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 8px;
    }
    .profile-stat {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .stat-label {
      font-size: 0.6rem;
      color: var(--text-muted);
      text-transform: uppercase;
    }
    .stat-value {
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--text-primary);
    }
    .profile-chart-area {
      min-height: 45px;
    }
    .profile-no-chart {
      color: var(--text-muted);
      font-size: 0.7rem;
      text-align: center;
      padding: 10px 0;
    }
    /* Histogram SVG */
    .profile-histogram {
      display: block;
      margin: 0 auto;
    }
    .histogram-bar {
      fill: #3b82f6;
      opacity: 0.8;
    }
    .histogram-bar:hover {
      opacity: 1;
    }
    .histogram-label {
      font-size: 8px;
      fill: var(--text-muted);
    }
    /* Range bar for numeric without histogram */
    .profile-range-bar {
      padding: 4px 0;
    }
    .range-track {
      position: relative;
      height: 8px;
      background: var(--bg-tertiary);
      border-radius: 4px;
      margin-bottom: 4px;
    }
    .range-iqr {
      position: absolute;
      top: 0;
      height: 100%;
      background: rgba(59, 130, 246, 0.4);
      border-radius: 4px;
    }
    .range-median {
      position: absolute;
      top: -2px;
      width: 3px;
      height: 12px;
      background: #3b82f6;
      border-radius: 1px;
      transform: translateX(-50%);
    }
    .range-mean {
      position: absolute;
      top: -2px;
      width: 3px;
      height: 12px;
      background: #10b981;
      border-radius: 1px;
      transform: translateX(-50%);
    }
    .range-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.65rem;
      color: var(--text-muted);
    }
    /* Top values bar chart */
    .profile-top-values {
      display: flex;
      flex-direction: column;
      gap: 3px;
    }
    .top-value-row {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .top-value-label {
      width: 60px;
      font-size: 0.65rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--text-secondary);
    }
    .top-value-bar-container {
      flex: 1;
      height: 6px;
      background: var(--bg-tertiary);
      border-radius: 3px;
      overflow: hidden;
    }
    .top-value-bar {
      height: 100%;
      background: #10b981;
      border-radius: 3px;
    }
    .top-value-count {
      width: 36px;
      font-size: 0.65rem;
      text-align: right;
      color: var(--text-muted);
    }

    .enrichment-section-toggle {
      margin-left: auto;
      color: var(--text-secondary);
      font-size: 0.7rem;
    }
    /* Force reprofile button */
    .force-reprofile-btn {
      padding: 4px 10px;
      font-size: 0.75rem;
      border: 1px solid rgba(59, 130, 246, 0.5);
      border-radius: 6px;
      background: rgba(59, 130, 246, 0.1);
      color: #3b82f6;
      cursor: pointer;
      transition: all 0.2s;
      font-weight: 500;
      margin-left: auto;
      margin-right: 8px;
    }
    .force-reprofile-btn:hover {
      background: #3b82f6;
      border-color: #3b82f6;
      color: white;
      transform: translateY(-1px);
      box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    }
    .force-reprofile-btn:active {
      transform: translateY(0);
    }
    .enrichment-section-content {
      padding: 12px;
      background: var(--bg-primary);
    }
    /* Make section content in expandable panes fill and scroll */
    .enrichment-output-pane .enrichment-section-content,
    .enrichment-fields-pane .enrichment-section-content {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
    }
    .enrichment-tools-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .enrichment-tool-line {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.85rem;
    }
    .enrichment-tool-status {
      width: 16px;
      text-align: center;
    }
    .enrichment-tool-name {
      flex: 1;
    }
    .enrichment-tool-time {
      font-size: 0.75rem;
    }
    .enrichment-output {
      font-family: var(--font-mono);
      font-size: 0.8rem;
      line-height: 1.6;
      white-space: pre-wrap;
      word-break: break-word;
      background: #1a1a1a;
      color: #e0e0e0;
      padding: 16px;
      border-radius: 8px;
      border: 1px solid rgba(255,255,255,0.1);
      box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
      flex: 1;
      min-height: 100px;
      overflow-y: auto;
      scroll-behavior: smooth;
    }
    /* 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 */
    .enrichment-setup-section {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 16px;
      border-bottom: 1px solid var(--border-color);
      flex-wrap: wrap;
    }
    .enrichment-setup-header {
      flex-shrink: 0;
    }
    .enrichment-artifact-name {
      font-size: 0.85rem;
      flex-shrink: 1;
      min-width: 0;
      max-width: 300px;
      overflow: hidden;
    }
    .enrichment-artifact-name code {
      background: var(--bg-tertiary);
      padding: 3px 8px;
      border-radius: 4px;
      font-weight: 500;
      word-break: break-all;
      display: inline-block;
      max-width: 100%;
    }
    .enrichment-setup-options {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
    }
    .enrichment-setup-option {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .enrichment-setup-option > label:first-child {
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    .enrichment-model-select {
      padding: 4px 8px;
      font-size: 0.8rem;
      min-width: 140px;
    }
    .enrichment-checkbox-label {
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
      font-size: 0.75rem;
      white-space: nowrap;
    }
    .enrichment-checkbox-label input[type="checkbox"] {
      width: 13px;
      height: 13px;
      cursor: pointer;
    }
    .enrichment-setup-buttons {
      display: flex;
      gap: 6px;
      margin-left: auto;
      flex-shrink: 0;
    }
    .enrichment-action-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      font-size: 0.75rem;
    }
    .enrichment-action-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    /* Stop button - red styling */
    .enrichment-stop-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      font-size: 0.8rem;
      font-weight: 500;
      background: #dc2626;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      transition: background 0.15s, opacity 0.15s;
    }
    .enrichment-stop-btn:hover:not(:disabled) {
      background: #b91c1c;
    }
    .enrichment-stop-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      background: #6b7280;
    }
    .enrichment-stop-btn svg {
      fill: currentColor;
    }
    .enrichment-setup-divider {
      display: none; /* Border on section replaces this */
    }
    .enrichment-setup-sep {
      color: var(--border-color);
      font-size: 0.9rem;
      opacity: 0.6;
    }

    /* Enrichment Result Panes */
    .enrichment-result-pane {
      margin-top: 8px;
      flex-shrink: 0;
    }
    /* Fields pane in results should grow to fill space */
    .enrichment-result-pane.enrichment-fields-pane {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    /* Classifications pane should also grow to fill space */
    .enrichment-result-pane.enrichment-classifications-pane {
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .enrichment-result-content {
      max-height: 200px;
      overflow-y: auto;
    }
    /* Fields and Classifications content should fill available space */
    .enrichment-fields-pane .enrichment-result-content,
    .enrichment-fields-pane .enrichment-section-content,
    .enrichment-classifications-pane .enrichment-result-content,
    .enrichment-classifications-pane .enrichment-section-content {
      max-height: none;
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .enrichment-desc-item {
      margin-bottom: 12px;
    }
    .enrichment-desc-item:last-child {
      margin-bottom: 0;
    }
    .enrichment-desc-item strong {
      display: block;
      margin-bottom: 4px;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .enrichment-desc-item p {
      margin: 0;
      color: var(--text-primary);
      font-size: 0.85rem;
      line-height: 1.5;
    }
    .enrichment-insights-list {
      margin: 0;
      padding-left: 20px;
    }
    .enrichment-insights-list li {
      margin-bottom: 6px;
      font-size: 0.85rem;
      color: var(--text-primary);
      line-height: 1.4;
    }
    .enrichment-fields-content {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
    }
    /* 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;
    }
    .clear-filters-btn {
      padding: 4px 10px;
      font-size: 0.75rem;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--bg-tertiary);
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s;
      margin-left: 6px;
    }
    .clear-filters-btn:hover {
      background: var(--bg-secondary);
      color: var(--text-primary);
    }
    /* Row highlighting for sensitive classifications */
    .row-highlight-critical {
      background-color: rgba(220, 38, 38, 0.08) !important;
      border-left: 3px solid #dc2626;
    }
    .row-highlight-critical:hover {
      background-color: rgba(220, 38, 38, 0.12) !important;
    }
    .row-highlight-warning {
      background-color: rgba(234, 88, 12, 0.06) !important;
      border-left: 3px solid #ea580c;
    }
    .row-highlight-warning:hover {
      background-color: rgba(234, 88, 12, 0.10) !important;
    }
    /* Inline editing controls */
    .enrichment-edit-actions {
      display: flex;
      justify-content: flex-end;
      margin-bottom: 8px;
    }
    .enrichment-edit-btn {
      padding: 6px 12px;
      font-size: 0.85rem;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-primary);
      cursor: pointer;
      transition: all 0.2s;
      font-weight: 500;
    }
    .enrichment-edit-btn:hover {
      background: #3b82f6;
      border-color: #3b82f6;
      color: white;
    }
    .enrichment-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;
    }
    .enrichment-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;
    }
    .enrichment-save-btn:hover {
      background: #2563eb;
      border-color: #2563eb;
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    }
    .enrichment-save-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }
    .enrichment-cancel-btn {
      padding: 8px 16px;
      font-size: 0.9rem;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--bg-secondary);
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.2s;
    }
    .enrichment-cancel-btn:hover {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }
    .enrichment-save-hint {
      font-size: 0.75rem;
      color: var(--text-muted);
      font-style: italic;
      margin-left: auto;
    }
    .inline-edit-select {
      width: 100%;
      padding: 4px 6px;
      font-size: 0.85rem;
      border: 1px solid var(--border);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
      cursor: pointer;
    }
    .inline-edit-select:focus {
      outline: none;
      border-color: #3b82f6;
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }
    .inline-edit-input {
      width: 100%;
      padding: 4px 6px;
      font-size: 0.85rem;
      border: 1px solid var(--border);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
    }
    .inline-edit-input:focus {
      outline: none;
      border-color: #3b82f6;
      box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }
    .enrichment-fields-table-container {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 8px;
    }
    .enrichment-fields-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }
    .enrichment-fields-table thead {
      position: sticky;
      top: 0;
      z-index: 1;
    }
    .enrichment-fields-table th {
      background: var(--bg-tertiary);
      padding: 8px 12px;
      text-align: left;
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-secondary);
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      user-select: none;
    }
    .enrichment-fields-table th:hover {
      background: var(--bg-secondary);
    }
    .enrichment-fields-table th .sort-indicator {
      margin-left: 4px;
      opacity: 0.5;
    }
    .enrichment-fields-table th.sorted .sort-indicator {
      opacity: 1;
    }
    .enrichment-field-row {
      border-bottom: 1px solid var(--border);
    }
    .enrichment-field-row:last-child {
      border-bottom: none;
    }
    .enrichment-field-row:hover {
      background: var(--bg-secondary);
    }
    .enrichment-field-row td {
      padding: 8px 12px;
      vertical-align: top;
    }
    .enrichment-field-name code {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.8rem;
      color: var(--accent);
    }
    .enrichment-field-desc {
      color: var(--text-secondary);
      font-size: 0.8rem;
      line-height: 1.4;
    }

    /* Table Tabs */
    .tableTab {
      padding: 8px 16px;
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--text-secondary);
      cursor: pointer;
      font-size: 0.9rem;
      font-weight: 500;
      transition: all 0.2s;
    }
    .tableTab:hover {
      color: var(--text-primary);
      background: var(--bg-secondary);
    }
    .tableTab.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }

    /* File path with copy button */
    .filePath {
      display: flex;
      align-items: center;
      gap: 8px;
      max-width: 100%;
    }
    .filePathText {
      font-family: var(--font-mono);
      font-size: 0.8rem;
      color: var(--text-secondary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }
    .copyBtn {
      padding: 2px 6px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      color: var(--text-secondary);
      font-size: 0.7rem;
      cursor: pointer;
      transition: all 0.2s;
      flex-shrink: 0;
    }
    .copyBtn:hover {
      background: var(--accent);
      color: white;
      border-color: var(--accent);
    }
    .copyBtn.copied {
      background: #16a34a;
      color: white;
      border-color: #16a34a;
    }

    /* Artifact list view */
    .artifactListView {
      padding: 16px;
    }
    .artifactListHeader {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
    }
    .artifactListHeader h2 {
      margin: 0;
    }
    .artifactListTable {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
      background: var(--bg-secondary);
      border-radius: 8px;
      overflow: hidden;
    }
    .artifactListTable th,
    .artifactListTable td {
      padding: 10px 12px;
      text-align: left;
      border-bottom: 1px solid var(--border-color);
    }
    .artifactListTable th {
      background: var(--bg-tertiary);
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-secondary);
    }
    .artifactListTable tr:last-child td {
      border-bottom: none;
    }
    .artifactListTable tr:hover {
      background: var(--hover);
    }
    .artifactListTable .nameCell {
      font-weight: 500;
      cursor: pointer;
      color: var(--accent);
    }
    .artifactListTable .nameCell:hover {
      text-decoration: underline;
    }
    .artifactListTable .timestampCell {
      font-size: 0.75rem;
      color: var(--text-secondary);
      white-space: nowrap;
    }
    .artifactListTable .pathCell {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--text-secondary);
      max-width: 300px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sidebarHeader {
      cursor: pointer;
      transition: color 0.2s;
    }
    .sidebarHeader:hover {
      color: var(--accent);
    }

    /* Clickable artifact links in chat */
    .artifactLink {
      color: var(--accent);
      cursor: pointer;
      text-decoration: underline;
      text-decoration-style: dotted;
      text-underline-offset: 2px;
    }
    .artifactLink:hover {
      text-decoration-style: solid;
      filter: brightness(1.2);
    }

    /* Lineage Node Tags */
    .lineageNodeTag {
      display: inline-block;
      padding: 2px 8px;
      margin: 2px;
      border-radius: 4px;
      font-size: 0.85rem;
      font-family: monospace;
      transition: all 0.15s;
    }
    .lineageNodeTag.upstream {
      background: rgba(16, 185, 129, 0.15);
      color: #10b981;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }
    .lineageNodeTag.upstream:hover {
      background: rgba(16, 185, 129, 0.25);
    }
    .lineageNodeTag.downstream {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
      border: 1px solid rgba(59, 130, 246, 0.3);
    }
    .lineageNodeTag.downstream:hover {
      background: rgba(59, 130, 246, 0.25);
    }
    .sidebarSection {
      margin-bottom: 12px;
    }
    .sidebarSectionTitle {
      padding: 8px 12px;
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--text-primary);
      background: var(--bg-tertiary);
      border-bottom: 1px solid var(--border-color);
    }

    /* Main Content - fills remaining grid space */
    .mainContent {
      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: 14px 16px;
      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: 56px;
      box-sizing: border-box;
    }
    .headerLeft { display: flex; align-items: center; gap: 12px; }
    .headerRight { display: flex; align-items: center; gap: 8px; }
    .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 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) */
    .barq-content {
      color: var(--text-primary);
      line-height: 1.6;
    }
    .barq-content h4 {
      color: var(--accent) !important;
      margin: 20px 0 12px 0;
      font-size: 1.1em;
      font-weight: 600;
      border-bottom: 1px solid var(--border-color);
      padding-bottom: 6px;
    }
    .barq-content h4:first-child {
      margin-top: 0;
    }
    .barq-content p {
      margin: 10px 0;
      color: var(--text-primary);
    }
    .barq-content ul, .barq-content ol {
      margin: 10px 0;
      padding-left: 24px;
    }
    .barq-content li {
      margin: 6px 0;
      color: var(--text-primary);
    }
    .barq-content strong {
      color: var(--text-primary);
      font-weight: 600;
    }
    .barq-content code {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.9em;
      color: var(--accent);
    }
    .barq-content pre {
      background: var(--bg-tertiary);
      padding: 16px;
      border-radius: 8px;
      overflow-x: auto;
      margin: 12px 0;
    }
    .barq-content pre code {
      background: transparent;
      padding: 0;
    }
    /* Specific followup types */
    .insights-content, .recommend-content, .technical-content, .explain-content {
      padding: 16px;
      background: var(--bg-secondary);
      border-radius: 8px;
      border: 1px solid var(--border-color);
    }
    .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 */
    .sanitized-html [class*="insight"],
    .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: 300px;
      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;
    }

    /* LLM Output Highlighting */
    .highlight-number { color: #22c55e; font-weight: 600; }
    .highlight-percent { color: #f59e0b; font-weight: 600; }
    .highlight-positive { color: #22c55e; font-weight: 500; }
    .highlight-negative { color: #f87171; font-weight: 500; }
    .highlight-key { color: #a855f7; font-weight: 500; }
    .highlight-metric { background: rgba(34, 197, 94, 0.1); padding: 1px 4px; border-radius: 3px; }
    .key-insight {
      background: linear-gradient(90deg, rgba(168, 85, 247, 0.1) 0%, transparent 100%);
      padding: 8px 12px;
      border-left: 3px solid #a855f7;
      margin: 8px 0;
      border-radius: 0 8px 8px 0;
    }
    .recommendation-item {
      background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
      padding: 8px 12px;
      border-left: 3px solid #3b82f6;
      margin: 8px 0;
      border-radius: 0 8px 8px 0;
    }

    /* Recommendation Sections */
    .recommend-content {
      padding: 0 !important;
      background: transparent !important;
      border: none !important;
    }
    .recommend-section {
      margin-bottom: 16px;
      padding: 12px 16px;
      background: var(--bg-tertiary);
      border-radius: 8px;
      border: 1px solid var(--border-color);
    }
    .recommend-section:last-child {
      margin-bottom: 0;
    }
    .recommend-section h4 {
      margin: 0 0 12px 0;
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--text-primary);
      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.9rem;
      line-height: 1.5;
    }
    .recommend-item::before {
      content: '•';
      position: absolute;
      left: 12px;
      color: var(--accent);
      font-weight: bold;
    }
    .recommend-item strong {
      color: var(--text-primary);
    }
    /* 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;
    }

    /* 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;
    }
    .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: var(--bg-tertiary);
      color: var(--text-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 4px 6px;
      font-size: 0.75rem;
      cursor: pointer;
      transition: all 0.15s ease;
      opacity: 0.85;
      min-width: 28px;
      min-height: 28px;
    }
    .followup-btn:hover {
      background: var(--bg-secondary);
      border-color: var(--accent);
      color: var(--accent);
      opacity: 1;
      transform: translateY(-1px);
    }
    .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 */
    .followup-btn.disabled {
      opacity: 0.3;
      cursor: not-allowed;
      pointer-events: none;
    }

    /* 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);
    }

    /* Auto-generate toggles (stacked checkbox on top of icon) */
    .followup-auto-toggle {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      cursor: pointer;
      padding: 4px 6px;
      border-radius: 6px;
      transition: background 0.15s;
      user-select: none;
    }
    .followup-auto-toggle:hover {
      background: var(--hover);
    }
    .followup-auto-toggle input[type="checkbox"] {
      width: 14px;
      height: 14px;
      cursor: pointer;
      accent-color: var(--accent);
      margin: 0;
    }
    .followup-auto-toggle input[type="checkbox"]:checked + .followup-auto-icon {
      opacity: 1;
    }
    .followup-auto-icon {
      font-size: 1rem;
      opacity: 0.5;
      transition: opacity 0.15s;
    }

    /* 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: 300px;
      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: 8px;
      padding: 12px;
      background: var(--bg-tertiary);
      border-radius: 6px;
      border-left: 3px solid var(--accent);
    }
    .followup-content-item:first-child {
      margin-top: 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: 8px;
      gap: 8px;
    }
    .followup-content-title {
      font-weight: 600;
      color: var(--accent);
      font-size: 0.95rem;
      flex: 1;
    }
    .followup-content-meta {
      font-size: 0.9rem;
      color: #22c55e;  /* Green for visibility */
      font-weight: 500;
    }
    @media (prefers-color-scheme: light) {
      .followup-content-meta {
        color: #15803d;  /* Darker green for light mode */
      }
    }
    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;
    }
    .followup-content-body 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 td {
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
      color: var(--text-primary);
      font-size: 0.9rem;
    }
    .followup-content-body tr:last-child td {
      border-bottom: none;
    }
    .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 */
    @media (max-width: 900px) {
      .table-grid,
      .table-grid-2 {
        grid-template-columns: 1fr;
      }
    }

    /* 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;
    }
    /* 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;
    }

    /* Explore chat timestamps and elapsed times - make more visible */
    #exploreChat .startTs,
    #exploreChat .endTs,
    #exploreChat .thinkingElapsed,
    #exploreChat .toolsElapsed,
    #exploreChat .toolTime {
      color: #22c55e !important;  /* Green for dark mode */
      font-weight: 500;
      font-size: 0.9rem !important;
    }
    @media (prefers-color-scheme: light) {
      #exploreChat .startTs,
      #exploreChat .endTs,
      #exploreChat .thinkingElapsed,
      #exploreChat .toolsElapsed,
      #exploreChat .toolTime {
        color: #15803d !important;  /* Darker green for light mode */
      }
    }
    html[data-theme="light"] #exploreChat .startTs,
    html[data-theme="light"] #exploreChat .endTs,
    html[data-theme="light"] #exploreChat .thinkingElapsed,
    html[data-theme="light"] #exploreChat .toolsElapsed,
    html[data-theme="light"] #exploreChat .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;
      height: 450px;
      min-height: 250px;
      max-height: 80vh;
      position: relative;
      padding-bottom: 12px;  /* Space for resize handle */
    }
    .followup-content-item.resizable .followup-content-body {
      height: calc(100% - 48px); /* Account for header + resize area */
      overflow: hidden;
      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 should not be resizable */
    .followup-content-item.resizable.pane-collapsed {
      resize: none;
      height: auto;
      min-height: auto;
      max-height: none;
    }
    /* 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%;
    }
    .followup-content-body .leaflet-container {
      width: 100% !important;
      height: 100% !important;
      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 */
    .followup-content-body .sanitized-html {
      height: 100%;
    }
    .followup-content-body .sanitized-html > div:first-child {
      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 {
      border-color: #ef4444;
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
      animation: pulse 1.5s infinite;
    }
    .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: 600px;
      margin: 0 auto;
      padding: 24px;
    }
    .registerFormCard {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 24px;
    }
    .registerFormHeader {
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--border-color);
    }
    .registerFormHeader h2 {
      margin: 0 0 8px 0;
      font-size: 1.25rem;
      color: var(--text-primary);
    }
    .registerFormHeader p {
      margin: 0;
      color: var(--text-muted);
      font-size: 0.9rem;
    }

    /* 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: 20px;
    }
    .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: 12px;
    }
    .formField {
      margin-bottom: 16px;
    }
    .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: 10px 12px;
      border-radius: 8px;
      font-size: 0.9rem;
      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: 10px 12px;
      border-radius: 8px;
      font-size: 0.9rem;
      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: 12px;
      justify-content: flex-end;
      margin-top: 24px;
      padding-top: 20px;
      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; }
    .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;
    }
    .toolLine .toolStatus {
      flex-shrink: 0;
      width: 16px;
      text-align: center;
    }
    .toolLine .toolTime {
      flex-shrink: 0;
      font-size: 0.75rem;
    }

    /* 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; }
    .placeholder .desc { font-size: 0.9rem; text-align: center; max-width: 400px; }

    /* ================================================================================
       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;
    }
    @media (max-width: 1100px) {
      .usersGrid {
        grid-template-columns: 1fr;
      }
    }
    @media (max-width: 760px) {
      .usersFilterGroup {
        min-width: 100%;
      }
      .usersHeaderStatus {
        width: 100%;
      }
    }

    /* 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: var(--bg-tertiary);
      padding: 10px 12px;
      text-align: left;
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-secondary);
      border-bottom: 1px solid var(--border);
    }
    .notes-column-row {
      border-bottom: 1px solid var(--border);
    }
    .notes-column-row:last-child {
      border-bottom: none;
    }
    .notes-column-row:hover {
      background: var(--bg-secondary);
    }
    .notes-column-row td {
      padding: 8px 12px;
      vertical-align: top;
    }
    .notes-column-name code {
      background: var(--bg-tertiary);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.8rem;
      color: var(--accent);
    }
    .notes-column-ai-desc {
      color: var(--text-secondary);
      font-size: 0.8rem;
      line-height: 1.4;
    }
    .notes-column-user-notes {
      padding-right: 8px !important;
    }
    .notes-column-input {
      width: 100%;
      padding: 6px 10px;
      border: 1px solid var(--border);
      border-radius: 4px;
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.8rem;
    }
    .notes-column-input:focus {
      outline: none;
      border-color: var(--accent);
      background: var(--bg-secondary);
    }
    .notes-column-input::placeholder {
      color: var(--text-muted);
    }
    .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: var(--text-secondary);
      line-height: 1.6;
    }
    .table-insights-list li {
      margin: 6px 0;
    }

    /* Namespace Hierarchy for Tables List */
    .namespace-group {
      margin-bottom: 8px;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      overflow: hidden;
    }
    .namespace-header {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: var(--bg-secondary);
      cursor: pointer;
      user-select: none;
      transition: background 0.15s;
    }
    .namespace-header:hover {
      background: var(--bg-tertiary);
    }
    .namespace-toggle {
      color: var(--text-muted);
      font-size: 0.7rem;
      transition: transform 0.2s;
      width: 12px;
    }
    .namespace-group.collapsed .namespace-toggle {
      transform: rotate(-90deg);
    }
    .namespace-icon {
      font-size: 1rem;
    }
    .namespace-name {
      flex: 1;
      font-weight: 600;
      font-size: 0.85rem;
      color: var(--text-primary);
    }
    .namespace-count {
      background: var(--accent);
      color: white;
      font-size: 0.65rem;
      padding: 1px 6px;
      border-radius: 8px;
      font-weight: 500;
    }
    .namespace-tables {
      border-top: 1px solid var(--border-color);
    }
    .namespace-group.collapsed .namespace-tables {
      display: none;
    }
    .namespace-tables .artifactListTable {
      margin: 0;
    }
    .namespace-tables .artifactListTable thead {
      display: none;
    }
    .namespace-tables .artifactListTable tbody tr:first-child td {
      border-top: none;
    }

    /* Namespace Filter Bar (top of tables view) */
    .namespaceFilterBar {
      padding: 8px 16px;
      background: var(--bg-secondary);
      border-bottom: 1px solid var(--border-color);
      overflow-x: auto;
      flex-shrink: 0;
    }
    .namespaceChips {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: nowrap;
    }
    .namespaceChip {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 16px;
      border: 1px solid var(--border-color);
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      font-size: 0.8rem;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.15s;
    }
    .namespaceChip:hover {
      background: var(--bg-hover);
      border-color: var(--accent-color);
    }
    .namespaceChip.active {
      background: var(--accent-color);
      color: white;
      border-color: var(--accent-color);
    }
    .namespaceChip .chipIcon {
      font-size: 0.9rem;
    }
    .namespaceChip .chipLabel {
      font-weight: 500;
    }
    .namespaceChip .chipCount {
      background: rgba(255,255,255,0.2);
      padding: 1px 6px;
      border-radius: 8px;
      font-size: 0.7rem;
    }
    .namespaceChip.active .chipCount {
      background: rgba(255,255,255,0.3);
    }

    /* Sidebar Namespace Groups (table sidebar hierarchy) */
    .sidebarNamespaceGroup {
      margin-bottom: 4px;
    }
    .sidebarNamespaceHeader {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      background: var(--bg-secondary);
      border-radius: 4px;
      cursor: pointer;
      user-select: none;
      font-size: 0.8rem;
      transition: background 0.15s;
    }
    .sidebarNamespaceHeader:hover {
      background: var(--bg-tertiary);
    }
    .sidebarNamespaceHeader .nsToggle {
      color: var(--text-muted);
      font-size: 0.65rem;
      transition: transform 0.2s;
      width: 10px;
    }
    .sidebarNamespaceGroup.collapsed .nsToggle {
      transform: rotate(-90deg);
    }
    .sidebarNamespaceHeader .nsIcon {
      font-size: 0.85rem;
    }
    .sidebarNamespaceHeader .nsName {
      flex: 1;
      font-weight: 500;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .sidebarNamespaceHeader .nsCount {
      background: var(--accent-color);
      color: white;
      font-size: 0.6rem;
      padding: 1px 5px;
      border-radius: 6px;
      font-weight: 500;
    }
    .sidebarNamespaceTables {
      padding-left: 12px;
      border-left: 1px solid var(--border-color);
      margin-left: 8px;
    }
    .sidebarNamespaceGroup.collapsed .sidebarNamespaceTables {
      display: none;
    }

    /* Sidebar Namespace Dropdown Selector */
    .sidebarNsSelector {
      padding: 6px 10px;
      border-bottom: 1px solid var(--border-color);
      position: relative;
    }
    .nsCurrentSelection {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s;
    }
    .nsCurrentSelection:hover {
      background: var(--bg-tertiary);
      border-color: var(--accent-color);
    }
    .nsSelIcon { font-size: 0.85rem; }
    .nsSelName {
      flex: 1;
      font-size: 0.8rem;
      font-weight: 500;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .nsSelChevron {
      font-size: 0.6rem;
      color: var(--text-muted);
      transition: transform 0.2s;
    }
    .sidebarNsSelector.open .nsSelChevron { transform: rotate(180deg); }
    .nsDropdown {
      position: absolute;
      top: 100%;
      left: 10px;
      right: 10px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: 6px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      z-index: 100;
      max-height: 280px;
      overflow-y: auto;
      margin-top: 2px;
    }
    .nsDropdownItem {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      cursor: pointer;
      font-size: 0.8rem;
      color: var(--text-secondary);
      transition: background 0.15s;
    }
    .nsDropdownItem:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
    }
    .nsDropdownItem.active {
      background: var(--accent-color);
      color: white;
    }
    .nsDropdownItem .nsItemIcon { font-size: 0.85rem; width: 16px; text-align: center; }
    .nsDropdownItem .nsItemName { flex: 1; }
    .nsDropdownItem .nsItemCount { font-size: 0.65rem; color: var(--text-muted); }
    .nsDropdownItem.active .nsItemCount { color: rgba(255,255,255,0.8); }
    .nsDropdownSeparator { height: 1px; background: var(--border-color); margin: 4px 0; }

    /* External Table Stats Grid */
    .table-stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 10px;
      margin-bottom: 16px;
    }
    .table-stat-card {
      padding: 10px 14px;
      border-radius: 8px;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
    }
    .table-stat-title {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 2px;
    }
    .table-stat-value {
      font-size: 1.1rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    .table-stat-detail {
      font-size: 0.7rem;
      color: var(--text-muted);
      margin-top: 2px;
    }
    /* Stat card color variations */
    .table-stat-rows {
      background: rgba(59, 130, 246, 0.08);
      border-color: rgba(59, 130, 246, 0.2);
    }
    .table-stat-rows .table-stat-title { color: #3b82f6; }
    .table-stat-size {
      background: rgba(16, 185, 129, 0.08);
      border-color: rgba(16, 185, 129, 0.2);
    }
    .table-stat-size .table-stat-title { color: #10b981; }
    .table-stat-columns {
      background: rgba(168, 85, 247, 0.08);
      border-color: rgba(168, 85, 247, 0.2);
    }
    .table-stat-columns .table-stat-title { color: #a855f7; }
    .table-stat-partitions {
      background: rgba(245, 158, 11, 0.08);
      border-color: rgba(245, 158, 11, 0.2);
    }
    .table-stat-partitions .table-stat-title { color: #f59e0b; }
    .table-stat-modified {
      background: rgba(99, 102, 241, 0.08);
      border-color: rgba(99, 102, 241, 0.2);
    }
    .table-stat-modified .table-stat-title { color: #6366f1; }

    /* External Table Usage Section */
    .table-usage-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      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: 300px;
      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: 4px;
      background: transparent;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 4px 8px;
      cursor: pointer;
      color: var(--text-muted);
      font-size: 0.7rem;
      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.55rem;
      transition: transform 0.2s ease;
    }
    .auto-toggle-btn.active .toggle-arrow {
      /* No rotation - arrow stays pointing right */
    }

    /* Auto-generate panel - inline side collapse */
    .auto-generate-panel {
      display: flex;
      align-items: center;
      gap: 4px;
      padding-left: 8px;
      border-left: 1px solid var(--border-color);
      margin-left: 8px;
      overflow: hidden;
      max-width: 350px;
      transition: max-width 0.25s ease, padding 0.25s ease, margin 0.25s ease, opacity 0.2s ease, border 0.25s ease;
    }
    .auto-generate-panel.hidden {
      max-width: 0;
      padding-left: 0;
      margin-left: 0;
      border-left: none;
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
    }
    .auto-panel-title {
      display: none;
    }

    /* 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-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;
    }

    /* ─────────────────────────────────────────────────────────────────
       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);
    }
    .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 */
    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }
      .authHeroBadge {
        animation: none;
      }
      .authGoogleBtn:hover {
        transform: none;
      }
    }

    /* High contrast mode support */
    @media (prefers-contrast: high) {
      .authCard {
        border-width: 2px;
      }
      .authGoogleBtn {
        border-width: 2px;
      }
      .authNotice {
        border-width: 2px;
      }
    }

    .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;
    }
    @media (max-width: 720px) {
      .cookieBanner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        flex-direction: column;
        align-items: flex-start;
      }
    }

    /* 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 */
    @media (max-width: 1024px) {
      .authLayout {
        grid-template-columns: 1fr 1fr;
      }
      .authHero {
        padding: 48px;
      }
      .authHero h1 {
        font-size: 2rem;
      }
      .authPanel {
        padding: 40px 24px;
      }
    }

    /* Tablet portrait */
    @media (max-width: 768px) {
      .authLayout {
        grid-template-columns: 1fr;
      }
      .authHero {
        display: block;
        min-height: auto;
        padding: 40px 32px;
        align-items: flex-start;
      }
      .authHeroStats {
        justify-content: flex-start;
      }
      .authHeroStat {
        min-width: 100px;
      }
      .authPanel {
        padding: 32px 24px;
      }
      .authCard {
        padding: 24px;
      }
    }

    /* Mobile */
    @media (max-width: 640px) {
      .authLayout {
        grid-template-columns: 1fr;
        min-height: 100vh;
      }
      .authHero {
        display: none;
      }
      .authPanel {
        padding: 24px 16px;
        justify-content: flex-start;
        padding-top: 60px;
      }
      .authPanelInner {
        width: 100%;
        max-width: 380px;
      }
      .authLogo {
        font-size: 1.6rem;
        margin-bottom: 28px;
      }
      .authCard {
        padding: 20px;
        border-radius: 14px;
      }
      .authCard h2 {
        font-size: 1.5rem;
      }
      .authGoogleBtn {
        padding: 12px 20px;
        font-size: 0.9rem;
        min-height: 48px;
      }
      .authSubmit {
        padding: 13px 20px;
        font-size: 0.95rem;
        min-height: 48px;
      }
      .authInput {
        font-size: 16px;  /* Prevents iOS zoom on focus */
        min-height: 48px;
        padding: 14px 16px;
      }
      .authDivider span {
        font-size: 0.7rem;
      }
      .authFooter {
        position: static;
        margin-top: 24px;
        font-size: 0.7rem;
      }
    }

    /* Small mobile */
    @media (max-width: 400px) {
      .authPanel {
        padding: 20px 12px;
        padding-top: 40px;
      }
      .authCard {
        padding: 16px;
      }
      .authCard h2 {
        font-size: 1.3rem;
      }
      .authGoogleBtn {
        font-size: 0.85rem;
        padding: 11px 16px;
      }
    }

    /* Touch device hover overrides */
    @media (hover: none) {
      .authGoogleBtn:hover {
        transform: none;
      }
      .authHeroStat:hover {
        transform: none;
        box-shadow: none;
      }
    }

/* ================================================================================
   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;
}

.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;
}

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

.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+) */
@media (min-width: 1920px) {
  .settings-card {
    max-width: 1200px;
  }

  #settings-users .settings-card {
    max-width: 1600px;
  }
}

/* Large Screens (1440px - 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
  .settings-card {
    max-width: 1100px;
  }

  #settings-users .settings-card {
    max-width: 1500px;
  }
}

/* Desktop (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
  .settings-card {
    max-width: 960px;
  }

  #settings-users .settings-card {
    max-width: 1400px;
  }
}

/* Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) {
  .settings-section {
    padding: 20px 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .settings-card {
    padding: 40px 32px;
    max-width: 100%;
  }

  #settings-users .settings-card {
    max-width: 100%;
  }

  .userTable {
    min-width: 800px;
  }
}

/* Tablet Portrait & Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .adminPanel {
    padding: 0;
  }

  .adminHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }

  .adminTitle {
    font-size: 1.5rem;
  }

  .adminToolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filterSelect {
    width: 100%;
  }

  .userTable {
    font-size: 0.85rem;
    min-width: 700px;
  }

  .userTable th,
  .userTable td {
    padding: 12px 8px;
  }

  .userAvatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  /* Hide less important columns on tablet */
  .userTable th:nth-child(5),
  .userTable td:nth-child(5) {
    display: none;
  }

  /* Settings card responsive styles */
  .settings-section {
    padding: 16px 12px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .settings-card {
    padding: 32px 28px;
    border-radius: 20px;
    width: 100%;
  }

  .settings-card::before {
    height: 150px;
  }

  .settings-section h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }

  .settings-group.horizontal {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .settings-group.horizontal .settings-label {
    padding-top: 0;
  }

  .settings-group.horizontal .settings-hint {
    grid-column: 1;
    margin-top: -8px;
  }

  .settings-subsection {
    padding: 24px 20px;
  }

  /* Maintain centering on tablet */
  #settingsMode .mainBody {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 16px;
  }

  /* Profile responsive styles */
  .profileAvatar {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  .profileDisplayName {
    font-size: 1.25rem;
  }

  .profileMetaRow {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .profileActions {
    flex-direction: column;
  }

  .profileActions .btnPrimary,
  .profileActions .btnSecondary {
    width: 100%;
    justify-content: center;
  }

  .settings-group input[type="text"],
  .settings-group input[type="number"],
  .settings-group input[type="password"],
  .settings-group select {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Mobile Landscape (641px - 767px) */
@media (min-width: 641px) and (max-width: 767px) {
  .settings-card {
    padding: 28px 24px;
  }

  .userTable {
    min-width: 650px;
    font-size: 0.88rem;
  }

  /* Hide providers column */
  .userTable th:nth-child(5),
  .userTable td:nth-child(5) {
    display: none;
  }
}

/* Mobile Portrait (481px - 640px) */
@media (max-width: 640px) {
  .modalDialog {
    width: 95%;
    max-width: none;
  }

  .modalHeader {
    padding: 20px 16px;
  }

  /* Settings card for mobile */
  .settings-section {
    padding: 12px 8px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .settings-card {
    padding: 24px 20px;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
  }

  #settings-users .settings-card {
    max-width: 100%;
    padding: 20px 12px;
  }

  .settings-card::before {
    height: 100px;
  }

  .settings-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }

  .settings-section h3::after {
    width: 40px;
  }

  .settings-subsection {
    padding: 20px 16px;
  }

  .settings-subsection h4 {
    font-size: 1rem;
  }

  /* User table mobile */
  .userTable {
    min-width: 600px;
    font-size: 0.82rem;
  }

  .userTable th,
  .userTable td {
    padding: 10px 6px;
  }

  /* Hide role and providers columns on mobile */
  .userTable th:nth-child(4),
  .userTable td:nth-child(4),
  .userTable th:nth-child(5),
  .userTable td:nth-child(5) {
    display: none;
  }

  .adminToolbar {
    padding: 0;
  }

  .searchInput {
    font-size: 0.85rem;
    padding: 10px 12px 10px 40px;
  }

  /* Maintain centering on mobile */
  #settingsMode .mainBody {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 8px;
  }

  /* Security section items */
  .sessionItem,
  .loginItem {
    padding: 16px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .sessionItem button {
    width: 100%;
    margin-top: 8px;
  }

  /* Profile mobile */
  .profileAvatar {
    width: 56px;
    height: 56px;
    font-size: 1.35rem;
  }

  .profileDisplayName {
    font-size: 1.15rem;
  }

  .profileHeader {
    padding: 24px 20px 20px;
  }

  .profileMetaRow {
    padding: 16px;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .settings-section {
    padding: 8px 4px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  .settings-card {
    padding: 20px 16px;
    border-radius: 14px;
  }

  #settings-users .settings-card {
    padding: 16px 8px;
  }

  .settings-section h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
  }

  .settings-section h3::after {
    width: 30px;
  }

  /* Ultra compact user table */
  .userTable {
    min-width: 500px;
    font-size: 0.78rem;
  }

  .userTable th,
  .userTable td {
    padding: 8px 4px;
  }

  .userAvatar {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  /* Show only essential columns */
  .userTable th:nth-child(1),
  .userTable td:nth-child(1),
  .userTable th:nth-child(4),
  .userTable td:nth-child(4),
  .userTable th:nth-child(5),
  .userTable td:nth-child(5),
  .userTable th:nth-child(6),
  .userTable td:nth-child(6) {
    display: none;
  }

  .searchInput {
    font-size: 0.8rem;
    padding: 8px 10px 8px 36px;
  }

  .sessionItem,
  .loginItem {
    padding: 14px 12px;
  }

  .profileAvatar {
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }

  .profileDisplayName {
    font-size: 1.05rem;
  }

  .profileHeader {
    padding: 20px 16px 16px;
  }

  .btnPrimary,
  .btnSecondary {
    font-size: 0.85rem;
    padding: 10px 16px;
  }

  .modalTitle {
    font-size: 1.25rem;
  }

  .modalBody {
    padding: 20px 16px;
  }

  .modalFooter {
    padding: 16px;
  }

  .toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
}

/* 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: 7px;
  right: 16px;
  z-index: 9999;
}

/* Adjust header controls to make room for profile button */
.mainHeader .headerRight {
  margin-right: 60px !important;
}

.userProfileButton {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px 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: 16px;
  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 */
@media (prefers-color-scheme: dark) {
  .userProfileButton {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .userProfileButton:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  .userDropdown {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .userProfileContainer {
    top: 7px;
    right: 16px;
  }

  .userProfileButton {
    width: 38px;
    height: 38px;
  }

  .userAvatar {
    font-size: 14px;
  }

  .userDropdown {
    min-width: 240px;
  }
}

/* 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);
}

/* 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 bottom border */
.light-theme .followup-content-header {
  border-bottom: 1px solid #e5e9ef;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* 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;
}

/* Auto-generate panel */
.light-theme .auto-generate-panel {
  border-left: 1px solid #d1d9e3;
}

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

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

/* Followup auto toggle buttons */
.light-theme .followup-auto-toggle {
  color: #374151;
}

.light-theme .followup-auto-toggle:hover {
  color: #111827;
}

.light-theme .followup-auto-toggle input:checked + .followup-auto-icon {
  color: #2563eb;
}

/* 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;
}

/* 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;
}
