/* === Design System (Catppuccin Mocha Dark) === */
:root {
  /* Status colors */
  --pass: #a6e3a1; --pass-bg: rgba(166,227,161,0.12);
  --fail: #f38ba8; --fail-bg: rgba(243,139,168,0.12);
  --skip: #f9e2af; --skip-bg: rgba(249,226,175,0.12);
  --blocked: #9399b2; --blocked-bg: rgba(147,153,178,0.1);
  --untested: #6c7086; --untested-bg: rgba(108,112,134,0.1);

  /* Surfaces */
  --bg: #11111b; --card: #1e1e2e; --border: #313244; --border-subtle: #252536;

  /* Text */
  --text: #cdd6f4; --text-secondary: #a6adc8; --muted: #6c7086;

  /* Accent */
  --primary: #89b4fa; --primary-hover: #74c7ec; --primary-bg: rgba(137,180,250,0.1);
  --orange: #fab387; --orange-hover: #e6a070;
  --purple: #cba6f7; --purple-bg: rgba(203,166,247,0.1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.3);

  /* Radii */
  --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease; --transition-normal: 200ms ease;

  /* Hover backgrounds */
  --hover-bg: rgba(205,214,244,0.06);
  --hover-bg-subtle: rgba(205,214,244,0.04);
  --hover-bg-faint: rgba(205,214,244,0.02);

  /* Sidebar */
  --sidebar-width: 220px; --sidebar-collapsed: 56px;
}

/* === Custom Scrollbars === */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* === Light Theme === */
[data-theme="light"] {
  --pass: #16a34a; --pass-bg: rgba(22,163,74,0.1);
  --fail: #dc2626; --fail-bg: rgba(220,38,38,0.1);
  --skip: #ca8a04; --skip-bg: rgba(202,138,4,0.1);
  --blocked: #64748b; --blocked-bg: rgba(100,116,139,0.08);
  --untested: #94a3b8; --untested-bg: rgba(148,163,184,0.08);

  --bg: #f1f5f9; --card: #fff; --border: #e2e8f0; --border-subtle: #f1f5f9;
  --text: #1e293b; --text-secondary: #475569; --muted: #94a3b8;
  --primary: #4F46E5; --primary-hover: #4338CA; --primary-bg: rgba(79,70,229,0.08);
  --orange: #ea580c; --orange-hover: #c2410c;
  --purple: #7c3aed; --purple-bg: rgba(124,58,237,0.08);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);

  --hover-bg: rgba(0,0,0,0.04);
  --hover-bg-subtle: rgba(0,0,0,0.025);
  --hover-bg-faint: rgba(0,0,0,0.015);
}
/* light sidebar/topbar now handled via var(--card) */
[data-theme="light"] .sidebar-nav-item:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .sidebar-nav-item.active { background: var(--primary-bg); }
[data-theme="light"] .sidebar-nav-sub:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .sidebar-collapse-btn { border-color: var(--border); }
[data-theme="light"] .sidebar-collapse-btn:hover { background: rgba(0,0,0,0.04); }
/* light topbar now handled via var(--card) */
[data-theme="light"] .form-input, [data-theme="light"] .form-select, [data-theme="light"] .form-textarea {
  background: #f8fafc; color: var(--text); border-color: var(--border);
}
[data-theme="light"] .form-input:focus, [data-theme="light"] .form-select:focus, [data-theme="light"] .form-textarea:focus {
  background: #fff; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,0.12);
}
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-danger,
[data-theme="light"] .btn-success,
[data-theme="light"] .filter-btn.active,
[data-theme="light"] .selection-bar .btn-select-all,
[data-theme="light"] .selection-bar .btn-ai-edit,
[data-theme="light"] .selection-bar .btn-apply,
[data-theme="light"] .toast.error,
[data-theme="light"] .toast.success,
[data-theme="light"] .badge.pass,
[data-theme="light"] .badge.fail,
[data-theme="light"] .badge.skip,
[data-theme="light"] .badge.blocked,
[data-theme="light"] .badge.running { color: #fff; }
[data-theme="light"] .btn-danger:hover { background: #b91c1c; }
[data-theme="light"] .btn-success:hover { background: #15803d; }

/* Theme toggle in topbar */
.theme-toggle-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.25rem 0.45rem; cursor: pointer; font-size: 0.9rem; line-height: 1;
  color: var(--text-secondary); transition: all var(--transition-fast);
}
.theme-toggle-btn:hover { background: var(--primary-bg); border-color: var(--text-secondary); }

/* === Reset === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Inter, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; display: flex; min-height: 100vh; transition: background .2s, color .2s; }

/* === Sidebar === */
.sidebar { width: var(--sidebar-width); background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; z-index: 101; transition: width var(--transition-normal); overflow: hidden; }
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.main-area { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; transition: margin-left var(--transition-normal); }
.sidebar.collapsed ~ .main-area { margin-left: var(--sidebar-collapsed); }

.sidebar-brand { display: flex; align-items: center; gap: 0.65rem; padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sidebar-logo { width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0; }
.sidebar-brand-text { font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0; scrollbar-width: thin; scrollbar-color: #45475a transparent; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #45475a; border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #585b70; }
.sidebar-nav-item { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 1rem; cursor: pointer; color: var(--text-secondary); transition: all var(--transition-fast); border-left: 3px solid transparent; white-space: nowrap; }
.sidebar-nav-item:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); color: var(--text); }
.sidebar-nav-item.active { background: rgba(137,180,250,0.1); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-icon { display: flex; align-items: center; justify-content: center; width: 20px; flex-shrink: 0; }
.nav-label { font-size: 0.875rem; }

.sidebar-nav-group { max-height: 0; overflow: hidden; transition: max-height var(--transition-normal); }
.sidebar-nav-group.expanded { max-height: 600px; }
.sidebar-nav-sub { display: flex; align-items: center; gap: 0.65rem; padding: 0.4rem 1rem 0.4rem 2.75rem; cursor: pointer; color: var(--muted); font-size: 0.8rem; transition: all var(--transition-fast); white-space: nowrap; }
.sidebar-nav-sub:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); color: var(--text); }
.sidebar-nav-sub.active { color: var(--primary); font-weight: 600; background: rgba(137,180,250,0.08); }
.sidebar-nav-divider { border-top: 1px solid var(--border); margin: 0.35rem 1rem; }
.sidebar-nav-subheader { padding: 0.5rem 1rem 0.2rem 2.75rem; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

.sidebar-footer { padding: 0.5rem; border-top: 1px solid var(--border); }
.sidebar-collapse-btn { width: 100%; padding: 0.4rem; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; font-size: 0.85rem; transition: all var(--transition-fast); }
.sidebar-collapse-btn:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); color: var(--text); }
.sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }

.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-nav-group { display: none; }
.sidebar.collapsed .sidebar-nav-item { justify-content: center; padding-left: 0; padding-right: 0; border-left-color: transparent; }
.sidebar.collapsed .sidebar-nav-item.active { background: rgba(137,180,250,0.1); }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }

.sidebar-mobile-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.25rem; cursor: pointer; padding: 0.25rem 0.5rem; margin-right: 0.5rem; }
.sidebar-overlay { display: none; }

/* === View Toggle === */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; }
.view-toggle-btn { padding: 0.3rem 0.6rem; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; transition: all var(--transition-fast); font-family: inherit; }
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.active { background: var(--primary-bg); color: var(--primary); }

/* === Suites Table View === */
.suites-table { width: 100%; border-collapse: collapse; }
.suites-table th { text-align: left; padding: 0.6rem 0.75rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); background: var(--bg); }
.suites-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem; }
.suites-table tbody tr { cursor: pointer; transition: background var(--transition-fast); }
.suites-table tbody tr:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.suites-table .suite-table-name { font-weight: 500; }
.suites-table .mini-progress { height: 6px; border-radius: var(--radius-full); overflow: hidden; display: flex; background: var(--border); width: 120px; }
.suites-table .mini-progress .progress-pass { background: var(--pass); }
.suites-table .mini-progress .progress-fail { background: var(--fail); }
.suites-table .num-pass { color: var(--pass); }
.suites-table .num-fail { color: var(--fail); }
.suites-table .num-untested { color: var(--muted); }
.suite-table-expanded { animation: fadeSlideIn 0.2s ease; }
.suite-table-expanded td { padding: 0; background: var(--bg); }
.suite-table-expanded .suite-body { padding: 0.5rem 1rem 1rem; }

/* Table group rows (pivot-style) */
.table-group-row { cursor: pointer; user-select: none; }
.table-group-row > td { background: var(--card); padding: 0.6rem 0.75rem !important; border-bottom: 1px solid var(--border); }
.table-group-row:hover > td { background: var(--primary-bg); }
.table-group-row .category-color-dot { vertical-align: middle; margin-right: 0.35rem; }
.table-group-row strong { font-size: 0.9rem; vertical-align: middle; color: var(--text); }
.table-group-row .category-stats { font-size: 0.78rem; margin-left: 0.75rem; vertical-align: middle; }
.table-group-row .btn-run-category { opacity: 0; transition: opacity var(--transition-fast); float: right; }
.table-group-row:hover .btn-run-category { opacity: 1; }

/* Suite cards grid */
.suite-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.suite-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.15rem; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.suite-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.suite-card-cats { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.35rem; min-height: 1.2rem; }
.suite-card-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.5rem; line-height: 1.3; }
.suite-card-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.suite-card-bar .progress-bar { flex: 1; }
.suite-card-pct { font-size: 0.78rem; font-weight: 600; color: var(--pass); min-width: 2.5rem; text-align: right; }
.suite-card-stats { display: flex; gap: 0.5rem; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.65rem; flex-wrap: wrap; }
.suite-card-actions { display: flex; gap: 0.35rem; }
.suite-card-actions .btn { opacity: 0; transition: opacity var(--transition-fast); }
.suite-card:hover .suite-card-actions .btn { opacity: 1; }

/* === Topbar === */
.topbar { background: var(--card); color: var(--text); padding: 0.875rem 2rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.025em; }
.topbar .meta { font-size: 0.8rem; color: var(--muted); display: flex; gap: 1rem; align-items: center; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex-shrink: 0; }
.live-dot.connected { background: var(--pass); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all var(--transition-fast); border: 1px solid transparent; font-family: inherit; line-height: 1.4; }
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-primary { background: var(--primary); color: #11111b; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--hover-bg); border-color: var(--border); }
.btn-danger { background: var(--fail); color: #11111b; border-color: var(--fail); }
.btn-danger:hover { background: #eba0ac; }

.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); cursor: pointer; transition: background var(--transition-fast), color var(--transition-fast); }
.btn-icon:hover { background: var(--hover-bg); color: var(--text); }
.btn-icon-danger:hover { background: var(--fail-bg); color: var(--fail); }
.btn-icon-success { color: var(--pass); }
.btn-icon-success:hover { background: var(--pass-bg); color: var(--pass); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); color: var(--text); }
.btn-ghost.active { color: var(--primary); }
.btn-success { background: var(--pass); color: #11111b; border-color: var(--pass); }
.btn-success:hover { background: #b5e8b0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* === Tab Panels === */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === Controls === */
.controls { padding: 0.6rem 2rem; background: var(--card); border-bottom: 1px solid var(--border); display: flex; gap: 0.5rem; align-items: center; }

/* === Filter Drawer === */
.filter-drawer { max-height: 0; overflow: hidden; transition: max-height var(--transition-normal), padding var(--transition-normal); background: var(--card); border-bottom: 1px solid transparent; padding: 0 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.filter-drawer.open { max-height: 120px; padding: 0.5rem 2rem 0.65rem; border-bottom-color: var(--border); }
.search-box { flex: 1; min-width: 200px; padding: 0.5rem 0.875rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; outline: none; font-family: inherit; background: var(--bg); color: var(--text); transition: all var(--transition-fast); }
.search-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(137,180,250,0.15); background: var(--card); }
.search-box::placeholder { color: var(--muted); }
.filter-btn { padding: 0.35rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--card); cursor: pointer; font-size: 0.8rem; transition: all var(--transition-fast); font-family: inherit; color: var(--text-secondary); }
.filter-btn:hover { background: var(--hover-bg); border-color: var(--border); }
.filter-btn.active { background: var(--primary); color: #11111b; border-color: var(--primary); }

/* === Stats Grid === */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.75rem; padding: 1.25rem 2rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; text-align: center; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition-fast), transform var(--transition-fast); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--border); transition: background var(--transition-fast); }
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat.pass::before { background: var(--pass); }
.stat.fail::before { background: var(--fail); }
.stat.untested::before { background: var(--untested); }
.stat.knowledge::before { background: var(--purple); }
.stat .num { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.stat .lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.25rem; }
.stat.pass .num { color: var(--pass); }
.stat.fail .num { color: var(--fail); }
.stat.untested .num { color: var(--untested); }
.stat.knowledge .num { color: var(--purple); }

/* === Content === */
.content { padding: 0 2rem 2rem; }

/* === Suites === */
.suite { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 0.75rem; background: var(--card); box-shadow: var(--shadow-sm); overflow: hidden; }
.suite > summary { padding: 1rem 1.25rem; cursor: pointer; list-style: none; transition: background var(--transition-fast); }
.suite > summary:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.suite > summary::-webkit-details-marker { display: none; }
.suite > summary::before { content: '\25B6'; display: inline-block; margin-right: 0.5rem; transition: transform var(--transition-normal); font-size: 0.65em; color: var(--muted); }
.suite[open] > summary::before { transform: rotate(90deg); }
.suite-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.suite-wid { color: var(--muted); font-size: 0.8rem; font-family: 'SF Mono', ui-monospace, monospace; }
.suite-name { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.suite-stats { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.btn-run-suite { opacity: 0; transition: opacity var(--transition-fast); }
.suite > summary:hover .btn-run-suite, .btn-run-suite:focus { opacity: 1; }
.suite-progress { margin-top: 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.progress-bar { flex: 1; max-width: 200px; height: 6px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; display: flex; }
.progress-pass { background: var(--pass); transition: width 0.5s ease; }
.progress-fail { background: var(--fail); transition: width 0.5s ease; }
.progress-label { font-size: 0.78rem; color: var(--muted); }

/* === Suite Body === */
.suite-body { padding: 0 1.25rem 1rem; animation: fadeSlideIn 0.2s ease; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* === Test Cases === */
.test-case { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); margin-bottom: 0.375rem; transition: border-color var(--transition-fast), background var(--transition-fast); }
.test-case > summary { padding: 0.55rem 0.75rem; cursor: pointer; list-style: none; }
.test-case > summary::-webkit-details-marker { display: none; }
.test-case:hover { border-color: var(--border); background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.test-case.marked-exclude { border-color: var(--orange); background: rgba(250,179,135,0.1); }
.case-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.88rem; }
.case-id { color: var(--muted); font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.78rem; min-width: 2.5rem; }
.case-wid { color: var(--muted); font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.78rem; }
.case-name { font-weight: 500; }
.case-badges { margin-left: auto; display: flex; gap: 0.35rem; align-items: center; flex-shrink: 0; }

/* === Badges (pill style) === */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-full); font-weight: 600; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.4; }
.badge.pass { background: var(--pass); color: #11111b; }
.badge.fail { background: var(--fail); color: #11111b; }
.badge.skip { background: var(--skip); color: #11111b; }
.badge.blocked { background: var(--blocked); color: #11111b; }
.badge.untested { background: var(--untested-bg); color: var(--muted); }
.model-badge { display: inline-flex; align-items: center; background: rgba(137,180,250,0.15); color: var(--primary); padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 500; }
.knowledge-badge { display: inline-flex; align-items: center; background: var(--purple-bg); color: var(--purple); padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 500; }
.step-count { color: var(--muted); font-size: 0.75rem; }
.badge-curation { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em; }
.cur-curated { background: var(--pass-bg); color: var(--pass); }
.cur-explored { background: var(--purple-bg); color: var(--purple); }
.cur-needs-steps { background: var(--skip-bg); color: var(--skip); }
.badge-source { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.6rem; font-weight: 500; background: var(--primary-bg); color: var(--primary); }

/* === Case Body === */
.case-body { padding: 0.75rem; border-top: 1px solid var(--border-subtle); animation: fadeSlideIn 0.15s ease; }
.case-desc { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; line-height: 1.5; }
.case-precond { font-size: 0.85rem; margin-bottom: 0.5rem; }
.last-run { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.75rem; padding: 0.375rem 0.5rem; background: var(--bg); border-radius: var(--radius-sm); }
.case-hints { font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--skip); background: rgba(249,226,175,0.1); padding: 0.375rem 0.5rem; border-radius: var(--radius-sm); }
.case-expected { font-size: 0.85rem; margin-bottom: 0.5rem; }

/* === Knowledge Section === */
.knowledge-section { background: rgba(203,166,247,0.08); border: 1px solid rgba(203,166,247,0.2); border-radius: var(--radius-sm); padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; font-size: 0.85rem; }
.selectors-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }
.selectors-grid code { background: var(--border); padding: 2px 6px; border-radius: var(--radius-sm); font-size: 0.78rem; font-family: 'SF Mono', ui-monospace, monospace; }
.sel-name { color: var(--purple); font-weight: 600; }

/* === Steps Table === */
.steps-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.steps-table th { text-align: left; padding: 0.4rem 0.5rem; background: var(--bg); color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.steps-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.step-num { width: 2rem; color: var(--muted); text-align: center; font-family: 'SF Mono', ui-monospace, monospace; }
.step-expected { color: var(--muted); font-style: italic; }

/* === Hints Section === */
.hints-section { margin-top: 1.5rem; }
.hints-stats { display: flex; gap: 1.5rem; margin-top: 0.75rem; }
.hint-stat { text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem 1rem; box-shadow: var(--shadow-sm); }
.hint-num { display: block; font-size: 1.5rem; font-weight: 700; }
.hint-lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hint-new { color: var(--primary); }
.hint-exploring { color: var(--skip); }
.hint-covered { color: var(--pass); }
.hint-irrelevant { color: var(--muted); }

/* === Case Selection === */
.exclude-cb-wrap { display: inline-flex; align-items: center; margin-right: 0.25rem; }
.exclude-cb { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.category-cb-wrap { display: inline-flex; align-items: center; margin-right: 0.25rem; }
.category-cb-wrap input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.selection-bar { display: none; position: fixed; bottom: 0; left: var(--sidebar-width); right: 0; background: var(--card); color: var(--text); padding: 0.75rem 2rem; z-index: 200; align-items: center; gap: 1rem; border-top: 1px solid var(--border); box-shadow: 0 -4px 12px rgba(0,0,0,0.15); transition: left var(--transition-normal); }
.sidebar.collapsed ~ .main-area ~ .selection-bar,
.sidebar.collapsed ~ .selection-bar { left: var(--sidebar-collapsed); }
.selection-bar.visible { display: flex; }
.selection-bar .count { font-size: 1.1rem; font-weight: 600; color: var(--primary); }
.selection-bar button { padding: 0.5rem 1rem; border: none; border-radius: var(--radius-sm); font-size: 0.875rem; cursor: pointer; font-weight: 500; font-family: inherit; transition: all var(--transition-fast); }
.selection-bar .btn-select-all { background: var(--primary); color: #11111b; opacity: 0.75; }
.selection-bar .btn-select-all:hover { opacity: 1; }
.selection-bar .btn-ai-edit { background: var(--primary); color: #11111b; }
.selection-bar .btn-ai-edit:hover { opacity: 0.85; }
.selection-bar .btn-apply { background: var(--orange); color: #11111b; }
.selection-bar .btn-apply:hover { background: var(--orange-hover); }
.selection-bar .btn-export { background: var(--border); color: var(--text); }
.selection-bar .btn-export:hover { background: #585b70; }
.selection-bar .btn-cancel { background: var(--border); color: var(--text); }
.selection-bar .btn-cancel:hover { background: #585b70; }

/* === Discoveries === */
.discoveries-section { margin-top: 1.5rem; }
.section-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.75rem; letter-spacing: -0.01em; }
.disc-count { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.section-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.discovery-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.875rem 1rem; margin-bottom: 0.5rem; background: var(--card); border-left: 4px solid var(--muted); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition-fast); }
.discovery-card:hover { box-shadow: var(--shadow-md); }
.discovery-card.prio-high { border-left-color: var(--fail); }
.discovery-card.prio-med { border-left-color: var(--skip); }
.discovery-card.prio-low { border-left-color: var(--muted); }
.disc-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.88rem; }
.disc-id { color: var(--muted); font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.78rem; }
.badge-prio { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-prio.prio-high { background: var(--fail-bg); color: var(--fail); }
.badge-prio.prio-med { background: var(--skip-bg); color: var(--skip); }
.badge-prio.prio-low { background: var(--bg); color: var(--muted); }
.badge-status { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-status.new { background: var(--primary-bg); color: var(--primary); }
.badge-status.reviewed { background: var(--skip-bg); color: var(--skip); }
.badge-status.added { background: var(--pass-bg); color: var(--pass); }
.disc-desc { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.disc-meta { display: flex; gap: 1rem; font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; flex-wrap: wrap; }
.disc-steps { margin-top: 0.5rem; font-size: 0.85rem; }
.disc-steps ol { padding-left: 1.5rem; margin-top: 0.25rem; }
.disc-steps li { margin-bottom: 0.15rem; }
.disc-actions { margin-top: 0.5rem; display: flex; gap: 0.5rem; }
.disc-actions .btn-promote { padding: 0.35rem 0.75rem; border: 1px solid var(--pass); border-radius: var(--radius-sm); background: transparent; cursor: pointer; font-size: 0.8rem; color: var(--pass); font-weight: 500; font-family: inherit; transition: all var(--transition-fast); }
.disc-actions .btn-promote:hover { background: var(--pass-bg); }
.disc-actions .btn-dismiss { padding: 0.35rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; cursor: pointer; font-size: 0.8rem; color: var(--muted); font-weight: 500; font-family: inherit; transition: all var(--transition-fast); }
.disc-actions .btn-dismiss:hover { background: var(--fail-bg); color: var(--fail); border-color: var(--fail); }

/* === Modal === */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17,17,27,0.7); z-index: 500; opacity: 0; transition: opacity 0.2s; pointer-events: none; backdrop-filter: blur(4px); }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 501; max-width: 480px; width: 92%; max-height: 85vh; display: flex; flex-direction: column; opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.modal.modal-md { max-width: 560px; }
.modal.modal-lg { max-width: 680px; }
.modal-backdrop.open .modal { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-header h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--muted); padding: 0.25rem; line-height: 1; transition: color var(--transition-fast); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-body:has(#tdm-content) { overflow: visible; }
.modal-body .form-group { margin-bottom: 1.25rem; }
.modal-body .form-label { margin-bottom: 0.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; flex-shrink: 0; }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.825rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.35rem; }
.form-input, .form-select { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; font-family: inherit; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); background: var(--bg); color: var(--text); }
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(137,180,250,0.15); outline: none; }
.form-input::placeholder { color: var(--muted); }
.form-select option { background: var(--card); color: var(--text); }

/* === Active Run Panel === */
.run-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.run-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.run-panel-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.run-panel-title .live-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--pass); animation: pulse 1.5s infinite; }
.run-elapsed { font-size: 0.8rem; color: var(--muted); font-family: 'SF Mono', ui-monospace, monospace; }
.run-progress-bar { width: 100%; height: 10px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; display: flex; margin-bottom: 0.75rem; }
.run-progress-bar > div { transition: width 0.4s ease; height: 100%; }
.run-progress-pass { background: var(--pass); }
.run-progress-fail { background: var(--fail); }
.run-progress-skip { background: var(--skip); }
.run-progress-blocked { background: var(--blocked); }
.run-stats-row { display: flex; gap: 1rem; font-size: 0.825rem; color: var(--text-secondary); flex-wrap: wrap; margin-bottom: 0.75rem; }
.run-stats-row span { display: inline-flex; align-items: center; gap: 0.25rem; }
.run-stats-row .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
/* --- Run Console (terminal-style log) --- */
.run-console { background: var(--bg); border-radius: var(--radius-md); max-height: 400px; overflow-y: auto; padding: 0.75rem 1rem; margin-top: 0.75rem; scroll-behavior: smooth; }
.run-console::-webkit-scrollbar { width: 6px; }
.run-console::-webkit-scrollbar-track { background: var(--bg); }
.run-console::-webkit-scrollbar-thumb { background: #45475a; border-radius: 3px; }
.run-console-line { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.3rem 0; font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', ui-monospace, monospace; font-size: 0.78rem; line-height: 1.5; border-bottom: 1px solid #2a2a3c; animation: fadeSlideIn 0.15s ease; }
.run-console-line:last-child { border-bottom: none; }
.run-console-ts { color: #6c7086; white-space: nowrap; flex-shrink: 0; }
.run-console-status { font-weight: 700; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; min-width: 5ch; }
.run-console-status.pass { color: #a6e3a1; }
.run-console-status.fail { color: #f38ba8; }
.run-console-status.skip { color: #f9e2af; }
.run-console-status.blocked { color: #9399b2; }
.run-console-ref { color: #89b4fa; white-space: nowrap; flex-shrink: 0; }
.run-console-name { color: #cdd6f4; flex: 1; min-width: 0; }
.run-console-model { color: #89b4fa; opacity: 0.7; font-size: 0.7rem; flex-shrink: 0; }
.run-console-meta { color: #a6adc8; font-size: 0.72rem; font-style: italic; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; flex-shrink: 0; }
.run-console-meta.expanded { white-space: normal; max-width: none; }
.run-console-discoveries { color: #fab387; font-size: 0.72rem; flex-shrink: 0; }
.run-console-completion { color: #a6e3a1; font-weight: 600; padding: 0.5rem 0 0.25rem; border-top: 1px solid #45475a; margin-top: 0.25rem; display: flex; align-items: center; gap: 0.5rem; font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', ui-monospace, monospace; font-size: 0.78rem; }
/* Per-suite stats during run */
.run-suite-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.run-suite-stat { flex: 1; min-width: 180px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.5rem 0.65rem; }
.run-suite-stat-header { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; margin-bottom: 0.35rem; }
.run-suite-stat-name { font-weight: 500; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-suite-stat-progress { color: var(--muted); font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.72rem; }
.run-suite-stat-counts { display: flex; gap: 0.35rem; font-size: 0.7rem; font-weight: 600; font-family: 'SF Mono', ui-monospace, monospace; }
.run-suite-stat-bar { height: 4px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; display: flex; }
.run-suite-stat-bar > div { transition: width 0.4s ease; }
.run-console-empty { color: #6c7086; font-style: italic; padding: 1rem 0; text-align: center; font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', ui-monospace, monospace; font-size: 0.78rem; }
/* --- Agent execution log lines --- */
.run-console-agent { opacity: 0.75; }
.run-console-agent-prefix { color: #585b70; font-weight: 600; text-transform: uppercase; font-size: 0.7rem; min-width: 5ch; flex-shrink: 0; }
.run-console-agent-text { color: #9399b2; flex: 1; min-width: 0; word-break: break-word; }
.run-console-agent.agent-error { opacity: 1; }
.run-console-agent.agent-error .run-console-agent-prefix { color: #f38ba8; }
.run-console-agent.agent-error .run-console-agent-text { color: #f38ba8; }
.run-console-agent.agent-tool .run-console-agent-prefix { color: #89b4fa; }
.run-console-agent.agent-tool .run-console-agent-text { color: #a6adc8; }
.run-console-agent.agent-info .run-console-agent-prefix { color: #a6e3a1; }
.run-console-agent.agent-info .run-console-agent-text { color: #cdd6f4; }
.batch-progress-bar { padding: 0.5rem 0; }
.batch-progress-info { font-size: 0.82rem; color: #89b4fa; margin-bottom: 0.35rem; font-weight: 600; }
.batch-progress-track { width: 100%; height: 6px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.batch-progress-fill { height: 100%; background: #89b4fa; border-radius: var(--radius-full); transition: width 0.4s ease; }
.run-console-toolbar { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0; font-size: 0.8rem; color: #a6adc8; }
.run-console-toolbar select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.2rem 0.5rem; font-size: 0.78rem; }
.run-completed-banner { background: var(--pass-bg); border: 1px solid var(--pass); border-radius: var(--radius-md); padding: 1rem; text-align: center; margin-bottom: 1rem; }
.run-completed-banner h3 { color: var(--pass); font-size: 1rem; margin-bottom: 0.25rem; }

/* === Run History === */
.run-history-table { width: 100%; border-collapse: collapse; }
.run-history-table th { text-align: left; padding: 0.6rem 0.75rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); background: var(--bg); }
.run-history-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem; }
.run-history-table tr { cursor: pointer; transition: background var(--transition-fast); }
.run-history-table tbody tr:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.run-row-id { color: var(--muted); font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.8rem; }
.run-row-name { font-weight: 500; }
.run-row-date { color: var(--muted); font-size: 0.8rem; }
.regression-badge { background: var(--fail-bg); color: var(--fail); padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 600; }
.run-detail-panel { padding: 0.75rem; background: var(--bg); border-radius: var(--radius-sm); margin: 0.5rem 0; animation: fadeSlideIn 0.2s ease; }
.run-detail-panel .mini-progress { height: 6px; border-radius: var(--radius-full); overflow: hidden; display: flex; margin-bottom: 0.5rem; background: var(--border); }

/* === Loading === */
.loading { text-align: center; padding: 4rem 2rem; color: var(--muted); font-size: 1rem; }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: absolute; inset: 0; background: rgba(17,17,27,0.7); display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: inherit; }

/* === Empty States === */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--muted); }
.empty-state-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.5; }
.empty-state-text { font-size: 0.9rem; }

/* === Toast === */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 600; display: flex; flex-direction: column-reverse; gap: 0.5rem; }
.toast { background: #313244; color: var(--text); padding: 0.75rem 1.25rem; border-radius: var(--radius-md); font-size: 0.875rem; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(0.5rem); transition: opacity 0.25s, transform 0.25s; pointer-events: none; display: flex; align-items: center; gap: 0.5rem; max-width: 400px; border: 1px solid var(--border); }
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.error { background: var(--fail); color: #11111b; border-color: var(--fail); }
.toast.success { background: var(--pass); color: #11111b; border-color: var(--pass); }
.toast.warning { background: var(--orange, #fab387); color: #11111b; border-color: var(--orange, #fab387); }
.toast-icon { flex-shrink: 0; }

/* MFA / Agent Waiting Banner */
.mfa-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: var(--orange, #fab387); color: #11111b;
  transform: translateY(-100%); transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.mfa-banner.visible { transform: translateY(0); }
.mfa-banner-content {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.5rem; max-width: 1200px; margin: 0 auto;
}
.mfa-banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.mfa-banner-text { flex: 1; }
.mfa-banner-text strong { display: block; font-size: 0.95rem; }
.mfa-banner-text span { font-size: 0.82rem; opacity: 0.85; }
.mfa-banner-btn {
  flex-shrink: 0; background: #11111b; color: var(--orange, #fab387);
  border: none; padding: 0.5rem 1.25rem; border-radius: var(--radius-md);
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
  transition: opacity var(--transition-fast);
}
.mfa-banner-btn:hover { opacity: 0.85; }

/* === Search Highlight === */
mark { background: rgba(249,226,175,0.3); color: var(--text); padding: 1px 2px; border-radius: 2px; }

/* === Utility === */
.hidden { display: none !important; }

/* === Settings Panel === */
.settings-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 1rem; overflow: hidden; }
.settings-section-header { padding: 1rem 1.25rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; transition: background var(--transition-fast); }
.settings-section-header:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.settings-section-header h3 { font-size: 0.95rem; font-weight: 600; }
.settings-section-header::after { content: '▾'; color: var(--muted); font-size: 0.8rem; transition: transform var(--transition-normal); }
.settings-section-header.collapsed::after { transform: rotate(-90deg); }
.settings-section-body { padding: 0 1.25rem 1.25rem; }
.settings-section-body.collapsed { display: none; }
.settings-row { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); }
.settings-row:last-child { border-bottom: none; }
.settings-row > label:first-child { flex: 0 0 180px; font-size: 0.85rem; color: var(--text-secondary); }
.settings-row input, .settings-row select { flex: 1; }
.settings-row .toggle-switch { flex: none; }
.settings-actions { padding-top: 0.75rem; display: flex; justify-content: flex-end; gap: 0.5rem; }

/* Schedule table */
.schedule-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.schedule-table th { text-align: left; padding: 0.5rem 0.75rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.schedule-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem; }
.schedule-table tbody tr:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 10px; cursor: pointer; transition: background var(--transition-fast); }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: white; top: 2px; left: 2px; transition: transform var(--transition-fast); }
.toggle-switch input:checked + .toggle-slider { background: var(--pass); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }
.toggle-sm { width: 30px; height: 17px; }
.toggle-sm .toggle-slider::before { width: 13px; height: 13px; }
.toggle-sm input:checked + .toggle-slider::before { transform: translateX(13px); }

/* === Bugs Split View === */
.bugs-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.75rem; }
.bugs-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.bugs-split { display: grid; grid-template-columns: 340px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); min-height: 500px; }
.bugs-list-panel { border-right: 1px solid var(--border); display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.bugs-list-search { padding: 0.6rem; border-bottom: 1px solid var(--border); }
.bugs-list-search .search-box { width: 100%; min-width: 0; }
.bugs-list-items { flex: 1; overflow-y: auto; }
.bugs-list-item { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background var(--transition-fast); border-left: 3px solid transparent; }
.bugs-list-item:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.bugs-list-item.active { background: rgba(137,180,250,0.08); border-left-color: var(--primary); }
.bugs-list-item-header { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.bugs-list-item-id { color: var(--muted); font-size: 0.72rem; font-family: 'SF Mono', ui-monospace, monospace; }
.bugs-list-item-status { margin-left: auto; font-size: 0.65rem; color: var(--muted); text-transform: uppercase; }
.bugs-list-item-title { font-weight: 500; font-size: 0.85rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bugs-list-item-date { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
.bugs-detail-panel { padding: 1.25rem; overflow-y: auto; max-height: calc(100vh - 220px); }
.bugs-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 300px; }
.bugs-detail-content { animation: fadeSlideIn 0.15s ease; }

.bug-severity-critical { border-left-color: var(--fail) !important; }
.bug-severity-high { border-left-color: var(--orange) !important; }
.bug-severity-medium { border-left-color: var(--skip) !important; }
.bug-severity-low { border-left-color: var(--muted) !important; }

/* Orchestrator log */
.agent-orchestrator { color: var(--orange) !important; }
.run-console-agent-prefix.orch-prefix { background: rgba(250,179,135,0.15); color: var(--orange); }

/* Assistant (AI reasoning) log */
.run-console-agent.agent-assistant .run-console-agent-prefix { color: var(--purple); }
.run-console-agent.agent-assistant .run-console-agent-text { color: var(--text); }

/* Default persona highlight */
.persona-default { border-left: 3px solid var(--orange); }

/* === Settings Panes === */
.settings-pane { display: none; }
.settings-pane.active { display: block; }
.settings-app-banner { background: var(--info-bg, rgba(137,180,250,0.12)); border: 1px solid var(--info, #89b4fa); border-radius: var(--radius-lg); padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; color: var(--text); }
.settings-app-banner-hint { color: var(--text-muted); font-size: 0.8rem; }
.settings-content-full { max-width: none; }
.settings-content-full .settings-pane { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.settings-content-full .settings-pane h3 { margin-bottom: 1rem; }
.settings-content-full .settings-section { border: none; margin-bottom: 0; }
.settings-content-full .settings-section-body { padding: 0; }

/* === Prompt Editor === */
.prompt-editor { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-subtle); }
.prompt-editor:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.prompt-editor-header { margin-bottom: 0.75rem; }
.prompt-editor-header strong { font-size: 0.9rem; }
.prompt-editor-desc { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }
.prompt-editor textarea { width: 100%; min-height: 200px; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', ui-monospace, monospace; font-size: 0.8rem; line-height: 1.6; resize: vertical; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.prompt-editor textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(137,180,250,0.15); outline: none; }
.prompt-variables { margin-top: 0.5rem; padding: 0.5rem 0.75rem; background: rgba(137,180,250,0.06); border-radius: var(--radius-sm); font-size: 0.78rem; }
.prompt-variables strong { font-size: 0.75rem; color: var(--text-secondary); display: block; margin-bottom: 0.35rem; }
.prompt-var { padding: 0.15rem 0; color: var(--text-secondary); }
.prompt-var code { background: var(--border); padding: 1px 5px; border-radius: 3px; font-size: 0.75rem; color: var(--primary); }
.prompt-editor-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
.prompt-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-left: 0.5rem; }
.prompt-badge.default { background: var(--primary-bg); color: var(--primary); }
.prompt-badge.customized { background: var(--skip-bg); color: var(--skip); }

/* === Category Groups === */
.category-group { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }
.category-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; background: var(--primary-bg); cursor: pointer; transition: background var(--transition-fast); user-select: none; }
.category-header:hover { background: rgba(137,180,250,0.12); }
[data-theme="light"] .category-header { background: rgba(79,70,229,0.04); }
[data-theme="light"] .category-header:hover { background: rgba(79,70,229,0.08); }
.category-color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.category-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.category-stats { font-size: 0.8rem; color: var(--muted); }
.category-body { padding: 0 0.75rem 0.75rem; }
.category-body .suite { border: 1px solid var(--border-subtle); }
.category-group.collapsed .category-body { display: none; }
.category-group.collapsed .category-header::after { transform: rotate(-90deg); }
.btn-run-category { opacity: 0; transition: opacity var(--transition-fast); margin-left: auto; }
.category-header:hover .btn-run-category { opacity: 1; }
.category-header::after { content: '▾'; color: var(--muted); font-size: 0.8rem; margin-left: 0.5rem; transition: transform var(--transition-normal); }

/* === Category Badges === */
.cat-badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
[data-theme="light"] .cat-badge { filter: saturate(1.4) brightness(0.55); }

/* === Category Filters === */
.category-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 0.25rem; vertical-align: middle; }
.cat-filter-btn { display: inline-flex; align-items: center; }

/* === Run Analytics === */
.run-analytics-wrap { padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.analytics-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.analytics-tab-btn { padding: 0.55rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-size: 0.85rem; font-weight: 500; cursor: pointer; font-family: inherit; transition: all var(--transition-fast); }
.analytics-tab-btn:hover { color: var(--text); background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.analytics-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.analytics-tab-content { animation: fadeSlideIn 0.15s ease; }
.analytics-empty { color: var(--muted); font-size: 0.85rem; padding: 1.5rem 0; }
.analytics-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.analytics-table { width: 100%; border-collapse: collapse; }
.analytics-table th { text-align: left; padding: 0.6rem 0.75rem; font-size: 0.75rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); background: var(--bg); }
.analytics-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem; }
.analytics-table tbody tr:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.sparkline-dots { display: inline-flex; gap: 4px; align-items: center; }
.sparkline-dots .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sparkline-dots .dot-pass { background: var(--pass); }
.sparkline-dots .dot-fail { background: var(--fail); }
.sparkline-dots .dot-skip { background: var(--skip); }
.sparkline-dots .dot-blocked { background: var(--blocked); }
.flakiness-bar { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }
.duration-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.875rem 1rem; margin-bottom: 0.75rem; }
.duration-group-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-subtle); }
.duration-group-name { font-weight: 600; font-size: 0.9rem; }
.duration-group-meta { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; }
.duration-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.3rem 0; }
.duration-date { font-size: 0.75rem; color: var(--muted); min-width: 110px; font-family: 'SF Mono', ui-monospace, monospace; }
.duration-bar-track { flex: 1; height: 8px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.duration-bar-fill { height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: width 0.4s ease; }
.duration-value { font-size: 0.78rem; color: var(--muted); min-width: 60px; text-align: right; font-family: 'SF Mono', ui-monospace, monospace; }
.duration-pass-rate { font-size: 0.72rem; font-weight: 600; min-width: 35px; text-align: right; }

/* === Exploration Panel (split layout) === */
.explore-top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.explore-top-tabs { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.explore-top-tab { padding: 0.5rem 1.25rem; background: var(--card); border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; font-weight: 500; font-family: inherit; transition: all var(--transition-fast); border-right: 1px solid var(--border); }
.explore-top-tab:last-child { border-right: none; }
.explore-top-tab:hover { color: var(--text); background: var(--hover-bg, rgba(205,214,244,0.06)); }
.explore-top-tab.active { background: var(--primary-bg); color: var(--primary); }
.explore-top-view { min-height: 400px; }
.explore-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.explore-split { display: grid; grid-template-columns: 280px 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); height: calc(100vh - 200px); }

/* List panel (left sidebar) */
.explore-list-panel { border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.explore-list-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.explore-list-item { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background var(--transition-fast); border-left: 3px solid transparent; }
.explore-list-item:hover { background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.explore-list-item.active { background: rgba(137,180,250,0.08); border-left-color: var(--primary); }
.explore-list-item.explore-running { border-left-color: var(--pass); }
.explore-list-item.explore-running.active { border-left-color: var(--primary); }
.explore-list-item-top { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.2rem; }
.explore-list-item-id { color: var(--muted); font-size: 0.72rem; font-family: 'SF Mono', ui-monospace, monospace; }
.explore-list-item-name { font-weight: 500; font-size: 0.85rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.explore-list-item-meta { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }

/* Detail panel (right) */
.explore-detail-panel { display: flex; flex-direction: column; overflow: hidden; }
.explore-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 300px; color: var(--muted); }
.explore-detail-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.explore-detail-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.explore-detail-title { font-size: 1rem; font-weight: 600; margin: 0; }
.explore-detail-url { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; word-break: break-all; }
.explore-detail-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.explore-detail-info { display: flex; align-items: center; gap: 0.65rem; margin-top: 0.65rem; flex-wrap: wrap; }
.explore-elapsed { font-size: 0.8rem; color: var(--muted); font-family: 'SF Mono', ui-monospace, monospace; }

/* Tabs */
.explore-detail-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--hover-bg-faint, rgba(205,214,244,0.02)); }
.explore-tab-btn { padding: 0.55rem 1rem; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; font-size: 0.85rem; font-family: inherit; transition: all var(--transition-fast); }
.explore-tab-btn:hover { color: var(--text); background: var(--hover-bg-subtle, rgba(205,214,244,0.04)); }
.explore-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* Tab body */
.explore-detail-body { flex: 1; overflow-y: auto; }

/* Overview tab */
.explore-overview { padding: 1.25rem; }
.explore-overview-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.explore-stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem; text-align: center; }
.explore-stat-num { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.explore-stat-lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.2rem; }
.explore-overview-coverage { margin-bottom: 1rem; }
.explore-overview-coverage-label { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 4px; }
.explore-overview-coverage-track { background: var(--border); border-radius: var(--radius-full); height: 8px; overflow: hidden; }
.explore-overview-coverage-fill { background: var(--pass); height: 100%; border-radius: var(--radius-full); transition: width 0.4s ease; }
.explore-overview-summary { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }
.explore-overview-meta { font-size: 0.82rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 0.35rem; }
.explore-overview-meta strong { color: var(--text); }

/* Log tab */
.explore-log-container { display: flex; flex-direction: column; height: 100%; }
.explore-log-toolbar { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.explore-log-status { font-size: 0.78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.35rem; margin-right: auto; }
.explore-log-container .run-console { flex: 1; max-height: none; border-radius: 0; margin-top: 0; }

/* Map tab */
.explore-map-container { display: flex; flex-direction: column; height: 100%; min-height: 450px; }
.explore-map-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1rem; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.explore-map-coverage { display: flex; align-items: center; gap: 0.75rem; font-size: 0.82rem; color: var(--text-secondary); }
.explore-map-coverage-track { width: 120px; height: 6px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.explore-map-coverage-fill { height: 100%; background: var(--pass); border-radius: var(--radius-full); }
.explore-map-controls { display: flex; gap: 0.5rem; align-items: center; }
.explore-map-autozoom-label { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.explore-map-autozoom-label input[type="checkbox"] { accent-color: var(--primary); }
.explore-map-empty { padding: 2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.explore-map-error { padding: 1rem; color: var(--fail); font-size: 0.85rem; }

/* Map detail slide-out panel */
.explore-map-detail-panel {
  position: absolute; top: 0; right: -300px; width: 300px; height: 100%;
  background: var(--card); border-left: 1px solid var(--border);
  overflow-y: auto; transition: right 0.3s ease; z-index: 10;
  box-shadow: var(--shadow-lg);
}
.explore-map-detail-panel.open { right: 0; }
.map-detail-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle); position: relative; }
.map-detail-close { position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.map-detail-close:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); color: var(--text-primary); }
.map-detail-title { font-size: 0.9rem; font-weight: 600; margin: 0 0 4px; padding-right: 24px; word-break: break-word; }
.map-detail-url { font-size: 0.72rem; color: var(--muted); word-break: break-all; margin-bottom: 6px; }
.map-detail-badges { display: flex; align-items: center; gap: 0.5rem; }
.map-detail-nav { font-size: 0.72rem; color: var(--text-secondary); margin-top: 4px; }
.map-detail-elements { padding: 0.5rem 0; }
.map-detail-empty { padding: 1rem; text-align: center; color: var(--muted); font-size: 0.82rem; }

/* Map elements (shared between map detail and old tree) */
.explore-map-element { display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.75rem; font-size: 0.8rem; }
.explore-map-element.uncovered { opacity: 0.6; }
.explore-map-element-icon { flex-shrink: 0; font-size: 0.75rem; }
.explore-map-element-type { color: var(--primary); font-weight: 500; font-size: 0.78rem; }
.explore-map-element-label { color: var(--text-secondary); }
.explore-map-element-action { color: var(--muted); font-size: 0.72rem; }
.explore-map-element-selector { background: var(--border); padding: 1px 4px; border-radius: 3px; font-size: 0.68rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Running animation */
.badge.running { background: var(--pass); color: #11111b; animation: pulse 2s infinite; }

@media (max-width: 768px) {
  .explore-split { grid-template-columns: 1fr; }
  .explore-list-panel { max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
  .explore-detail-panel { max-height: none; }
  .explore-overview-stats { grid-template-columns: repeat(2, 1fr); }
}

/* === Application Model === */
.app-model-section { margin-bottom: 2rem; }
.app-model-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.app-model-header-left { display: flex; align-items: center; gap: 0.75rem; }
.app-model-version { background: var(--primary-bg); color: var(--primary); padding: 2px 10px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; }
.app-model-stats { font-size: 0.85rem; color: var(--muted); }
.app-model-coverage-bar { margin-bottom: 1rem; }
.app-model-coverage-label { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 4px; }
.app-model-coverage-track { background: var(--border); border-radius: var(--radius-full); height: 8px; overflow: hidden; }
.app-model-coverage-fill { background: var(--pass); height: 100%; border-radius: var(--radius-full); transition: width 0.4s ease; }
.app-model-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.app-model-view { position: relative; overflow: hidden; }
.app-model-view-toggle { display: flex; gap: 0.25rem; }
.app-model-toolbar-right { display: flex; gap: 0.5rem; align-items: center; }

/* Graph controls toolbar (above the canvas) */
.app-model-graph-toolbar {
  display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end;
  padding: 0.4rem 0.75rem; background: var(--card); border: 1px solid var(--border);
  border-bottom: none; border-radius: 8px 8px 0 0;
}
.app-model-autozoom-label { display: flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.app-model-autozoom-label input[type="checkbox"] { accent-color: var(--primary); }

/* Graph detail panel (slide-out) */
.app-model-detail-panel { position: absolute; top: 0; right: -320px; width: 320px; height: 100%; background: var(--card); border-left: 1px solid var(--border); overflow-y: auto; transition: right 0.3s ease; z-index: 10; box-shadow: var(--shadow-lg); }
.app-model-detail-panel.open { right: 0; }
.detail-panel-header { padding: 1rem; border-bottom: 1px solid var(--border); position: relative; }
.detail-panel-header h3 { font-size: 1rem; font-weight: 600; margin: 0; padding-right: 2rem; }
.detail-close-btn { position: absolute; top: 0.75rem; right: 0.75rem; background: none; border: none; color: var(--muted); font-size: 1.25rem; cursor: pointer; padding: 0.25rem; line-height: 1; }
.detail-close-btn:hover { color: var(--text); }
.detail-url { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; word-break: break-all; }
.detail-screenshot { width: 100%; border-bottom: 1px solid var(--border); }
.detail-coverage { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.detail-coverage-label { font-size: 0.85rem; margin-bottom: 4px; }
.detail-coverage-bar { background: var(--border); border-radius: var(--radius-full); height: 6px; overflow: hidden; }
.detail-coverage-fill { background: var(--pass); height: 100%; border-radius: var(--radius-full); }
.detail-section { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle); }
.detail-section h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-secondary); }
.detail-element { font-size: 0.82rem; padding: 0.2rem 0; display: flex; align-items: center; gap: 0.35rem; }
.detail-element-icon { flex-shrink: 0; }
.detail-element-type { color: var(--primary); font-weight: 500; }
.detail-element-action { color: var(--muted); font-size: 0.75rem; }
.detail-element.uncovered { opacity: 0.7; }
.detail-nav-path { font-size: 0.82rem; color: var(--text-secondary); }
.detail-type-badge { display: inline-block; font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.25rem; }
.detail-screenshot-placeholder { padding: 2rem 1rem; text-align: center; background: var(--bg); color: var(--muted); font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.detail-child-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0; font-size: 0.82rem; }
.detail-child-icon { flex-shrink: 0; }
.detail-child-name { color: var(--text); flex: 1; }
.detail-child-count { color: var(--muted); font-size: 0.72rem; }
.detail-element-label { color: var(--text-secondary); }
.detail-nav-link { font-size: 0.82rem; padding: 0.2rem 0; display: flex; align-items: center; gap: 0.35rem; }
.detail-nav-trigger { color: var(--muted); font-size: 0.72rem; }

/* Test Generation Wizard */
.wizard-loading { text-align: center; padding: 3rem 1rem; }
.wizard-error { padding: 1.5rem; color: var(--fail); font-size: 0.9rem; }
.wizard-empty { padding: 2rem; text-align: center; color: var(--muted); font-size: 0.9rem; }
.wizard-proposal { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem 1rem; margin-bottom: 0.5rem; transition: border-color var(--transition-fast); }
.wizard-proposal:hover { border-color: var(--primary); }
.wizard-proposal-header { display: flex; align-items: flex-start; gap: 0.65rem; cursor: pointer; }
.wizard-proposal-info { flex: 1; }
.wizard-proposal-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; }
.wizard-proposal-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.78rem; }
.wizard-proposal-rationale { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; padding-left: 1.75rem; font-style: italic; }
.wizard-case { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 0.5rem; overflow: hidden; }
.wizard-case-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1rem; cursor: pointer; list-style: none; font-size: 0.88rem; }
.wizard-case-header::-webkit-details-marker { display: none; }
.wizard-case-body { padding: 0.5rem 1rem 1rem; border-top: 1px solid var(--border-subtle); }
.wizard-case-body .steps-table { margin-top: 0.25rem; }
.detail-screenshots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.5rem; }
.detail-screenshot-thumb img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.detail-screenshot-label { font-size: 0.7rem; color: var(--muted); text-align: center; margin-top: 2px; }

/* Graph context menu */
.app-model-context-menu { position: absolute; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 20; min-width: 220px; padding: 0.25rem 0; }
.context-menu-item { padding: 0.5rem 1rem; font-size: 0.85rem; cursor: pointer; transition: background var(--transition-fast); color: var(--text); }
.context-menu-item:hover { background: rgba(137,180,250,0.1); color: var(--primary); }
.context-menu-divider { border-top: 1px solid var(--border); margin: 0.25rem 0; }
.context-menu-danger { color: var(--fail) !important; }
.context-menu-danger:hover { background: rgba(243,139,168,0.15) !important; }

.detail-panel-header-actions { display: flex; justify-content: space-between; align-items: center; }
.detail-delete-btn { margin-left: auto; }

/* Orphaned pages report */
.orphaned-report { padding: 0.5rem 0; }
.orphaned-report-header { display: flex; align-items: baseline; gap: 1rem; padding: 0 0 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.orphaned-report-header h3 { margin: 0; font-size: 1.05rem; }
.orphaned-report-summary { font-size: 0.82rem; color: var(--muted); }
.orphaned-section { margin-bottom: 1.5rem; }
.orphaned-section h4 { margin: 0 0 0.25rem; font-size: 0.92rem; }
.orphaned-count { color: var(--muted); font-weight: 400; }
.orphaned-desc { font-size: 0.8rem; color: var(--muted); margin: 0 0 0.5rem; }
.orphaned-select-all { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; font-size: 0.82rem; }
.orphaned-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.82rem; }
.orphaned-item:hover { background: var(--bg-secondary); }
.orphaned-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orphaned-meta { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.orphaned-url { font-size: 0.78rem; color: var(--muted); word-break: break-all; }

/* Coverage gaps */
/* Coverage report */
.coverage-gap-group { margin-bottom: 1.5rem; }
.coverage-gap-subsystem { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.subsystem-name-editable { cursor: pointer; border-bottom: 1px dashed var(--muted); padding-bottom: 1px; }
.subsystem-name-editable:hover { border-bottom-color: var(--accent); color: var(--accent); }

.coverage-report-group { margin-bottom: 1.5rem; }
.coverage-report-subsystem { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.coverage-report-subsystem-stats { font-size: 0.82rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.coverage-report-subsystem-bar { width: 120px; height: 6px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; flex-shrink: 0; }
.coverage-report-subsystem-fill { height: 100%; background: var(--pass); border-radius: var(--radius-full); transition: width 0.3s; }

.coverage-report-page { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 0.35rem; overflow: hidden; }
.coverage-report-page-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.75rem; cursor: pointer; transition: background var(--transition-fast); }
.coverage-report-page-header:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); }
.coverage-report-page-chevron { font-size: 0.6rem; color: var(--muted); transition: transform 0.2s; flex-shrink: 0; width: 12px; }
.coverage-report-page-chevron.open { transform: rotate(90deg); }
.coverage-report-page-title { font-size: 0.85rem; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage-report-page-bar-wrap { flex-shrink: 0; width: 80px; }
.coverage-report-page-bar { display: block; height: 4px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.coverage-report-page-bar-fill { display: block; height: 100%; background: var(--pass); border-radius: var(--radius-full); }
.coverage-report-page-stats { font-size: 0.75rem; font-weight: 600; flex-shrink: 0; min-width: 42px; text-align: right; }
.coverage-report-page-stats.full { color: var(--pass); }
.coverage-report-page-stats.partial { color: var(--skip); }
.coverage-report-page-stats.none { color: var(--fail); }

.coverage-report-page-body { padding: 0.5rem 0.75rem 0.75rem 1.5rem; border-top: 1px solid var(--border); }
.coverage-report-covered-by { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; }
.coverage-report-covered-label { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
.coverage-report-suite-tag { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.7rem; background: rgba(137,180,250,0.12); color: var(--primary); padding: 2px 8px; border-radius: var(--radius-full); white-space: nowrap; }
.coverage-report-suite-result { font-size: 0.65rem; color: var(--pass); font-weight: 600; }
.coverage-report-run-tag { font-size: 0.7rem; background: rgba(166,227,161,0.12); color: var(--pass); padding: 2px 8px; border-radius: var(--radius-full); white-space: nowrap; }

.coverage-report-elements { display: flex; flex-direction: column; gap: 0.15rem; }
.coverage-report-element { font-size: 0.8rem; display: flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0; }
.coverage-report-check { width: 16px; text-align: center; flex-shrink: 0; font-size: 0.8rem; }
.coverage-report-element.covered .coverage-report-check { color: var(--pass); }
.coverage-report-element.uncovered .coverage-report-check { color: var(--fail); }
.coverage-report-element.uncovered { opacity: 0.7; }
.coverage-report-elem-type { font-size: 0.72rem; color: var(--muted); background: var(--border); padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.coverage-report-elem-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage-report-selector { background: var(--border); padding: 1px 5px; border-radius: 3px; font-size: 0.68rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }

/* Coverage levels */
.coverage-level-3 .coverage-report-check, .coverage-level-icon.coverage-level-3 { color: var(--pass); }
.coverage-level-2 .coverage-report-check, .coverage-level-icon.coverage-level-2 { color: var(--orange); }
.coverage-level-1 .coverage-report-check, .coverage-level-icon.coverage-level-1 { color: var(--skip); }
.coverage-level-0 .coverage-report-check, .coverage-level-icon.coverage-level-0 { color: var(--fail); }
.coverage-report-element.coverage-level-0 { opacity: 0.55; }
.coverage-report-element.coverage-level-1 { opacity: 0.8; }
.coverage-level-pill { display: inline-flex; align-items: center; font-size: 0.65rem; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-full); white-space: nowrap; margin-left: 0.25rem; }
.coverage-level-pill.coverage-level-3 { background: rgba(166,227,161,0.15); color: var(--pass); }
.coverage-level-pill.coverage-level-2 { background: rgba(250,179,135,0.15); color: var(--orange); }
.coverage-level-pill.coverage-level-1 { background: rgba(249,226,175,0.15); color: var(--skip); }
.coverage-level-summary { display: inline-flex; align-items: center; gap: 0.15rem; margin-left: 0.5rem; }
.coverage-report-level-breakdown { display: inline-flex; align-items: center; gap: 0.15rem; margin-left: 0.35rem; }

/* Version timeline */
.version-timeline { display: flex; flex-direction: column; gap: 0.5rem; }
.version-entry { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem 1rem; cursor: pointer; transition: border-color var(--transition-fast); }
.version-entry:hover { border-color: var(--primary); }
.version-entry-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.35rem; }
.version-badge { background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 700; }
.version-date { font-size: 0.78rem; color: var(--muted); }
.version-exploration { font-size: 0.78rem; color: var(--text-secondary); }
.version-entry-changes { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.version-change { font-size: 0.75rem; padding: 1px 6px; border-radius: var(--radius-sm); }
.version-change.added { background: var(--pass-bg); color: var(--pass); }
.version-change.updated { background: var(--skip-bg); color: var(--skip); }
.version-summary { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; font-style: italic; }

/* === Responsive === */

/* Tablet breakpoint */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .analytics-stats { grid-template-columns: repeat(2, 1fr); }
  .topbar .meta #meta-info { display: none; }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); position: fixed; width: 220px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-area { margin-left: 0 !important; }
  .sidebar-overlay.visible { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; }
  .sidebar-mobile-toggle { display: block; }
  .selection-bar { left: 0 !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; padding: 0.75rem; }
  .analytics-stats { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .topbar { padding: 0.75rem 1rem; gap: 0.5rem; flex-wrap: wrap; }
  .topbar h1 { font-size: 0.95rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .meta { gap: 0.5rem; }
  .topbar .meta #meta-info { display: none; }
  .topbar .meta .user-info #userName { display: none; }
  .content { padding: 0 0.75rem 1rem; }
  .settings-row { flex-direction: column; align-items: stretch; gap: 0.35rem; }
  .settings-row label { flex: none; }
  .suite-header { font-size: 0.9rem; }
  .suite-stats { font-size: 0.75rem; }
  .stat .num { font-size: 1.35rem; }
  .stat .lbl { font-size: 0.6rem; }
  .stat { padding: 0.65rem 0.5rem; }
  .bugs-split { grid-template-columns: 1fr; }
  .bugs-list-panel { max-height: 250px; border-right: none; border-bottom: 1px solid var(--border); }
  .bugs-detail-panel { max-height: none; }
}

/* Small mobile */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat .num { font-size: 1.15rem; }
  .topbar h1 { font-size: 0.85rem; }
  .suite-cards-grid { grid-template-columns: 1fr; }
}

/* === AI Agent Chat === */
.thinking-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
.case-pick-row:hover { background: var(--bg-secondary); }

/* === Login Page === */
#login-container {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-logo { margin-bottom: 1rem; }
.login-card h2 { margin: 0 0 1.5rem; color: var(--text); font-size: 1.25rem; }
.login-form .form-group { margin-bottom: 1rem; text-align: left; }
.login-form label { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; color: var(--text-secondary); }
.login-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
}
.login-form input:focus { outline: none; border-color: var(--primary); }
.login-form button[type="submit"] { width: 100%; margin-top: 0.5rem; padding: 0.65rem; }
.login-error { color: var(--fail); font-size: 0.85rem; margin-bottom: 0.5rem; }

/* === Sidebar App Switcher === */
.sidebar-app-switcher {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sidebar.collapsed .sidebar-app-switcher { display: none; }

.app-switcher-current {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  position: relative;
}
.app-switcher-current:hover {
  border-color: var(--primary);
  background: var(--hover-bg);
}
.app-switcher-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.app-switcher-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-switcher-chevron {
  color: var(--muted);
  font-size: 0.65rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.app-switcher-current.open .app-switcher-chevron { transform: rotate(180deg); }

.app-switcher-dropdown {
  position: fixed;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.app-switcher-dropdown.open { display: block; }

.app-switcher-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.app-switcher-item:hover {
  background: var(--hover-bg);
  color: var(--text);
}
.app-switcher-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}
.app-switcher-item .app-switcher-url {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-switcher-item-info {
  flex: 1;
  min-width: 0;
}
.app-switcher-divider {
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}
.app-switcher-manage {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--muted);
  transition: all var(--transition-fast);
}
.app-switcher-manage:hover {
  background: var(--hover-bg);
  color: var(--primary);
}
.app-switcher-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.35rem 0.6rem 0.15rem;
}
.user-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* === Log Detail Row === */
.log-row:hover { background: var(--primary-bg); }
.log-detail pre { white-space: pre-wrap; word-break: break-all; }

/* === Test Data Variables (Multivariate) === */
.var-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.5rem; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 600;
  background: var(--purple-bg); color: var(--purple);
}
.var-ref {
  background: var(--purple-bg); color: var(--purple);
  padding: 0.1rem 0.35rem; border-radius: var(--radius-sm);
  font-size: 0.85em; font-weight: 500;
}
.case-actions-row {
  display: flex; gap: 0.5rem; padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle); margin-top: 0.75rem;
}
.btn-test-data { font-size: 0.75rem; color: var(--purple); }
.btn-test-data:hover { background: var(--purple-bg); }

/* Test Data Modal */
.tdm-vars { margin-bottom: 1.25rem; }
.tdm-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.tdm-section-header h4 { margin: 0; font-size: 0.9rem; color: var(--text); }
.tdm-count {
  font-size: 0.8rem; color: var(--purple); font-weight: 600;
}
.tdm-count.warn { color: var(--orange); }
.tdm-count.blocked { color: var(--fail); }
.tdm-var-row {
  display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.5rem;
}
.tdm-var-name-wrap { width: 200px; flex-shrink: 0; }
.tdm-var-values-wrap { flex: 1; position: relative; }
.tdm-var-name, .tdm-var-name-custom {
  width: 100%; box-sizing: border-box;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.tdm-var-name-custom { margin-top: 0.35rem; }
.tdm-var-select {
  width: 100%; box-sizing: border-box;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); border-radius: var(--radius-sm);
  font-size: 0.82rem; cursor: pointer; appearance: auto;
}
.tdm-var-values {
  width: 100%; box-sizing: border-box;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.tdm-var-remove { font-size: 1.1rem; color: var(--muted); padding: 0.2rem 0.4rem; margin-top: 0.25rem; }
.tdm-var-remove:hover { color: var(--fail); }

/* Searchable single-select for variable names */
.tdm-searchselect { position: relative; }
.tdm-searchselect-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  background: var(--bg); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.82rem; min-height: 1.6rem;
  transition: border-color var(--transition-fast);
}
.tdm-searchselect-toggle:hover { border-color: var(--primary); }
.tdm-ss-value { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdm-searchselect-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.3));
  z-index: 300; max-height: 260px; overflow: hidden;
  min-width: 240px;
}
.tdm-searchselect-dropdown.open { display: flex; flex-direction: column; }
.tdm-ss-search {
  padding: 0.4rem 0.6rem; border: none; border-bottom: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.82rem;
  outline: none; width: 100%; box-sizing: border-box;
}
.tdm-ss-search::placeholder { color: var(--muted); }
.tdm-ss-options { overflow-y: auto; max-height: 210px; padding: 0.25rem 0; }
.tdm-ss-option {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.35rem 0.6rem; cursor: pointer; font-size: 0.82rem;
  transition: background var(--transition-fast);
}
.tdm-ss-option:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); }
.tdm-ss-option.selected { background: rgba(137,180,250,0.12); color: var(--primary); }
.tdm-ss-option-count { font-size: 0.7rem; color: var(--muted); flex-shrink: 0; }
.tdm-ss-custom { color: var(--muted); font-style: italic; }

/* Multi-select for values */
.tdm-multiselect { position: relative; }
.tdm-multiselect-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  background: var(--bg); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.82rem; min-height: 1.6rem;
  transition: border-color var(--transition-fast);
}
.tdm-multiselect-toggle:hover { border-color: var(--primary); }
.tdm-ms-placeholder { color: var(--muted); }
.tdm-ms-tag { color: var(--text); font-size: 0.8rem; }
.tdm-ms-chevron { font-size: 0.6rem; color: var(--muted); margin-left: 0.5rem; flex-shrink: 0; transition: transform var(--transition-fast); }
.tdm-multiselect-dropdown.open ~ .tdm-multiselect-toggle .tdm-ms-chevron,
.tdm-multiselect-dropdown.open + .tdm-ms-chevron { transform: rotate(180deg); }
.tdm-multiselect-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.3));
  z-index: 300; max-height: 220px; overflow-y: auto;
  padding: 0.25rem 0;
}
.tdm-multiselect-dropdown.open { display: block; }
.tdm-ms-option {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.6rem; cursor: pointer; font-size: 0.82rem;
  transition: background var(--transition-fast);
}
.tdm-ms-option:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); }
.tdm-ms-option input[type="checkbox"] { accent-color: var(--primary); cursor: pointer; }
.tdm-ms-all { font-weight: 600; color: var(--primary); }
.tdm-ms-divider { border-top: 1px solid var(--border); margin: 0.2rem 0.5rem; }

.tdm-preview { margin-top: 1rem; }
.tdm-combo-table-wrap {
  max-height: 300px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.tdm-combo-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
}
.tdm-combo-table th {
  padding: 0.35rem 0.5rem; background: var(--bg);
  border-bottom: 1px solid var(--border); text-align: left;
  font-weight: 600; color: var(--text-secondary); position: sticky; top: 0;
}
.tdm-combo-table td {
  padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border-subtle);
}
.tdm-combo-table tr.tdm-disabled { opacity: 0.4; }
.tdm-combo-table tr:hover { background: var(--primary-bg); }

.tdm-warning {
  margin-top: 1rem; padding: 0.75rem;
  background: var(--fail-bg); border-radius: var(--radius-sm);
  color: var(--fail); font-size: 0.82rem; font-weight: 500;
}
.tdm-preview-count { font-size: 0.75rem; color: var(--muted); }

/* === Potential Variables Modal === */
/* --- Variables Panel --- */
.pv-stats {
  display: flex; gap: 12px; margin-bottom: 1rem;
}
.pv-stat {
  display: flex; flex-direction: column; align-items: center; padding: 10px 18px;
  border-radius: var(--radius); background: var(--card, #fff); border: 1px solid var(--border);
  min-width: 80px; transition: border-color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}
.pv-stat:hover { border-color: var(--primary); }
.pv-stat.active { border-color: var(--primary); background: var(--primary-bg); }
.pv-stat-num { font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.pv-stat.active .pv-stat-num { color: var(--primary); }
.pv-stat-label { font-size: 0.68rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.pv-stat[data-filter="pending"] .pv-stat-num { color: var(--warning, #f59e0b); }
.pv-stat[data-filter="confirmed"] .pv-stat-num { color: var(--pass); }
.pv-stat[data-filter="dismissed"] .pv-stat-num { color: var(--muted); }
.pv-stat[data-filter="all"].active .pv-stat-num { color: var(--primary); }

.pv-empty { text-align: center; padding: 3rem 2rem; color: var(--text-secondary); font-size: 0.85rem; }
.pv-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; display: block; }
.pv-empty-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; }

.pv-page-group { margin-bottom: 1.25rem; }
.pv-page-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--card, #1e1e2e); border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer;
  transition: background var(--transition-fast);
}
.pv-page-header:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); }
.pv-page-chevron {
  font-size: 0.7rem; color: var(--muted); transition: transform var(--transition-fast);
  width: 14px; text-align: center; flex-shrink: 0;
}
.pv-page-group.collapsed .pv-page-chevron { transform: rotate(-90deg); }
.pv-page-group.collapsed .pv-page-items { display: none; }
.pv-page-url {
  font-size: 0.78rem; font-weight: 600; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex: 1; font-family: monospace;
}
.pv-page-count {
  font-size: 0.68rem; color: var(--text-secondary); background: var(--border);
  padding: 1px 8px; border-radius: 10px; white-space: nowrap;
}

.pv-item {
  padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card, #fff);
  border-left: 3px solid var(--blocked); transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.pv-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.pv-item.confirmed { border-left-color: var(--pass); }
.pv-item.pending { border-left-color: var(--warning, #f59e0b); }
.pv-item.dismissed { border-left-color: var(--border); opacity: 0.5; }
.pv-item.dismissed:hover { opacity: 0.75; }

.pv-item-header { display: flex; align-items: center; gap: 8px; }
.pv-item-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.pv-element-label { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.pv-selector {
  font-size: 0.66rem; color: var(--muted); background: var(--code-bg, rgba(0,0,0,0.06));
  padding: 2px 6px; border-radius: 3px; font-family: monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px;
}
.pv-linked { font-size: 0.72rem; color: var(--pass); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.pv-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.pv-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.pv-status-dot.pending { background: var(--warning, #f59e0b); }
.pv-status-dot.confirmed { background: var(--pass); }
.pv-status-dot.dismissed { background: var(--muted); }

.pv-body { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }

.pv-var-name-row { display: flex; align-items: center; gap: 8px; }
.pv-var-name-row label { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.pv-var-name {
  font-size: 0.8rem; padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--code-bg, rgba(0,0,0,0.04)); font-family: 'SF Mono', 'Fira Code', monospace; width: 200px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  color: var(--text);
}
.pv-var-name:focus {
  border-color: var(--primary); background: var(--card, #fff);
  outline: none; box-shadow: 0 0 0 2px var(--primary-bg);
}

.pv-values { display: flex; flex-wrap: wrap; gap: 5px; }
.pv-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; border-radius: 12px; font-size: 0.72rem;
  background: var(--blue-bg, #e3f2fd); color: var(--blue, #1976d2); white-space: nowrap;
  border: 1px solid transparent; transition: background var(--transition-fast);
}
.pv-chip:hover { background: var(--primary-bg); }
.pv-chip-tech { font-size: 0.63rem; opacity: 0.6; }
.pv-values-label { font-size: 0.68rem; color: var(--muted); margin-right: 2px; white-space: nowrap; }
.pv-values-row { display: flex; align-items: baseline; gap: 6px; }
.pv-values-count { font-size: 0.68rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* Link panel overlay */
.pv-link-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px); animation: pv-fade-in 0.15s ease-out;
}
@keyframes pv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pv-slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.pv-link-panel {
  background: var(--card, #fff); border-radius: var(--radius); padding: 1.5rem;
  width: 520px; max-height: 70vh; overflow: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25); animation: pv-slide-up 0.2s ease-out;
  border: 1px solid var(--border);
}
.pv-link-panel h4 { margin: 0 0 4px; font-size: 1rem; }
.pv-link-panel-subtitle { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 14px; }
.pv-case-search {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.82rem; margin-bottom: 10px; background: var(--code-bg, rgba(0,0,0,0.04));
  color: var(--text); transition: border-color var(--transition-fast);
}
.pv-case-search:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px var(--primary-bg); }
.pv-case-list { max-height: 300px; overflow: auto; }
.pv-case-section-label {
  font-size: 0.68rem; color: var(--muted); padding: 8px 0 4px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pv-case-option {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 8px 12px; border: none; background: none; cursor: pointer;
  font-size: 0.82rem; text-align: left; border-radius: var(--radius-sm);
  transition: background var(--transition-fast); color: var(--text);
}
.pv-case-option:hover { background: var(--primary-bg); }
.pv-case-suite { font-size: 0.7rem; color: var(--text-secondary); }

.btn-xs { padding: 3px 10px; font-size: 0.72rem; border-radius: var(--radius-sm); }

/* --- Matching Matrix Panel --- */
.mm-loading { text-align: center; padding: 3rem; color: var(--text-secondary); }

.mm-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 12px;
}
.mm-header-left { display: flex; flex-direction: column; gap: 2px; }
.mm-title { margin: 0; font-size: 1.15rem; }
.mm-subtitle { font-size: 0.78rem; color: var(--text-secondary); }
.mm-header-actions { display: flex; gap: 8px; align-items: center; }

.mm-stats-row {
  display: flex; gap: 10px; margin-bottom: 1rem;
}
.mm-mini-stat {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-secondary);
}
.mm-mini-num { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.mm-mini-label { font-size: 0.72rem; }
.mm-stat-good .mm-mini-num { color: var(--pass); }

.mm-legend {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 1rem; flex-wrap: wrap;
}
.mm-legend-title { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.mm-legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--text-secondary); }

.mm-persona-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.mm-persona-color-1 { background: #89b4fa; }
.mm-persona-color-2 { background: #a6e3a1; }
.mm-persona-color-3 { background: #f9e2af; }
.mm-persona-color-4 { background: #cba6f7; }
.mm-persona-color-5 { background: #f38ba8; }
.mm-persona-color-6 { background: #94e2d5; }
.mm-persona-none { background: var(--border); }

.mm-table-wrapper {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; max-height: calc(100vh - 320px);
}
.mm-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.mm-table thead { position: sticky; top: 0; z-index: 2; }
.mm-table th {
  background: var(--card); border-bottom: 2px solid var(--border);
  padding: 10px 12px; text-align: left; font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary);
  white-space: nowrap;
}
.mm-th-suite { min-width: 300px; }
.mm-matrix .mm-th-suite { min-width: unset; }
.mm-th-status { width: 120px; }
.mm-th-persona { width: 180px; }
.mm-th-vars { min-width: 200px; }

/* Suite rows */
.mm-suite-row {
  cursor: pointer; transition: background var(--transition-fast);
  background: var(--card);
}
.mm-suite-row:hover { background: var(--hover-bg, rgba(205,214,244,0.06)); }
.mm-suite-row td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.mm-td-suite { display: flex; align-items: center; gap: 8px; }
.mm-matrix .mm-td-suite { display: table-cell; }
.mm-suite-content { display: flex; align-items: center; gap: 8px; }
.mm-suite-chevron { font-size: 0.7rem; color: var(--muted); width: 14px; text-align: center; }
.mm-suite-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-suite-count {
  font-size: 0.68rem; color: var(--muted); background: var(--border);
  padding: 1px 8px; border-radius: 10px; font-weight: 500; white-space: nowrap;
}

/* Status mini bar */
.mm-status-bar {
  display: flex; width: 80px; height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--border);
}
.mm-bar-pass { background: var(--pass); }
.mm-bar-fail { background: var(--fail, #f38ba8); }
.mm-bar-other { background: var(--border); }

/* Case rows */
.mm-case-row { transition: background var(--transition-fast); }
.mm-case-row:hover { background: var(--hover-bg, rgba(205,214,244,0.04)); }
.mm-case-row td { padding: 7px 12px; border-bottom: 1px solid var(--border-subtle, var(--border)); }
.mm-td-case { display: flex; align-items: center; gap: 6px; }
.mm-case-indent { width: 24px; flex-shrink: 0; }
.mm-case-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }

.mm-td-status { white-space: nowrap; }
.mm-status-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.mm-dot-pass { background: var(--pass); }
.mm-dot-fail { background: var(--fail, #f38ba8); }
.mm-dot-none { background: var(--muted); opacity: 0.4; }
.mm-status-label { font-size: 0.72rem; color: var(--text-secondary); }

/* Persona cells */
.mm-persona-cell {
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; padding: 3px 6px; transition: all var(--transition-fast);
  display: inline-flex; align-items: center;
}
.mm-persona-cell:hover { border-color: var(--primary); background: var(--primary-bg); }
.mm-persona-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
  border-radius: 12px; font-size: 0.72rem; font-weight: 500; white-space: nowrap;
}
.mm-persona-badge.mm-persona-color-1 { background: rgba(137,180,250,0.15); color: #89b4fa; }
.mm-persona-badge.mm-persona-color-2 { background: rgba(166,227,161,0.15); color: #a6e3a1; }
.mm-persona-badge.mm-persona-color-3 { background: rgba(249,226,175,0.15); color: #f9e2af; }
.mm-persona-badge.mm-persona-color-4 { background: rgba(203,166,247,0.15); color: #cba6f7; }
.mm-persona-badge.mm-persona-color-5 { background: rgba(243,139,168,0.15); color: #f38ba8; }
.mm-persona-badge.mm-persona-color-6 { background: rgba(148,226,213,0.15); color: #94e2d5; }
.mm-persona-badge.mm-persona-none { background: var(--border); color: var(--muted); }
.mm-persona-badge.mm-inherited { opacity: 0.7; }
.mm-inherit-tag {
  font-size: 0.6rem; opacity: 0.6; padding: 0 4px; background: rgba(255,255,255,0.1);
  border-radius: 3px; margin-left: 2px;
}
.mm-persona-empty { color: var(--muted); font-size: 0.75rem; }
.mm-coverage-frac { font-size: 0.72rem; color: var(--muted); }

/* Light theme persona badge adjustments */
[data-theme="light"] .mm-persona-badge.mm-persona-color-1 { background: rgba(79,70,229,0.1); color: #4338CA; }
[data-theme="light"] .mm-persona-badge.mm-persona-color-2 { background: rgba(22,163,74,0.1); color: #15803d; }
[data-theme="light"] .mm-persona-badge.mm-persona-color-3 { background: rgba(234,179,8,0.1); color: #a16207; }
[data-theme="light"] .mm-persona-badge.mm-persona-color-4 { background: rgba(147,51,234,0.1); color: #7e22ce; }
[data-theme="light"] .mm-persona-badge.mm-persona-color-5 { background: rgba(239,68,68,0.1); color: #dc2626; }
[data-theme="light"] .mm-persona-badge.mm-persona-color-6 { background: rgba(20,184,166,0.1); color: #0d9488; }

/* Variable chips in matrix */
.mm-var-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.mm-var-chip {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px;
  border-radius: 10px; font-size: 0.68rem; background: var(--blue-bg, #e3f2fd);
  color: var(--blue, #1976d2); white-space: nowrap;
}
.mm-var-count { font-size: 0.62rem; opacity: 0.6; }
.mm-no-vars { color: var(--muted); font-size: 0.72rem; }

/* Persona dropdown */
.mm-persona-dropdown {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2); min-width: 200px; max-width: 300px;
  overflow: hidden; animation: pv-slide-up 0.12s ease-out;
}
.mm-dd-header {
  padding: 8px 12px; font-size: 0.72rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border);
}
.mm-dd-option {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px;
  border: none; background: none; cursor: pointer; font-size: 0.82rem;
  text-align: left; color: var(--text); transition: background var(--transition-fast);
}
.mm-dd-option:hover { background: var(--primary-bg); }
.mm-dd-option.active { background: var(--primary-bg); font-weight: 600; }
.mm-dd-role { font-size: 0.68rem; color: var(--muted); margin-left: auto; }

/* AI context bar */
.mm-ai-context {
  margin-bottom: 0.75rem; padding: 8px 12px;
  background: var(--primary-bg); border: 1px solid var(--primary);
  border-radius: var(--radius-sm); font-size: 0.8rem;
}
.mm-ai-context-stats {
  display: flex; gap: 16px; color: var(--text-secondary); font-size: 0.78rem;
}

/* Matrix view */
.mm-filter-bar {
  display: flex; gap: 4px; margin-bottom: 1rem;
}
.mm-filter-btn {
  padding: 5px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text-secondary); font-size: 0.75rem;
  cursor: pointer; transition: all var(--transition-fast);
}
.mm-filter-btn:hover { border-color: var(--primary); color: var(--text); }
.mm-filter-btn.active {
  background: var(--primary); color: white; border-color: var(--primary); font-weight: 600;
}

.mm-matrix { table-layout: fixed; }
.mm-matrix .mm-table-wrapper { overflow-x: auto; }

/* Group header row */
.mm-group-header-row th {
  padding: 4px 8px; text-align: center; font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.mm-matrix-header-fixed { border-bottom: none !important; }
.mm-matrix-header-group { font-weight: 700; }
.mm-matrix-header-personas {
  color: #89b4fa; border-bottom: 2px solid rgba(137,180,250,0.4) !important;
}
.mm-matrix-header-vars {
  color: #a6e3a1; border-bottom: 2px solid rgba(166,227,161,0.4) !important;
}
[data-theme="light"] .mm-matrix-header-personas { color: #4338CA; border-bottom-color: rgba(79,70,229,0.3) !important; }
[data-theme="light"] .mm-matrix-header-vars { color: #15803d; border-bottom-color: rgba(22,163,74,0.3) !important; }

/* Column header labels */
.mm-th-persona-col, .mm-th-var-col {
  font-size: 0.65rem !important; text-align: center !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 2px !important;
}
.mm-th-persona-col .mm-persona-dot {
  display: inline-block; width: 7px; height: 7px; vertical-align: middle; margin-right: 2px;
}

/* Column widths — fixed layout */
.mm-col-suite { width: 100px; }
.mm-col-case { width: 240px; }
.mm-col-status { width: 90px; }
.mm-col-persona { width: 70px; }
.mm-col-var { width: 70px; }

/* Suite row — use inner flex wrapper instead of flex on td (breaks colspan) */
.mm-matrix .mm-td-suite { display: table-cell; }
.mm-suite-content { display: flex; align-items: center; gap: 8px; }
.mm-suite-content .mm-status-bar { flex-shrink: 0; }

/* Sticky first columns for horizontal scroll */
.mm-matrix .mm-sticky-col { position: sticky; z-index: 1; }
.mm-matrix .mm-sticky-col-1 { left: 0; }
.mm-matrix .mm-sticky-col-2 { left: 100px; }
.mm-matrix .mm-sticky-col-3 { left: 340px; }
.mm-case-row .mm-sticky-col { background: var(--bg); }
.mm-case-row:hover .mm-sticky-col { background: var(--hover-bg, rgba(205,214,244,0.04)); }
.mm-matrix thead .mm-sticky-col { background: var(--card); z-index: 3; }

.mm-td-suite-name { font-size: 0.7rem; color: var(--muted); }
.mm-matrix .mm-td-case { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Matrix cells */
.mm-td-matrix-cell { text-align: center; padding: 4px 2px !important; vertical-align: middle; }
.mm-matrix-cell-btn {
  background: none; border: 1px solid transparent; border-radius: 4px;
  cursor: pointer; padding: 2px; transition: all var(--transition-fast);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
}
.mm-matrix-cell-btn:hover { border-color: var(--primary); background: var(--primary-bg); }

.mm-matrix-check {
  color: var(--pass, #a6e3a1); font-size: 0.9rem; line-height: 1;
}
.mm-matrix-check.inherited {
  opacity: 0.45;
}
.mm-matrix-empty {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--border); opacity: 0.3;
}

/* ── AI Message Rich Formatting ── */
.ai-msg-rich { line-height: 1.5; }
.ai-msg-heading {
  font-weight: 700; font-size: 0.95rem; margin: 0.5rem 0 0.25rem;
  color: var(--text);
}
.ai-msg-heading:first-child { margin-top: 0; }
.ai-msg-subheading {
  font-weight: 600; font-size: 0.88rem; margin: 0.4rem 0 0.2rem;
  color: var(--text-secondary, var(--text));
}
.ai-msg-code {
  background: var(--bg-secondary, rgba(0,0,0,0.15)); padding: 1px 5px;
  border-radius: 3px; font-family: monospace; font-size: 0.82em;
}
.ai-msg-list {
  margin: 0.3rem 0; padding-left: 1.2rem; list-style: disc;
}
.ai-msg-list li { margin: 0.15rem 0; }
.ai-msg-checklist { list-style: none; padding-left: 0.2rem; }
.ai-msg-checkbox-item { margin: 0.2rem 0; }
.ai-msg-checkbox-item label {
  display: flex; align-items: center; gap: 0.4rem; cursor: pointer;
  padding: 0.2rem 0.4rem; border-radius: 4px; transition: background var(--transition-fast, 0.15s);
}
.ai-msg-checkbox-item label:hover { background: var(--primary-bg, rgba(137,180,250,0.1)); }
.ai-msg-cb {
  accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; flex-shrink: 0;
}
.ai-msg-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.75rem; margin: 0.3rem 0.25rem 0.3rem 0;
  background: var(--primary); color: white; border: none; border-radius: 6px;
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  transition: opacity var(--transition-fast, 0.15s);
}
.ai-msg-btn:hover { opacity: 0.85; }
.ai-msg-selection-status {
  margin-top: 0.4rem; padding-top: 0.3rem;
  border-top: 1px solid var(--border); font-size: 0.78rem;
  color: var(--primary); font-style: italic;
}

/* === Onboarding Wizard === */
.onboarding-backdrop {
  position: fixed; inset: 0; background: rgba(17,17,27,0.75);
  z-index: 600; opacity: 0; transition: opacity 0.2s;
  pointer-events: none; backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.onboarding-backdrop.open { opacity: 1; pointer-events: auto; }
.onboarding-wizard {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 560px; width: 92%; max-height: 85vh;
  display: flex; flex-direction: column;
  opacity: 0; transform: scale(0.95);
  transition: opacity 0.2s, transform 0.2s;
}
.onboarding-backdrop.open .onboarding-wizard { opacity: 1; transform: scale(1); }
.onboarding-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.onboarding-header h3 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.onboarding-stepper {
  display: flex; align-items: center; justify-content: center;
  padding: 1rem 1.5rem 0; gap: 0;
}
.onboarding-step {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  min-width: 60px;
}
.onboarding-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
  background: var(--border); color: var(--muted);
  transition: all var(--transition-fast);
}
.onboarding-step.active .onboarding-step-num {
  background: var(--primary); color: var(--bg);
}
.onboarding-step.completed .onboarding-step-num {
  background: var(--pass); color: var(--bg);
}
.onboarding-step-label {
  font-size: 0.7rem; color: var(--muted);
  transition: color var(--transition-fast);
}
.onboarding-step.active .onboarding-step-label { color: var(--text); }
.onboarding-step.completed .onboarding-step-label { color: var(--text-secondary); }
.onboarding-step-line {
  flex: 1; height: 2px; background: var(--border);
  margin: 0 0.25rem; margin-bottom: 1rem;
}
.onboarding-body {
  padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1;
}
.onboarding-field { margin-bottom: 1rem; }
.onboarding-field .form-label { display: block; margin-bottom: 0.35rem; }
.onboarding-field .field-hint {
  display: block; font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem;
}
.onboarding-actions {
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem;
}
.onboarding-summary-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border-subtle);
}
.onboarding-summary-item:last-of-type { border-bottom: none; }

/* === Dashboard KPI Tiles === */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.kpi-tile .kpi-value { font-size: 2rem; font-weight: 700; color: var(--text); }
.kpi-tile .kpi-label { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.kpi-tile .kpi-subtitle { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.15rem; }
.kpi-tile .kpi-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 0.5rem; }
.kpi-tile .kpi-bar-fill { height: 100%; border-radius: 2px; }

/* === Maturity Funnel === */
.maturity-funnel { margin-bottom: 1.5rem; }
.maturity-funnel h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.funnel-bar { display: flex; height: 32px; border-radius: var(--radius-md); overflow: hidden; }
.funnel-segment { display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 600; color: #11111b; transition: width 0.3s ease; min-width: 28px; }
.funnel-labels { display: flex; margin-top: 0.35rem; font-size: 0.7rem; color: var(--muted); }
.funnel-labels span { text-align: center; }

/* === Readiness Badge === */
.pw-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }
.pw-badge-green { background: var(--pass); color: #11111b; }
.pw-badge-yellow { background: var(--skip); color: #11111b; }
.pw-badge-gray { background: var(--border); color: var(--muted); }

/* === Type Badge === */
.type-badge { display: inline-flex; align-items: center; padding: 0.1rem 0.5rem; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.type-badge.type-agent { background: var(--border); color: var(--text-secondary); }
.type-badge.type-pw { background: var(--primary-bg); color: var(--primary); border: 1px solid var(--primary); }

/* === Quick Actions === */
.dashboard-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* === Recent Runs Table === */
.recent-runs-section { margin-top: 1.5rem; }
.recent-runs-section h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.recent-runs-table { width: 100%; font-size: 0.82rem; border-collapse: collapse; }
.recent-runs-table th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.recent-runs-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-subtle); }
.recent-runs-table tr:hover { background: var(--hover-bg); cursor: pointer; }
.run-mode-badge { display: inline-flex; padding: 0.1rem 0.4rem; border-radius: var(--radius-sm); font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }
.run-mode-badge.mode-agent { background: var(--border); color: var(--text-secondary); }
.run-mode-badge.mode-playwright { background: var(--primary-bg); color: var(--primary); }

/* === Test Cases Panel === */
.tc-pane-header { margin-bottom: 1rem; }
.tc-pane-header .section-title { margin: 0; }
.tc-pane-header .section-desc { font-size: 0.82rem; color: var(--muted); margin: 0.25rem 0 0; }
.tc-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tc-controls-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.tc-controls-left .search-box { max-width: 300px; }
.tc-controls-right { display: flex; align-items: center; gap: 0.5rem; }
.tc-summary { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.tc-suite .suite-header { gap: 0.5rem; }

/* Test Cases Filters */
.tc-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.tc-cat-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

/* Playwright code block */
.pw-code-container { margin-top: 0.75rem; }
.pw-code-block { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; overflow-x: auto; font-size: 0.78rem; max-height: 400px; overflow-y: auto; }

/* Case tabs (Steps / Playwright Code) */
.case-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem;
}
.case-tab {
  padding: 0.4rem 1rem; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); transition: color var(--transition-fast), border-color var(--transition-fast);
}
.case-tab:hover { color: var(--text); }
.case-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.case-tab-content { display: none; }
.case-tab-content.active { display: block; }
.pw-code-inline { margin: 0; }
.pw-code-loading { color: var(--muted); font-size: 0.82rem; }

/* === Dashboard Overview === */
.dashboard-overview-section { margin-bottom: 1.5rem; }
.dashboard-link { color: var(--primary); text-decoration: none; font-size: 0.82rem; font-weight: 500; }
.dashboard-link:hover { text-decoration: underline; }

/* Next Steps / Workflow */
.dash-workflow { margin-bottom: 1.5rem; }
.dash-workflow h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
.next-steps-list { display: flex; flex-direction: column; gap: 0.5rem; }
.next-step-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.65rem 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 0.82rem;
}
.next-step-text { color: var(--text-secondary); flex: 1; }

/* Coverage Widget */
.dash-coverage-empty { color: var(--muted); font-size: 0.82rem; }
.dash-coverage-empty h3 { color: var(--text); font-size: 0.88rem; font-weight: 600; margin-bottom: 0.35rem; }
.coverage-bar-wrap { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.coverage-bar-wrap .kpi-bar { flex: 1; }
.coverage-pct { font-size: 1.1rem; font-weight: 700; color: var(--text); min-width: 40px; }
.coverage-subsystems { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.35rem; }
.coverage-sub { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.coverage-sub-name { min-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coverage-sub-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.coverage-sub-bar span { display: block; height: 100%; border-radius: 2px; }
.coverage-sub-pct { font-weight: 600; min-width: 30px; text-align: right; color: var(--muted); }

/* === Responsive === */
@media (max-width: 900px) {
  .dashboard-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .tc-controls { flex-direction: column; align-items: stretch; }
  .tc-controls-left { flex-direction: column; }
  .tc-controls-left .search-box { max-width: none; }
}


/* === Insights Panel === */

/* Header */
.ins-header { margin-bottom: 1rem; }
.ins-header-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}
.ins-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Source tiles */
.ins-source-tiles {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.ins-source-tile {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem; cursor: pointer; transition: all var(--transition-fast);
  font-size: 0.8rem; color: var(--text-secondary);
}
.ins-source-tile:hover { border-color: var(--src-color, var(--primary)); background: var(--src-bg, var(--primary-bg)); }
.ins-source-tile.active { border-color: var(--src-color, var(--primary)); background: var(--src-bg, var(--primary-bg)); }
.ins-source-tile-count { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.ins-source-tile-label { color: var(--muted); font-size: 0.72rem; }
.ins-clear-source { color: var(--muted); font-size: 0.75rem; padding: 0.4rem 0.55rem; }

/* Source icon (shared) */
.ins-source-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: var(--radius-sm);
  font-size: 0.75rem; flex-shrink: 0;
}

/* Filters */
.ins-filters {
  display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.ins-status-pills { display: flex; gap: 0.25rem; }
.ins-pill {
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 0.25rem 0.7rem; font-size: 0.78rem; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition-fast);
}
.ins-pill:hover { border-color: var(--primary); color: var(--primary); }
.ins-pill.active { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }
.ins-pill-count { font-weight: 600; }
.ins-type-sel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 0.3rem 0.5rem; font-size: 0.78rem; margin-left: auto;
}
.ins-results-info { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.5rem; }

/* Badge */
.ins-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Cards */
.ins-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.75rem 1rem; margin-bottom: 0.5rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  border-left: 3px solid var(--border);
}
.ins-card:hover { border-color: var(--primary); }
.ins-card.ins-card-high { border-left-color: var(--pass); }
.ins-card.ins-card-med { border-left-color: var(--skip, #f9e2af); }
.ins-card.ins-card-low { border-left-color: var(--fail); }
.ins-card.ins-selected { background: var(--primary-bg); }

.ins-card-header {
  display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; flex-wrap: wrap;
}
.ins-cb-wrap { flex-shrink: 0; display: flex; align-items: center; }
.ins-cb-wrap input { margin: 0; cursor: pointer; }

.ins-conf {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 600; margin-left: auto;
}
.ins-conf-bar {
  width: 40px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.ins-conf-fill { height: 100%; border-radius: 3px; }

.ins-time { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }

/* Card body */
.ins-card-body { margin-left: 1.8rem; }
.ins-title { font-weight: 600; color: var(--text); margin-bottom: 0.2rem; font-size: 0.9rem; }
.ins-desc { color: var(--text-secondary); font-size: 0.82rem; line-height: 1.45; }

/* Context chips */
.ins-context {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem;
}
.ins-ctx-item {
  font-size: 0.72rem; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border-subtle, var(--border)); border-radius: var(--radius-sm);
  padding: 1px 6px;
}

/* Steps preview */
.ins-steps {
  margin-top: 0.4rem; font-size: 0.78rem; color: var(--text-secondary);
  background: var(--bg); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem;
}
.ins-steps ol { margin: 0; padding-left: 1.2rem; }
.ins-steps li { margin-bottom: 0.15rem; }
.ins-step-expected { color: var(--muted); font-size: 0.72rem; }
.ins-steps-more { color: var(--muted); font-style: italic; list-style: none; }

/* Acceptance criteria */
.ins-ac {
  margin-top: 0.35rem; font-size: 0.75rem; color: var(--text-secondary);
  border-left: 2px solid var(--border); padding-left: 0.5rem;
}
.ins-ac-label { color: var(--muted); font-weight: 600; }

/* Card footer */
.ins-card-footer {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; margin-left: 1.8rem;
}
.ins-status-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px;
}
.ins-status-promoted { background: rgba(166,227,161,0.15); color: var(--pass); }
.ins-status-auto_promoted { background: rgba(166,227,161,0.15); color: var(--pass); }
.ins-status-dismissed { background: rgba(108,112,134,0.1); color: var(--muted); }
.ins-status-covered { background: rgba(137,180,250,0.1); color: var(--primary); }
.ins-status-reviewing { background: rgba(250,179,135,0.15); color: var(--orange, #fab387); }

.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: var(--radius-sm); padding: 0.25rem 0.6rem; cursor: pointer; font-size: 0.78rem;
}
.btn-ghost:hover { border-color: var(--fail); color: var(--fail); }

/* Groups */
.ins-group { margin-bottom: 1.25rem; }
.ins-group-header {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem; border-radius: var(--radius-sm);
  background: var(--bg);
}
.ins-group-title { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.ins-group-count {
  font-size: 0.72rem; color: var(--muted); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 0 6px; font-weight: 600;
}

/* Empty states */
.ins-empty {
  text-align: center; padding: 3rem 2rem; color: var(--muted); font-size: 0.9rem;
}
.ins-empty-icon { font-size: 2.5rem; opacity: 0.2; margin-bottom: 0.75rem; }
.ins-empty-filtered { padding: 2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* View toggle */
.ins-view-toggle {
  background: var(--card); border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 0.78rem;
}
