/* TraceReports — temas.
   Cada tema es una interfaz con identidad propia (tipografía, forma, densidad, navegación),
   no solo una paleta. Se activan con <body data-theme="...">; "trace" es el predeterminado
   y vive en style.css. Los cambios de layout se limitan a escritorio para no romper el móvil. */

/* ═══════════════════════ TRACE DARK ═══════════════════════
   La interfaz Trace en oscuro, pensada para oscuro (no un "invertido"): tres niveles de
   superficie bien diferenciados, bordes en vez de sombras, estados con fondo translúcido en
   lugar de bloques sólidos que encandilan, y capturas levemente atenuadas. */
body[data-theme="trace-dark"] {
	--bg: #0f1216;
	--surface: #171b21;
	--surface-2: #1e242c;
	--hover: #20262f;
	--border: #2a313b;
	--text: #c9d1d9;
	--text-muted: #8b949e;
	--heading: #f0f3f6;
	--primary: #4493f8;
	--accent: #2fbfae;
	--accent-soft: rgba(47, 191, 174, .14);
	--nav-bg: #0b0e11;
	--nav-text: #7d8590;
	--shadow: none;
	--pass: #3fb950;
	--fail: #f85149;
	--warning: #d29922;
	--skip: #58a6ff;
	--info: #39c5cf;
	--running: #7d8590;
	--started: #3fb950;
	--ended: #f85149;
	--elapsed: #8b949e;
	--topbar-bg: #12161b;
	--logo-bg: #0b0d0a; /* el de tracereports.netlify.app: el logo lima combina */
	--chip-bg: #262d36;
	--progress: #2fbfae;
	--progress-bg: #1f2a2f;
	--on-accent: #04201c;
	color-scheme: dark;
}
body[data-theme="trace-dark"] ::selection { background: rgba(68, 147, 248, .35); }
body[data-theme="trace-dark"] .topbar { border-bottom: 1px solid var(--border); }
body[data-theme="trace-dark"] .side-nav { border-right: 1px solid var(--border); }
body[data-theme="trace-dark"] .card { border: 1px solid var(--border); }
body[data-theme="trace-dark"] .report-env,
body[data-theme="trace-dark"] .count-chip { background: var(--surface-2); }
body[data-theme="trace-dark"] .run-select,
body[data-theme="trace-dark"] .search,
body[data-theme="trace-dark"] #net-search { background: var(--bg); }
/* estados y tiempos: texto de color sobre fondo translúcido (legible y sin encandilar) */
body[data-theme="trace-dark"] .label.outline { background: color-mix(in srgb, currentColor 12%, transparent); border-color: color-mix(in srgb, currentColor 45%, transparent); }
body[data-theme="trace-dark"] .label.started,
body[data-theme="trace-dark"] .label.ended,
body[data-theme="trace-dark"] .label.elapsed { background: color-mix(in srgb, currentColor 13%, transparent); border: 1px solid color-mix(in srgb, currentColor 35%, transparent); }
body[data-theme="trace-dark"] .label.started { color: var(--started); }
body[data-theme="trace-dark"] .label.ended { color: var(--ended); }
body[data-theme="trace-dark"] .label.elapsed { color: var(--elapsed); }
body[data-theme="trace-dark"] .label.tag { background: var(--surface-2); border-color: var(--border); }
body[data-theme="trace-dark"] .status-filters button,
body[data-theme="trace-dark"] .step-chip { background: transparent; }
body[data-theme="trace-dark"] .status-filters button.active,
body[data-theme="trace-dark"] .step-chip.all.active,
body[data-theme="trace-dark"] .net-seg button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
body[data-theme="trace-dark"] .export-btn { color: var(--on-accent); }
body[data-theme="trace-dark"] .collection-item.active { background: rgba(68, 147, 248, .08); border-left-color: var(--primary); }
body[data-theme="trace-dark"] .detail-tabs button.active { color: var(--heading); border-bottom-color: var(--primary); }
body[data-theme="trace-dark"] .tab-ok { color: #04260f; }
body[data-theme="trace-dark"] .ai-card {
	border-color: rgba(47, 191, 174, .3);
	background: linear-gradient(135deg, rgba(47, 191, 174, .10), rgba(68, 147, 248, .06) 60%, transparent), var(--surface);
}
body[data-theme="trace-dark"] .ai-card .suggestion { background: var(--bg); border-color: var(--border); }
body[data-theme="trace-dark"] .error-block { background: linear-gradient(90deg, rgba(248, 81, 73, .06), transparent 40%), var(--surface); }
body[data-theme="trace-dark"] .error-block pre { background: var(--bg); }
body[data-theme="trace-dark"] .report-img { border-color: var(--border); filter: brightness(.88); transition: filter .15s, transform .15s, box-shadow .15s; }
body[data-theme="trace-dark"] .report-img:hover { filter: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
body[data-theme="trace-dark"] .net-card { background: var(--surface-2); }
body[data-theme="trace-dark"] .peso-alto { background: rgba(210, 153, 34, .15); color: #e3b341; }


/* ═══════════════════════ MIDNIGHT ═══════════════════════
   Oscuro profundo estilo Linear/Vercel: superficies con borde fino en lugar de sombra,
   sidebar flotante, acento violeta con degradados y tipografía Inter. */
body[data-theme="midnight"] {
	--bg: #08080d;
	--surface: #101017;
	--surface-2: #15151e;
	--hover: #191924;
	--border: rgba(255, 255, 255, .08);
	--text: #c9c9d6;
	--text-muted: #777789;
	--heading: #f5f5f8;
	--primary: #7c6cff;
	--accent: #a78bfa;
	--accent-soft: rgba(124, 108, 255, .14);
	--nav-bg: rgba(255, 255, 255, .025);
	--nav-text: #8a8a9e;
	--nav-active: #ffffff;
	--shadow: none;
	--radius: 12px;
	--pass: #34d399;
	--fail: #fb7185;
	--warning: #fbbf24;
	--skip: #60a5fa;
	--info: #22d3ee;
	--running: #6b7280;
	--started: #0f766e;
	--ended: #be123c;
	--elapsed: #3a3a4d;
	--font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
	--font-head: "Inter", "Segoe UI", system-ui, sans-serif;
	--font-mono: "JetBrains Mono", Consolas, monospace;
	--topbar-bg: rgba(8, 8, 13, .72);
	--logo-bg: transparent;
	--logo-text: #ffffff;
	--chip-bg: rgba(255, 255, 255, .06);
	--progress: #a78bfa;
	--progress-bg: rgba(167, 139, 250, .15);
	color-scheme: dark;
	background:
		radial-gradient(1100px 520px at 75% -12%, rgba(124, 108, 255, .20), transparent 62%),
		radial-gradient(800px 420px at -10% 110%, rgba(34, 211, 238, .08), transparent 60%),
		var(--bg);
	background-attachment: fixed;
	font-size: 14.5px;
	letter-spacing: -.005em;
}
body[data-theme="midnight"] .topbar { backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--border); }
body[data-theme="midnight"] .logo-container { width: auto; padding: 0 22px; font-weight: 700; letter-spacing: -.02em; }
body[data-theme="midnight"] .logo-mark { color: #a78bfa; filter: drop-shadow(0 0 10px rgba(167, 139, 250, .7)); }
body[data-theme="midnight"] .logo-word { background: linear-gradient(90deg, #fff, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
body[data-theme="midnight"] .card {
	border: 1px solid var(--border);
	background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%), var(--surface);
}
body[data-theme="midnight"] .detail-name,
body[data-theme="midnight"] .heading h5 { letter-spacing: -.025em; font-weight: 650; }
body[data-theme="midnight"] .panel-lead { font-weight: 600; letter-spacing: -.03em; }
body[data-theme="midnight"] .export-btn,
body[data-theme="midnight"] .status-filters button.active,
body[data-theme="midnight"] .step-chip.all.active,
body[data-theme="midnight"] .net-seg button.active {
	background: linear-gradient(135deg, #7c6cff, #c084fc); border-color: transparent; color: #fff;
	box-shadow: 0 6px 24px -6px rgba(124, 108, 255, .65);
}
body[data-theme="midnight"] .status-filters button,
body[data-theme="midnight"] .step-chip,
body[data-theme="midnight"] .search,
body[data-theme="midnight"] .run-select,
body[data-theme="midnight"] #net-search,
body[data-theme="midnight"] .net-seg button { background: rgba(255, 255, 255, .03); }
body[data-theme="midnight"] .label.outline { border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); border-color: color-mix(in srgb, currentColor 40%, transparent); }
body[data-theme="midnight"] .label.started,
body[data-theme="midnight"] .label.ended,
body[data-theme="midnight"] .label.elapsed,
body[data-theme="midnight"] .label.tag { border-radius: 999px; }
body[data-theme="midnight"] .collection-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
body[data-theme="midnight"] .detail-tabs button.active { color: #fff; border-bottom-color: var(--accent); }
body[data-theme="midnight"] .ai-card {
	border-color: rgba(167, 139, 250, .35);
	background: radial-gradient(600px 200px at 0 0, rgba(124, 108, 255, .18), transparent 70%), var(--surface);
}
body[data-theme="midnight"] .ai-card::before { background: linear-gradient(180deg, #7c6cff, #22d3ee); }
body[data-theme="midnight"] .report-img { border-color: var(--border); border-radius: 8px; }
body[data-theme="midnight"] .stat { border-top-width: 2px; }
body[data-theme="midnight"] .net-card { background: rgba(255, 255, 255, .02); }
@media (min-width: 821px) {
	body[data-theme="midnight"] { --sidenav-w: 92px; }
	body[data-theme="midnight"] .side-nav {
		top: calc(var(--topbar-h) + 14px); bottom: 14px; left: 14px; width: 64px;
		border: 1px solid var(--border); border-radius: 18px; backdrop-filter: blur(12px); padding: 8px 0;
	}
	body[data-theme="midnight"] .side-nav a { margin: 2px 8px; padding: 12px 0; border-left: 0; border-radius: 12px; }
	body[data-theme="midnight"] .side-nav a span { display: none; }
	body[data-theme="midnight"] .side-nav a.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .35); }
	body[data-theme="midnight"] .side-nav a.active svg { color: #c4b5fd; filter: drop-shadow(0 0 8px rgba(167, 139, 250, .8)); }
}


/* ═══════════════════════ PAPER ═══════════════════════
   Editorial estilo Notion/revista: papel cálido, títulos con serifa, navegación superior
   en pestañas (sin sidebar), mucho aire y líneas finas en lugar de sombras. */
body[data-theme="paper"] {
	--bg: #f7f4ee;
	--surface: #fffdf9;
	--surface-2: #f3efe6;
	--hover: #f2ede3;
	--border: #e7e0d3;
	--text: #2e2a26;
	--text-muted: #8b8279;
	--heading: #1b1815;
	--primary: #1b1815;
	--accent: #b4532a;
	--accent-soft: rgba(180, 83, 42, .09);
	--nav-bg: var(--bg);
	--nav-text: #8b8279;
	--nav-active: #1b1815;
	--shadow: none;
	--radius: 6px;
	--pass: #3f7d4a;
	--fail: #b42318;
	--warning: #b7791f;
	--skip: #35699e;
	--info: #3d7a7a;
	--running: #8b8279;
	--started: #3f7d4a;
	--ended: #b42318;
	--elapsed: #a59b8f;
	--font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
	--font-head: "Fraunces", Georgia, "Times New Roman", serif;
	--font-mono: "JetBrains Mono", Consolas, monospace;
	--topbar-h: 62px;
	--topbar-bg: var(--bg);
	--logo-bg: transparent;
	--logo-text: #1b1815;
	--chip-bg: #efe9dd;
	--progress: #1b1815;
	--progress-bg: #e7e0d3;
	color-scheme: light;
	font-size: 15px;
}
body[data-theme="paper"] .topbar { box-shadow: none; border-bottom: 1px solid var(--border); }
body[data-theme="paper"] .logo-container { width: auto; padding: 0 28px 0 32px; font-size: 23px; font-weight: 600; letter-spacing: -.01em; }
body[data-theme="paper"] .logo-cursor { color: #6c9736; }
body[data-theme="paper"] .report-name { font-weight: 500; font-style: italic; }
body[data-theme="paper"] .card { border: 1px solid var(--border); }
body[data-theme="paper"] .detail-name { font-size: 30px; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
body[data-theme="paper"] .heading h5 { font-size: 22px; font-weight: 500; }
body[data-theme="paper"] .sub-title { font-size: 26px; font-weight: 500; }
body[data-theme="paper"] .panel-lead { font-weight: 400; font-size: 34px; }
body[data-theme="paper"] .pass-percentage { font-size: 52px; font-weight: 400; }
body[data-theme="paper"] .panel-name,
body[data-theme="paper"] .table-results th,
body[data-theme="paper"] .mini-table th,
body[data-theme="paper"] .bloque-titulo,
body[data-theme="paper"] .ai-card h6 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
body[data-theme="paper"] .label.outline {
	border: 0; padding: 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
}
body[data-theme="paper"] .label.outline::before { content: "● "; font-size: 9px; vertical-align: 1px; }
body[data-theme="paper"] .label.started,
body[data-theme="paper"] .label.ended,
body[data-theme="paper"] .label.elapsed { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
body[data-theme="paper"] .label.started { color: var(--started); }
body[data-theme="paper"] .label.ended { color: var(--ended); }
body[data-theme="paper"] .status-filters button,
body[data-theme="paper"] .step-chip { border-radius: 999px; background: transparent; }
body[data-theme="paper"] .status-filters button.active,
body[data-theme="paper"] .step-chip.all.active,
body[data-theme="paper"] .net-seg button.active,
body[data-theme="paper"] .export-btn { background: var(--heading); border-color: var(--heading); color: #fffdf9; }
body[data-theme="paper"] .collection-item { padding: 14px 20px; }
body[data-theme="paper"] .collection-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
body[data-theme="paper"] .collection-item .test-name { font-weight: 500; }
body[data-theme="paper"] .detail-tabs button.active { color: var(--heading); border-bottom-color: var(--heading); }
body[data-theme="paper"] .ai-card { border-color: #e9d5c3; background: #fbf5ec; }
body[data-theme="paper"] .ai-card::before { background: var(--accent); }
body[data-theme="paper"] .ai-title { font-family: var(--font-head); text-transform: none; font-size: 17px; font-weight: 600; letter-spacing: 0; }
body[data-theme="paper"] .ai-title svg { color: var(--accent); }
body[data-theme="paper"] .report-img { width: 180px; border-radius: 3px; box-shadow: 0 1px 0 var(--border), 0 8px 20px -12px rgba(60, 40, 20, .35); }
body[data-theme="paper"] .stat { border-top: 0; border-left: 3px solid var(--border); }
body[data-theme="paper"] .stat.accent-pass { border-left-color: var(--pass); }
body[data-theme="paper"] .stat.accent-fail { border-left-color: var(--fail); }
body[data-theme="paper"] .stat.accent-skip { border-left-color: var(--skip); }
@media (min-width: 821px) {
	/* la sidebar se convierte en una barra de pestañas bajo el encabezado */
	body[data-theme="paper"] .side-nav {
		top: var(--topbar-h); left: 0; right: 0; bottom: auto; width: auto; height: 48px;
		flex-direction: row; align-items: stretch; gap: 6px; padding: 0 30px;
		background: var(--bg); border-bottom: 1px solid var(--border);
	}
	body[data-theme="paper"] .side-nav a {
		flex-direction: row; gap: 8px; padding: 0 14px; font-size: 14px; font-weight: 500;
		border-left: 0; border-bottom: 2px solid transparent; color: var(--text-muted);
	}
	body[data-theme="paper"] .side-nav a svg { width: 16px; height: 16px; }
	body[data-theme="paper"] .side-nav a:hover { background: transparent; color: var(--heading); }
	body[data-theme="paper"] .side-nav a.active { background: transparent; color: var(--heading); border-bottom-color: var(--heading); }
	body[data-theme="paper"] .side-nav a.active svg { color: var(--accent); }
	body[data-theme="paper"] .container { padding: calc(var(--topbar-h) + 48px + 28px) 32px 48px; max-width: 1480px; margin: 0 auto; }
	body[data-theme="paper"] .split { gap: 28px; }
	body[data-theme="paper"] .split-left { top: calc(var(--topbar-h) + 48px + 28px); }
	body[data-theme="paper"] .list-card { max-height: calc(100vh - var(--topbar-h) - 48px - 56px); }
	body[data-theme="paper"] .split-right { gap: 18px; }
	body[data-theme="paper"] .detail-head { padding: 26px 30px; }
}
@media (max-width: 820px) {
	body[data-theme="paper"] .side-nav { background: var(--surface); border-top: 1px solid var(--border); }
	body[data-theme="paper"] .side-nav a.active { color: var(--heading); border-top-color: var(--accent); background: var(--accent-soft); }
}


/* ═══════════════════════ TERMINAL ═══════════════════════
   Consola de operaciones estilo Grafana/Datadog: todo monoespaciado, alta densidad,
   esquinas rectas, grilla de fondo, acento neón y estados como luces. */
body[data-theme="terminal"] {
	--bg: #070b08;
	--surface: #0c120e;
	--surface-2: #111a14;
	--hover: #142019;
	--border: #1d2a22;
	--text: #b4c6b9;
	--text-muted: #587062;
	--heading: #e3f5e8;
	--primary: #39ff88;
	--accent: #39ff88;
	--accent-soft: rgba(57, 255, 136, .08);
	--nav-bg: #070b08;
	--nav-text: #587062;
	--nav-active: #39ff88;
	--shadow: none;
	--radius: 0;
	--pass: #39ff88;
	--fail: #ff4d6d;
	--warning: #ffd166;
	--skip: #4cc9f0;
	--info: #7ae7ff;
	--running: #587062;
	--started: #39ff88;
	--ended: #ff4d6d;
	--elapsed: #587062;
	--font-ui: "JetBrains Mono", Consolas, monospace;
	--font-head: "JetBrains Mono", Consolas, monospace;
	--font-mono: "JetBrains Mono", Consolas, monospace;
	--topbar-h: 46px;
	--sidenav-w: 58px;
	--topbar-bg: #070b08;
	--logo-bg: #070b08;
	--logo-text: #39ff88;
	--chip-bg: #142019;
	--progress: #39ff88;
	--progress-bg: #142019;
	--on-accent: #03140a;
	color-scheme: dark;
	font-size: 13px;
	background-color: var(--bg);
	background-image:
		linear-gradient(rgba(57, 255, 136, .035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(57, 255, 136, .035) 1px, transparent 1px);
	background-size: 28px 28px;
	background-attachment: fixed;
}
body[data-theme="terminal"] * { border-radius: 0 !important; }
body[data-theme="terminal"] .topbar { border-bottom: 1px solid var(--border); }
body[data-theme="terminal"] .logo-container { width: auto; padding: 0 18px; font-size: 14px; font-weight: 700; text-transform: lowercase; border-right: 1px solid var(--border); }
body[data-theme="terminal"] .logo-word::before { content: "> "; color: var(--text-muted); }
body[data-theme="terminal"] .logo-cursor { color: inherit; }
@keyframes blink { 50% { opacity: 0; } }
body[data-theme="terminal"] .logo-mark { display: none; }
body[data-theme="terminal"] .report-name { font-size: 13px; color: var(--heading); }
body[data-theme="terminal"] .card { border: 1px solid var(--border); background: rgba(12, 18, 14, .92); }
body[data-theme="terminal"] .heading h5,
body[data-theme="terminal"] .panel-name,
body[data-theme="terminal"] .table-results th,
body[data-theme="terminal"] .mini-table th,
body[data-theme="terminal"] .bloque-titulo,
body[data-theme="terminal"] .detail-tabs button,
body[data-theme="terminal"] .ai-card h6 { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
body[data-theme="terminal"] .heading h5::before { content: "## "; color: var(--text-muted); }
body[data-theme="terminal"] .detail-name { font-size: 17px; font-weight: 700; }
body[data-theme="terminal"] .detail-name::before { content: "$ "; color: var(--accent); }
body[data-theme="terminal"] .panel-lead { font-size: 26px; font-weight: 700; color: var(--accent); text-shadow: 0 0 12px rgba(57, 255, 136, .35); }
body[data-theme="terminal"] .pass-percentage { font-weight: 700; color: var(--accent); text-shadow: 0 0 14px rgba(57, 255, 136, .4); }
body[data-theme="terminal"] .label.outline { border: 0; padding: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; text-shadow: 0 0 8px currentColor; }
body[data-theme="terminal"] .label.outline::before { content: "["; color: var(--text-muted); text-shadow: none; }
body[data-theme="terminal"] .label.outline::after { content: "]"; color: var(--text-muted); text-shadow: none; }
body[data-theme="terminal"] .label.started,
body[data-theme="terminal"] .label.ended,
body[data-theme="terminal"] .label.elapsed,
body[data-theme="terminal"] .label.tag { background: transparent; border: 1px solid var(--border); color: var(--text); }
body[data-theme="terminal"] .label.started { color: var(--pass); }
body[data-theme="terminal"] .label.ended { color: var(--fail); }
body[data-theme="terminal"] .collection-item { padding: 8px 14px; }
body[data-theme="terminal"] .collection-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
body[data-theme="terminal"] .collection-item .test-name { font-weight: 500; }
body[data-theme="terminal"] .status-filters button,
body[data-theme="terminal"] .step-chip { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; background: transparent; }
body[data-theme="terminal"] .status-filters button.active,
body[data-theme="terminal"] .step-chip.all.active,
body[data-theme="terminal"] .net-seg button.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
body[data-theme="terminal"] .export-btn { background: transparent; border: 1px solid var(--accent); color: var(--accent); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
body[data-theme="terminal"] .export-btn:hover { background: var(--accent-soft); filter: none; }
body[data-theme="terminal"] .table-results td.status svg,
body[data-theme="terminal"] .step-chip svg { filter: drop-shadow(0 0 4px currentColor); }
body[data-theme="terminal"] .table-results td { padding-top: 7px; padding-bottom: 7px; }
body[data-theme="terminal"] .detail-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
body[data-theme="terminal"] .ai-card { border-color: rgba(57, 255, 136, .35); background: var(--surface); }
body[data-theme="terminal"] .ai-card::before { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
body[data-theme="terminal"] .ai-title::after { content: " //"; color: var(--text-muted); }
body[data-theme="terminal"] .report-img { border: 1px solid var(--border); filter: saturate(.85); }
body[data-theme="terminal"] .error-block { background: rgba(255, 77, 109, .04); }
body[data-theme="terminal"] .stat { border-top: 1px solid var(--border); border-left: 2px solid var(--border); }
body[data-theme="terminal"] .stat.accent-pass { border-left-color: var(--pass); }
body[data-theme="terminal"] .stat.accent-fail { border-left-color: var(--fail); }
body[data-theme="terminal"] .stat.accent-skip { border-left-color: var(--skip); }
body[data-theme="terminal"] .live-pill[data-state="live"] .dot { box-shadow: 0 0 8px var(--rec); }
body[data-theme="terminal"] .tab-ok,
body[data-theme="terminal"] .label.pass:not(.outline) { color: var(--on-accent); }
body[data-theme="midnight"] .tab-ok { color: #052e1f; }
@media (min-width: 821px) {
	body[data-theme="terminal"] .side-nav { border-right: 1px solid var(--border); padding-top: 4px; }
	body[data-theme="terminal"] .side-nav a span { display: none; }
	body[data-theme="terminal"] .side-nav a { padding: 14px 0; }
	body[data-theme="terminal"] .side-nav a.active svg { color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
	body[data-theme="terminal"] .container { padding-top: calc(var(--topbar-h) + 12px); padding-left: calc(var(--sidenav-w) + 12px); padding-right: 12px; }
	body[data-theme="terminal"] .split,
	body[data-theme="terminal"] .split-right,
	body[data-theme="terminal"] .totals,
	body[data-theme="terminal"] .charts { gap: 8px; }
	body[data-theme="terminal"] .split-left { top: calc(var(--topbar-h) + 12px); }
}


/* ═══════════════════════ PIXEL ═══════════════════════
   Arte 8-bit / videojuego retro. Paleta "Sweetie 16" (CC0, GrafxKid). Paneles como ventanas
   de RPG clásico: azul noche con borde pixelado (esquinas en escalón con box-shadow), sombras
   duras, botones que se hunden al presionarlos, barra de progreso segmentada como barra de
   vida, cursor ▶ en el elemento activo. Títulos en Press Start 2P, texto en VT323. */
body[data-theme="pixel"] {
	--bg: #1a1c2c;
	--surface: #29366f;
	--surface-2: #333c57;
	--hover: #333c57;
	--border: #566c86;
	--text: #f4f4f4;
	--text-muted: #94b0c2;
	--heading: #ffcd75;
	--primary: #41a6f6;
	--accent: #ffcd75;
	--accent-soft: rgba(255, 205, 117, .12);
	--nav-bg: #1a1c2c;
	--nav-text: #94b0c2;
	--nav-active: #ffcd75;
	--shadow: none;
	--radius: 0;
	--pass: #a7f070;
	--fail: #ff6170;
	--warning: #ef7d57;
	--skip: #73eff7;
	--info: #41a6f6;
	--running: #94b0c2;
	--started: #38b764;
	--ended: #b13e53;
	--elapsed: #566c86;
	--font-ui: "VT323", "Courier New", monospace;
	--font-head: "Press Start 2P", "Courier New", monospace;
	--font-mono: "VT323", "Courier New", monospace;
	--topbar-h: 58px;
	--topbar-bg: #1a1c2c;
	--logo-bg: #b13e53;
	--logo-text: #f4f4f4;
	--chip-bg: #333c57;
	--progress: #a7f070;
	--progress-bg: #1a1c2c;
	--on-accent: #1a1c2c;
	--edge: #f4f4f4;          /* color del borde pixelado */
	--px: 3px;                /* tamaño del "pixel" del borde */
	color-scheme: dark;
	font-size: 20px;
	line-height: 1.2;
	-webkit-font-smoothing: none;
	background-color: var(--bg);
	/* cielo de estrellas pixeladas */
	background-image:
		radial-gradient(#333c57 1px, transparent 1.5px),
		radial-gradient(#29366f 1px, transparent 1.5px);
	background-size: 24px 24px, 37px 37px;
	background-position: 0 0, 11px 17px;
}
body[data-theme="pixel"] * { border-radius: 0 !important; }
body[data-theme="pixel"] svg { shape-rendering: crispEdges; }
body[data-theme="pixel"] ::selection { background: #ffcd75; color: #1a1c2c; }

/* borde pixelado: 4 sombras sin difuminado dejan las esquinas "en escalón" + sombra dura */
body[data-theme="pixel"] .card,
body[data-theme="pixel"] .net-card,
body[data-theme="pixel"] .theme-menu {
	border: 0;
	box-shadow:
		0 calc(var(--px) * -1) 0 0 var(--edge), 0 var(--px) 0 0 var(--edge),
		calc(var(--px) * -1) 0 0 0 var(--edge), var(--px) 0 0 0 var(--edge),
		calc(var(--px) * 3) calc(var(--px) * 3) 0 0 rgba(0, 0, 0, .45);
}
body[data-theme="pixel"] .split,
body[data-theme="pixel"] .split-right,
body[data-theme="pixel"] .totals,
body[data-theme="pixel"] .charts { gap: 20px; }
body[data-theme="pixel"] .net-card { --edge: #566c86; margin-bottom: 12px; background: #1a1c2c; }
body[data-theme="pixel"] .net-card-error { --edge: var(--fail); border-left: 0; }

/* botones y chips: borde de 2px que "se hunde" al presionar */
body[data-theme="pixel"] .status-filters button,
body[data-theme="pixel"] .step-chip,
body[data-theme="pixel"] .net-seg button,
body[data-theme="pixel"] .export-btn,
body[data-theme="pixel"] .net-curl,
body[data-theme="pixel"] .copy-btn,
body[data-theme="pixel"] .run-select {
	border: 0; background: #333c57; color: #f4f4f4;
	box-shadow: 0 -2px 0 0 #94b0c2, 0 2px 0 0 #94b0c2, -2px 0 0 0 #94b0c2, 2px 0 0 0 #94b0c2, 4px 4px 0 0 #000;
	font-family: var(--font-head); font-size: 9px; padding: 8px 10px; line-height: 1;
	transition: transform .05s;
}
body[data-theme="pixel"] .status-filters,
body[data-theme="pixel"] .steps-toolbar { gap: 12px; }
body[data-theme="pixel"] .net-seg { border: 0; gap: 10px; overflow: visible; }
body[data-theme="pixel"] .net-seg button + button { border-left: 0; }
body[data-theme="pixel"] .status-filters button:active,
body[data-theme="pixel"] .step-chip:active,
body[data-theme="pixel"] .net-seg button:active,
body[data-theme="pixel"] .export-btn:active,
body[data-theme="pixel"] .net-curl:active,
body[data-theme="pixel"] .copy-btn:active { transform: translate(4px, 4px); box-shadow: 0 -2px 0 0 #94b0c2, 0 2px 0 0 #94b0c2, -2px 0 0 0 #94b0c2, 2px 0 0 0 #94b0c2; }
body[data-theme="pixel"] .status-filters button.active,
body[data-theme="pixel"] .step-chip.active,
body[data-theme="pixel"] .net-seg button.active { background: #ffcd75; color: #1a1c2c; }
body[data-theme="pixel"] .step-chip.active svg { color: #1a1c2c; }
body[data-theme="pixel"] .export-btn { background: #38b764; color: #f4f4f4; text-shadow: 2px 2px 0 #1a1c2c; }
body[data-theme="pixel"] .export-btn:hover { filter: brightness(1.1); }
body[data-theme="pixel"] .search,
body[data-theme="pixel"] #net-search { border: 0; background: #1a1c2c; box-shadow: inset 0 0 0 2px #566c86; }
body[data-theme="pixel"] .search input,
body[data-theme="pixel"] #net-search { font-size: 20px; color: #f4f4f4; }

/* encabezado */
body[data-theme="pixel"] .topbar { box-shadow: 0 var(--px) 0 0 #f4f4f4, 0 calc(var(--px) * 2) 0 0 #000; }
body[data-theme="pixel"] .logo-container { width: auto; padding: 0 20px; font-size: 12px; text-shadow: 3px 3px 0 #5d275d; letter-spacing: 0; }
body[data-theme="pixel"] .logo-word::before { content: "★ "; color: #ffcd75; }
body[data-theme="pixel"] .report-name { font-size: 10px; color: #f4f4f4; }
body[data-theme="pixel"] .report-env { font-size: 18px; border-color: #566c86; }
body[data-theme="pixel"] .live-pill { font-family: var(--font-head); font-size: 8px; letter-spacing: 0; padding: 6px 8px; }
body[data-theme="pixel"] .live-pill[data-state="live"] { --rec: #ff4d4d; }
body[data-theme="pixel"] .live-pill[data-state="live"] .dot { animation: pixel-blink 1s steps(1) infinite; }
body[data-theme="pixel"] .live-pill .dot::after { display: none; }
@keyframes pixel-blink { 50% { opacity: 0; } }

/* títulos */
body[data-theme="pixel"] .heading h5 { font-size: 13px; text-shadow: 3px 3px 0 #000; }
body[data-theme="pixel"] .detail-name { font-size: 16px; line-height: 1.6; color: #ffcd75; text-shadow: 3px 3px 0 #000; }
body[data-theme="pixel"] .sub-title { font-size: 14px; line-height: 1.6; color: #ffcd75; }
body[data-theme="pixel"] .count-chip { font-size: 18px; background: #1a1c2c; border-color: #566c86; }
body[data-theme="pixel"] .test-desc { color: #94b0c2; }
body[data-theme="pixel"] .table-results th,
body[data-theme="pixel"] .mini-table th,
body[data-theme="pixel"] .panel-name,
body[data-theme="pixel"] .bloque-titulo,
body[data-theme="pixel"] .ai-card h6,
body[data-theme="pixel"] .detail-tabs button { font-family: var(--font-head); font-size: 9px; letter-spacing: 0; color: #94b0c2; }

/* estados como insignias de juego */
body[data-theme="pixel"] .label { font-family: var(--font-head); font-size: 8px; line-height: 1; padding: 6px 7px; text-transform: uppercase; }
body[data-theme="pixel"] .label.outline { border: 0; color: #1a1c2c !important; box-shadow: 2px 2px 0 0 #000; }
body[data-theme="pixel"] .label.outline.pass { background: var(--pass) !important; }
body[data-theme="pixel"] .label.outline.fail { background: var(--fail) !important; }
body[data-theme="pixel"] .label.outline.warning { background: var(--warning) !important; }
body[data-theme="pixel"] .label.outline.skip { background: var(--skip) !important; }
body[data-theme="pixel"] .label.outline.info { background: var(--info) !important; }
body[data-theme="pixel"] .label.outline.running { background: var(--running) !important; }
body[data-theme="pixel"] .label.started,
body[data-theme="pixel"] .label.ended,
body[data-theme="pixel"] .label.elapsed { color: #f4f4f4; box-shadow: 2px 2px 0 0 #000; }
body[data-theme="pixel"] .label.tag { font-family: var(--font-ui); font-size: 18px; padding: 2px 8px; text-transform: none; background: #1a1c2c; border: 0; box-shadow: inset 0 0 0 2px #566c86; color: #f4f4f4; }
body[data-theme="pixel"] .ai-cat { font-family: var(--font-head); font-size: 8px; padding: 5px 7px; box-shadow: 2px 2px 0 0 #000; }

/* lista: cursor ▶ en el elemento activo */
body[data-theme="pixel"] .collection-item { border-bottom: 2px dashed #333c57; border-left: 0; }
body[data-theme="pixel"] .collection-item:hover { background: rgba(255, 255, 255, .04); }
body[data-theme="pixel"] .collection-item.active { background: #1a1c2c; }
body[data-theme="pixel"] .collection-item.active .test-name { color: #ffcd75; }
body[data-theme="pixel"] .collection-item.active .test-name::before { content: "▶ "; animation: pixel-blink 1s steps(1) infinite; }
body[data-theme="pixel"] .collection-item .meta { font-size: 17px; }

/* pestañas */
body[data-theme="pixel"] .detail-tabs { border-bottom: 2px dashed #566c86; box-shadow: none; }
body[data-theme="pixel"] .detail-tabs button.active { color: #ffcd75; border-bottom: 3px solid #ffcd75; }
body[data-theme="pixel"] .tab-err, body[data-theme="pixel"] .tab-ok { font-family: var(--font-head); font-size: 8px; padding: 4px 5px; color: #1a1c2c; }

/* pasos y capturas */
body[data-theme="pixel"] .table-results td { border-bottom: 2px dashed #333c57; }
body[data-theme="pixel"] .report-img { border: 0; box-shadow: 0 0 0 3px #f4f4f4, 6px 6px 0 3px #000; image-rendering: pixelated; margin-top: 12px; }
body[data-theme="pixel"] .report-img:hover { transform: translate(-2px, -2px); box-shadow: 0 0 0 3px #ffcd75, 8px 8px 0 3px #000; }

/* IA como cuadro de diálogo de RPG */
body[data-theme="pixel"] .ai-card { --edge: #ffcd75; background: #29366f; }
body[data-theme="pixel"] .ai-card::before { display: none; }
body[data-theme="pixel"] .ai-title { font-family: var(--font-head); font-size: 11px; color: #ffcd75; text-shadow: 2px 2px 0 #000; }
body[data-theme="pixel"] .ai-title svg { color: #ffcd75; }
body[data-theme="pixel"] .ai-card p { font-size: 21px; }
body[data-theme="pixel"] .ai-card .suggestion { background: #1a1c2c; border: 2px dashed #566c86; }
body[data-theme="pixel"] .ai-card .suggestion::after { content: " ▼"; color: #ffcd75; animation: pixel-blink 1s steps(1) infinite; }
body[data-theme="pixel"] .error-block { --edge: var(--fail); border-left: 0; background: #1a1c2c; }
body[data-theme="pixel"] .error-msg { font-size: 19px; }
body[data-theme="pixel"] .error-block pre { background: #262b44; }
body[data-theme="pixel"] .bloque pre { background: #1a1c2c; font-size: 18px; box-shadow: inset 0 0 0 2px #333c57; }

/* dashboard: números de marcador y barra de vida */
body[data-theme="pixel"] .stat { border-top: 0; }
body[data-theme="pixel"] .stat.accent-pass { --edge: var(--pass); }
body[data-theme="pixel"] .stat.accent-fail { --edge: var(--fail); }
body[data-theme="pixel"] .stat.accent-skip { --edge: var(--skip); }
body[data-theme="pixel"] .panel-lead { font-size: 22px; line-height: 1.8; color: #ffcd75; text-shadow: 3px 3px 0 #000; }
body[data-theme="pixel"] #d-time { font-size: 12px; line-height: 2.6; }
body[data-theme="pixel"] .pass-percentage { font-size: 28px; color: #a7f070; text-shadow: 4px 4px 0 #000; margin-top: 14px; }
body[data-theme="pixel"] .progress { height: 18px; margin: 14px 3px 22px; box-shadow: 0 -3px 0 0 #f4f4f4, 0 3px 0 0 #f4f4f4, -3px 0 0 0 #f4f4f4, 3px 0 0 0 #f4f4f4; }
body[data-theme="pixel"] .determinate { background: repeating-linear-gradient(90deg, #a7f070 0 12px, #38b764 12px 14px, transparent 14px 16px); }
body[data-theme="pixel"] .env-table td { border-bottom: 2px dashed #333c57; font-size: 19px; }
body[data-theme="pixel"] .chart-legend { font-size: 20px; }

/* VT323 es más chico que una fuente normal al mismo tamaño: se escalan los textos fijos */
body[data-theme="pixel"] .collection-item .test-name { color: #f4f4f4; }
body[data-theme="pixel"] .table-results,
body[data-theme="pixel"] .mini-table { font-size: 20px; }
body[data-theme="pixel"] .table-results td.timestamp { color: #94b0c2; }
body[data-theme="pixel"] .ai-model,
body[data-theme="pixel"] .panel-sub,
body[data-theme="pixel"] .steps-toolbar .lbl,
body[data-theme="pixel"] .peso { font-size: 17px; }
body[data-theme="pixel"] .net-summary,
body[data-theme="pixel"] .net-check,
body[data-theme="pixel"] .net-url,
body[data-theme="pixel"] .truncado-aviso,
body[data-theme="pixel"] .collection-empty,
body[data-theme="pixel"] .placeholder { font-size: 19px; }
body[data-theme="pixel"] .nbadge { font-family: var(--font-head); font-size: 8px; padding: 5px 6px; }
body[data-theme="pixel"] .theme-option b { font-family: var(--font-head); font-size: 10px; margin-bottom: 4px; }
body[data-theme="pixel"] .theme-option small { font-size: 17px; }
body[data-theme="pixel"] .theme-menu h6 { font-family: var(--font-head); font-size: 9px; }

/* piezas de diagnóstico, historial, timeline y endpoints en VT323 */
body[data-theme="pixel"] .sum-head h3 { font-size: 13px; line-height: 1.7; color: #ffcd75; text-shadow: 3px 3px 0 #000; }
body[data-theme="pixel"] .insight-card h5 { font-size: 11px; line-height: 1.6; color: #ffcd75; }
body[data-theme="pixel"] .insight-card h5 small { font-size: 16px; }
body[data-theme="pixel"] .sum-text,
body[data-theme="pixel"] .inc-cause,
body[data-theme="pixel"] .inc-action,
body[data-theme="pixel"] .tl-main,
body[data-theme="pixel"] .cmp-group a,
body[data-theme="pixel"] .cmp-same,
body[data-theme="pixel"] .run-banner { font-size: 20px; }
body[data-theme="pixel"] .incident { background: #1a1c2c; border: 2px dashed #566c86; }
body[data-theme="pixel"] .inc-tests a,
body[data-theme="pixel"] .inc-count,
body[data-theme="pixel"] .cmp-chip,
body[data-theme="pixel"] .history,
body[data-theme="pixel"] .tl-toolbar,
body[data-theme="pixel"] .tl-dur,
body[data-theme="pixel"] .tl-time { font-size: 17px; }
body[data-theme="pixel"] .ep-table { font-size: 18px; }
body[data-theme="pixel"] .ep-table th,
body[data-theme="pixel"] .history-lbl { font-family: var(--font-head); font-size: 8px; }
body[data-theme="pixel"] .tl-url { font-size: 18px; }
body[data-theme="pixel"] .hist-cell { border-radius: 0; box-shadow: 2px 2px 0 #000; }
body[data-theme="pixel"] .flaky-badge { font-family: var(--font-head); font-size: 8px; padding: 5px 7px; }

/* navegación: cursor ▶ junto al ícono activo */
@media (min-width: 821px) {
	body[data-theme="pixel"] .side-nav { box-shadow: var(--px) 0 0 0 #f4f4f4, calc(var(--px) * 2) 0 0 0 #000; }
	body[data-theme="pixel"] .side-nav a { position: relative; border-left: 0; font-family: var(--font-head); font-size: 7px; padding: 14px 4px; }
	body[data-theme="pixel"] .side-nav a.active { background: transparent; color: #ffcd75; }
	body[data-theme="pixel"] .side-nav a.active::before { content: "▶"; position: absolute; left: 6px; top: 20px; font-size: 10px; animation: pixel-blink 1s steps(1) infinite; }
	body[data-theme="pixel"] .side-nav a.active svg { color: #ffcd75; }
	body[data-theme="pixel"] .container { padding-top: calc(var(--topbar-h) + 24px); padding-left: calc(var(--sidenav-w) + 24px); padding-right: 20px; }
	body[data-theme="pixel"] .split-left { top: calc(var(--topbar-h) + 24px); }
}
@media (max-width: 820px) {
	body[data-theme="pixel"] .side-nav { box-shadow: 0 calc(var(--px) * -1) 0 0 #f4f4f4; }
	body[data-theme="pixel"] .side-nav a { font-family: var(--font-head); font-size: 7px; }
	body[data-theme="pixel"] .side-nav a.active { color: #ffcd75; background: rgba(255, 205, 117, .08); }
}


/* ═══════════════════════ SELECTOR DE TEMAS ═══════════════════════ */
.theme-picker { position: relative; }
.theme-menu {
	position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 340px;
	background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
	box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .35); padding: 8px;
	transform-origin: top right; animation: theme-pop .14s ease-out;
}
@keyframes theme-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.theme-menu h6 { margin: 6px 8px 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.theme-option {
	display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid transparent;
	border-radius: 9px; background: none; cursor: pointer; text-align: left; color: var(--text);
}
.theme-option:hover, .theme-option:focus-visible { background: var(--hover); outline: none; }
.theme-option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.theme-option b { display: block; font-size: 14px; color: var(--heading); }
.theme-option small { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.theme-option .check { margin-left: auto; color: var(--accent); visibility: hidden; }
.theme-option[aria-checked="true"] .check { visibility: visible; }
/* mini vista previa de cada tema: barra superior, navegación y dos tarjetas */
.theme-swatch {
	position: relative; flex: none; width: 74px; height: 50px; border-radius: 7px; overflow: hidden;
	background: var(--sw-bg); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .25);
}
.theme-swatch::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 9px; background: var(--sw-top); }
.theme-swatch i { position: absolute; display: block; }
.theme-swatch .nav { left: 0; top: 9px; bottom: 0; width: 13px; background: var(--sw-nav); }
.theme-swatch .c1 { left: 18px; top: 14px; width: 20px; height: 31px; background: var(--sw-card); border-radius: 2px; }
.theme-swatch .c2 { left: 42px; top: 14px; width: 27px; height: 31px; background: var(--sw-card); border-radius: 2px; }
.theme-swatch .dot { left: 45px; top: 18px; width: 14px; height: 4px; background: var(--sw-accent); border-radius: 2px; }
.theme-swatch.topnav .nav { left: 0; right: 0; top: 9px; bottom: auto; width: auto; height: 6px; }
.theme-swatch.topnav .c1, .theme-swatch.topnav .c2 { top: 19px; height: 26px; }
.theme-swatch.topnav .c1 { left: 5px; width: 26px; }
.theme-swatch.topnav .c2 { left: 35px; width: 34px; }
.theme-swatch.topnav .dot { top: 23px; left: 39px; }

/* Los temas que agregan borde a .card pisan el color de la franja superior del dashboard:
   se restaura con mayor especificidad. */
body:is([data-theme="trace-dark"], [data-theme="midnight"]) .stat { border-top-width: 3px; }
body:is([data-theme="trace-dark"], [data-theme="midnight"]) .stat.accent-pass { border-top-color: var(--pass); }
body:is([data-theme="trace-dark"], [data-theme="midnight"]) .stat.accent-fail { border-top-color: var(--fail); }
body:is([data-theme="trace-dark"], [data-theme="midnight"]) .stat.accent-skip { border-top-color: var(--skip); }
