
*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;background:#f5f7fb;color:#172033}a{text-decoration:none;color:inherit}
:root{--primary:#2563eb;--primary-dark:#1d4ed8;--card:#fff;--muted:#667085;--line:#e6eaf0;--green:#16a34a}
.nav{height:68px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 6%;position:sticky;top:0;z-index:10}
.brand{font-weight:800;font-size:21px}.brand span{color:var(--primary)}.navlinks{display:flex;gap:22px;color:#536071;font-size:14px}.navlinks a:hover{color:var(--primary)}
.container{max-width:1120px;margin:auto;padding:38px 20px}.hero{background:linear-gradient(135deg,#172554,#2563eb);color:#fff;border-radius:26px;padding:55px 48px;display:grid;grid-template-columns:1.5fr 1fr;gap:30px;align-items:center}
.hero h1{font-size:48px;line-height:1.05;margin:0 0 16px}.hero p{font-size:18px;color:#dbeafe;line-height:1.6}.btn{display:inline-block;background:#fff;color:#17306f;padding:13px 19px;border-radius:12px;font-weight:700;border:0;cursor:pointer}.btn.primary{background:var(--primary);color:white}.btn.light{background:#eef4ff;color:#1d4ed8}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:22px 0}.stat,.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:22px}.stat strong{font-size:27px;display:block}.muted{color:var(--muted)}
.section-title{display:flex;justify-content:space-between;align-items:end;margin:35px 0 15px}.section-title h2{margin:0}.levels{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.level-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px}.level-card h3{margin:0 0 7px}.bar{height:8px;background:#edf0f5;border-radius:20px;overflow:hidden;margin:14px 0}.fill{height:100%;background:var(--primary);border-radius:20px}
.lesson-list{display:grid;gap:10px}.lesson-row{display:flex;align-items:center;gap:15px;background:#fff;border:1px solid var(--line);padding:15px 17px;border-radius:14px}.lesson-num{width:36px;height:36px;border-radius:10px;background:#edf4ff;color:var(--primary);display:grid;place-items:center;font-weight:800}.lesson-row .grow{flex:1}.done{color:var(--green);font-weight:800}.search{width:100%;padding:14px 16px;border:1px solid var(--line);border-radius:12px;font-size:15px;margin:15px 0 22px}
.lesson{max-width:820px;margin:auto}.lesson-header{margin-bottom:24px}.lesson-header h1{font-size:40px;margin:8px 0}.tag{display:inline-block;background:#eaf1ff;color:var(--primary);font-weight:700;padding:6px 10px;border-radius:20px;font-size:12px}.content-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:28px;margin-bottom:16px}.formula{background:#111827;color:#e5e7eb;border-radius:12px;padding:18px;font-family:ui-monospace,monospace;font-size:16px}.exercise{border-left:4px solid var(--primary);background:#f8fbff;padding:20px;border-radius:12px;margin-top:18px}.options{display:grid;gap:10px;margin:15px 0}.option{padding:12px;border:1px solid var(--line);border-radius:10px;background:white;cursor:pointer}.option:hover{border-color:var(--primary)}.feedback{margin-top:12px;font-weight:700}.lesson-nav{display:flex;justify-content:space-between;gap:10px;margin-top:20px}
.progress-big{font-size:42px;font-weight:850}.achievement{display:flex;gap:14px;align-items:center}.badge{width:48px;height:48px;border-radius:14px;background:#fff2c7;display:grid;place-items:center;font-size:23px}
.footer{text-align:center;color:#7b8494;padding:35px}.empty{padding:30px;text-align:center;color:var(--muted)}
@media(max-width:800px){.hero{grid-template-columns:1fr;padding:35px 25px}.hero h1{font-size:38px}.levels{grid-template-columns:1fr 1fr}.navlinks{gap:10px}.navlinks a:nth-child(n+4){display:none}}
@media(max-width:560px){.container{padding:25px 14px}.stats,.levels{grid-template-columns:1fr}.nav{padding:0 15px}.brand{font-size:18px}.navlinks{font-size:12px}.lesson-header h1{font-size:31px}.hero{border-radius:18px}}

/* Simulador Excel */
.sheet-wrap{overflow:auto;border:1px solid #d9dee8;border-radius:14px;background:#fff}
.sheet-toolbar{display:flex;gap:8px;align-items:center;padding:10px;background:#f7f8fb;border-bottom:1px solid #e1e5ec}
.name-box{width:80px;padding:7px 9px;border:1px solid #cfd5df;border-radius:7px;background:#fff;font-size:13px}
.formula-box{flex:1;padding:7px 9px;border:1px solid #cfd5df;border-radius:7px;background:#fff;font-family:ui-monospace,monospace}
.sheet{border-collapse:collapse;width:100%;min-width:620px;font-size:14px}
.sheet th,.sheet td{border:1px solid #dfe3ea;height:34px;padding:7px 9px}
.sheet thead th{background:#f1f3f6;text-align:center;font-weight:700;color:#667085}
.sheet .rowhead{background:#f1f3f6;text-align:center;width:45px;color:#667085}
.sheet td.editable{background:#fff;cursor:text}
.sheet td.editable:focus{outline:2px solid var(--primary);outline-offset:-2px;background:#f8fbff}
.sheet td.target{background:#f7fbff}
.sheet td.correct{background:#ecfdf3!important}
.sheet td.wrong{background:#fff7ed!important}
.sheet-actions{display:flex;gap:10px;align-items:center;margin-top:14px;flex-wrap:wrap}
.sheet-message{font-weight:700}
@media(max-width:560px){.sheet-toolbar{min-width:620px}.sheet-wrap{overflow-x:auto}}

.lesson-objective{font-weight:700;color:#172033;font-size:17px}
.concept-box{background:#f8fbff;border:1px solid #dbe6fb;border-left:4px solid var(--primary);border-radius:12px;padding:16px 18px;margin-top:14px}
.concept-box h3{margin:0 0 8px;font-size:15px;color:#1d4ed8}
.concept-box p{margin:0;line-height:1.6}
.concept-box.prereq-box{border-left-color:#f0b429;background:#fffdf5}
.concept-box.prereq-box h3{color:#a16207}
.concept-box .guide-list{margin:0 0 0 20px;padding:0}
.help-box{background:#f8fafc;border:1px solid #dfe5ee;border-radius:14px;padding:18px;margin-top:15px}
.help-box h3{margin:0 0 8px;font-size:16px}.solution{display:none;margin-top:12px;background:#fff;border:1px dashed #b9c3d1;border-radius:10px;padding:13px}
.solution.show{display:block}.mini-formula{font-family:ui-monospace,monospace;background:#111827;color:#e5e7eb;padding:9px 11px;border-radius:8px;display:inline-block}
.cell-result{font-weight:700}.formula-input{font-family:ui-monospace,monospace}

.sheet td.selected{outline:2px solid #2563eb;outline-offset:-2px;background:#eef4ff}.sheet td.target{background:#fffdf0}
/* Práctica de hoja de cálculo: interacción tipo Excel */
.practice-card{overflow:visible}.practice-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.practice-head h2{margin-bottom:5px}.practice-badge{background:#eef4ff;color:#1d4ed8;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:800;white-space:nowrap}.practice-prompt{background:#f8fbff;border-left:4px solid var(--primary);padding:16px 18px;border-radius:10px;margin:18px 0}.excel-help{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px;color:#667085;font-size:12px}.excel-help span{background:#f4f6f9;border:1px solid #e1e5ec;border-radius:999px;padding:6px 9px}.sheet-toolbar{min-width:620px}.sheet-toolbar .fx{font-weight:800;color:#667085;padding:0 2px}.toolbar-hint{font-size:11px;color:#98a2b3}.sheet td{position:relative;min-width:82px}.sheet td.target{background:#fff9d8!important;box-shadow:inset 0 0 0 1px #f0c84b}.sheet td.target:empty:after{content:'Escribe aquí';color:#b08b25;font-size:11px;opacity:.8}.sheet td.editable{cursor:text}.sheet td.correct{background:#ecfdf3!important;box-shadow:inset 0 0 0 2px #22c55e}.sheet td.wrong{background:#fff1f2!important;box-shadow:inset 0 0 0 2px #ef4444}.sheet td.selected{outline:2px solid #2563eb;outline-offset:-2px;background:#eef4ff}.sheet td.target.selected{background:#fff3b0}.sheet-message{min-height:22px}.solution .mini-formula{max-width:100%;overflow:auto;white-space:nowrap}.example-strip{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0;color:#475467;font-size:12px}.example-strip span{padding:7px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#fff}.corner{width:45px}.sheet td[contenteditable="true"]{user-select:text}@media(max-width:700px){.practice-head{flex-direction:column}.practice-badge{align-self:flex-start}.sheet{min-width:760px}}
/* Editor de celda: se comporta como la edición directa de Excel */
.sheet td.editable { padding: 0 !important; }
.sheet td.editable .cell-editor {
  display:block; width:100%; height:33px; box-sizing:border-box; border:0; outline:2px solid var(--primary);
  padding:7px 9px; margin:0; background:#fff; font:inherit; color:inherit;
}
.sheet td.editable .cell-editor:focus { outline:2px solid var(--primary); }
.sheet td.cell-result { font-weight:700; }
.format-tool{border:1px solid #d1d5db;background:#fff;border-radius:7px;padding:7px 10px;font-weight:600;cursor:pointer;white-space:nowrap}.format-tool:hover{background:#f3f4f6}.formatted-currency{font-weight:600}
.excel-reference-img{display:block;max-width:100%;width:auto;max-height:150px;object-fit:contain;border:1px solid #dfe3ea;border-radius:10px;margin:12px 0;background:#fff}.guide-list{margin:10px 0 0 20px;padding:0}.guide-list li{margin:8px 0;line-height:1.55}.action-panel{margin:10px 0;padding:12px 14px;border:1px solid #dfe3ea;border-radius:10px;background:#f8fafc}.action-panel strong{margin-right:6px}.action-buttons,.pivot-controls,.conditional-controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.pivot-choice{border:1px solid #cfd5df;background:#fff;border-radius:8px;padding:8px 10px;cursor:pointer}.pivot-choice.selected-action{border-color:var(--primary);background:#eef4ff}.pivot-preview{margin-top:10px;padding:10px;border-radius:8px;background:#fff;border:1px dashed #cfd5df;color:#475467}.filter-panel select,.conditional-panel select,.conditional-panel input{padding:8px 10px;border:1px solid #cfd5df;border-radius:7px;background:#fff}.conditional-hit{background:#fee2e2!important;box-shadow:inset 0 0 0 2px #ef4444!important}.worksheet-tabs{display:flex;gap:2px;align-items:end;padding:8px 8px 0;background:#eef1f5;border:1px solid #d9dee8;border-top:0;border-radius:0 0 10px 10px}.worksheet-tab{border:1px solid #d1d5db;border-bottom:0;background:#e5e7eb;padding:8px 16px;border-radius:8px 8px 0 0;cursor:pointer}.worksheet-tab.active{background:#fff;font-weight:800}.worksheet-tab.add-sheet{color:#667085}.sheet tbody tr[hidden]{display:none}.filter-panel{margin-top:8px}.format-tool{font-family:inherit}
