/* Estilos base (del mockup aprobado). Los agregados de la app están en app.css */
:root{
  /* layout: barra superior + menú lateral fijo (inicio, olimpiadas, temas) + área de trabajo. grises neutros, un solo acento azul */
  --bg:#f4f4f2; --surface:#fcfcfb; --surface-2:#f0efec; --border:#e2e1dc; --border-2:#d3d2cc;
  --text:#1a1a18; --muted:#5d5c57; --faint:#8a8983;
  --accent:#256abf; --accent-text:#1c5cab; --accent-soft:#e4eefb;
  --good:#0ca30c; --good-text:#006300; --good-soft:#e2f2e2;
  --warn-text:#7a5200; --warn-soft:#fbefd2;
  --crit:#d03b3b; --crit-text:#b02a2a; --crit-soft:#fbe4e3;
  --s-ok:#2a78d6; --s-no:#eb6834;
  --code-bg:#ffffff; --code-head:#f0efec; --out-bg:#f0efec; --viewer:#e6e5e0;
  --font:'IBM Plex Sans',system-ui,-apple-system,sans-serif; --mono:'IBM Plex Mono',ui-monospace,Menlo,monospace;
  --top:52px; --side:268px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#141413; --surface:#1a1a19; --surface-2:#232321; --border:#2f2f2c; --border-2:#3d3d39;
  --text:#f0efec; --muted:#b4b3aa; --faint:#86857e;
  --accent:#3987e5; --accent-text:#86b6ef; --accent-soft:#1d2836;
  --good-text:#5fd35f; --good-soft:#18291a; --warn-text:#f5c454; --warn-soft:#332912;
  --crit:#e66767; --crit-text:#f08a8a; --crit-soft:#341c1c;
  --s-ok:#3987e5; --s-no:#d95926;
  --code-bg:#212121; --code-head:#1a1a19; --out-bg:#111110; --viewer:#262624; color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#141413; --surface:#1a1a19; --surface-2:#232321; --border:#2f2f2c; --border-2:#3d3d39;
  --text:#f0efec; --muted:#b4b3aa; --faint:#86857e;
  --accent:#3987e5; --accent-text:#86b6ef; --accent-soft:#1d2836;
  --good-text:#5fd35f; --good-soft:#18291a; --warn-text:#f5c454; --warn-soft:#332912;
  --crit:#e66767; --crit-text:#f08a8a; --crit-soft:#341c1c;
  --s-ok:#3987e5; --s-no:#d95926;
  --code-bg:#212121; --code-head:#1a1a19; --out-bg:#111110; --viewer:#262624; color-scheme:dark;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow-x:hidden}
body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14.5px;line-height:1.5;-webkit-font-smoothing:antialiased}
h1,h2,h3{margin:0;line-height:1.25;font-weight:600;text-wrap:balance}
p{margin:0}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
code{font-family:var(--mono);font-size:.88em;background:var(--surface-2);padding:1px 5px;border-radius:4px}
.tnum{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
[hidden]{display:none!important}

/* ---------- barra superior ---------- */
.top{position:sticky;top:0;z-index:40;height:var(--top);display:flex;align-items:center;gap:10px;padding:0 14px;background:var(--surface);border-bottom:1px solid var(--border)}
.brand{display:flex;align-items:center;gap:9px;font-weight:700;font-size:.96rem;white-space:nowrap;width:calc(var(--side) - 28px)}
.logo{width:26px;height:26px;border-radius:6px;background:var(--text);color:var(--surface);display:grid;place-items:center;font-family:var(--mono);font-weight:500;font-size:.66rem}
.ib.menubtn{display:none}
.crumbs{font-size:.86rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crumbs b{color:var(--text);font-weight:600}
.spacer{flex:1}
.segl{font-size:.74rem;color:var(--faint);white-space:nowrap}
.seg{display:flex;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:2px}
.seg button{border:0;background:none;padding:4px 10px;border-radius:6px;font-size:.78rem;font-weight:600;color:var(--muted)}
.seg button.on{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.ghost{border:1px solid var(--border);background:none;border-radius:7px;padding:5px 10px;font-size:.8rem;color:var(--muted)}
.ghost:hover{color:var(--text);border-color:var(--border-2)}
.user{display:flex;align-items:center;gap:8px;font-size:.85rem;white-space:nowrap}
.avatar{width:28px;height:28px;border-radius:50%;background:var(--surface-2);border:1px solid var(--border-2);color:var(--text);display:grid;place-items:center;font-size:.7rem;font-weight:600}

/* ---------- shell con menú fijo ---------- */
.shell{display:grid;grid-template-columns:var(--side) 1fr;height:calc(100vh - var(--top))}
.side{background:var(--surface);border-right:1px solid var(--border);overflow-y:auto;padding:12px 10px 28px;display:flex;flex-direction:column;gap:1px}
.sitem{display:flex;align-items:center;gap:10px;width:100%;border:0;background:none;text-align:left;padding:7px 10px;border-radius:7px;font-size:.88rem;color:var(--text)}
.sitem:hover{background:var(--surface-2)}
.sitem.on{background:var(--accent-soft);color:var(--accent-text);font-weight:600}
.sitem svg{width:16px;height:16px;flex:none;color:var(--muted)}
.sitem.on svg{color:var(--accent-text)}
.sitem .c{margin-left:auto;font-size:.74rem;color:var(--faint);font-weight:500}
.ssect{font-size:.7rem;text-transform:uppercase;letter-spacing:.07em;color:var(--faint);font-weight:600;padding:16px 10px 6px;display:flex;justify-content:space-between}
.content{overflow-y:auto;overflow-x:hidden;min-width:0;position:relative;overscroll-behavior-x:none}

/* ---------- comunes ---------- */
.btn{border:1px solid var(--accent);background:var(--accent);color:#fff;padding:7px 13px;border-radius:7px;font-weight:600;font-size:.84rem;display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.btn:hover{filter:brightness(1.08)}
.btn.quiet{background:var(--surface);border-color:var(--border-2);color:var(--text)}
.btn.quiet:hover{background:var(--surface-2);filter:none}
.btn.ghostb{background:transparent;border-color:transparent;color:var(--accent-text)}
.btn.ghostb:hover{background:var(--accent-soft);filter:none}
.btn.danger{background:transparent;border-color:var(--crit);color:var(--crit-text)}
.btn.dangerfill{background:var(--crit);border-color:var(--crit)}
.btn.sm{padding:4px 10px;font-size:.78rem}
.btn:disabled{opacity:.45;cursor:not-allowed;filter:none}
.ib{width:28px;height:28px;border-radius:7px;border:1px solid var(--border);background:var(--surface);display:grid;place-items:center;color:var(--muted);padding:0;font-size:.9rem}
.ib:hover:not(:disabled){color:var(--text);border-color:var(--border-2)}
.ib:disabled{opacity:.35;cursor:not-allowed}
.kbd{font-family:var(--mono);font-size:.66rem;opacity:.7;border:1px solid currentColor;border-radius:4px;padding:0 4px}
.pill{font-size:.72rem;font-weight:600;padding:2px 8px;border-radius:99px;background:var(--surface-2);color:var(--muted);white-space:nowrap;display:inline-flex;align-items:center;gap:4px}
.pill.acc{background:var(--accent-soft);color:var(--accent-text)}
.pill.good{background:var(--good-soft);color:var(--good-text)}
.pill.warn{background:var(--warn-soft);color:var(--warn-text)}
.pill.crit{background:var(--crit-soft);color:var(--crit-text)}
.bar{height:6px;border-radius:99px;background:var(--surface-2);overflow:hidden}
.bar>i{display:block;height:100%;background:var(--s-ok);border-radius:99px}
.bar.good>i{background:var(--good)}
.dots{display:inline-flex;gap:3px}
.dots i{width:6px;height:6px;border-radius:50%;background:var(--border-2)}
.dots i.on{background:var(--text)}
.card{background:var(--surface);border:1px solid var(--border);border-radius:10px}
.chead{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 16px;border-bottom:1px solid var(--border)}
.chead h2{font-size:.93rem}
.chead .sub{font-size:.78rem;color:var(--muted)}
.tab .pill{font-size:.68rem}
.empty{padding:16px;color:var(--muted);font-size:.87rem}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);background:var(--text);color:var(--bg);padding:9px 16px;border-radius:8px;font-size:.86rem;font-weight:500;z-index:90;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.page{padding:22px 26px 50px;max-width:1240px}
.phead{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.phead h1{font-size:1.35rem}
.phead p{color:var(--muted);margin-top:3px;font-size:.9rem}
.filters{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.fbtn{border:1px solid var(--border);background:var(--surface);border-radius:99px;padding:4px 11px;font-size:.78rem;color:var(--muted)}
.fbtn.on{background:var(--text);color:var(--bg);border-color:var(--text)}
table.tb{width:100%;border-collapse:collapse;font-size:.86rem}
.tb th{text-align:left;font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;color:var(--faint);font-weight:600;padding:8px 14px;border-bottom:1px solid var(--border);white-space:nowrap}
.tb td{padding:9px 14px;border-bottom:1px solid var(--border);vertical-align:middle}
.tb tr:last-child td{border-bottom:0}
.tb tbody tr:hover{background:color-mix(in srgb,var(--surface-2) 60%,transparent)}
.tb .r{text-align:right}
.tb .t b{font-weight:600;display:block}
.tb .t small{color:var(--muted);font-size:.78rem}
.tb tr.locked{color:var(--faint)}
.tb .n{width:34px;color:var(--faint);font-family:var(--mono);font-size:.78rem}
.mini{display:flex;align-items:center;gap:9px}
.mini .bar{width:110px;flex:none}
.tablewrap{overflow-x:auto}

/* ---------- dashboard ---------- */
.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}
.kpi{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:13px 15px}
.kpi .k{font-size:.78rem;color:var(--muted)}
.kpi .v{font-size:1.6rem;font-weight:700;margin-top:2px;letter-spacing:-.01em}
.kpi .v small{font-size:.86rem;color:var(--muted);font-weight:500}
.kpi .s{font-size:.78rem;color:var(--muted);margin-top:2px}
.kpi .bar{margin-top:8px}
.drow{display:grid;grid-template-columns:1.7fr 1fr;gap:14px;margin-bottom:14px;align-items:start}
.chart{position:relative;padding:8px 14px 12px}
.chart svg{display:block;width:100%;height:220px;overflow:visible}
.chart .grid line{stroke:var(--border);stroke-width:1}
.chart .axis text{fill:var(--faint);font-size:11px;font-family:var(--font)}
.chart .col:hover .hl,.chart .col:focus .hl{fill:var(--surface-2)}
.chart .col{outline:none}
.legend{display:flex;gap:14px;font-size:.78rem;color:var(--muted);align-items:center;flex-wrap:wrap}
.legend span{display:flex;align-items:center;gap:6px}
.legend i{width:10px;height:10px;border-radius:3px;display:inline-block}
.tip{position:absolute;pointer-events:none;background:var(--surface);border:1px solid var(--border-2);border-radius:8px;padding:8px 10px;font-size:.78rem;box-shadow:0 6px 20px rgba(0,0,0,.14);min-width:150px;z-index:5}
.tip b{display:block;margin-bottom:4px;font-size:.8rem}
.tip div{display:flex;justify-content:space-between;gap:14px;color:var(--muted)}
.tip div span:last-child{color:var(--text);font-weight:600}
.tip i{width:8px;height:8px;border-radius:2px;display:inline-block;margin-right:6px}
.vlist{padding:10px 16px 14px;display:flex;flex-direction:column;gap:11px}
.vrow .top2{display:flex;justify-content:space-between;font-size:.84rem;margin-bottom:4px}
.vrow .top2 b{font-weight:500}
.vrow .bar>i{background:var(--text);opacity:.75}
.due{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center;padding:10px 16px;border-top:1px solid var(--border);font-size:.85rem}
.due small{display:block;color:var(--muted);font-size:.76rem}
.mt{margin-bottom:14px}

/* ---------- tema ---------- */
.lhead{padding:18px 26px 0;background:var(--surface);border-bottom:1px solid var(--border)}
.lhead .cr{font-size:.78rem;color:var(--muted);margin-bottom:3px}
.lhead h1{font-size:1.35rem}
.lmeta{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:10px 0 12px;font-size:.83rem;color:var(--muted)}
.lmeta .bar{width:130px}
.lmeta .prog{display:flex;align-items:center;gap:9px}
.lmeta .btn{margin-left:auto}
.pane{padding:18px 26px 40px;max-width:1100px}
.desc{max-width:72ch;display:flex;flex-direction:column;gap:9px;margin-bottom:16px}
.matcard{border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface)}
.free{display:grid;grid-template-columns:1fr 320px;gap:14px}
.free .edwrap{border:1px solid var(--border);border-radius:10px;overflow:hidden;height:430px;display:flex;flex-direction:column}
.free .sidep{display:flex;flex-direction:column;gap:12px}
.lbl{font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;color:var(--faint);font-weight:600;margin-bottom:6px;display:block}
textarea.io{width:100%;border:1px solid var(--border);background:var(--surface);border-radius:8px;padding:9px;font-family:var(--mono);font-size:.84rem;resize:vertical}
pre.out{margin:0;background:var(--out-bg);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:11px;font-family:var(--mono);font-size:.83rem;white-space:pre-wrap;min-height:140px;max-height:260px;overflow:auto}
pre.out.err{color:var(--crit-text)}
pre.out.warn{color:var(--warn-text)}

/* ---------- IDE ---------- */
.ide{display:flex;flex-direction:column;height:100%}
.idebar{display:flex;align-items:center;gap:10px;padding:7px 14px;background:var(--surface);border-bottom:1px solid var(--border);flex-wrap:wrap;min-height:46px}
.idebar h1{font-size:1rem}
.idebar .nav2{display:flex;gap:6px;align-items:center;margin-left:auto;font-size:.8rem;color:var(--muted)}
.idebar select{border:1px solid var(--border);background:var(--surface);border-radius:7px;padding:5px 8px;font-size:.84rem;max-width:280px}
.saved{font-size:.75rem;color:var(--faint);white-space:nowrap}
.idebody{flex:1;display:grid;grid-template-columns:minmax(300px,37%) 1fr;min-height:0}
.lp{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--border);background:var(--surface)}
.lp .tabs{flex:none}
.lpb{flex:1;overflow:auto;padding:16px 18px 28px}
.lpb h2{font-size:1.08rem;margin-bottom:9px}
.lpb .st{display:flex;flex-direction:column;gap:9px;font-size:.92rem;max-width:68ch}
.lpb h3{font-size:.7rem;text-transform:uppercase;letter-spacing:.06em;color:var(--faint);font-weight:600;margin:16px 0 7px}
.sig{display:block;background:var(--surface-2);border-radius:7px;padding:8px 11px;font-family:var(--mono);font-size:.83rem;overflow-x:auto;white-space:pre}
.ex2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ex2 div{background:var(--surface-2);border-radius:7px;padding:7px 11px}
.ex2 b{display:block;font-size:.66rem;text-transform:uppercase;letter-spacing:.06em;color:var(--faint);margin-bottom:2px}
.ex2 pre{margin:0;font-family:var(--mono);font-size:.84rem;white-space:pre-wrap}
details.hint{border:1px solid var(--border);border-radius:8px;padding:8px 11px;margin-top:8px;font-size:.87rem}
details.hint summary{cursor:pointer;font-weight:600}
details.hint p{margin-top:7px}
.note{background:var(--warn-soft);color:var(--warn-text);border-radius:8px;padding:8px 11px;font-size:.83rem;margin-top:12px}
.att{display:flex;flex-direction:column;gap:7px}
.attrow{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;border:1px solid var(--border);border-radius:8px;padding:8px 11px;font-size:.84rem}
.attrow small{display:block;color:var(--muted);font-size:.75rem}
.lp .pdfhost{flex:1;min-height:0;display:flex;flex-direction:column}
.rp{display:flex;flex-direction:column;min-height:0;min-width:0}
.edhead{display:flex;align-items:center;gap:8px;padding:5px 10px;background:var(--code-head);font-size:.8rem;border-bottom:1px solid var(--border)}
.edhead .fn{font-family:var(--mono);background:var(--code-bg);padding:4px 10px;border-radius:6px 6px 0 0;margin-bottom:-6px;border:1px solid var(--border);border-bottom:0}
.edhead .sp{flex:1}
.edhead button{background:var(--surface);border:1px solid var(--border);color:var(--muted);border-radius:6px;padding:3px 9px;font-size:.76rem}
.edhead button:hover{color:var(--text);border-color:var(--border-2)}
.mainview{background:var(--surface-2);border-bottom:1px solid var(--border);max-height:200px;overflow:auto}
.mainview .lbl2{font-size:.74rem;color:var(--muted);padding:6px 12px 0}
.mainview pre{margin:0;padding:6px 12px 10px;font-family:var(--mono);font-size:.8rem;color:var(--muted);white-space:pre}
.cmhost{flex:1;min-height:0;background:var(--code-bg)}
.cmhost .CodeMirror{height:100%;font-family:var(--mono);font-size:.9rem;line-height:1.55}
.cm-s-idea.CodeMirror{background:var(--code-bg)}
.cm-s-material-darker.CodeMirror,.cm-s-material-darker .CodeMirror-gutters{background:var(--code-bg)}
.con{height:270px;flex:none;display:flex;flex-direction:column;background:var(--surface);border-top:1px solid var(--border)}
.conbar{display:flex;align-items:center;gap:8px;padding:0 10px 0 4px;border-bottom:1px solid var(--border)}
.conbar .tabs{border-bottom:0;flex:1}
.conbody{flex:1;overflow:auto;padding:11px 14px}
.confoot{display:flex;align-items:center;gap:8px;padding:7px 12px;border-top:1px solid var(--border);flex-wrap:wrap}
.confoot .sim{margin-left:auto;font-size:.72rem;color:var(--faint)}
.verdict{display:flex;align-items:center;gap:10px;border-radius:8px;padding:8px 12px;margin-bottom:10px;font-size:.87rem}
.verdict b{font-weight:700}
.verdict.ok{background:var(--good-soft);color:var(--good-text)}
.verdict.no{background:var(--crit-soft);color:var(--crit-text)}
.verdict.tle{background:var(--warn-soft);color:var(--warn-text)}
.verdict .btn{margin-left:auto}
.why{font-size:.84rem;border-left:3px solid var(--border-2);padding:6px 10px;margin:0 0 10px;color:var(--text);background:var(--surface-2);border-radius:0 7px 7px 0}
.case{display:grid;grid-template-columns:20px 1fr auto;gap:10px;align-items:start;padding:7px 2px;border-bottom:1px solid var(--border);font-size:.84rem}
.case:last-child{border-bottom:0}
.case .ic{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-size:.64rem;font-weight:700;background:var(--surface-2);color:var(--muted)}
.case.pass .ic{background:var(--good-soft);color:var(--good-text)}
.case.fail .ic{background:var(--crit-soft);color:var(--crit-text)}
.case .io2{display:flex;gap:14px;flex-wrap:wrap;margin-top:3px;font-family:var(--mono);font-size:.78rem;color:var(--muted)}
.case .io2 em{font-style:normal;color:var(--good-text)}
.case .io2 s{text-decoration:none;color:var(--crit-text)}
.case .tm{font-size:.74rem;color:var(--faint);font-family:var(--mono)}
.conbody pre.out{min-height:0;max-height:none}
.conbody textarea.io{height:140px}

/* ---------- gestión ---------- */
.tgrid{display:grid;grid-template-columns:290px 1fr;gap:16px;align-items:start}
.lvitem{display:grid;grid-template-columns:28px 1fr auto;gap:10px;align-items:center;padding:9px 12px;border-bottom:1px solid var(--border);cursor:pointer;border-left:3px solid transparent}
.lvitem:hover{background:var(--surface-2)}
.lvitem.on{background:var(--accent-soft);border-left-color:var(--accent)}
.lvitem .n{width:28px;height:28px;border-radius:7px;background:var(--surface-2);display:grid;place-items:center;font-weight:700;font-size:.82rem}
.lvitem.on .n{background:var(--accent);color:#fff}
.lvitem b{display:block;font-size:.87rem}
.lvitem small{font-size:.74rem;color:var(--muted)}
.arrows{display:flex;flex-direction:column;gap:2px}
.arrows .ib{width:22px;height:18px;font-size:.58rem;border-radius:5px}
.pad{padding:14px 16px}
.field{display:flex;flex-direction:column;gap:5px;margin-bottom:13px}
.field label{font-size:.83rem;font-weight:600}
.field .hint{font-weight:400;font-size:.75rem;color:var(--muted)}
.field input[type=text],.field input[type=date],.field textarea{border:1px solid var(--border-2);background:var(--surface);border-radius:7px;padding:8px 10px;width:100%}
.field textarea{min-height:90px;resize:vertical}
.field .err{color:var(--crit-text);font-size:.8rem}
.field.bad input{border-color:var(--crit)}
.chk{display:flex;gap:10px;align-items:flex-start;font-size:.86rem;cursor:pointer;margin-bottom:9px}
.chk input{width:16px;height:16px;margin:2px 0 0;accent-color:var(--accent)}
.chk small{display:block;color:var(--muted);font-size:.75rem}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.lrow{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:11px 16px;border-bottom:1px solid var(--border)}
.lrow:last-child{border-bottom:0}
.lrow h3{font-size:.9rem}
.lrow p{font-size:.8rem;color:var(--muted);margin-top:2px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.chips{display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}
.overlay{position:fixed;inset:0;z-index:60;background:rgba(10,10,9,.5);display:flex;justify-content:flex-end}
.drawer{width:min(800px,100%);height:100%;background:var(--bg);display:flex;flex-direction:column;box-shadow:-10px 0 40px rgba(0,0,0,.25)}
.dhead{display:flex;justify-content:space-between;align-items:center;padding:13px 22px;background:var(--surface);border-bottom:1px solid var(--border)}
.dhead small{font-size:.74rem;color:var(--muted);display:block}
.dbody{flex:1;overflow:auto;padding:18px 22px}
.dfoot{display:flex;justify-content:flex-end;gap:8px;padding:11px 22px;background:var(--surface);border-top:1px solid var(--border);align-items:center}
.dfoot .err{margin-right:auto;color:var(--crit-text);font-size:.84rem}
.sectionl{font-size:.7rem;text-transform:uppercase;letter-spacing:.07em;color:var(--faint);font-weight:600;margin:4px 0 9px}
.drop{border:2px dashed var(--border-2);border-radius:10px;padding:22px;text-align:center;background:var(--surface);cursor:pointer;display:flex;flex-direction:column;gap:4px;align-items:center}
.drop:hover,.drop.over{border-color:var(--accent);background:var(--accent-soft)}
.drop small{color:var(--muted);font-size:.8rem}
.fcard{display:flex;gap:12px;align-items:center;background:var(--surface);border:1px solid var(--border);border-radius:10px 10px 0 0;padding:10px 12px}
.fcard .meta{flex:1;min-width:0}
.fcard b{display:block;font-size:.87rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fcard small{color:var(--muted);font-size:.76rem}
.ficon{width:36px;height:44px;border-radius:5px;background:var(--crit-soft);color:var(--crit-text);display:grid;place-items:center;font-weight:700;font-size:.62rem;font-family:var(--mono);flex:none}
.prevbox{border:1px solid var(--border);border-top:0;border-radius:0 0 10px 10px;overflow:hidden}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:13px 15px;margin-bottom:14px}
.picker details{border-bottom:1px solid var(--border)}
.picker details:last-child{border-bottom:0}
.picker summary{padding:8px 12px;cursor:pointer;font-size:.86rem;font-weight:600;display:flex;justify-content:space-between}
.picker .opts{display:grid;grid-template-columns:1fr 1fr;gap:2px 14px;padding:4px 12px 12px}
.picker label{display:flex;gap:8px;align-items:center;font-size:.83rem;padding:3px 0;cursor:pointer}
.picker input{accent-color:var(--accent)}
.confirm{position:fixed;inset:0;z-index:80;background:rgba(10,10,9,.5);display:grid;place-items:center;padding:16px}
.confirm .box{background:var(--surface);border-radius:12px;padding:20px;max-width:420px;width:100%}
.confirm p{margin:8px 0 16px;color:var(--muted);font-size:.9rem}

/* ---------- visor PDF ---------- */


/* ---------- movimiento y estados ---------- */
@keyframes fadeUp{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes pop{0%{transform:scale(.4);opacity:0}60%{transform:scale(1.18);opacity:1}100%{transform:scale(1)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes shimmer{0%{background-position:100% 0}100%{background-position:0 0}}
@keyframes grow{from{width:0}}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes pulseRing{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--good) 55%,transparent)}100%{box-shadow:0 0 0 10px transparent}}
@keyframes indet{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}
.enter>*{animation:fadeUp .32s cubic-bezier(.2,.7,.3,1) both}
.enter .kpis>*,.enter .drow>*{animation:fadeUp .36s cubic-bezier(.2,.7,.3,1) both}
.enter .kpis>*:nth-child(2){animation-delay:.04s}.enter .kpis>*:nth-child(3){animation-delay:.08s}.enter .kpis>*:nth-child(4){animation-delay:.12s}
.enter .drow>*:nth-child(2){animation-delay:.1s}
.fade{animation:fadeIn .2s ease both}
.bar>i{transition:width .5s cubic-bezier(.2,.7,.3,1);animation:grow .7s cubic-bezier(.2,.7,.3,1) both}
.sk{display:block;border-radius:6px;background:linear-gradient(90deg,var(--surface-2) 30%,var(--border) 50%,var(--surface-2) 70%);background-size:300% 100%;animation:shimmer 1.3s ease-in-out infinite}
.skcard{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.skwrap{padding:22px 26px;display:flex;flex-direction:column;gap:14px;max-width:1240px}
.skrow{display:grid;gap:12px}
.spin{width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .7s linear infinite;display:inline-block;flex:none;vertical-align:-2px}
.btn.loading{pointer-events:none}
.btn.loading .kbd{display:none}
.progress{height:4px;border-radius:99px;background:var(--surface-2);overflow:hidden;margin:-2px 0 10px}
.progress i{display:block;height:100%;background:var(--accent);border-radius:99px;transition:width .3s ease}
.progress.indet i{width:40%;animation:indet 1s ease-in-out infinite}
.case{animation:fadeIn .2s both}
.case.pass .ic,.case.fail .ic{animation:pop .35s cubic-bezier(.2,.7,.3,1.4) both}
.case.running .ic{background:var(--accent-soft);color:var(--accent-text)}
.case.wait{opacity:.55}
.verdict{animation:fadeUp .3s cubic-bezier(.2,.7,.3,1) both}
.verdict .vi{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-size:.72rem;font-weight:800;flex:none;color:#fff}
.verdict.ok .vi{background:var(--good);animation:pop .45s cubic-bezier(.2,.7,.3,1.4) both,pulseRing 1s .3s ease-out 2}
.verdict.no .vi{background:var(--crit)}
.verdict.tle .vi{background:#c98500}
.toast{animation:toastIn .25s cubic-bezier(.2,.7,.3,1) both;display:flex;align-items:center;gap:8px}
.toast.out{transition:opacity .25s,transform .25s;opacity:0;transform:translate(-50%,6px)}
.confetti{position:fixed;width:8px;height:12px;border-radius:2px;pointer-events:none;z-index:95}
.btn,.sitem,.sles,.exi,.fbtn,.tab,.ib,.ghost,.edhead button{transition:background-color .15s,border-color .15s,color .15s,filter .15s,transform .1s,box-shadow .15s}
.btn:active:not(:disabled){transform:translateY(1px)}
.kpi,.card{transition:border-color .2s,box-shadow .2s}
.kpi:hover{border-color:var(--border-2);box-shadow:0 2px 10px rgba(0,0,0,.05)}
tr.rowlink{cursor:pointer}
.pdfsk{width:min(420px,80%);aspect-ratio:1/1.41;background:var(--surface);border-radius:3px;box-shadow:0 2px 12px rgba(0,0,0,.2);padding:8% 9%;display:flex;flex-direction:column;gap:5%}
.pdfsk .sk{height:3%}
.pdfsk .sk.h{height:7%;width:70%;margin-bottom:4%}

/* ---------- títulos fijos al hacer scroll ---------- */
.phead.sticky{position:sticky;top:0;z-index:12;margin:-22px -26px 16px;padding:18px 26px 14px;background:color-mix(in srgb,var(--bg) 96%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-bottom:1px solid transparent;transition:padding .2s,border-color .2s}
.phead.sticky h1{transition:font-size .2s}
.phead.sticky p{transition:opacity .2s,max-height .2s;max-height:3em;overflow:hidden}
.phead.sticky.stuck{padding-top:10px;padding-bottom:10px;border-bottom-color:var(--border)}
.phead.sticky.stuck h1{font-size:1.08rem}
.phead.sticky.stuck p{opacity:0;max-height:0;margin:0}
.lhead{position:sticky;top:0;z-index:12;transition:padding .2s}
.lhead .cr,.lhead h1,.lmeta{transition:all .2s}
.lhead.stuck{padding-top:8px}
.lhead.stuck .cr{opacity:0;height:0;margin:0;overflow:hidden}
.lhead.stuck h1{font-size:1.05rem}
.lhead.stuck .lmeta{margin:6px 0 8px}
.tb thead th{position:sticky;top:var(--stick,0px);background:var(--surface);z-index:3;box-shadow:inset 0 -1px 0 var(--border)}
.tablewrap{overflow:visible}
.lpb h2.stk{position:sticky;top:-16px;background:var(--surface);padding:10px 0 8px;margin:-10px 0 4px;z-index:2}
@media (max-width:900px){
  .phead.sticky,.lhead{top:var(--top)}
  .tablewrap{overflow-x:auto}
  .tb thead th{position:static}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .sk{animation:none}
}

/* ---------- menú lateral: niveles, temas y ejercicios ---------- */
.lvh{display:grid;grid-template-columns:24px 1fr auto 14px;gap:9px;align-items:center;width:100%;border:0;background:var(--surface);padding:8px 8px;border-radius:9px;text-align:left;position:sticky;top:-12px;z-index:2;margin-top:2px}
.lvh:hover{background:var(--surface-2)}
.lvn{width:24px;height:24px;border-radius:7px;background:var(--surface-2);border:1px solid var(--border);display:grid;place-items:center;font-size:.72rem;font-weight:700;color:var(--muted);transition:background-color .3s,color .3s,border-color .3s}
.lvn.cur{background:var(--accent);border-color:var(--accent);color:#fff}
.lvn.done{background:var(--good);border-color:var(--good);color:#fff}
.lvt{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:.83rem;font-weight:600;color:var(--text)}
.lvt span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lvt .bar{height:3px}
.lvh .cnt{font-size:.74rem;color:var(--faint);font-weight:500}
.lvh .chev{width:14px;height:14px;color:var(--faint);transition:transform .28s cubic-bezier(.2,.7,.3,1)}
.lvh[aria-expanded="true"] .chev{transform:rotate(90deg)}
.lvbody{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows .32s cubic-bezier(.2,.7,.3,1),opacity .25s ease}
.lvbody.open{grid-template-rows:1fr;opacity:1}
.lvin{min-height:0;overflow:hidden;position:relative;padding:2px 0 6px 20px}
.lvin::before{content:'';position:absolute;left:19px;top:4px;bottom:10px;width:1px;background:var(--border)}
.sles{display:grid;grid-template-columns:18px 1fr auto;gap:9px;align-items:center;width:100%;border:0;background:none;text-align:left;padding:7px 9px;border-radius:8px;font-size:.86rem;position:relative}
.sles:hover{background:var(--surface-2)}
.sles:hover .rg{transform:scale(1.12)}
.sles.on{background:var(--surface-2);font-weight:600}
.sles.on::before{content:'';position:absolute;left:-1px;top:8px;bottom:8px;width:3px;border-radius:3px;background:var(--accent)}
.sles .c{font-size:.74rem;color:var(--faint);font-weight:500}
.rg{width:18px;height:18px;display:block;transition:transform .2s}
.rg .t{fill:none;stroke:var(--border-2);stroke-width:2.5}
.rg .v{fill:none;stroke:var(--s-ok);stroke-width:2.5;stroke-linecap:round;transition:stroke-dashoffset .9s cubic-bezier(.2,.7,.3,1),stroke .3s}
.rg .bg{fill:transparent;transition:fill .3s .55s}
.rg .ck{fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:0}
.rg.done .v{stroke:var(--good)}
.rg.done .bg{fill:var(--good)}
.rg.draw .ck{animation:draw .4s .7s ease both}
.rg.draw .bg{transition-delay:.55s}
@keyframes draw{from{stroke-dashoffset:1}}
.exl{margin:2px 0 8px 17px;padding-left:10px;border-left:2px solid var(--border);display:flex;flex-direction:column;gap:1px}
.exi{display:grid;grid-template-columns:16px 1fr;gap:9px;align-items:center;border:0;background:none;text-align:left;padding:5px 8px;border-radius:7px;font-size:.82rem;color:var(--muted);position:relative}
.exi:hover:not(:disabled){background:var(--surface-2);color:var(--text)}
.exi:hover:not(:disabled) .si{transform:scale(1.15)}
.exi.on{color:var(--accent-text);font-weight:600;background:var(--accent-soft)}
.exi.on::before{content:'';position:absolute;left:-12px;top:6px;bottom:6px;width:2px;border-radius:2px;background:var(--accent)}
.exi:disabled{cursor:not-allowed;color:var(--faint)}
.exl.in .exi{animation:fadeUp .26s cubic-bezier(.2,.7,.3,1) both;animation-delay:calc(var(--i)*28ms)}
.si{width:15px;height:15px;border-radius:50%;border:1.5px solid var(--border-2);display:grid;place-items:center;transition:transform .2s}
.si svg{width:9px;height:9px}
.si.ok{background:var(--good);border-color:var(--good);color:#fff}
.si.tried{border-color:#c98500;background:var(--warn-soft);animation:breathe 2s ease-in-out infinite}
.si.next{border-color:var(--accent);animation:breatheA 1.8s ease-in-out infinite}
.si.lock{border:0;color:var(--faint)}
.si.lock svg{width:11px;height:11px}
.si.pop{animation:pop .5s cubic-bezier(.2,.7,.3,1.4) both,pulseRing 1s .2s ease-out 2}
@keyframes breathe{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,#c98500 45%,transparent)}50%{box-shadow:0 0 0 4px transparent}}
@keyframes breatheA{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 45%,transparent)}50%{box-shadow:0 0 0 4px transparent}}
.exi .lbl3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.exi .tag{font-size:.66rem;font-weight:600;color:var(--accent-text);margin-left:6px}

/* ---------- pestañas con indicador deslizante ---------- */
.tabs{position:relative;display:flex;gap:2px;border-bottom:1px solid var(--border);padding:0 4px;overflow:hidden;flex-wrap:nowrap}
.tab{position:relative;z-index:1;border:0;background:none;padding:10px 12px;font-size:.86rem;font-weight:500;color:var(--muted);white-space:nowrap;display:flex;gap:7px;align-items:center;border-radius:7px 7px 0 0}
.tab:hover{color:var(--text)}
.tab.on{color:var(--text);font-weight:600}
.tab svg{width:15px;height:15px;flex:none}
.tab-ind{position:absolute;bottom:0;left:0;width:0;height:2px;border-radius:2px;background:var(--text);transition:left .3s cubic-bezier(.2,.7,.3,1),width .3s cubic-bezier(.2,.7,.3,1);pointer-events:none}
.tabs.segt{display:inline-flex;border:1px solid var(--border);background:var(--surface-2);border-radius:11px;padding:4px;gap:4px;max-width:100%}
.segt .tab{border-radius:8px;padding:8px 14px;font-weight:500;color:var(--muted)}
.segt .tab:hover:not(.on){color:var(--text);background:color-mix(in srgb,var(--surface) 55%,transparent)}
.segt .tab:hover:not(.on) svg{transform:translateY(-1px)}
.segt .tab svg{transition:transform .2s}
.segt .tab.on{color:var(--text);font-weight:600}
.segt .tab-ind{top:4px;bottom:4px;height:auto;background:var(--surface);border-radius:8px;box-shadow:0 1px 2px rgba(0,0,0,.1),0 0 0 1px var(--border);z-index:0}
.tab .nudge{width:7px;height:7px;border-radius:50%;background:var(--accent);animation:nudge 1.6s ease-in-out infinite;margin-left:-2px}
@keyframes nudge{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 55%,transparent);transform:scale(1)}50%{box-shadow:0 0 0 5px transparent;transform:scale(1.15)}}
.tab .cntp{font-size:.68rem;font-weight:600;padding:1px 7px;border-radius:99px;background:var(--surface);border:1px solid var(--border);color:var(--muted)}
.tab .cntp.warn{background:var(--warn-soft);border-color:transparent;color:var(--warn-text)}
.tab .cntp.good{background:var(--good-soft);border-color:transparent;color:var(--good-text)}
.lhead .tabs.segt{margin:2px 0 14px}

/* ---------- visor PDF integrado ---------- */
.pdfv{display:flex;flex-direction:column;background:var(--surface);overflow:hidden;height:100%;min-height:0}
.pdfbar{display:flex;gap:8px;align-items:center;padding:7px 10px;border-bottom:1px solid var(--border);background:var(--surface);flex:none}
.pdfbar .grp{display:flex;align-items:center;gap:2px;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:2px}
.pdfbar .grp .ib{border:0;background:transparent;width:26px;height:26px;border-radius:6px}
.pdfbar .grp .ib:hover:not(:disabled){background:var(--surface)}
.pdfbar .pg{font-size:.78rem;color:var(--muted);min-width:46px;text-align:center}
.pdfbar .zm{border:0;background:none;font-size:.78rem;color:var(--muted);min-width:50px;padding:4px 2px;border-radius:6px;font-family:var(--font)}
.pdfbar .zm:hover{color:var(--text);background:var(--surface)}
.pdfbar .sep{flex:1}
.pdfbar .ib svg{width:14px;height:14px}
.pdfwrap{flex:1;min-height:0;background:var(--viewer);overflow:auto;position:relative;padding:18px 18px 26px;overscroll-behavior:contain}
.pages{display:flex;flex-direction:column;align-items:center;gap:16px;min-width:min-content}
.pgc{display:block;background:#fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.12),0 8px 24px rgba(0,0,0,.12);opacity:0;transition:opacity .35s ease}
.pgc.ready{opacity:1}
.pdfmsg{position:absolute;inset:0;display:grid;place-items:start center;padding:18px}
.pdfv:fullscreen{height:100vh}
.matcard.viewer{display:flex;flex-direction:column;height:max(480px,calc(100vh - var(--top) - var(--stick,150px) - 36px));scroll-margin-top:calc(var(--stick,150px) + 12px)}
.matcard.viewer .chead{flex:none}
.matcard.viewer #pdfMain{flex:1;min-height:0}
.lp .pdfhost .pdfv{height:100%}
.prevbox{height:420px}

@media (max-width:1100px){
  .kpis{grid-template-columns:repeat(2,1fr)}
  .drow,.free,.tgrid{grid-template-columns:1fr}
}
@media (max-width:900px){
  .ib.menubtn{display:grid}
  .brand{width:auto}
  .crumbs,.segl,.user span{display:none}
  .shell{grid-template-columns:1fr;height:auto;min-height:calc(100vh - var(--top))}
  .side{position:fixed;top:var(--top);left:0;bottom:0;width:min(300px,86vw);z-index:35;transform:translateX(-102%);transition:transform .2s;box-shadow:8px 0 30px rgba(0,0,0,.2)}
  .shell.open .side{transform:none}
  .content{overflow:visible}
  .page,.pane{padding-left:16px;padding-right:16px}
  .lhead{padding-left:16px;padding-right:16px}
  .ide{height:auto}
  .idebody{grid-template-columns:1fr}
  .lp{border-right:0;border-bottom:1px solid var(--border)}
  .lp .pdfhost{height:72vh;flex:none}
  .matcard.viewer{height:78vh}
  .cmhost{height:360px;flex:none}
  .con{height:auto}
  .conbody{max-height:340px}
  .hide-sm{display:none}
  .picker .opts{grid-template-columns:1fr}
}
@media (max-width:520px){.kpis{grid-template-columns:1fr}}
