    :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);
      /* 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: #111827;
      --text-secondary: #4b5563;
      --text-muted: #6b7280;
      --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);
    }
    * { 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;
      /* Font rendering - use auto to preserve font weight appearance */
      -webkit-font-smoothing: auto;
      text-rendering: optimizeLegibility;
    }

    /* Layout - using CSS Grid for reliable sizing */
    .appContainer {
      display: grid;
      grid-template-columns: 48px auto 4px 1fr;
      height: 100vh;
      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 - positioned at right edge of sidebar */
    .sidebarCollapseBtn {
      position: absolute;
      left: 296px; /* 48px (activity bar) + 260px (sidebar) - 12px (half button) */
      top: 60px;
      width: 24px;
      height: 24px;
      background: var(--accent);
      border: 2px solid var(--bg-primary);
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      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, left 0.2s;
    }
    .sidebarCollapseBtn:hover {
      background: var(--accent-hover, #2563eb);
      transform: scale(1.1);
    }

    /* 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: 60px;
      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: 12px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .sidebarHeader h2 { font-size: 0.875rem; font-weight: 600; margin: 0; flex: 1; }
    .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.7rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .sidebarItem {
      padding: 8px 12px;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      gap: 2px;
      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 .itemTitle {
      font-size: 0.85rem;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .sidebarItem .itemMeta {
      font-size: 0.7rem;
      color: var(--text-muted);
    }

    /* 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: 0.7rem;
      color: var(--text-muted);
      transition: transform 0.2s;
      flex-shrink: 0;
    }
    .chatItem.expanded .chatItemExpand {
      transform: rotate(90deg);
    }
    .chatItemContent {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .chatItemTitle {
      font-size: 0.85rem;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chatItemMeta {
      font-size: 0.7rem;
      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: var(--text-muted);
      border-radius: 4px;
      font-size: 0.75rem;
    }
    .chatActionBtn:hover {
      background: var(--hover);
      color: var(--danger);
    }
    .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.8rem;
    }
    .messageItem:hover {
      background: var(--hover);
    }
    .messageItemIcon {
      color: var(--text-muted);
      font-size: 0.7rem;
      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.65rem;
      color: var(--text-muted);
      flex-shrink: 0;
    }
    /* Compact chat sidebar header */
    .chatSidebarHeader {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 12px;
      border-bottom: 1px solid var(--border-color);
    }
    .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);
    }

    /* 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: 6px;
      cursor: pointer;
      font-weight: 500;
      font-size: 0.8rem;
      padding: 8px 16px;
    }
    .btnPrimary:hover { filter: brightness(1.1); }
    .btnPrimary:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    .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;
    }

    /* 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: 750px;
      min-width: 400px;
      min-height: 300px;
      max-width: 95vw;
      max-height: none;  /* Allow full resize - JS controls the limits */
      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: 9998;
      background: transparent;
      user-select: none;
      -webkit-user-select: none;
      pointer-events: auto !important;
    }
    .modal-resize-edge:hover {
      background: rgba(59, 130, 246, 0.3);
    }
    .modal-resize-edge[data-edge="bottom"] {
      bottom: 0;
      left: 14px;
      right: 14px;
      height: 6px;
      cursor: ns-resize;
    }
    .modal-resize-edge[data-edge="left"] {
      left: 0;
      top: 0;
      bottom: 14px;
      width: 6px;
      cursor: ew-resize;
    }
    .modal-resize-edge[data-edge="right"] {
      right: 0;
      top: 0;
      bottom: 14px;
      width: 6px;
      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-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: nowrap;
    }
    .enrichment-setup-header {
      flex-shrink: 0;
    }
    .enrichment-artifact-name {
      font-size: 0.85rem;
    }
    .enrichment-artifact-name code {
      background: var(--bg-tertiary);
      padding: 3px 8px;
      border-radius: 4px;
      font-weight: 500;
    }
    .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;
    }
    /* Sidebar Footer with Version */
    .sidebar-footer {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 8px 12px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .version-badge {
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--text-secondary);
      background: var(--bg-tertiary);
      padding: 3px 10px;
      border-radius: 10px;
      letter-spacing: 0.5px;
    }
    .mainHeader {
      padding: 8px 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;
    }
    .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: background 0.15s;
      border: 1px solid var(--border);
      padding: 8px 16px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 0.8rem;
    }
    .btnSecondary:hover { filter: brightness(1.1); }

    /* 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: 10px;
      padding: 16px 0;
      color: var(--text-muted);
      font-size: 0.85rem;
    }
    .followup-loading .loading-spinner {
      width: 16px;
      height: 16px;
      border: 2px solid var(--border-color);
      border-top-color: var(--accent);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    .followup-content-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }
    .followup-content-title {
      font-weight: 600;
      color: var(--accent);
      font-size: 0.9rem;
    }
    .followup-content-meta {
      font-size: 0.7rem;
      color: var(--text-muted);
    }
    .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.8rem;
    }
    .followup-content-body td {
      padding: 6px 12px;
      border-bottom: 1px solid var(--border-color);
      color: var(--text-secondary);
      font-size: 0.85rem;
    }
    .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;
    }

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

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

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

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

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

    /* ═══════════════════════════════════════════════════════════════
       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;
    }
    .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;
    }
    .authHero h1 {
      font-size: 2.4rem;
      line-height: 1.1;
      margin: 0 0 16px;
      color: #f8fafc;
    }
    .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;
    }
    .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: 700;
      font-size: 1.8rem;
      margin-bottom: 32px;
      color: var(--text-primary);
    }
    .authCard {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 28px;
      box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
    }
    .authCard h2 {
      margin: 0 0 6px;
      font-size: 1.4rem;
    }
    .authSubtitle {
      margin: 0 0 24px;
      color: var(--text-secondary);
      font-size: 0.9rem;
    }
    .authForm {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .authLabel {
      font-size: 0.85rem;
      color: var(--text-secondary);
    }
    .authInput {
      width: 100%;
    }
    .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: 10px 16px;
      border-radius: 10px;
    }
    .authDivider {
      text-align: center;
      position: relative;
      margin: 6px 0;
      color: var(--text-muted);
      font-size: 0.8rem;
    }
    .authDivider span {
      background: var(--bg-secondary);
      padding: 0 10px;
      position: relative;
      z-index: 1;
    }
    .authDivider::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 0;
      right: 0;
      height: 1px;
      background: var(--border-color);
      z-index: 0;
    }
    .authGoogleBtn {
      width: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 10px 16px;
      border-radius: 10px;
    }
    .authError {
      display: none;
      padding: 10px 12px;
      border-radius: 10px;
      background: rgba(239, 68, 68, 0.12);
      border: 1px solid rgba(239, 68, 68, 0.3);
      color: #fecaca;
      font-size: 0.8rem;
    }
    .authNotice {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      border-radius: 10px;
      background: rgba(59, 130, 246, 0.08);
      border: 1px solid rgba(59, 130, 246, 0.2);
      font-size: 0.8rem;
      color: var(--text-secondary);
    }
    .authNoticeLabel {
      text-transform: uppercase;
      font-size: 0.65rem;
      letter-spacing: 0.08em;
      color: var(--text-muted);
    }
    .authNoticeValue {
      font-weight: 600;
      color: var(--text-primary);
    }
    .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;
    }

    .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;
      }
    }
    .authFooter {
      position: absolute;
      bottom: 24px;
      font-size: 0.75rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    @media (max-width: 960px) {
      .authLayout {
        grid-template-columns: 1fr;
      }
      .authHero {
        display: none;
      }
      .authPanel {
        padding: 32px 16px;
      }
      .authFooter {
        position: static;
        margin-top: 24px;
      }
    }
