/* ═══════════════════════════════════════════════════════════
   TronScan AI Testing Platform — Design System v2
   Slate dark + Emerald accent | Fira Sans + Fira Code
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-base: #0B1120;
  --bg-card: #1E293B;
  --bg-card-hover: #253449;
  --bg-surface: #0F172A;
  --bg-input: #152033;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text-primary: #F1F5F9;
  --text-secondary: #CBD5E1;
  --text-muted: #7C8BA1;
  --green: #22C55E;
  --green-dim: rgba(34,197,94,0.15);
  --red: #EF4444;
  --red-dim: rgba(239,68,68,0.12);
  --yellow: #EAB308;
  --yellow-dim: rgba(234,179,8,0.12);
  --blue: #3B82F6;
  --blue-dim: rgba(59,130,246,0.12);
  --cyan: #06B6D4;
  --accent: #22C55E;
  --accent-hover: #16A34A;
  --accent-glow: rgba(34,197,94,0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font-sans: 'Fira Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', 'SF Mono', monospace;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.03);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06);
  --transition: 200ms cubic-bezier(0.4,0,0.2,1);
}

/* ─── Light Theme ─── */
body.light-theme {
  --bg-base: #F4F7FB;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-surface: #F1F5F9;
  --bg-input: #FFFFFF;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.15);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --green: #16A34A;
  --green-dim: rgba(22,163,74,0.1);
  --red: #DC2626;
  --red-dim: rgba(220,38,38,0.08);
  --yellow: #CA8A04;
  --yellow-dim: rgba(202,138,4,0.08);
  --blue: #2563EB;
  --blue-dim: rgba(37,99,235,0.08);
  --cyan: #0891B2;
  --accent: #16A34A;
  --accent-hover: #15803D;
  --accent-glow: rgba(22,163,74,0.2);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.06);
}

/* Light theme component overrides */
body.light-theme .site-nav {
  background: rgba(255,255,255,0.85) !important;
  border-bottom-color: rgba(0,0,0,0.06) !important;
}
body.light-theme .nav-tabs-center { background: rgba(0,0,0,0.04) !important; }
body.light-theme .nav-tab.tab-active {
  background: #0F172A !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
}
body.light-theme .nav-logo span { color: #0F172A !important; }

body.light-theme .btn-primary-glow,
body.light-theme .btn-accent-glow {
  background: linear-gradient(135deg, #1E293B, #334155) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
  color: #fff !important;
}
body.light-theme .btn-primary-glow:hover,
body.light-theme .btn-accent-glow:hover {
  background: linear-gradient(135deg, #0F172A, #1E293B) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18) !important;
}

body.light-theme .stats { border-color: rgba(0,0,0,0.06) !important; }
body.light-theme .stat-value { color: #0F172A !important; }

body.light-theme .modal-box {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,0.1) !important;
  box-shadow: 0 24px 48px rgba(0,0,0,0.12) !important;
}
body.light-theme .modal-backdrop { background: rgba(0,0,0,0.3) !important; }

body.light-theme .table th { color: #64748B !important; border-color: rgba(0,0,0,0.06) !important; }
body.light-theme .table td { border-color: rgba(0,0,0,0.04) !important; }

body.light-theme .jira-key { color: #0891B2 !important; }
body.light-theme .step-content-block { background: #F8FAFC !important; border-color: rgba(0,0,0,0.06) !important; color: #475569 !important; }

body.light-theme .hero-title { color: #0F172A !important; }
body.light-theme .hero-subtitle { color: #64748B !important; }
body.light-theme .intro-badge { color: #16A34A !important; background: rgba(22,163,74,0.08) !important; border-color: rgba(22,163,74,0.15) !important; }
body.light-theme .intro-highlight { background: linear-gradient(135deg, #16A34A, #0891B2) !important; -webkit-background-clip: text !important; }
body.light-theme .hero-bg { background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(22,163,74,0.06) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 80% 50%, rgba(8,145,178,0.04) 0%, transparent 50%) !important; }
body.light-theme .hero-bg::before { background: rgba(22,163,74,0.04) !important; }
body.light-theme .hero-bg::after { background: rgba(8,145,178,0.03) !important; }
body.light-theme .btn-outline-glow { border-color: rgba(0,0,0,0.12) !important; color: #334155 !important; }
body.light-theme .btn-outline-glow:hover { background: rgba(0,0,0,0.04) !important; color: #0F172A !important; border-color: rgba(0,0,0,0.2) !important; }
body.light-theme .scroll-indicator span { border-color: #94A3B8 !important; }

body.light-theme .feature-number { color: #16A34A !important; }
body.light-theme .feature-title { color: #0F172A !important; }
body.light-theme .feature-desc { color: #475569 !important; }
body.light-theme .feature-list li { color: #475569 !important; }
body.light-theme .feature-list li::before { color: #16A34A !important; }
body.light-theme .feature-cta { color: #16A34A !important; }

body.light-theme .mockup-terminal { background: #FFFFFF !important; border-color: rgba(0,0,0,0.1) !important; box-shadow: 0 8px 32px rgba(0,0,0,0.08) !important; }
body.light-theme .mockup-step { background: #F8FAFC !important; border-color: rgba(0,0,0,0.08) !important; }
body.light-theme .mockup-bar { background: #F1F5F9 !important; border-color: rgba(0,0,0,0.06) !important; }
body.light-theme .mockup-body { color: #64748B !important; }
body.light-theme .mockup-body .t-green { color: #16A34A !important; }
body.light-theme .mockup-body .t-cyan { color: #0891B2 !important; }
body.light-theme .mockup-body .t-dim { color: #94A3B8 !important; }
body.light-theme .mockup-step-text { color: #475569 !important; }
body.light-theme .mockup-step-connector { background: rgba(0,0,0,0.1) !important; }
body.light-theme .mockup-diff-frame { background: #F8FAFC !important; border-color: rgba(0,0,0,0.1) !important; }
body.light-theme .mockup-diff-label { color: #64748B !important; }

body.light-theme .cta-section { background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(22,163,74,0.04) 0%, transparent 60%) !important; }
body.light-theme .cta-content h2 { color: #0F172A !important; }
body.light-theme .intro-tech { color: #94A3B8 !important; }

body.light-theme .vc-card,
body.light-theme .epic-group { border-color: rgba(0,0,0,0.08) !important; }
body.light-theme .epic-group-header { background: #F8FAFC !important; }
body.light-theme .epic-group-header:hover { background: #F1F5F9 !important; }

body.light-theme .vd-section { background: #F8FAFC !important; border-color: rgba(0,0,0,0.06) !important; }
body.light-theme .vd-collapse { border-color: rgba(0,0,0,0.08) !important; }
body.light-theme .vd-collapse-header { background: #F8FAFC !important; }
body.light-theme .vd-collapse-header:hover { background: #F1F5F9 !important; }
body.light-theme .vd-collapse-body { background: #FFFFFF !important; border-color: rgba(0,0,0,0.06) !important; }

body.light-theme .route-chip { background: rgba(8,145,178,0.06) !important; border-color: rgba(8,145,178,0.12) !important; }
body.light-theme .route-chip:hover { background: rgba(8,145,178,0.12) !important; color: #0891B2 !important; }

body.light-theme .jira-tab.active { border-bottom-color: #0F172A !important; color: #0F172A !important; }

body.light-theme .image-zoom-overlay { background: rgba(255,255,255,0.92) !important; }

/* Light mode background gradient */
body.light-theme {
  background: #F4F7FB !important;
  background-image:
    radial-gradient(ellipse 50% 40% at 15% 10%, rgba(22,163,74,0.04) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 85% 30%, rgba(8,145,178,0.03) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 90%, rgba(37,99,235,0.02) 0%, transparent 50%) !important;
  background-attachment: fixed !important;
}
body.light-theme #app::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}
body.light-theme .landing-section { background: transparent !important; }
body.light-theme .hero-section { background: transparent !important; }
body.light-theme .cta-section { background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(22,163,74,0.04) 0%, transparent 60%) !important; }

body.light-theme ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12) !important; }
body.light-theme ::selection { background: rgba(22,163,74,0.2) !important; }

/* ─── Nav right area (theme + user) ─── */
.nav-right {
  position: absolute; right: 24px;
  display: flex; align-items: center; gap: 10px;
}

/* Sign in button */
.sign-in-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  text-decoration: none; font-family: var(--font-sans);
  transition: all var(--transition);
}
.sign-in-btn:hover { background: rgba(128,128,128,0.1); color: var(--text-primary); border-color: var(--border-hover); }

/* User menu */
.user-menu { position: relative; }
.user-avatar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px;
  background: none; border: 1px solid transparent;
  color: var(--text-secondary); cursor: pointer;
  font-family: var(--font-sans); font-size: 13px;
  transition: all var(--transition);
}
.user-avatar-btn:hover { background: rgba(128,128,128,0.1); border-color: var(--border); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dropdown */
.user-dropdown {
  display: none;
  position: absolute; right: 0; top: 100%; margin-top: 6px;
  min-width: 200px; padding: 6px 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 100;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown-header {
  padding: 8px 14px; font-size: 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-dropdown-item {
  display: block; width: 100%; padding: 8px 14px;
  font-size: 13px; color: var(--text-secondary);
  background: none; border: none; text-align: left;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-sans);
  transition: background var(--transition);
}
.user-dropdown-item:hover { background: rgba(128,128,128,0.1); color: var(--text-primary); }

/* Settings secret field */
.settings-secret-field {
  position: relative;
}
.settings-secret-field input {
  position: relative; z-index: 1;
}
.settings-mask {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 13px; color: var(--text-muted);
  pointer-events: none; z-index: 2;
  background: var(--bg-input); padding-right: 70px;
  width: calc(100% - 82px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.settings-reveal-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  z-index: 3;
  padding: 4px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  background: rgba(128,128,128,0.1); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition);
}
.settings-reveal-btn:hover { background: rgba(128,128,128,0.2); }

/* Theme toggle button */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { background: rgba(128,128,128,0.1); color: var(--text-primary); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.site-nav, .card, .table, .modal-box, .badge, .btn,
.vd-section, .vd-collapse, .vd-collapse-header, .vd-collapse-body,
.step-content-block, .vc-card, .epic-group, .epic-group-header,
.jira-tab, .nav-tab, .nav-tabs-center, .stats, .stat,
.mockup-terminal, .mockup-step, .mockup-bar {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
pre, code, .font-mono { font-family: var(--font-mono); }
pre { white-space: pre-wrap; word-break: break-all; }

/* ─── Landing page ─── */

/* Home tab 一直保留在 nav 里,不随路由切换 —— 避免切 Home/Dashboard 时
   导航栏位置来回抖动 (之前的 body.on-intro 隐藏规则已移除) */

/* Full-viewport sections */
.landing-section {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 80px 40px;
}

/* Hero */
.hero-section { flex-direction: column; text-align: center; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(34,197,94,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(6,182,212,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(59,130,246,0.06) 0%, transparent 50%);
}
.hero-bg::before, .hero-bg::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(80px);
  animation: floatOrb 8s ease-in-out infinite alternate;
}
.hero-bg::before { width: 400px; height: 400px; top: -100px; left: 20%; background: rgba(34,197,94,0.1); }
.hero-bg::after { width: 350px; height: 350px; bottom: -50px; right: 15%; background: rgba(6,182,212,0.08); animation-delay: -4s; }
@keyframes floatOrb { from { transform: translate(0,0) scale(1); } to { transform: translate(30px,-20px) scale(1.1); } }

.hero-content { position: relative; z-index: 1; max-width: 700px; display: flex !important; flex-direction: column !important; align-items: center !important; }
.hero-title { font-size: 72px; font-weight: 800; line-height: 1.05; margin: 0 0 20px; color: #fff; letter-spacing: -2px; }
.intro-highlight { background: linear-gradient(135deg, #22C55E, #06B6D4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.intro-badge { display: inline-block; padding: 6px 18px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; color: var(--green); background: var(--green-dim); border: 1px solid rgba(34,197,94,0.2); margin-bottom: 24px; font-family: var(--font-mono); }
.hero-subtitle { font-size: 19px; color: var(--text-secondary); max-width: 540px; margin: 0 auto 36px; line-height: 1.7; }
.hero-actions { display: flex; justify-content: center; gap: 16px; }
.btn-lg { padding: 14px 32px !important; font-size: 16px !important; border-radius: 10px !important; }
.btn-outline-glow {
  display: inline-flex; align-items: center; gap: 6px; padding: 14px 32px;
  border: 1px solid var(--border-hover); border-radius: 10px; color: var(--text-secondary);
  font-size: 16px; font-weight: 600; font-family: var(--font-sans); background: transparent; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
}
.btn-outline-glow:hover { border-color: rgba(255,255,255,0.25); color: var(--text-primary); background: rgba(255,255,255,0.04); }

/* Scroll indicator */
.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); }
.scroll-indicator span {
  display: block; width: 24px; height: 24px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce { 0%,100% { transform: rotate(45deg) translate(0,0); opacity: 0.4; } 50% { transform: rotate(45deg) translate(6px,6px); opacity: 1; } }

/* Feature sections */
.feature-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; max-width: 1100px; width: 100%; }
.feature-text { display: block !important; }
.feature-visual { display: block !important; }
.feature-reverse .feature-grid { direction: rtl; }
.feature-reverse .feature-grid > * { direction: ltr; }
.feature-number { font-family: var(--font-mono); font-size: 14px; color: var(--green); font-weight: 600; letter-spacing: 2px; display: block; margin-bottom: 12px; }
.feature-title { font-size: 40px; font-weight: 800; color: #fff; margin: 0 0 16px; letter-spacing: -0.5px; }
.feature-desc { font-size: 16px; color: var(--text-secondary); line-height: 1.7; margin: 0 0 24px; }
.feature-list { list-style: none; padding: 0; margin: 0 0 28px; }
.feature-list li { padding: 8px 0 8px 28px; position: relative; font-size: 15px; color: var(--text-secondary); }
.feature-list li::before { content: '→'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.feature-cta { font-size: 15px; font-weight: 600; color: var(--green); text-decoration: none; transition: all var(--transition); }
.feature-cta:hover { color: var(--cyan); letter-spacing: 0.5px; }

/* Feature visual mockups */
.mockup-terminal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.mockup-bar { display: flex; gap: 6px; padding: 12px 16px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); }
.mockup-bar span { width: 10px; height: 10px; border-radius: 50%; }
.mockup-bar span:nth-child(1) { background: #EF4444; }
.mockup-bar span:nth-child(2) { background: #EAB308; }
.mockup-bar span:nth-child(3) { background: #22C55E; }
.mockup-body { padding: 20px; font-family: var(--font-mono); font-size: 13px; line-height: 2; color: var(--text-muted); }
.mockup-body .t-green { color: var(--green); }
.mockup-body .t-cyan { color: var(--cyan); }
.mockup-body .t-dim { color: var(--text-muted); opacity: 0.6; }

.mockup-steps { display: flex; flex-direction: column; gap: 16px; }
.mockup-step { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--bg-surface); border-radius: var(--radius-sm); border: 1px solid var(--border); transition: border-color 0.3s; }
.mockup-step:hover { border-color: var(--border-hover); }
.mockup-step-num { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; font-weight: 700; flex-shrink: 0; color: #fff; }
.mockup-step-text { font-size: 14px; color: var(--text-secondary); }
.mockup-step-connector { width: 2px; height: 16px; background: var(--border); margin-left: 17px; }

/* Visual Regression mockup (intro page) */
.vr-result-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface); border: 1px solid var(--border);
}
.vr-badge { padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; font-family: var(--font-mono); }
.vr-match { background: var(--green-dim); color: var(--green); }
.vr-pct { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text-primary); }
.vr-pages { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.vr-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.vr-frame { }
.vr-fake-page {
  border-radius: 6px; padding: 8px;
  background: var(--bg-surface); border: 1px solid var(--border);
  aspect-ratio: 4/3;
  display: flex; flex-direction: column; gap: 5px;
}
.vr-fake-nav { height: 6px; border-radius: 3px; background: var(--border-hover); margin-bottom: 4px; }
.vr-fake-row { height: 5px; border-radius: 2px; background: var(--border-hover); }
.vr-diff-highlight { background: rgba(234,179,8,0.4) !important; }
.vr-diff-page { background: rgba(0,0,0,0.3); }
body.light-theme .vr-diff-page { background: rgba(0,0,0,0.03); }
.vr-diff-mark { background: var(--red) !important; opacity: 0.7; }
.vr-label { font-family: var(--font-mono); font-size: 10px; text-align: center; padding: 5px; color: var(--text-muted); }

/* CTA footer */
.cta-section { min-height: 60vh; flex-direction: column; text-align: center; background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(34,197,94,0.08) 0%, transparent 60%); }
.cta-content { display: flex !important; flex-direction: column !important; align-items: center !important; }
.cta-content h2 { font-size: 44px; font-weight: 800; color: #fff; margin: 0 0 32px; }
.btn-xl { padding: 16px 40px !important; font-size: 18px !important; border-radius: 12px !important; }
.intro-tech { font-size: 14px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 24px; }

/* ─── Reveal animation system ─── */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal-left { transform: translateX(-60px) translateY(0); }
.reveal-right { transform: translateX(60px) translateY(0); }
.reveal.revealed { opacity: 1; transform: translate(0,0); }
.reveal .reveal-child { opacity: 0; transform: translateY(20px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.reveal.revealed .reveal-child { opacity: 1; transform: translateY(0); }
.reveal.revealed .reveal-child:nth-child(1) { transition-delay: 0.1s; }
.reveal.revealed .reveal-child:nth-child(2) { transition-delay: 0.2s; }
.reveal.revealed .reveal-child:nth-child(3) { transition-delay: 0.3s; }
.reveal.revealed .reveal-child:nth-child(4) { transition-delay: 0.4s; }
.reveal.revealed .reveal-child:nth-child(5) { transition-delay: 0.5s; }
.reveal.revealed .reveal-child:nth-child(6) { transition-delay: 0.6s; }

/* Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 44px; letter-spacing: -1px; }
  .feature-grid { grid-template-columns: 1fr; gap: 40px; }
  .feature-reverse .feature-grid { direction: ltr; }
  .landing-section { padding: 60px 20px; min-height: auto; }
  .feature-title { font-size: 30px; }
  .cta-content h2 { font-size: 32px; }
  .hero-actions { flex-direction: column; align-items: center; }
}

/* ─── Page transition ─── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#app { animation: fadeSlideIn 0.3s ease-out; }
#app > * { animation: fadeSlideIn 0.25s ease-out both; }

/* ─── Navbar ─── */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  height: 60px; padding: 0 24px;
  background: rgba(15,23,42,0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-logo {
  position: absolute; left: 24px;
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  font-size: 16px; font-weight: 600; color: var(--text-primary);
  font-family: var(--font-sans);
}
.nav-logo-icon {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-tabs-center {
  display: flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

/* ─── Nav tabs ─── */
.nav-tab {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.nav-tab.tab-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(6,182,212,0.15));
  box-shadow: 0 0 12px rgba(34,197,94,0.12);
}

/* ─── Primary glow button ─── */
.btn-primary-glow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #fff; font-size: 13px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 0 16px var(--accent-glow), 0 1px 2px rgba(0,0,0,0.3);
  transition: all var(--transition);
}
.btn-primary-glow:hover {
  background: linear-gradient(135deg, #16A34A, #15803D);
  box-shadow: 0 0 24px var(--accent-glow);
  transform: translateY(-1px);
}

/* app.js accent button (replaces bg-brand) */
.btn-accent-glow {
  background: linear-gradient(135deg, #22C55E, #16A34A) !important;
  color: #fff !important; border: none !important;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: all var(--transition);
}
.btn-accent-glow:hover {
  background: linear-gradient(135deg, #16A34A, #15803D) !important;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

/* ─── Card system ─── */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-card) !important;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1) !important;
  overflow: hidden;
}
.card:hover {
  border-color: var(--border-hover) !important;
  box-shadow: var(--shadow-hover) !important;
  transform: translateY(-2px);
}
.card-title {
  color: var(--text-secondary) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.card-body {
  color: var(--text-primary) !important;
}

/* Pipeline step cards (border-l-4) — no hover lift */
.card.border-l-4 { transform: none !important; }
.card.border-l-4:hover { transform: none !important; }
.card.border-l-success { border-left-color: var(--green) !important; }
.card.border-l-error { border-left-color: var(--red) !important; }
.card.border-l-warning { border-left-color: var(--yellow) !important; }
.card.border-l-primary { border-left-color: var(--cyan) !important; }
.card.border-l-info { border-left-color: var(--blue) !important; }
.card.border-l-base-300 { border-left-color: var(--text-muted) !important; }

/* ─── Stats bar ─── */
.stat { background: transparent !important; }
.stats {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
}
.stats:hover { transform: none; }
.stat-title { color: var(--text-muted) !important; font-size: 12px !important; letter-spacing: 0.5px; text-transform: uppercase; }
.stat-value { font-family: var(--font-mono) !important; font-weight: 700 !important; }
.text-success { color: var(--green) !important; }
.text-error { color: var(--red) !important; }

/* ─── Table ─── */
.table { color: var(--text-primary) !important; font-size: 14px !important; }
.table th {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-color: var(--border) !important;
  white-space: nowrap;
  padding: 10px 16px !important;
}
.table td {
  border-color: var(--border) !important;
  padding: 12px 16px !important;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.table .hover:hover, .table tr:hover { background: var(--bg-card-hover) !important; }

/* ─── Badges ─── */
.badge { font-family: var(--font-mono) !important; font-size: 11px !important; white-space: nowrap; padding: 4px 10px !important; line-height: 1.3 !important; height: auto !important; min-height: 0 !important; border-radius: 6px !important; }
.badge-ghost { background: rgba(255,255,255,0.06) !important; color: var(--text-secondary) !important; border: none !important; }
.badge-success { background: var(--green-dim) !important; color: var(--green) !important; border: none !important; }
.badge-error { background: var(--red-dim) !important; color: var(--red) !important; border: none !important; }
.badge-warning { background: var(--yellow-dim) !important; color: var(--yellow) !important; border: none !important; padding-inline: 8px !important; }
.badge-primary { background: rgba(6,182,212,0.15) !important; color: var(--cyan) !important; border: none !important; }
.badge-info { background: var(--blue-dim) !important; color: var(--blue) !important; border: none !important; }
.badge-outline { border-color: var(--border-hover) !important; color: var(--text-secondary) !important; background: transparent !important; }

.link-primary { color: var(--cyan) !important; }
.alert-error { background: var(--red-dim) !important; color: var(--red) !important; border: 1px solid rgba(239,68,68,0.2) !important; border-radius: var(--radius-sm) !important; }
.alert-info { background: var(--blue-dim) !important; color: var(--blue) !important; border: 1px solid rgba(59,130,246,0.2) !important; border-radius: var(--radius-sm) !important; }
.loading-spinner { color: var(--accent) !important; }

.bg-base-100 { background: var(--bg-card) !important; }
.bg-base-200 { background: var(--bg-surface) !important; }
.bg-base-300 { background: var(--bg-card-hover) !important; }
.border-base-200, .border-base-300 { border-color: var(--border) !important; }

/* ─── Inputs ─── */
.textarea, .input, .select {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
}
.textarea:focus, .input:focus, .select:focus {
  border-color: rgba(34,197,94,0.4) !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.1) !important;
  outline: none !important;
}
.label-text { color: var(--text-secondary) !important; font-size: 13px !important; }

/* ─── Step/pipeline content blocks ─── */
.step-content-block {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
  /* Horizontal clip keeps long lines contained, vertical lets max-h-XX
     classes produce a scrollbar instead of silently truncating content. */
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
.step-content-block code {
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ─── Modal ─── */
.modal-box {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5) !important;
  color: var(--text-primary) !important;
  animation: modalSlideIn 0.25s ease-out !important;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box { overflow-x: hidden !important; }
.modal-box h3 { color: var(--text-primary) !important; }
.modal-action { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.modal-action .btn { border-radius: var(--radius-sm) !important; font-family: var(--font-sans) !important; font-size: 13px !important; }
.modal-action .btn-ghost { color: var(--text-secondary) !important; border: 1px solid var(--border) !important; }
.modal-action .btn-ghost:hover { background: rgba(255,255,255,0.06) !important; color: var(--text-primary) !important; }
.modal-backdrop { background: rgba(0,0,0,0.6) !important; backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }

/* ─── Text overflow ─── */
.truncate, .text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
h2 { overflow: hidden; text-overflow: ellipsis; }

/* ─── Progress ─── */
.progress { background: rgba(255,255,255,0.06) !important; height: 6px !important; border-radius: 3px !important; }
.progress::-webkit-progress-bar { background: rgba(255,255,255,0.06) !important; border-radius: 3px !important; }
.progress-success::-webkit-progress-value { background: var(--green) !important; border-radius: 3px !important; }
.progress-warning::-webkit-progress-value { background: var(--yellow) !important; border-radius: 3px !important; }
.progress-error::-webkit-progress-value { background: var(--red) !important; border-radius: 3px !important; }

/* ─── Checkbox ─── */
.checkbox { border-color: var(--border-hover) !important; background: transparent !important; }
.checkbox:checked, .checkbox-success:checked { background: var(--green) !important; border-color: var(--green) !important; }

/* ─── Details/accordion ─── */
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }
details > summary {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  transition: all var(--transition);
}
details > summary:hover { background: var(--bg-card-hover) !important; border-color: var(--border-hover) !important; }
details[open] > summary { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; }

/* ─── Visual page cards ─── */
/* Visual Regression config panel — inputs on the left half, tool buttons on the right */
.vr-config-row {
  display: flex;
  align-items: stretch;
  gap: 24px;
}
.vr-config-left {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
}
.vr-config-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
}
.vr-config-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}
.vr-config-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.vr-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.vr-tool-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: var(--border-hover, var(--cyan));
}
.vr-tool-btn svg { flex-shrink: 0; color: var(--text-muted); }
.vr-tool-btn:hover svg { color: var(--cyan); }
.vr-tool-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 14px;
  text-align: center;
}
.vr-tool-count:empty { display: none; }

/* Page picker modal — collapsible categories with per-row checkboxes */
.vr-picker-body {
  max-height: 58vh;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.vr-cat {
  border-bottom: 1px solid var(--border);
}
.vr-cat:last-child { border-bottom: none; }
.vr-cat > .vr-cat-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.vr-cat > .vr-cat-summary::-webkit-details-marker,
.vr-cat > .vr-cat-summary::marker { display: none; content: ''; }
.vr-cat > .vr-cat-summary:hover { background: rgba(255,255,255,0.03); }
.vr-cat-arrow {
  flex-shrink: 0;
  transition: transform 0.18s;
  color: var(--text-muted);
}
.vr-cat[open] > .vr-cat-summary > .vr-cat-arrow { transform: rotate(90deg); }
.vr-cat-name { flex: 1; }
.vr-cat-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.vr-cat-actions { display: flex; align-items: center; gap: 6px; }
.vr-cat-link {
  background: none;
  border: none;
  color: var(--cyan);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
}
.vr-cat-link:hover { text-decoration: underline; }
.vr-cat-body {
  padding: 2px 0 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vr-picker-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.vr-picker-row:hover { background: rgba(255,255,255,0.04); }
.vr-picker-row input[type="checkbox"] { flex-shrink: 0; }
.vr-picker-label { color: var(--text-primary); }
.vr-picker-route {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .vr-config-row { flex-direction: column; gap: 12px; }
  .vr-config-left { flex: 1 1 auto; max-width: none; }
  .vr-config-right { justify-content: flex-start; flex-wrap: wrap; }
}

.vc-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
}
.vc-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.vc-status-bar { height: 3px; }
.vc-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.vc-name {
  font-weight: 600; font-size: 15px; margin-bottom: 4px;
  height: 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  overflow: hidden;
}
.vc-name-label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.vc-route {
  font-size: 11px; font-weight: 400; color: var(--text-muted);
  font-family: var(--font-mono); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vc-preview { margin: 10px 0; }
.vc-img {
  width: 100%; height: 180px;
  object-fit: cover; object-position: top;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.vc-img:hover { opacity: 0.85; }
.vc-empty {
  width: 100%; height: 180px;
  border-radius: var(--radius-xs);
  border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 13px;
}
.vc-result-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  margin-top: 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  overflow: hidden;
}
.vc-result-bar:hover { background: var(--bg-card-hover); }
.vc-view-link {
  font-size: 12px; color: var(--cyan); white-space: nowrap;
  font-weight: 500;
}
.vc-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }

/* Visual card inline loading overlay */
.visual-card-loading {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.88);
  backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius);
  z-index: 10;
  animation: fadeSlideIn 0.2s ease-out;
}
.visual-card-loading .loading-text { font-size: 13px; color: var(--text-secondary); }

/* Diff modal images */
.diff-img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.diff-img:hover { opacity: 0.85; }

/* Image zoom lightbox — must be above DaisyUI modal (z-index ~999) */
.image-zoom-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: fadeSlideIn 0.2s ease-out;
}
.image-zoom-img {
  max-width: 95vw; max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.image-zoom-close {
  position: absolute; top: 16px; right: 20px;
  font-size: 12px; color: var(--text-muted);
  background: rgba(255,255,255,0.1);
  padding: 4px 12px; border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
}

/* ─── Jira queue cards ─── */
.jira-queue-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.jira-queue-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}
.jira-queue-card .jira-key {
  color: var(--cyan);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}
.jira-queue-card .jira-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-secondary);
}
.jira-queue-card .jira-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.jira-status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(234,179,8,0.2);
}

/* ─── Jira History cards ─── */
.jira-history-card {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}
.jira-history-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}
.jira-history-card.border-l-success { border-left-color: var(--green) !important; }
.jira-history-card.border-l-error { border-left-color: var(--red) !important; }
.jira-history-card.border-l-primary { border-left-color: var(--cyan) !important; }
.jira-history-card.border-l-warning { border-left-color: var(--yellow) !important; }
.jh-left { flex: 1; min-width: 0; overflow: hidden; }
.jh-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.jh-summary {
  font-size: 13px; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all; overflow-wrap: anywhere;
  max-width: 100%;
}
.jh-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; min-width: 160px; }
.jh-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }
.jh-actions { display: flex; gap: 4px; }

/* ─── Epic group collapse ─── */
.epic-group { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.epic-group-header {
  display: flex !important; align-items: center; gap: 10px;
  padding: 12px 16px !important;
  background: var(--bg-card) !important;
  border: none !important; border-radius: 0 !important;
  cursor: pointer; user-select: none;
  font-size: 14px;
  transition: background var(--transition);
}
.epic-group-header:hover { background: var(--bg-card-hover) !important; }
.epic-group-arrow { color: var(--text-muted); transition: transform 0.2s ease; flex-shrink: 0; }
.epic-group[open] .epic-group-arrow { transform: rotate(90deg); }
.epic-group .card { border: none !important; border-radius: 0 !important; box-shadow: none !important; }
.epic-group .card:hover { transform: none; }

/* ─── Jira inner tabs ─── */
.jira-inner-tabs {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.jira-tab {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  margin-bottom: -1px;
}
.jira-tab:hover { color: var(--text-primary); }
.jira-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--green);
}

/* ─── Dashboard v2 (KPI tiles + project cards) ─── */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.dash-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: all var(--transition);
}
.dash-kpi:hover { transform: translateY(-1px); border-color: var(--cyan); }
.dash-kpi.dash-alert-warn {
  border-color: var(--yellow);
  background: rgba(250, 204, 21, 0.05);
}
.dash-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dash-kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.1;
}
.dash-kpi-link {
  display: block;
  font-size: 11px;
  color: var(--cyan);
  margin-top: 6px;
  text-decoration: none;
}
.dash-kpi-link:hover { text-decoration: underline; }

.dash-proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.dash-proj-card {
  display: block;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition);
}
.dash-proj-card:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}
.dash-proj-card.dash-proj-hot {
  border-left: 3px solid var(--yellow);
}

/* ─── AI Lab mode switch ─── */
.lab-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lab-mode-switch label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition);
}
.lab-mode-switch label:hover { border-color: var(--cyan); }
.lab-mode-switch label.active {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.06);
  box-shadow: 0 0 0 1px var(--green);
}
.lab-mode-switch input[type="radio"] { display: none; }

/* ─── Projects Workspace (Phase 4a) ─── */
.proj-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition);
  min-height: 220px;       /* 保证卡片等高,内容少的不会缩成小半张 */
  height: 100%;             /* grid 格子内 100% 充满,让 grid-auto-rows:1fr 生效 */
}
.proj-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
/* 让所有卡片同一行等高 (grid-auto-rows:1fr 配合 align-items) */
.proj-card-wrap { height: 100%; }

/* ─── Project card 三列 inline 指标 (用例 / 通过率 / 待人工) ─ */
.proj-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.proj-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.proj-stat-value {
  font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.proj-stat-value.muted { color: var(--text-muted); font-weight: 500; }
.proj-stat-value.ok    { color: var(--green, #10B981); }
.proj-stat-value.warn  { color: var(--yellow, #F59E0B); }
.proj-stat-value.bad   { color: var(--red, #EF4444); }
.proj-stat-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 500;
}

/* Footer 行 —— 上次执行时间,有数据才显示 */
.proj-stat-footer {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Project card v2: Jira issue 状态分布 ─── */
.proj-issue-summary {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.proj-issue-total {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.proj-issue-total-num {
  font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.proj-issue-total-label {
  font-size: 11px;
  color: var(--text-muted);
}
.proj-issue-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  min-width: 50px;
}
.proj-issue-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green, #10B981), var(--cyan, #06B6D4));
  border-radius: 2px;
  transition: width 0.4s ease;
}
.proj-issue-pct {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.proj-issue-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: 11px;
}
.proj-issue-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.proj-issue-pill .num {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.proj-issue-pill.todo    .num { color: #9CA3AF; }
.proj-issue-pill.pending .num { color: var(--yellow, #F59E0B); }
.proj-issue-pill.doing   .num { color: var(--cyan, #06B6D4); }
.proj-issue-pill.done    .num { color: var(--green, #10B981); }
.proj-row > summary { list-style: none; }
.proj-row > summary::-webkit-details-marker { display: none; }
.proj-row[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* Clickable big-number KPI on project Overview */
.proj-kpi-num {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: all var(--transition);
}
.proj-kpi-num:hover {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* Project card with a detached delete button */
.proj-card-wrap { position: relative; }
.proj-card-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  z-index: 2;
}
.proj-card-wrap:hover .proj-card-del { opacity: 1; }
.proj-card-del:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

/* ─── Jira History table ─── */
.jh-table td { vertical-align: middle !important; }
.jh-table .jira-key { font-size: 14px; }
.jh-td-summary {
  max-width: 400px !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px !important;
  color: var(--text-secondary);
}
.jh-td-time {
  font-size: 12px; color: var(--text-muted);
  font-family: var(--font-mono); white-space: nowrap;
}

/* ─── Verification Detail modal ─── */
.vd-header {
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.vd-title {
  font-size: 18px; font-weight: 700; font-family: var(--font-mono);
  color: var(--cyan); margin-bottom: 4px;
}
.vd-summary {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 10px;
  overflow-wrap: break-word; word-break: break-word;
  overflow: hidden;
}
.vd-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.vd-section {
  margin-bottom: 16px; padding: 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.vd-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}

/* Jira renderedBody HTML — tables/lists/etc. Make them legible in dark theme. */
.jira-rich { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.jira-rich p { margin: 0 0 8px; }
.jira-rich p:last-child { margin-bottom: 0; }
.jira-rich a { color: var(--cyan); text-decoration: underline; }
.jira-rich code {
  background: rgba(255,255,255,0.06); padding: 1px 6px;
  border-radius: 4px; font-family: var(--font-mono); font-size: 12px;
}
.jira-rich pre {
  background: rgba(0,0,0,0.3); padding: 10px; border-radius: 6px;
  overflow-x: auto; font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--border);
}
.jira-rich pre code { background: transparent; padding: 0; }
.jira-rich ul, .jira-rich ol { padding-left: 20px; margin: 6px 0; }
.jira-rich li { margin: 2px 0; }
.jira-rich blockquote {
  border-left: 3px solid var(--border); padding-left: 10px; margin: 6px 0;
  color: var(--text-muted);
}
.jira-rich table {
  width: 100%; border-collapse: collapse; margin: 8px 0;
  font-size: 12px; display: block; overflow-x: auto;
}
.jira-rich thead { background: rgba(255,255,255,0.05); }
.jira-rich th, .jira-rich td {
  border: 1px solid var(--border); padding: 6px 10px;
  text-align: left; vertical-align: top;
  color: var(--text-secondary);
}
.jira-rich th { color: var(--text-primary); font-weight: 600; }
.jira-rich img { max-width: 100%; border-radius: 4px; margin: 4px 0; }
.vd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 640px) { .vd-grid { grid-template-columns: 1fr; } }
.vd-field { }
.vd-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px; }
.vd-value { font-size: 14px; color: var(--text-secondary); overflow-wrap: break-word; word-break: break-word; line-height: 1.6; overflow: hidden; }
.vd-points { display: flex; flex-direction: column; gap: 4px; }
.vd-point {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
  padding: 6px 0; line-height: 1.5;
  overflow-wrap: break-word; word-break: break-word;
}
.vd-point > span:last-child { min-width: 0; overflow-wrap: break-word; }
.vd-point-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  font-size: 10px; font-weight: 600; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.vd-report {
  font-size: 14px; color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word;
  max-height: 400px; overflow-y: auto;
  margin-top: 4px; line-height: 1.7;
}
.vd-plan-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
  padding: 6px 10px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.vd-plan-num {
  width: 20px; height: 20px; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  font-size: 10px; font-weight: 600; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ─── Collapsible section (detail modal) ─── */
.vd-collapse {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.vd-collapse-header {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 12px 16px !important;
  background: var(--bg-surface) !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary) !important;
  transition: background var(--transition);
  user-select: none;
}
.vd-collapse-header:hover { background: var(--bg-card-hover) !important; }
.vd-collapse-arrow {
  transition: transform 0.2s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}
.vd-collapse[open] .vd-collapse-arrow { transform: rotate(90deg); }
.vd-collapse-count {
  font-size: 11px; font-weight: 400;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 1px 8px; border-radius: 10px;
}
.vd-collapse-body {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ─── Route chips ─── */
.route-chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-size: 13px; font-family: var(--font-mono);
  color: var(--cyan);
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.15);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.route-chip:hover {
  background: rgba(6,182,212,0.15);
  border-color: rgba(6,182,212,0.3);
  color: #fff;
}

/* ─── Route cell in table ─── */
.routes-cell { max-width: 250px !important; white-space: normal !important; }
.routes-cell .route-chip { display: inline-block; margin-bottom: 2px; }

/* ─── Dashboard Jira chips ─── */
.dash-jira-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}
.dash-jira-chip:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* ─── Activity feed (Dashboard) ─── */
.act-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.act-row:last-child { border-bottom: none; }
.act-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  margin-top: 6px; flex-shrink: 0;
}
.act-content { flex: 1; min-width: 0; overflow: hidden; }
.act-text {
  font-size: 13px; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.act-meta { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.act-agent {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: var(--blue-dim); color: var(--cyan);
  font-family: var(--font-mono); white-space: nowrap;
}

/* ─── Test Cases summary row ─── */
.tc-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition);
  background: transparent !important;
  border: none !important;
}
.tc-summary:hover { background: var(--bg-card-hover) !important; }
.tc-name-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tc-name-row { display: flex; align-items: center; gap: 8px; }
.tc-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-url-row { font-size: 11px; font-family: var(--font-mono); line-height: 1.2; }
.tc-url { color: var(--text-muted); text-decoration: none; }
.tc-url:hover { color: var(--cyan); text-decoration: underline; }
.tc-ai-badge, .tc-manual-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
  font-family: var(--font-mono);
}
.tc-ai-badge { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.tc-manual-badge { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); border: 1px solid var(--border); }

/* Origin badge for Jira verification records — AI run vs manual transition */
.src-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
  padding: 1px 5px; border-radius: 3px;
  font-family: var(--font-mono); margin-left: 4px; vertical-align: middle;
}
.src-ai     { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.src-manual { background: rgba(251, 146, 60, 0.12); color: #fb923c; border: 1px solid rgba(251, 146, 60, 0.3); }

/* ─── Jira queue buckets (测试中 / 已处理提测中 / 测试完成) ─── */
details.jq-bucket { margin: 0; }
details.jq-bucket + details.jq-bucket { margin-top: 12px; }
details.jq-bucket > summary.jq-bucket-header {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
details.jq-bucket > summary.jq-bucket-header::-webkit-details-marker { display: none; }
details.jq-bucket > summary.jq-bucket-header:hover { background: rgba(255,255,255,0.04); }
.jq-bucket-arrow { flex-shrink: 0; transition: transform 0.2s; color: var(--text-muted); }
details.jq-bucket[open] > summary > .jq-bucket-arrow { transform: rotate(90deg); }
.jq-bucket-title { flex: 1; }
.jq-bucket-count {
  font-size: 11px; font-family: var(--font-mono);
  color: var(--text-muted); font-weight: 500;
  background: rgba(255,255,255,0.06); padding: 1px 7px; border-radius: 10px;
}
details.jq-bucket[open] .jq-bucket-card {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border-top: 0;
}
.jq-bucket-card { border: 1px solid var(--border); border-top: 0; }
.jq-done-row { opacity: 0.75; }

/* Aligned table inside buckets — match first cell's left padding with header.
   table-layout:fixed makes the browser respect <colgroup> widths, so every
   bucket table lines up identically regardless of row content length. */
.jq-table { margin: 0 !important; table-layout: fixed; width: 100%; }
.jq-table th, .jq-table td { padding: 10px 12px !important; }
.jq-table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--text-muted); font-weight: 600;
  background: transparent; border-bottom: 1px solid var(--border);
}
.jq-table .jira-key { white-space: nowrap; }
.jq-table .jh-td-summary {
  max-width: none !important;       /* width is controlled by <col> now */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jq-status-col, .jq-status-cell { white-space: nowrap; }
.jq-ai-col, .jq-ai-cell { white-space: nowrap; text-align: center; }
.jq-ai-badge {
  display: inline-block;
  min-width: 56px;
  text-align: center;
  text-decoration: none !important;
}
.jq-ai-badge:hover { opacity: 0.85; }

/* ─── Clickable status dropdown ─── */
/* Summary IS the pill: daisyUI `badge badge-{info,warning,success}` class
   gives it color; we only add a tiny caret and kill the browser marker.
   Menu is portaled to <body> so no ancestor overflow/transform can move it. */
details.status-dd { display: inline-block; position: static; }
details.status-dd > summary.status-dd-pill {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  outline: none;                  /* kill the focus ring that made the pill "deform" */
  transition: filter 0.15s;
}
details.status-dd > summary.status-dd-pill::-webkit-details-marker,
details.status-dd > summary.status-dd-pill::marker { display: none; content: ''; }
details.status-dd > summary.status-dd-pill:hover   { filter: brightness(1.12); }
details.status-dd > summary.status-dd-pill:focus-visible {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}
.status-dd-caret {
  font-size: 9px; line-height: 1; opacity: 0.7;
  transition: transform 0.2s;
}
details.status-dd[open] .status-dd-caret { transform: rotate(180deg); }

.status-dd-menu {
  position: fixed;                 /* portaled to <body>, anchored to viewport */
  z-index: 9999;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 4px;
  display: flex; flex-direction: column;
  max-height: 300px; overflow-y: auto;
  font-size: 12px;
}
.status-dd-item {
  background: transparent; border: none; text-align: left;
  padding: 7px 10px; border-radius: 4px; cursor: pointer;
  color: var(--text-secondary); font-size: 12px; font-family: var(--font-sans);
  white-space: nowrap;
}
.status-dd-item:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.status-dd-loading, .status-dd-empty {
  padding: 8px 10px; font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}

/* Corner toast — brief success/error notifications for mutations */
.mini-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 10000;
  padding: 10px 16px; border-radius: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: opacity 0.3s ease-out;
  pointer-events: none;
  max-width: 360px;
}
.mini-toast.success { border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.12); color: #86efac; }
.mini-toast.error   { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.12); color: #fca5a5; }
.tc-stat { font-size: 12px; font-family: var(--font-mono); white-space: nowrap; }
.tc-bar { width: 80px; flex-shrink: 0; }
.tc-count { font-size: 13px; font-weight: 700; font-family: var(--font-mono); color: var(--text-secondary); white-space: nowrap; min-width: 24px; text-align: right; }

/* ─── Run chip selector ─── */
.run-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.run-chip:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.run-chip .run-chip-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border-hover);
  font-size: 11px;
  color: transparent;
  transition: all var(--transition);
}
.run-chip.selected {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--text-primary);
}
.run-chip.selected .run-chip-check {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ─── Legacy helpers ─── */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn { font-family: var(--font-sans) !important; }
.btn-sm, .btn-xs { white-space: nowrap; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Selection ─── */
::selection { background: rgba(34,197,94,0.3); color: #fff; }

/* ─── Stagger children animation ─── */
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 50ms; }
.stagger-in > *:nth-child(3) { animation-delay: 100ms; }
.stagger-in > *:nth-child(4) { animation-delay: 150ms; }
.stagger-in > *:nth-child(5) { animation-delay: 200ms; }
.stagger-in > *:nth-child(6) { animation-delay: 250ms; }
.stagger-in > * { animation: fadeSlideIn 0.3s ease-out both; }

/* ─── Scenario cards (AI Lab step 3) ─── */
.sc-card { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; background: var(--bg-surface); }
.sc-card > summary { padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; }
.sc-card > summary::-webkit-details-marker { display: none; }
.sc-card > summary:hover { background: rgba(255,255,255,0.04); }
.sc-num { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background: rgba(255,255,255,0.06); padding: 2px 7px; border-radius: 3px; }
.sc-name { font-weight: 500; flex: 1; }
.sc-route { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); }
.sc-method { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; font-family: var(--font-mono); display: inline-block; }
.sc-auto    { background: rgba(34,197,94,0.15);  color: #4ade80; }
.sc-manual  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.sc-api     { background: rgba(168,85,247,0.15); color: #c084fc; }
.sc-onchain { background: rgba(245,158,11,0.15); color: #fbbf24; }
.sc-review  { background: rgba(236,72,153,0.15); color: #f472b6; }
.sc-body { padding: 0 12px 12px 40px; }
.sc-desc { color: var(--text-secondary); font-size: 13px; margin: 6px 0 10px; }
.sc-section-title { font-size: 11px; text-transform: uppercase; color: var(--text-muted); margin: 8px 0 4px; }
.sc-steps { padding-left: 20px; margin: 4px 0 10px; font-size: 12px; }
.sc-steps code { font-family: var(--font-mono); background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 3px; }
.sc-expected { color: var(--text-secondary); font-size: 13px; margin: 4px 0; }

/* ─── Run detail tabs & Review ─── */
.run-tabs { border-bottom: 1px solid var(--border); }
.run-tab { background:none;border:none;cursor:pointer;padding:8px 14px;font-size:13px;color:var(--text-muted);border-bottom:2px solid transparent;display:inline-flex;align-items:center;gap:6px; }
.run-tab:hover { color:var(--text-primary); }
.run-tab.active { color:var(--text-primary);border-bottom-color:var(--cyan); }
.review-badge { background:var(--cyan);color:white;font-size:10px;padding:1px 6px;border-radius:10px;font-weight:600; }
.review-stats { display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap; }
.stat-chip { font-size:12px;padding:4px 10px;border-radius:14px;background:var(--bg-surface);border:1px solid var(--border); }
.stat-ai { border-color:rgba(34,197,94,0.3); }
.stat-pending { border-color:rgba(59,130,246,0.4);color:#60a5fa; }
.stat-human { border-color:rgba(168,85,247,0.3); }
.stat-override { border-color:rgba(245,158,11,0.3);color:#fbbf24; }
.stat-final { background:rgba(255,255,255,0.05);font-weight:600; }
.review-filters { display:flex;gap:16px;font-size:12px;color:var(--text-muted);margin-bottom:8px;padding:0 4px; }
.review-filters label { display:flex;align-items:center;gap:4px;cursor:pointer; }
.review-table th { font-size:11px;text-transform:uppercase;letter-spacing:0.5px;color:var(--text-muted);background:var(--bg-surface);white-space:nowrap; }
.review-table td { vertical-align:top;padding:8px 10px;font-size:13px; }
.review-table td:first-child { white-space:nowrap; }
.review-row:hover { background:rgba(255,255,255,0.03); }
.r-name { font-weight:500;color:var(--text-primary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4; }
.r-desc { font-size:12px;color:var(--text-secondary);margin-top:2px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden; }
.r-expect { font-size:11px;color:var(--text-muted);margin-top:2px;font-style:italic;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden; }
.r-ok { color:var(--green);font-weight:500; }
.r-fail { color:var(--red);font-weight:500;cursor:help; }
.r-muted { color:var(--text-muted); }
.r-pending { color:#60a5fa;font-weight:500; }
.r-override { color:#fbbf24;font-weight:500; }
.r-error { font-size:11px;color:var(--red);margin-top:4px;padding:4px 8px;background:rgba(239,68,68,0.08);border-radius:4px;word-break:break-all; }
.m-badge { font-size:10px;font-weight:700;padding:2px 8px;border-radius:10px;font-family:var(--font-mono); }
.m-auto { background:rgba(34,197,94,0.15);color:#4ade80; }
.m-manual { background:rgba(59,130,246,0.15);color:#60a5fa; }
.m-api { background:rgba(168,85,247,0.15);color:#c084fc; }
.m-onchain { background:rgba(245,158,11,0.15);color:#fbbf24; }
.m-review { background:rgba(236,72,153,0.15);color:#f472b6; }

/* ─── Explore screenshot gallery (Step 2) ─── */
.explore-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.explore-thumb {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--bg-surface);
  transition: all var(--transition);
}
.explore-thumb:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.explore-thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  object-position: top;
  display: block;
}
.explore-thumb-label {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 6px 8px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Running-lab nav pill ─── */
.lab-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.lab-pill:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.6);
}
.lab-pill.awaiting {
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.5);
}
.lab-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: lab-pulse 1.4s ease-in-out infinite;
}
.lab-pill.awaiting .lab-pill-dot { background: var(--yellow); animation: none; }
.lab-pill-label { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.lab-pill-step { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.lab-pill-title { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
@keyframes lab-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* Operations selector button on the multisig script card — compact, shows
   current selection count, opens a modal on click. Styled to match the
   existing inputs/selects in the card. */
.oneshot-ops-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.oneshot-ops-btn:hover {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.08);
}
.oneshot-ops-btn .oneshot-ops-summary {
  font-family: var(--font-mono);
  font-size: 11px;
}
