:root{
  --bg:#f7f7fb; --card:#ffffff; --ink:#111827; --muted:#6b7280; --line:#e5e7eb; --accent:#2563eb;
  --ok:#16a34a; --warn:#d97706; --err:#dc2626; --drop:#eef2ff;
  --item-h:34px;
  --active-bg:#fff4ce; --active-border:#f59e0b;
  --selected-folder:#e8f0ff; --selected-folder-border:#c7d2fe;
}
.app-jsonl{display:grid;grid-template-rows:auto 1fr;height:calc(100vh - 120px); /* ajusta a tu layout */}
.jsonl-header{display:flex;flex-direction:column;gap:6px;padding:10px 14px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#ffffff,#fafafa)}
.jsonl-header h1{font-size:16px;margin:0;font-weight:600}
.jsonl-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.jsonl-input{background:var(--card);border:1px solid var(--line);border-radius:10px;color:var(--ink);padding:8px 12px;min-width:240px;outline:none}
.jsonl-subtitle{color:var(--muted);font-size:12px}
.jsonl-main{display:grid;grid-template-columns:420px 1fr;height:100%}
.jsonl-left{border-right:1px solid var(--line);background:#fff;display:flex;flex-direction:column;min-height:0}
.jsonl-root{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px dashed var(--line);position:sticky;top:0;background:#fff;z-index:3}
.jsonl-root-pill{display:inline-flex;align-items:center;gap:8px;padding:6px 10px;border:1px solid var(--line);border-radius:999px;background:var(--card);font-size:12px;cursor:default}
.jsonl-left-body{display:grid;grid-template-rows:auto auto 1fr;height:100%;min-height:0}
.jsonl-tree-wrap{padding:8px 8px 4px;border-bottom:1px dashed var(--line);position:sticky;top:44px;background:#fff;z-index:2}
.jsonl-tree{max-height:30vh;overflow:auto;padding-right:6px}
.jsonl-tree details{padding-left:8px}
.jsonl-tree summary{list-style:none;user-select:none;display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;color:var(--ink);outline:none;cursor:default}
.jsonl-tree summary:hover{background:#f1f5f9}
.jsonl-tree summary:focus{outline:2px solid var(--accent)}
.jsonl-chev{transition:transform .15s ease;opacity:.8;cursor:pointer}
details[open] > summary .jsonl-chev{transform:rotate(90deg)}
.jsonl-folder{display:flex;flex-direction:column;gap:2px;margin-left:22px}
.jsonl-counts{margin-left:auto;color:var(--muted);font-size:12px}
.jsonl-selected{background:var(--selected-folder)!important;border:1px solid var(--selected-folder-border)}
.jsonl-root-files-wrap{padding:8px;border-bottom:1px dashed var(--line);background:#fff}
.jsonl-root-files-head{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;justify-content:space-between}
.jsonl-root-files{margin-top:6px;overflow:auto;max-height:calc(6 * var(--item-h));padding-right:6px;display:flex;flex-direction:column;gap:2px;overscroll-behavior:contain}
.jsonl-files-wrap{display:flex;flex-direction:column;gap:6px;padding:10px 8px 14px;height:100%;min-height:0;background:#fff;}
.jsonl-files-head{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);justify-content:space-between}
.jsonl-files{margin-top:2px;overflow:auto;height:100%;min-height:0;padding-right:6px;display:flex;flex-direction:column;gap:2px;overscroll-behavior:contain;background:#fff;}
.jsonl-file{cursor:pointer;padding:6px 8px;border-radius:8px;display:flex;gap:8px;align-items:center;outline:none;min-height:var(--item-h)}
.jsonl-file:hover{background:#f1f5f9}
.jsonl-file.active{background:var(--active-bg);border:1px solid var(--active-border)}
.jsonl-file[draggable="true"]{border:1px dashed transparent}
.jsonl-file.dragging{opacity:.8;border-color:#cbd5e1}
.jsonl-muted{color:var(--muted);font-size:12px}
.jsonl-drop-target{outline:2px dashed var(--accent);background:var(--drop)}
.jsonl-status{padding:8px 12px;border-top:1px dashed var(--line);font-size:12px;color:var(--muted);background:#fff}
.jsonl-right{position:relative;height:100%;background:#f8fafc;overflow:hidden}
.jsonl-topbar{display:flex;gap:8px;align-items:center;padding:8px 14px;border-bottom:1px solid var(--line);background:#f8fafc}
.jsonl-preview{height:100%;position:relative;overflow:auto;overscroll-behavior:contain;background:#fff}
.jsonl-path{font-family:ui-monospace,SFMono-Regular,Consolas,Menlo,monospace;font-size:12px;color:var(--muted)}
.jsonl-badge{padding:2px 8px;border:1px solid var(--line);border-radius:999px;font-size:12px;color:var(--muted);background:#fff}
.hidden{display:none}
.jsonl-pre{margin:0;padding:12px 14px;background:#0b1020;color:#e6edf3;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,Consolas,Menlo,monospace}
.jsonl-line-error{color:#ffb4b4}
.jsonl-line-ok{color:#b7ffb7}