/* ==========================================================================
   ReplayQA design system
   Tokens → base → layout (public + app shell) → components → pages.
   Bootstrap 5.3 provides grid/utilities; everything visual is themed here.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root,
[data-bs-theme="light"] {
  --rq-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rq-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --rq-bg: #f6f7f9;
  --rq-bg-elevated: #ffffff;
  --rq-surface: #ffffff;
  --rq-surface-2: #f1f3f6;
  --rq-surface-3: #e8ebf0;
  --rq-border: #e2e5ea;
  --rq-border-strong: #cbd1d9;
  --rq-text: #151a23;
  --rq-text-2: #3d4553;
  --rq-text-muted: #5f6878;          /* 5.6:1 on white */
  --rq-accent: #1f5eff;              /* electric blue, 5.1:1 on white */
  --rq-accent-hover: #164ad6;
  --rq-accent-soft: #e8efff;
  --rq-accent-ink: #ffffff;
  --rq-violet: #6d4aff;
  --rq-violet-soft: #f0ecff;
  --rq-success: #157a3a;
  --rq-success-soft: #e6f6ec;
  --rq-danger: #c42b2b;
  --rq-danger-soft: #fdecec;
  --rq-warning: #9a5b00;
  --rq-warning-soft: #fff4de;
  --rq-info-soft: #eef4ff;
  --rq-focus: 0 0 0 3px rgba(31, 94, 255, .35);
  --rq-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --rq-shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 16px rgba(16, 24, 40, .05);
  --rq-shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);
  --rq-sidebar-bg: #0f131a;
  --rq-sidebar-text: #b9c1cf;
  --rq-sidebar-active: #ffffff;
  --rq-sidebar-hover: #1a2030;

  --rq-radius-sm: 6px;
  --rq-radius: 10px;
  --rq-radius-lg: 16px;
  --rq-space-1: 4px;
  --rq-space-2: 8px;
  --rq-space-3: 12px;
  --rq-space-4: 16px;
  --rq-space-5: 24px;
  --rq-space-6: 32px;
  --rq-space-7: 48px;
  --rq-space-8: 72px;

  --rq-text-xs: .75rem;
  --rq-text-sm: .8125rem;
  --rq-text-base: .9375rem;
  --rq-text-lg: 1.125rem;
  --rq-text-xl: 1.375rem;
  --rq-text-2xl: 1.75rem;
  --rq-text-3xl: 2.5rem;
  --rq-text-4xl: 3.25rem;

  --rq-ease: cubic-bezier(.2, .8, .2, 1);
  --rq-dur: 160ms;

  --bs-body-font-family: var(--rq-font);
  --bs-body-bg: var(--rq-bg);
  --bs-body-color: var(--rq-text);
  --bs-border-color: var(--rq-border);
  --bs-link-color: var(--rq-accent);
  --bs-link-color-rgb: 31, 94, 255;
  --bs-link-hover-color: var(--rq-accent-hover);
  --bs-primary: var(--rq-accent);
  --bs-primary-rgb: 31, 94, 255;
  --bs-secondary-color: var(--rq-text-muted);
}

[data-bs-theme="dark"] {
  --rq-bg: #0b0e13;
  --rq-bg-elevated: #12161e;
  --rq-surface: #131821;
  --rq-surface-2: #1a202b;
  --rq-surface-3: #232a37;
  --rq-border: #252c39;
  --rq-border-strong: #343d4e;
  --rq-text: #e9edf3;
  --rq-text-2: #c4cbd6;
  --rq-text-muted: #9aa4b4;          /* 7:1 on surface */
  --rq-accent: #5b8cff;
  --rq-accent-hover: #7aa2ff;
  --rq-accent-soft: rgba(91, 140, 255, .14);
  --rq-accent-ink: #0b0e13;
  --rq-violet: #a08bff;
  --rq-violet-soft: rgba(160, 139, 255, .14);
  --rq-success: #4ade80;
  --rq-success-soft: rgba(74, 222, 128, .12);
  --rq-danger: #f87171;
  --rq-danger-soft: rgba(248, 113, 113, .12);
  --rq-warning: #fbbf24;
  --rq-warning-soft: rgba(251, 191, 36, .12);
  --rq-info-soft: rgba(91, 140, 255, .10);
  --rq-focus: 0 0 0 3px rgba(91, 140, 255, .45);
  --rq-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --rq-shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 6px 20px rgba(0, 0, 0, .35);
  --rq-shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
  --rq-sidebar-bg: #080a0e;
  --rq-sidebar-hover: #141923;

  --bs-body-bg: var(--rq-bg);
  --bs-body-color: var(--rq-text);
  --bs-border-color: var(--rq-border);
  --bs-link-color: var(--rq-accent);
  --bs-link-color-rgb: 91, 140, 255;
  --bs-secondary-color: var(--rq-text-muted);
  color-scheme: dark;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--rq-font);
  font-size: var(--rq-text-base);
  line-height: 1.55;
  background: var(--rq-bg);
  color: var(--rq-text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, h5, h6 { color: var(--rq-text); font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: var(--rq-text-2xl); }
h2 { font-size: var(--rq-text-xl); }
h3 { font-size: var(--rq-text-lg); }
a { text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code, kbd, pre, .mono { font-family: var(--rq-mono); font-size: .85em; }
code { color: var(--rq-violet); background: var(--rq-violet-soft); padding: 1px 5px; border-radius: 4px; }
hr { border-color: var(--rq-border); opacity: 1; }
.text-muted, .text-secondary { color: var(--rq-text-muted) !important; }
::selection { background: var(--rq-accent-soft); }

:focus-visible { outline: none; box-shadow: var(--rq-focus) !important; border-radius: var(--rq-radius-sm); }
.skip-link {
  position: absolute; left: var(--rq-space-4); top: -60px; z-index: 2000;
  background: var(--rq-accent); color: var(--rq-accent-ink); padding: 8px 14px; border-radius: var(--rq-radius-sm);
}
.skip-link:focus { top: var(--rq-space-3); }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; }

.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 28px; height: 28px; }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-font-weight: 550;
  --bs-btn-font-size: var(--rq-text-sm);
  --bs-btn-padding-y: .5rem;
  --bs-btn-padding-x: .9rem;
  --bs-btn-border-radius: var(--rq-radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--rq-dur) var(--rq-ease), border-color var(--rq-dur) var(--rq-ease), color var(--rq-dur), transform var(--rq-dur);
}
.btn:active { transform: translateY(1px); }
.btn-lg { --bs-btn-font-size: var(--rq-text-base); --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.2rem; }
.btn-sm { --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: var(--rq-text-xs); }
.btn-primary {
  --bs-btn-bg: var(--rq-accent); --bs-btn-border-color: var(--rq-accent); --bs-btn-color: var(--rq-accent-ink);
  --bs-btn-hover-bg: var(--rq-accent-hover); --bs-btn-hover-border-color: var(--rq-accent-hover); --bs-btn-hover-color: var(--rq-accent-ink);
  --bs-btn-active-bg: var(--rq-accent-hover); --bs-btn-active-border-color: var(--rq-accent-hover); --bs-btn-active-color: var(--rq-accent-ink);
  --bs-btn-disabled-bg: var(--rq-accent); --bs-btn-disabled-border-color: var(--rq-accent); --bs-btn-disabled-color: var(--rq-accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, var(--rq-shadow-sm);
}
.btn-secondary, .btn-outline-secondary {
  --bs-btn-bg: var(--rq-surface); --bs-btn-border-color: var(--rq-border-strong); --bs-btn-color: var(--rq-text);
  --bs-btn-hover-bg: var(--rq-surface-2); --bs-btn-hover-border-color: var(--rq-border-strong); --bs-btn-hover-color: var(--rq-text);
  --bs-btn-active-bg: var(--rq-surface-3); --bs-btn-active-border-color: var(--rq-border-strong); --bs-btn-active-color: var(--rq-text);
  --bs-btn-disabled-bg: var(--rq-surface); --bs-btn-disabled-color: var(--rq-text-muted); --bs-btn-disabled-border-color: var(--rq-border);
}
.btn-ghost {
  --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: var(--rq-text-2);
  --bs-btn-hover-bg: var(--rq-surface-2); --bs-btn-hover-color: var(--rq-text); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: var(--rq-surface-3); --bs-btn-active-border-color: transparent;
}
.btn-danger, .btn-outline-danger {
  --bs-btn-bg: var(--rq-surface); --bs-btn-border-color: var(--rq-border-strong); --bs-btn-color: var(--rq-danger);
  --bs-btn-hover-bg: var(--rq-danger-soft); --bs-btn-hover-border-color: var(--rq-danger); --bs-btn-hover-color: var(--rq-danger);
  --bs-btn-active-bg: var(--rq-danger-soft); --bs-btn-active-border-color: var(--rq-danger); --bs-btn-active-color: var(--rq-danger);
}
.btn-success {
  --bs-btn-bg: var(--rq-success); --bs-btn-border-color: var(--rq-success); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--rq-success); --bs-btn-hover-border-color: var(--rq-success); --bs-btn-hover-color: #fff;
}
[data-bs-theme="dark"] .btn-success { --bs-btn-color: #04120a; --bs-btn-hover-color: #04120a; }
.btn-play {
  --bs-btn-bg: var(--rq-accent); --bs-btn-border-color: var(--rq-accent); --bs-btn-color: var(--rq-accent-ink);
  --bs-btn-hover-bg: var(--rq-accent-hover); --bs-btn-hover-color: var(--rq-accent-ink); --bs-btn-hover-border-color: var(--rq-accent-hover);
  border-radius: 999px; padding-left: 1rem; padding-right: 1.1rem;
}
.btn-icon { --bs-btn-padding-x: .5rem; }

/* ---------- Forms ---------- */
.form-label { font-size: var(--rq-text-sm); font-weight: 560; color: var(--rq-text-2); margin-bottom: 6px; }
.form-text { color: var(--rq-text-muted); font-size: var(--rq-text-xs); }
.form-control, .form-select {
  background-color: var(--rq-surface); border: 1px solid var(--rq-border-strong); color: var(--rq-text);
  border-radius: var(--rq-radius-sm); font-size: var(--rq-text-sm); padding: .55rem .75rem;
  transition: border-color var(--rq-dur), box-shadow var(--rq-dur);
}
.form-select { padding-right: 2.25rem; } /* room for the dropdown arrow, which the shared padding above would cover */
.form-control::placeholder { color: var(--rq-text-muted); opacity: .8; }
.form-control:focus, .form-select:focus { border-color: var(--rq-accent); box-shadow: var(--rq-focus); background-color: var(--rq-surface); color: var(--rq-text); }
.form-control-sm, .form-select-sm { padding: .35rem .55rem; font-size: var(--rq-text-xs); }
.form-check-input { border-color: var(--rq-border-strong); background-color: var(--rq-surface); }
.form-check-input:checked { background-color: var(--rq-accent); border-color: var(--rq-accent); }
.form-check-input:focus { box-shadow: var(--rq-focus); border-color: var(--rq-accent); }
.input-group-text { background: var(--rq-surface-2); border-color: var(--rq-border-strong); color: var(--rq-text-muted); font-size: var(--rq-text-sm); }
.field-validation-error, .validation-summary-errors { color: var(--rq-danger); font-size: var(--rq-text-xs); }
.validation-summary-errors ul { padding-left: 1rem; margin: 0; }
.input-validation-error { border-color: var(--rq-danger) !important; }

/* ---------- Cards / surfaces ---------- */
.card, .rq-card {
  --bs-card-bg: var(--rq-surface); --bs-card-border-color: var(--rq-border); --bs-card-border-radius: var(--rq-radius);
  --bs-card-cap-bg: transparent; --bs-card-spacer-y: 1.25rem; --bs-card-spacer-x: 1.25rem;
  background: var(--rq-surface); border: 1px solid var(--rq-border); border-radius: var(--rq-radius); box-shadow: var(--rq-shadow-sm);
}
.rq-card { padding: var(--rq-space-5); }
.card-header { border-bottom: 1px solid var(--rq-border); padding: 1rem 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title { font-size: var(--rq-text-base); font-weight: 650; margin: 0; }
.card-subtle { background: var(--rq-surface-2); border: 1px dashed var(--rq-border-strong); border-radius: var(--rq-radius); padding: var(--rq-space-5); }
.rq-section-title { font-size: var(--rq-text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--rq-text-muted); font-weight: 650; margin-bottom: var(--rq-space-3); }

.stat { padding: var(--rq-space-5); }
.stat-label { font-size: var(--rq-text-sm); color: var(--rq-text-muted); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: var(--rq-text-2xl); font-weight: 680; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--rq-text-xs); color: var(--rq-text-muted); }

/* ---------- Badges / status ---------- */
.badge-rq {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--rq-text-xs); font-weight: 600;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; line-height: 1.4; white-space: nowrap;
  background: var(--rq-surface-2); color: var(--rq-text-2); border-color: var(--rq-border);
}
.badge-rq .icon { width: 12px; height: 12px; vertical-align: 0; }
.status-passed, .badge-success { background: var(--rq-success-soft); color: var(--rq-success); border-color: transparent; }
.status-failed, .status-error, .status-timedout, .badge-danger { background: var(--rq-danger-soft); color: var(--rq-danger); border-color: transparent; }
.status-running { background: var(--rq-accent-soft); color: var(--rq-accent); border-color: transparent; }
.status-queued { background: var(--rq-surface-2); color: var(--rq-text-2); }
.status-canceled, .status-skipped { background: var(--rq-surface-2); color: var(--rq-text-muted); }
.badge-warning, .status-draft { background: var(--rq-warning-soft); color: var(--rq-warning); border-color: transparent; }
.status-approved { background: var(--rq-success-soft); color: var(--rq-success); border-color: transparent; }
.status-archived, .status-superseded, .status-rejected { background: var(--rq-surface-2); color: var(--rq-text-muted); }
.badge-violet, .badge-ai { background: var(--rq-violet-soft); color: var(--rq-violet); border-color: transparent; }
.badge-accent { background: var(--rq-accent-soft); color: var(--rq-accent); border-color: transparent; }
.badge-simulated { background: var(--rq-warning-soft); color: var(--rq-warning); border: 1px dashed currentColor; }
.status-running .icon { animation: rq-spin 1.1s linear infinite; }
@keyframes rq-spin { to { transform: rotate(360deg); } }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: var(--rq-text-xs); color: var(--rq-text-muted); font-variant-numeric: tabular-nums; }
.confidence-bar { width: 44px; height: 6px; border-radius: 3px; background: var(--rq-surface-3); overflow: hidden; }
.confidence-bar > span { display: block; height: 100%; background: var(--rq-accent); border-radius: 3px; }
.confidence.low .confidence-bar > span { background: var(--rq-warning); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--rq-text); --bs-table-border-color: var(--rq-border); --bs-table-hover-bg: var(--rq-surface-2); --bs-table-hover-color: var(--rq-text); margin: 0; font-size: var(--rq-text-sm); }
.table > thead th { font-size: var(--rq-text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--rq-text-muted); font-weight: 650; border-bottom-width: 1px; padding: .7rem 1rem; white-space: nowrap; background: var(--rq-surface); }
.table > tbody td { padding: .8rem 1rem; vertical-align: middle; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table-card { background: var(--rq-surface); border: 1px solid var(--rq-border); border-radius: var(--rq-radius); overflow: hidden; box-shadow: var(--rq-shadow-sm); }
/* position: relative contains absolutely positioned children (visually-hidden header labels), which would otherwise
   escape the horizontal scroll and widen the whole page on phones. */
.table-card .table-responsive { margin: 0; position: relative; }
.row-link { color: var(--rq-text); font-weight: 560; }
.row-link:hover { color: var(--rq-accent); }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Alerts / flash ---------- */
.alert { border-radius: var(--rq-radius); font-size: var(--rq-text-sm); border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--rq-success-soft); color: var(--rq-success); }
.alert-danger { background: var(--rq-danger-soft); color: var(--rq-danger); }
.alert-warning { background: var(--rq-warning-soft); color: var(--rq-warning); }
.alert-info { background: var(--rq-info-soft); color: var(--rq-text-2); border-color: var(--rq-border); }
.alert .icon { margin-top: 2px; }
.alert pre { white-space: pre-wrap; font-family: inherit; margin: 0; font-size: inherit; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: var(--rq-space-8) var(--rq-space-5); color: var(--rq-text-muted); }
.empty-state .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--rq-accent-soft); color: var(--rq-accent); display: inline-grid; place-items: center; margin-bottom: var(--rq-space-4); }
.empty-state h3 { color: var(--rq-text); margin-bottom: 6px; }
.empty-state p { max-width: 460px; margin: 0 auto var(--rq-space-4); }

/* ==========================================================================
   Public site
   ========================================================================== */
.site-nav { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--rq-bg) 85%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--rq-border); }
.site-nav .container { display: flex; align-items: center; gap: var(--rq-space-5); height: 64px; }
.site-nav .nav-link { color: var(--rq-text-2); font-size: var(--rq-text-sm); font-weight: 550; padding: 6px 10px; border-radius: var(--rq-radius-sm); }
.site-nav .nav-link:hover { color: var(--rq-text); background: var(--rq-surface-2); text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 720; letter-spacing: -.02em; color: var(--rq-text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; color: var(--rq-text); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--rq-accent), var(--rq-violet)); color: #fff; }
.brand-mark svg { width: 15px; height: 15px; fill: #fff; stroke: none; }

.hero { padding: var(--rq-space-8) 0 var(--rq-space-7); }
.hero h1 { font-size: clamp(2.2rem, 5vw, var(--rq-text-4xl)); letter-spacing: -.035em; font-weight: 740; max-width: 820px; }
.hero .lead { font-size: var(--rq-text-lg); color: var(--rq-text-2); max-width: 640px; margin-top: var(--rq-space-4); }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: var(--rq-text-xs); font-weight: 650; color: var(--rq-accent); background: var(--rq-accent-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: var(--rq-space-4); }
.hero-visual { margin-top: var(--rq-space-7); border: 1px solid var(--rq-border); border-radius: var(--rq-radius-lg); background: var(--rq-surface); box-shadow: var(--rq-shadow-lg); overflow: hidden; }
.hero-visual .hv-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--rq-border); background: var(--rq-surface-2); }
.hero-visual .hv-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--rq-border-strong); }
.hv-body { display: grid; grid-template-columns: 1.3fr 1fr; min-height: 320px; }
.hv-video { background: repeating-linear-gradient(135deg, var(--rq-surface-2) 0 12px, var(--rq-surface) 12px 24px); display: grid; place-items: center; border-right: 1px solid var(--rq-border); position: relative; }
.hv-play { width: 64px; height: 64px; border-radius: 50%; background: var(--rq-accent); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(31,94,255,.35); }
.hv-play svg { fill: #fff; stroke: none; width: 22px; height: 22px; margin-left: 4px; }
.hv-steps { padding: var(--rq-space-4); display: flex; flex-direction: column; gap: 8px; }
.hv-step { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--rq-border); border-radius: var(--rq-radius-sm); font-size: var(--rq-text-sm); background: var(--rq-bg-elevated); }
.hv-step .n { font-family: var(--rq-mono); font-size: var(--rq-text-xs); color: var(--rq-text-muted); width: 18px; }
.feature { padding: var(--rq-space-5); height: 100%; }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--rq-accent-soft); color: var(--rq-accent); margin-bottom: var(--rq-space-4); }
.feature-icon.violet { background: var(--rq-violet-soft); color: var(--rq-violet); }
.section { padding: var(--rq-space-8) 0; }
.section-head { max-width: 640px; margin-bottom: var(--rq-space-6); }
.section-head p { color: var(--rq-text-2); }
.honesty { border-left: 3px solid var(--rq-violet); padding-left: var(--rq-space-4); color: var(--rq-text-2); }
.site-footer { border-top: 1px solid var(--rq-border); padding: var(--rq-space-6) 0; color: var(--rq-text-muted); font-size: var(--rq-text-sm); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--rq-space-6); }
.footer-grid h2 { font-size: var(--rq-text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--rq-text); margin-bottom: var(--rq-space-3); }
.footer-grid nav a { display: block; color: var(--rq-text-muted); padding: 3px 0; }
.footer-grid nav a:hover { color: var(--rq-text); }
.footer-base { margin-top: var(--rq-space-6); padding-top: var(--rq-space-4); border-top: 1px solid var(--rq-border); }
@media (max-width: 767.98px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

.hv-file { position: absolute; left: 14px; bottom: 12px; font-family: var(--rq-mono); font-size: var(--rq-text-xs); color: var(--rq-text-muted); background: var(--rq-surface); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rq-border); }
.hv-ok { margin-left: auto; color: var(--rq-success); display: inline-flex; }
@media (max-width: 767.98px) { .hv-body { grid-template-columns: 1fr; } .hv-video { min-height: 160px; border-right: 0; border-bottom: 1px solid var(--rq-border); } }

@media (max-width: 575.98px) {
    .site-nav .container { gap: var(--rq-space-2); }
    .site-nav [data-theme-set] { display: none; }
    .site-nav .btn { white-space: nowrap; padding: 6px 12px; }
}
.compare-table th[scope="row"] { font-weight: 600; min-width: 140px; }
.compare-table td:nth-child(2) { font-weight: 600; color: var(--rq-text); background: var(--rq-accent-soft); }
.faq { max-width: 820px; display: grid; gap: var(--rq-space-2); }
.faq details { border: 1px solid var(--rq-border); border-radius: var(--rq-radius); background: var(--rq-surface); padding: 0 var(--rq-space-4); }
.faq summary { cursor: pointer; font-weight: 600; padding: var(--rq-space-4) 0; list-style-position: inside; }
.faq details[open] summary { padding-bottom: var(--rq-space-2); }
.faq details p { color: var(--rq-text-2); margin-bottom: var(--rq-space-4); }
.cta-band { border: 1px solid var(--rq-border); border-radius: var(--rq-radius-lg); padding: var(--rq-space-7) var(--rq-space-6); text-align: center;
    background: linear-gradient(135deg, var(--rq-accent-soft), var(--rq-violet-soft)); }
.cta-band h2 { font-size: var(--rq-text-2xl); letter-spacing: -.02em; }
.cta-band p { color: var(--rq-text-2); max-width: 560px; margin: var(--rq-space-2) auto var(--rq-space-4); }
.cta-band .btn { margin: 4px; }

/* Blog */
.post-card { padding: var(--rq-space-5); height: 100%; position: relative; transition: border-color .15s; }
.post-card:hover, .post-lead:hover { border-color: var(--rq-accent); }
.post-card h3 a, .post-lead h2 a { color: var(--rq-text); }
.post-lead { padding: var(--rq-space-6); position: relative; }
.post-lead h2 { font-size: var(--rq-text-2xl); letter-spacing: -.02em; margin: var(--rq-space-2) 0; }
.post-meta { font-size: var(--rq-text-xs); color: var(--rq-text-muted); margin-bottom: var(--rq-space-2); }
.post-wrap { padding-top: var(--rq-space-6); padding-bottom: var(--rq-space-7); }
.post-crumbs { font-size: var(--rq-text-sm); color: var(--rq-text-muted); margin-bottom: var(--rq-space-4); }
.post-layout { display: grid; grid-template-columns: minmax(0, 720px) 240px; gap: var(--rq-space-7); justify-content: space-between; }
.post-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -.03em; font-weight: 740; }
.post-dek { font-size: var(--rq-text-lg); color: var(--rq-text-2); margin: var(--rq-space-3) 0; }
.post-head { padding-bottom: var(--rq-space-5); margin-bottom: var(--rq-space-5); border-bottom: 1px solid var(--rq-border); }
.post-toc { position: sticky; top: 88px; align-self: start; font-size: var(--rq-text-sm); }
.post-toc h2 { font-size: var(--rq-text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--rq-text-muted); }
.post-toc ol { padding-left: 1.1rem; display: grid; gap: 6px; }
.post-toc a { color: var(--rq-text-2); }
@media (max-width: 991.98px) { .post-layout { grid-template-columns: minmax(0, 1fr); } .post-toc { display: none; } }
.prose { font-size: 1.0625rem; line-height: 1.75; color: var(--rq-text); }
.prose h2 { font-size: 1.5rem; letter-spacing: -.02em; margin: 2.2em 0 .6em; scroll-margin-top: 88px; }
.prose h3 { font-size: 1.15rem; margin: 1.8em 0 .5em; scroll-margin-top: 88px; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.1em; }
.prose li { margin-bottom: .35em; }
.prose code { font-family: var(--rq-mono); font-size: .88em; background: var(--rq-surface-2); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--rq-surface-2); border: 1px solid var(--rq-border); border-radius: var(--rq-radius); padding: var(--rq-space-4); overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid var(--rq-accent); padding-left: var(--rq-space-4); color: var(--rq-text-2); }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.2em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--rq-border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--rq-surface-2); }
.prose kbd { font-family: var(--rq-mono); font-size: .85em; border: 1px solid var(--rq-border-strong); border-bottom-width: 2px; border-radius: 4px; padding: .05em .4em; background: var(--rq-surface); }
/* ::: tip / ::: note / ::: warning containers */
.prose .tip, .prose .note, .prose .warning { border: 1px solid var(--rq-border); border-left-width: 4px; border-radius: var(--rq-radius); padding: var(--rq-space-3) var(--rq-space-4); margin: 0 0 1.2em; background: var(--rq-surface); }
.prose .tip { border-left-color: var(--rq-success); }
.prose .note { border-left-color: var(--rq-accent); }
.prose .warning { border-left-color: var(--rq-warning, #d97706); }
.prose .tip > :last-child, .prose .note > :last-child, .prose .warning > :last-child { margin-bottom: 0; }
.prose .tip::before, .prose .note::before, .prose .warning::before { display: block; font-size: var(--rq-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.prose .tip::before { content: "Tip"; color: var(--rq-success); }
.prose .note::before { content: "Note"; color: var(--rq-accent); }
.prose .warning::before { content: "Watch out"; color: var(--rq-warning, #d97706); }

/* Docs */
.docs-search { position: relative; }
.docs-results { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 6px); background: var(--rq-bg-elevated, var(--rq-surface)); border: 1px solid var(--rq-border); border-radius: var(--rq-radius); box-shadow: var(--rq-shadow-lg); padding: 6px; margin: 0; max-height: 420px; overflow-y: auto; }
.docs-results a { display: block; padding: 8px 10px; border-radius: var(--rq-radius-sm); color: var(--rq-text); }
.docs-results a:hover, .docs-results a:focus { background: var(--rq-surface-2); text-decoration: none; outline: none; }
.docs-results .title { display: block; font-weight: 600; font-size: var(--rq-text-sm); }
.docs-results .meta { display: block; font-size: var(--rq-text-xs); color: var(--rq-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs-result-empty { padding: 8px 10px; font-size: var(--rq-text-sm); color: var(--rq-text-muted); }
.docs-start { display: flex; flex-direction: row; align-items: center; gap: var(--rq-space-4); padding: var(--rq-space-5); color: var(--rq-text); border-color: var(--rq-accent); }
.docs-start:hover { text-decoration: none; color: var(--rq-text); box-shadow: 0 0 0 1px var(--rq-accent); }
.docs-start .feature-icon { margin-bottom: 0; flex-shrink: 0; }
.docs-section-card { padding: var(--rq-space-5); height: 100%; }
.docs-section-links { padding-left: 1.1rem; margin: 0; display: grid; gap: 4px; font-size: var(--rq-text-sm); }
.docs-wrap { padding-top: var(--rq-space-5); padding-bottom: var(--rq-space-7); }
.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: var(--rq-space-6); }
.docs-nav { position: sticky; top: 80px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 4px; }
.docs-nav-toggle { margin-top: var(--rq-space-4); }
.docs-nav-toggle > summary { display: none; }
.docs-nav-group { margin-bottom: var(--rq-space-4); }
.docs-nav-label { font-size: var(--rq-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--rq-text-muted); margin-bottom: 4px; }
.docs-nav a { display: block; font-size: var(--rq-text-sm); color: var(--rq-text-2); padding: 4px 10px; border-radius: var(--rq-radius-sm); border-left: 2px solid transparent; }
.docs-nav a:hover { color: var(--rq-text); background: var(--rq-surface-2); text-decoration: none; }
.docs-nav a.active { color: var(--rq-accent); background: var(--rq-accent-soft); font-weight: 600; }
.docs-head { padding-bottom: var(--rq-space-4); margin-bottom: var(--rq-space-5); border-bottom: 1px solid var(--rq-border); }
.docs-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.3rem); letter-spacing: -.03em; font-weight: 740; }
.docs-article { max-width: 760px; }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--rq-space-3); margin-top: var(--rq-space-7); }
.docs-pager a { display: flex; flex-direction: column; gap: 2px; padding: var(--rq-space-4); color: var(--rq-text); font-weight: 600; }
.docs-pager a:hover { border-color: var(--rq-accent); text-decoration: none; }
@media (max-width: 1199.98px) { .docs-layout { grid-template-columns: 220px minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 767.98px) {
    .docs-layout { grid-template-columns: minmax(0, 1fr); gap: var(--rq-space-4); }
    .docs-nav { position: static; max-height: none; overflow: visible; }
    .docs-nav-toggle > summary { display: list-item; cursor: pointer; font-weight: 600; padding: 10px 12px; border: 1px solid var(--rq-border); border-radius: var(--rq-radius); background: var(--rq-surface); }
    .docs-nav-toggle[open] > summary { margin-bottom: var(--rq-space-3); }
    .docs-pager { grid-template-columns: 1fr; }
}

.plan { padding: var(--rq-space-6) var(--rq-space-5); height: 100%; display: flex; flex-direction: column; position: relative; }
.plan.featured { border-color: var(--rq-accent); box-shadow: 0 0 0 1px var(--rq-accent), var(--rq-shadow); }
.plan .price { font-size: var(--rq-text-3xl); font-weight: 740; letter-spacing: -.03em; }
.plan .price small { font-size: var(--rq-text-sm); color: var(--rq-text-muted); font-weight: 500; letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: var(--rq-space-4) 0; display: grid; gap: 8px; font-size: var(--rq-text-sm); }
.plan li { display: flex; gap: 8px; }
.plan li .icon { color: var(--rq-success); margin-top: 3px; }
.plan .tag { position: absolute; top: -11px; left: var(--rq-space-5); }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--rq-space-6) var(--rq-space-4); }
.auth-card { width: 100%; max-width: 420px; padding: var(--rq-space-6); }
.auth-card h1 { font-size: var(--rq-text-xl); margin: var(--rq-space-5) 0 var(--rq-space-2); }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--rq-sidebar-bg); color: var(--rq-sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid #1a1f29;
}
.sidebar .brand { color: #fff; padding: 18px 18px 10px; }
.sidebar .brand:hover { color: #fff; }
.ws-switch { margin: 6px 12px 14px; }
.ws-switch .btn { width: 100%; justify-content: space-between; background: #151a24; border: 1px solid #232a37; color: #e6e9ef; font-size: var(--rq-text-sm); }
.ws-switch .btn:hover, .ws-switch .btn:focus { background: #1b2130; color: #fff; }
.ws-switch .dropdown-menu { width: 100%; }
/* Project switcher: what Home, Tests, Runs, Recordings and Suites show. */
.proj-switch { margin: -4px 12px 14px; }
.proj-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #151a24; border: 1px solid #232a37; color: #e6e9ef; text-align: left; }
.proj-btn:hover, .proj-btn:focus-visible { background: #1b2130; border-color: #34405a; }
.proj-btn .proj-sub { color: #8b94a6; }
.proj-caret { flex: none; opacity: .7; }
.proj-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.proj-name { font-weight: 600; font-size: var(--rq-text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-sub { font-size: 11px; color: var(--rq-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-menu { width: 300px; max-width: calc(100vw - 24px); padding: 6px; }
.proj-list { max-height: 50vh; overflow-y: auto; }
.proj-item { display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 6px 8px; }
.proj-item[aria-current="true"] { background: var(--rq-accent-soft); }
.proj-item[hidden] { display: none; }
.proj-check { color: var(--rq-accent); flex: none; }
.pmark { flex: none; width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: hsl(var(--ph, 220) 58% 44%); }
.pmark-sm { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; vertical-align: -3px; }
.pmark-all { background: #2a3245; color: #c9d0dc; }
.pmark-all .icon { width: 15px; height: 15px; }
.ptag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.run-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--rq-border-strong); }
.run-dot.ok { background: var(--rq-success); }
.run-dot.bad { background: var(--rq-danger); }
.run-dot.busy { background: var(--rq-accent); }
.scope-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--rq-text-sm); color: var(--rq-text-muted); margin: calc(-1 * var(--rq-space-3)) 0 var(--rq-space-4); }
.scope-bar strong { color: var(--rq-text); }
.table .group-row th { background: var(--rq-surface-2); font-size: var(--rq-text-sm); font-weight: 650; padding-top: 10px; padding-bottom: 10px; }
.proj-card { padding: var(--rq-space-4); color: inherit; transition: box-shadow .15s, border-color .15s; }
.proj-card:hover, .proj-card:focus-visible { box-shadow: var(--rq-shadow); border-color: var(--rq-border-strong); }
.proj-card-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--rq-text-muted); }
.proj-card-stats strong { color: var(--rq-text); }
.min-w-0 { min-width: 0; }

.nav-group { padding: 4px 10px 10px; }
.nav-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #6e7789; font-weight: 650; padding: 8px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--rq-sidebar-text); font-size: var(--rq-text-sm); font-weight: 520; }
.side-link:hover { background: var(--rq-sidebar-hover); color: #fff; text-decoration: none; }
.side-link.active { background: #1c2333; color: var(--rq-sidebar-active); box-shadow: inset 2px 0 0 #5b8cff; }
.side-link .count { margin-left: auto; font-size: 11px; background: #232a37; color: #c9d0dc; padding: 1px 7px; border-radius: 999px; }
.sidebar .sidebar-cta { width: auto !important; margin: 0 20px 12px; justify-content: center; }
.next-step { border-left: 3px solid var(--rq-accent); }
.live-frame { background: #0d1117; min-height: 180px; display: grid; place-items: center; }
.live-frame img { display: block; width: 100%; height: auto; }
.live-frame img[hidden] { display: none; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid #1a1f29; }
.usage-mini { font-size: 12px; color: #9aa4b4; }
.usage-mini .progress { height: 5px; background: #232a37; margin-top: 6px; }
.usage-mini .progress-bar { background: #5b8cff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: var(--rq-space-3); padding: 0 var(--rq-space-5); border-bottom: 1px solid var(--rq-border); background: var(--rq-bg-elevated); position: sticky; top: 0; z-index: 50; }
.topbar .crumbs { font-size: var(--rq-text-sm); color: var(--rq-text-muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.topbar .crumbs a { color: var(--rq-text-muted); }
.topbar .crumbs .current { color: var(--rq-text); font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--rq-accent), var(--rq-violet)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.content { padding: var(--rq-space-6) var(--rq-space-5) var(--rq-space-8); max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--rq-space-4); margin-bottom: var(--rq-space-5); }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--rq-text-muted); font-size: var(--rq-text-sm); margin-top: 4px; }
.page-actions { display: flex; gap: var(--rq-space-2); flex-wrap: wrap; align-items: center; }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--rq-space-2); align-items: center; margin-bottom: var(--rq-space-4); }
.toolbar .form-control, .toolbar .form-select { width: auto; min-width: 160px; }
.toolbar input[type="search"], .toolbar input[name="q"] { flex: 1 1 220px; max-width: 360px; }
.toolbar .sort-select { margin-left: auto; }
@media (max-width: 575.98px) { .toolbar .form-control, .toolbar .form-select, .toolbar input[name="q"] { flex: 1 1 100%; max-width: none; } .toolbar .sort-select { margin-left: 0; } }
/* Sortable column headers */
.sort-link { color: inherit; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sort-link:hover { color: var(--rq-text); text-decoration: none; }
.sort-link .sort-ind { font-size: .85em; opacity: .35; }
.sort-link.active { color: var(--rq-text); }
.sort-link.active .sort-ind { opacity: 1; color: var(--rq-accent); }
/* Pager */
.pager { display: flex; flex-wrap: wrap; gap: var(--rq-space-2); justify-content: space-between; align-items: center; margin-top: var(--rq-space-4); }
.pager .page-item.active .page-link { background: var(--rq-accent); border-color: var(--rq-accent); color: #fff; }
.result-count { font-size: var(--rq-text-sm); color: var(--rq-text-muted); margin: calc(-1 * var(--rq-space-2)) 0 var(--rq-space-3); }

.dropdown-menu { --bs-dropdown-bg: var(--rq-surface); --bs-dropdown-border-color: var(--rq-border); --bs-dropdown-link-color: var(--rq-text); --bs-dropdown-link-hover-bg: var(--rq-surface-2); --bs-dropdown-link-active-bg: var(--rq-accent); --bs-dropdown-font-size: var(--rq-text-sm); border-radius: var(--rq-radius); box-shadow: var(--rq-shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 6px; padding: 7px 10px; display: flex; gap: 8px; align-items: center; }
.modal-content { background: var(--rq-surface); border: 1px solid var(--rq-border); border-radius: var(--rq-radius-lg); box-shadow: var(--rq-shadow-lg); }
.modal-header, .modal-footer { border-color: var(--rq-border); }
.offcanvas { --bs-offcanvas-bg: var(--rq-sidebar-bg); }
.nav-tabs { --bs-nav-tabs-border-color: var(--rq-border); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-border-color: transparent; gap: 4px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--rq-text-muted); font-size: var(--rq-text-sm); font-weight: 560; padding: 10px 12px; }
.nav-tabs .nav-link.active { color: var(--rq-text); border-bottom-color: var(--rq-accent); }
.nav-tabs .nav-link:hover { color: var(--rq-text); }
.progress { background: var(--rq-surface-3); border-radius: 999px; }
.progress-bar { background: var(--rq-accent); }
.progress-bar.over { background: var(--rq-danger); }
.progress-bar.warn { background: var(--rq-warning); }
.pagination { --bs-pagination-bg: var(--rq-surface); --bs-pagination-border-color: var(--rq-border); --bs-pagination-color: var(--rq-text-2); --bs-pagination-active-bg: var(--rq-accent); --bs-pagination-active-border-color: var(--rq-accent); --bs-pagination-hover-bg: var(--rq-surface-2); --bs-pagination-disabled-bg: var(--rq-surface); --bs-pagination-font-size: var(--rq-text-sm); }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.rq-toast { background: var(--rq-surface); border: 1px solid var(--rq-border); box-shadow: var(--rq-shadow-lg); border-radius: var(--rq-radius); padding: 12px 14px; font-size: var(--rq-text-sm); display: flex; gap: 10px; animation: rq-in 200ms var(--rq-ease); }
.rq-toast.error { border-left: 3px solid var(--rq-danger); }
.rq-toast.success { border-left: 3px solid var(--rq-success); }
@keyframes rq-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Lists */
.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: var(--rq-space-3); padding: 12px var(--rq-space-4); border-bottom: 1px solid var(--rq-border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 560; color: var(--rq-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.list-row .meta { font-size: var(--rq-text-xs); color: var(--rq-text-muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: var(--rq-text-sm); margin: 0; }
.kv dt { color: var(--rq-text-muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--rq-text); word-break: break-word; }

/* Dashboard trend */
.trend { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; max-width: 36px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; background: var(--rq-surface-2); min-height: 4px; }
.trend-bar .p { background: var(--rq-success); }
.trend-bar .f { background: var(--rq-danger); }
.trend-col small { font-size: 11px; color: var(--rq-text-muted); }

/* Project cards */
.project-card { display: block; padding: var(--rq-space-5); height: 100%; color: inherit; transition: border-color var(--rq-dur), box-shadow var(--rq-dur), transform var(--rq-dur); }
.project-card:hover { border-color: var(--rq-border-strong); box-shadow: var(--rq-shadow); text-decoration: none; color: inherit; transform: translateY(-1px); }
.project-card .stats { display: flex; gap: var(--rq-space-4); font-size: var(--rq-text-xs); color: var(--rq-text-muted); margin-top: var(--rq-space-4); }
.project-card .stats b { color: var(--rq-text); font-size: var(--rq-text-sm); display: block; font-variant-numeric: tabular-nums; }

/* Recording grid */
.rec-card { overflow: hidden; display: block; color: inherit; height: 100%; }
.rec-card:hover { text-decoration: none; color: inherit; box-shadow: var(--rq-shadow); }
.rec-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--rq-surface-2), var(--rq-surface-3)); display: grid; place-items: center; color: var(--rq-text-muted); position: relative; border-bottom: 1px solid var(--rq-border); }
.rec-thumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; font-family: var(--rq-mono); }
.rec-body { padding: 12px 14px; }

/* Onboarding */
.wizard-steps { display: flex; gap: 8px; margin-bottom: var(--rq-space-5); flex-wrap: wrap; }
.wizard-step { flex: 1; min-width: 140px; padding: 12px 14px; border-radius: var(--rq-radius); border: 1px solid var(--rq-border); background: var(--rq-surface); font-size: var(--rq-text-sm); display: flex; gap: 10px; align-items: center; }
.wizard-step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--rq-surface-2); color: var(--rq-text-muted); flex: none; }
.wizard-step.done .n { background: var(--rq-success-soft); color: var(--rq-success); }
.wizard-step.current { border-color: var(--rq-accent); box-shadow: 0 0 0 1px var(--rq-accent); }
.wizard-step.current .n { background: var(--rq-accent); color: var(--rq-accent-ink); }

/* Video player + event timeline */
.player { background: #000; border-radius: var(--rq-radius); overflow: hidden; border: 1px solid var(--rq-border); position: relative; }
.player video { width: 100%; display: block; max-height: 62vh; background: #000; }
.timeline { position: relative; height: 28px; margin-top: 10px; background: var(--rq-surface-2); border-radius: 6px; border: 1px solid var(--rq-border); cursor: pointer; }
.timeline .playhead { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--rq-accent); pointer-events: none; }
.timeline .marker { position: absolute; top: 6px; width: 8px; height: 14px; margin-left: -4px; border-radius: 2px; background: var(--rq-violet); border: 0; padding: 0; }
.timeline .marker.navigation { background: var(--rq-success); }
.timeline .marker.input, .timeline .marker.change { background: var(--rq-warning); }
.event-list { max-height: 58vh; overflow-y: auto; }
.event-item { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--rq-border); font-size: var(--rq-text-sm); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: var(--rq-text); }
.event-item:hover, .event-item.active { background: var(--rq-accent-soft); }
.event-item .t { font-family: var(--rq-mono); font-size: 11px; color: var(--rq-text-muted); width: 52px; flex: none; padding-top: 2px; }
.event-item .what { min-width: 0; }
.event-item .what small { display: block; color: var(--rq-text-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Test editor */
.editor-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--rq-space-5); align-items: start; }
.editor-layout.no-video { grid-template-columns: 1fr; }
.editor-side { position: sticky; top: 76px; }
.step-card { border: 1px solid var(--rq-border); border-radius: var(--rq-radius); background: var(--rq-surface); margin-bottom: 10px; transition: border-color var(--rq-dur), box-shadow var(--rq-dur); }
.step-card.uncertain { border-color: color-mix(in srgb, var(--rq-warning) 55%, var(--rq-border)); }
.step-card.destructive { border-color: color-mix(in srgb, var(--rq-danger) 55%, var(--rq-border)); }
.step-card.dragging { opacity: .5; }
.step-card.drop-target { box-shadow: 0 -2px 0 var(--rq-accent); }
.step-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.step-num { width: 26px; height: 26px; border-radius: 7px; background: var(--rq-surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--rq-text-2); flex: none; font-variant-numeric: tabular-nums; }
.step-handle { cursor: grab; color: var(--rq-text-muted); background: none; border: 0; padding: 2px; }
.step-title { flex: 1; min-width: 0; }
.step-title .desc { font-weight: 560; font-size: var(--rq-text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-title .loc { font-family: var(--rq-mono); font-size: 11px; color: var(--rq-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-body { border-top: 1px solid var(--rq-border); padding: 14px; display: none; }
.step-card.open .step-body { display: block; }
.action-pill { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; background: var(--rq-accent-soft); color: var(--rq-accent); }
.assert-row { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px dashed var(--rq-border-strong); border-radius: var(--rq-radius-sm); margin-top: 8px; font-size: var(--rq-text-sm); }
.assert-row .grow { flex: 1; min-width: 0; }
.confirm-box { background: var(--rq-warning-soft); color: var(--rq-warning); padding: 8px 10px; border-radius: var(--rq-radius-sm); font-size: var(--rq-text-sm); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.secret-box { background: var(--rq-surface-2, rgba(127,127,127,.08)); border: 1px solid var(--rq-border); padding: 8px 10px; border-radius: var(--rq-radius-sm); }
.secret-box .icon { vertical-align: -2px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--rq-bg); padding: 12px 0; border-top: 1px solid var(--rq-border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; z-index: 5; }
.issues li { margin-bottom: 4px; }

/* Runs */
.run-steps .run-step { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rq-border); align-items: flex-start; }
.run-steps .run-step:last-child { border-bottom: 0; }
.run-step .state { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--rq-surface-2); color: var(--rq-text-muted); }
.run-step.passed .state { background: var(--rq-success-soft); color: var(--rq-success); }
.run-step.failed .state, .run-step.error .state, .run-step.timedout .state { background: var(--rq-danger-soft); color: var(--rq-danger); }
.run-step.running .state { background: var(--rq-accent-soft); color: var(--rq-accent); }
.run-step .err { color: var(--rq-danger); font-size: var(--rq-text-xs); font-family: var(--rq-mono); white-space: pre-wrap; margin-top: 4px; }
.run-step .kind { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--rq-text-muted); }
.live-indicator { display: inline-flex; align-items: center; gap: 6px; font-size: var(--rq-text-xs); color: var(--rq-success); font-weight: 600; }
.live-indicator .dot { animation: rq-pulse 1.6s ease-in-out infinite; }
@keyframes rq-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.playall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.playall-tile { padding: 12px 14px; border-radius: var(--rq-radius); border: 1px solid var(--rq-border); background: var(--rq-surface); display: flex; gap: 10px; align-items: center; color: inherit; }
.playall-tile:hover { text-decoration: none; color: inherit; border-color: var(--rq-border-strong); }
.playall-tile.passed { border-left: 3px solid var(--rq-success); }
.playall-tile.failed, .playall-tile.error, .playall-tile.timedout { border-left: 3px solid var(--rq-danger); }
.playall-tile.running { border-left: 3px solid var(--rq-accent); }
.big-progress { height: 10px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--rq-space-4); }
.shot { border: 1px solid var(--rq-border); border-radius: var(--rq-radius); overflow: hidden; background: var(--rq-surface-2); }
.shot img, .shot video { width: 100%; display: block; }
.shot .cap { padding: 8px 12px; font-size: var(--rq-text-xs); color: var(--rq-text-muted); border-top: 1px solid var(--rq-border); background: var(--rq-surface); }
pre.json { background: var(--rq-surface-2); border: 1px solid var(--rq-border); border-radius: var(--rq-radius-sm); padding: 10px 12px; font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: var(--rq-text-2); }

/* Upload */
.dropzone { border: 2px dashed var(--rq-border-strong); border-radius: var(--rq-radius-lg); padding: var(--rq-space-7) var(--rq-space-5); text-align: center; background: var(--rq-surface); transition: border-color var(--rq-dur), background var(--rq-dur); }
.dropzone.over { border-color: var(--rq-accent); background: var(--rq-accent-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .content { padding: var(--rq-space-5) var(--rq-space-4) var(--rq-space-7); }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .hv-body { grid-template-columns: 1fr; }
  .hv-video { min-height: 200px; border-right: 0; border-bottom: 1px solid var(--rq-border); }
  .compare-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .topbar { padding: 0 var(--rq-space-3); }
  .page-head { align-items: flex-start; }
  .stat-value { font-size: var(--rq-text-xl); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
