/* Segunda edición: menos elementos decorativos y cálculos más legibles. */
aside{padding-top:32px}nav{margin-top:52px;gap:8px}nav a{gap:12px;padding:15px 12px}.method-symbol{width:23px;height:23px;flex:0 0 23px}.code-symbol{width:26px;height:26px;color:#698365;flex:0 0 26px}header{height:68px}header>strong{font-size:12px;font-weight:500;color:#758278}#fullscreen{display:inline-flex;align-items:center;gap:8px}#fullscreen .method-symbol{width:17px;height:17px;flex-basis:17px}main{padding-top:35px}.title-row{margin:0 0 29px}h1>span{display:none}.panel{box-shadow:none}.below{padding:26px 28px}.calculation{overflow-wrap:normal}.math-step{display:flex;gap:17px;padding:22px 0;border-bottom:1px solid #ebeee8;align-items:flex-start}.step-index{font-size:10px;font-family:inherit;flex:0 0 25px;width:25px;height:25px;display:flex;align-items:center;justify-content:center;border:1px solid #dde4d8;border-radius:50%;color:#6d8365;margin-top:1px}.step-content{min-width:0;flex:1}.step-content h3,.basis-item h3{font-family:inherit;font-size:13px;font-weight:600;margin:0;color:#35543c}.step-content>p{font-family:inherit;font-size:12px;line-height:1.7;margin:7px 0 14px;color:#85907e}.math-expression{font:18px/2.6 Georgia,'Times New Roman',serif;color:#344c35;overflow-x:auto;padding:5px 2px 8px;overflow-wrap:anywhere}.math-expression strong{font-weight:600;color:#24583c}.math-frac{display:inline-flex;flex-direction:column;align-items:stretch;vertical-align:middle;text-align:center;font-size:.95em;line-height:1.5;margin:5px 7px;white-space:nowrap}.math-frac>span{padding:3px 7px}.math-frac>span:first-child{border-bottom:1px solid #678364}.math-gap{display:inline-block;width:33px}.times{margin:0 5px;color:#819277}.final-step{border-bottom:0}.final-step .math-expression{font-size:25px;line-height:1.7}.rounding-note{font-size:10px;color:#94a08b;line-height:1.7;margin:15px 0 0}.basis-list{margin-left:42px}.basis-item{padding:22px 0;border-bottom:1px solid #ebeee8}.coordinate{display:inline-block;margin-right:25px}.division-table{font-family:inherit;min-width:360px}.calculation .division-table th{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#839079;font-size:10px;font-weight:500}.calculation .division-table td{font-size:14px;overflow-wrap:anywhere}.code-panel{margin-bottom:35px}.code-panel pre{background:#17272b;color:#d8e2e5;font-size:13px;line-height:1.9}.cpp-keyword{color:#c4a2ec}.cpp-string{color:#d9bd87}.cpp-comment{color:#8ea792;font-style:italic}.cpp-number{color:#dfa78a}.cpp-function{color:#8cc9d4}.cpp-directive{color:#94b7db}.code-note{font-size:10px;color:#94a08d}button{transition:background-color .15s}.small-tag{display:none}@media(max-width:820px){aside{padding:17px 20px}nav{margin-top:17px}nav a{gap:7px;padding:11px 6px}.method-symbol{width:20px;height:20px;flex-basis:20px}header{height:54px}.title-row{margin-bottom:24px}}@media(max-width:600px){nav a{font-size:10px}.method-symbol{width:18px;height:18px;flex-basis:18px}.below{padding:20px 17px}.math-step{gap:11px;padding:19px 0}.math-expression{font-size:16px}.basis-list{margin-left:0}.math-frac{margin:5px 3px}.math-frac>span{padding:2px 4px}.math-gap{width:17px}.code-panel pre{font-size:11px}.coordinate{margin-right:15px}.final-step .math-expression{font-size:23px}.division-table{min-width:300px}}@media(prefers-reduced-motion:reduce){button{transition:none}}
.simulator{animation:none!important}@media(max-width:600px){.result-strip{flex-direction:column;align-items:flex-start;gap:10px}.result-strip strong{font-size:23px;white-space:nowrap}.result-at{font-size:14px}}

/* Desarrollo gráfico en árbol: las conexiones sustituyen las explicaciones largas. */
.example-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.optional-fields{border-top:1px solid #e6ebe4;margin:22px 0 18px;padding-top:17px}
.optional-fields>strong{font-size:12px;font-weight:600;color:#3e5945}
.optional-fields>strong span{font-size:10px;color:#89958b;font-weight:400}
.optional-fields .hint{font-size:11px;margin:7px 0 10px}
.optional-fields label{font-size:10px;line-height:1.45}
.optional-fields input{margin-top:7px;font-size:13px;min-width:0}
.calc-tree{display:flex;flex-direction:column;align-items:center;width:100%;padding:8px 2px 2px;color:#304d3f}
.tree-node{border:1px solid #e2e9e0;background:#fff;border-radius:10px;min-width:min(100%,265px);max-width:100%;width:fit-content;text-align:center;padding:12px 20px;position:relative}
.tree-node>small,.tree-branch>small{font:600 9px -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#778f7c;letter-spacing:1.1px}
.tree-node .math-expression{padding:3px 0 0;font:20px/2.3 Georgia,serif;color:#304d3e;overflow-wrap:normal;white-space:normal}
.tree-node:not(:first-child){margin-top:31px}
.tree-node:not(:first-child)::before{content:"";position:absolute;left:50%;top:-32px;width:1px;height:31px;background:#b4c9bb}
.tree-root{background:#f2f7ef;border-color:#d6e2d3}
.tree-subformula{font-size:16px;color:#5b7264}
.tree-fork{width:100%;position:relative;margin-top:30px;padding-top:20px;border-top:1px solid transparent}
.tree-fork::before{content:"";position:absolute;height:50px;top:-31px;left:50%;border-left:1px solid #b4c9bb}
.tree-branches{width:100%;display:flex;flex-wrap:wrap;justify-content:center;gap:14px;position:relative}
.tree-branch{min-width:160px;flex:1 1 185px;max-width:330px;position:relative;background:#f8faf7;border:1px solid #e3ebe3;border-radius:9px;padding:12px 10px;text-align:center;overflow-x:auto}
.tree-branch::before{content:"";width:8px;height:8px;border-radius:50%;background:#8aaa94;display:block;margin:0 auto 7px}
.tree-branch .math-expression{font:16px/2 Georgia,serif;white-space:normal;overflow:visible;padding:3px 0;color:#365a46}
.tree-fork + .tree-node{margin-top:32px}
.tree-fork + .tree-node::before{height:32px;top:-33px}
.tree-final{background:#eaf3e7;border-color:#c4ddc5}
.tree-final .math-expression{font-size:27px}
.branch-formula{overflow-x:auto;white-space:nowrap;font-size:15px;padding:4px 0}
.branch-divider{color:#b3c4b3;line-height:1}
.branch-contribution{border-top:1px solid #e1e9df;margin-top:10px;padding-top:10px;font-size:15px}
.math-frac{max-width:none;white-space:nowrap;line-height:1.45}
.full-expansion{width:100%;max-width:950px;text-align:center;margin:9px auto;color:#57745f;font-size:12px}
.full-expansion>summary{cursor:pointer;padding:12px}
.full-expansion .math-expression{font-size:14px;line-height:2.5;overflow-wrap:anywhere}
.division-wrap{max-width:100%;max-height:310px;overflow:auto}
.tree-node:has(.division-wrap){width:min(100%,650px)}
.tree-node .division-table{width:100%;min-width:300px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
.tree-node .division-table th{font-size:11px}
.tree-node .division-table td{font-size:12px}
.error-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.error-metric{background:#f7f9f6;border:1px solid #e7ece5;border-radius:9px;padding:16px;display:flex;flex-direction:column;gap:10px;min-width:0}
.error-metric small{font-size:9px;letter-spacing:1px;color:#869587;font-weight:600}
.error-metric strong{font-size:clamp(18px,2vw,26px);font-weight:600;color:#2e6349;overflow-wrap:anywhere}
.error-metric span{font-size:11px;color:#7d8b7c;line-height:1.55}
.error-formulas{padding:12px 0 0}
.error-formula-row{border-bottom:1px solid #edf0eb;padding:12px 0}
.error-formula-row>span{font-size:9px;letter-spacing:1px;color:#869587}
.error-formula-row .math-expression{font-size:17px;color:#4a684d;line-height:2.4}
.error-disclaimer{font-size:11px;color:#768578;line-height:1.8;margin:15px 0 0}
.code-columns{display:grid;grid-template-columns:minmax(210px,.65fr) minmax(0,1.35fr);gap:15px;margin:14px 20px 17px;align-items:stretch}
.code-guide,.code-source{border:1px solid #e2e9e1;border-radius:9px;overflow:hidden;min-width:0}
.code-guide{background:#f9faf7;padding:18px 16px}
.code-guide h3,.code-source h3{margin:0;font-size:12px;font-weight:600;color:#2b5940}
.code-guide>p{font-size:10px;line-height:1.65;color:#758478;margin:8px 0 20px}
.code-source{background:#17272b;display:flex;flex-direction:column}
.code-source h3{color:#cadbd0;background:#203638;padding:14px 17px}
.code-source h3 span{font-family:monospace;font-size:10px;color:#96acaa;font-weight:400;margin-left:10px}
.code-source pre{margin:0!important;border-radius:0!important;flex:1;max-height:580px;overflow:auto;padding:15px 17px!important;font-size:12px!important;line-height:1.7!important}
.simple-part{display:grid;grid-template-columns:24px minmax(0,1fr);gap:9px;margin:0 0 19px;align-items:start}
.simple-number{border-radius:50%;background:#e6f0e2;color:#477651;width:23px;height:23px;display:grid;place-items:center;font-size:11px}
.simple-part b{font-size:12px;color:#3a5c45;font-weight:600}
.simple-part pre{background:transparent;color:#567164;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0 0;padding:0;line-height:1.8;font:11px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace}
@media(max-width:980px){.code-columns{grid-template-columns:1fr}.code-source pre{max-height:520px}.tree-branch{flex-basis:180px}}
@media(max-width:600px){.tree-node{min-width:0;padding:11px;width:100%}.tree-node .math-expression{font-size:17px}.tree-final .math-expression{font-size:23px}.tree-branch{flex-basis:100%;max-width:none}.error-metrics{grid-template-columns:1fr}.error-metric{gap:5px;padding:12px}.error-formula-row .math-expression{font-size:15px;overflow-x:auto}.example-actions{gap:4px}.example-actions button{font-size:9px}.code-columns{margin:10px 12px}.tree-subformula{font-size:14px}}

/* Comparación visual entre el valor interpolado y el valor real conocido. */
svg .actual-error{stroke:#c06454;stroke-dasharray:5 4;stroke-width:2}
svg .actual-node{stroke:#c06454;fill:none;stroke-width:2.5}
svg .actual-label{fill:#b16859;font-size:10px}
.real-dot{background:#c06454}
/* Ramificaciones hacia los cálculos parciales. */
.tree-branches::before{content:"";position:absolute;left:11%;right:11%;top:-11px;border-top:1px solid #b4c9bb}
.tree-branch::after{content:"";position:absolute;left:50%;top:0;transform:translateY(-15px);height:15px;border-left:1px solid #b4c9bb}
@media(max-width:600px){.tree-branches::before{display:none}.tree-branch::after{display:none}}

/* Lagrange: la gráfica es el área de entrada alternativa. */
.lagrange-workspace{align-items:start}
.lagrange-chart-panel{min-height:440px}
#lagrange-chart{display:block;width:100%;height:auto;cursor:crosshair;touch-action:manipulation;outline-offset:5px}
#lagrange-chart .chart-hit-area{cursor:crosshair}
svg .reference-curve{fill:none;stroke:#b98270;stroke-width:2.2;stroke-dasharray:6 5;opacity:.9}
.graph-hint{font-size:11px;color:#7c8d7d;line-height:1.45;margin:-5px 0 5px}
#lagrange-chart-hint{margin:0 0 2px}
#lagrange-result-strip[hidden]{display:none!important}
.empty-development{font-size:12px;color:#809082;text-align:center;margin:15px auto}
.examples-menu{position:relative;z-index:5}
.examples-menu summary{list-style:none;cursor:pointer;color:#648069;border:1px solid #dce7d9;border-radius:7px;padding:8px 11px;font-size:11px;white-space:nowrap}
.examples-menu summary::-webkit-details-marker{display:none}
.examples-menu summary span{margin-left:7px;color:#95a498}
.examples-menu[open] summary{background:#eef4eb}
.example-options{position:absolute;right:0;top:calc(100% + 5px);background:white;border:1px solid #e0e9de;border-radius:9px;box-shadow:0 10px 22px #0c2c1715;min-width:210px;padding:5px;display:flex;flex-direction:column}
.example-options button{background:none;border:0;text-align:left;color:#3f5e49;font-size:12px;padding:11px;border-radius:6px;cursor:pointer}
.example-options button:hover,.example-options button:focus-visible{background:#f2f6ef}
.function-details{margin:1px 0 15px;border-bottom:1px solid #e5ebe2;padding:0 0 12px}
.function-details>summary{cursor:pointer;color:#54745d;font-weight:550;font-size:12px;display:flex;justify-content:space-between;align-items:center;padding:8px 0;list-style:none}
.function-details>summary::-webkit-details-marker{display:none}
.function-details>summary span{font-size:10px;color:#94a397;font-weight:400}
.function-details[open]>summary{margin-bottom:10px}
.function-field{display:flex;align-items:center;gap:10px}
.function-field label{width:30px;flex:0 0 30px;margin:0;font-size:13px;color:#355e45}
.function-field input{min-width:0;flex:1;margin:0;background:#fbfcfa;font:13px ui-monospace,monospace}
.function-details .hint{font-size:10px;margin:8px 0 10px}
.function-apply{background:#eef4eb;color:#426e53;border:1px solid #d9e7d5;border-radius:7px;padding:9px 13px;font-size:11px;cursor:pointer}
.function-apply:hover{background:#e5efdf}
.function-details .error{font-size:11px;line-height:1.5}
.error-panel{display:block;padding:0 28px!important}
.error-panel>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;padding:22px 0}
.error-panel>summary::-webkit-details-marker{display:none}
.error-panel>summary h2{margin:0;font-size:16px;font-weight:600;color:#3b5d44}
.error-panel>summary>span{font-size:11px;color:#7c8e80;white-space:nowrap}
.error-panel .expand{display:inline-block;margin-left:7px;transition:transform .15s;font-size:20px;font-weight:400}
.error-panel[open] .expand{transform:rotate(45deg)}
.error-panel .quiet-explanation{font-size:11px;color:#7d8d80;margin:0 0 18px;line-height:1.7}
.error-panel .two-cols{max-width:660px;margin:0 0 20px}
.error-panel .two-cols label{font-size:11px}
.error-panel .two-cols input{font-size:13px}
.error-panel .error-report{margin:9px 0 25px}
.error-panel .error-metrics{grid-template-columns:repeat(auto-fit,minmax(165px,1fr))}
.error-panel .error-metric{padding:14px 17px;gap:6px}
.error-panel .error-metric strong{font-size:23px}
/* Polinomio completo y cálculo de cada término, como en el pizarrón. */
.tree-wide{width:min(100%,960px)}
.tree-wide>.math-expression{width:100%;line-height:1.6;overflow:auto}
.polynomial-terms{display:flex;flex-direction:column;gap:8px;text-align:left;margin:7px auto;max-width:100%;width:fit-content}
.polynomial-term{display:grid;grid-template-columns:minmax(55px,auto) minmax(0,1fr);gap:11px;align-items:center;white-space:nowrap;font-size:clamp(13px,1.35vw,18px)}
.polynomial-term>span{font-weight:500;color:#55775a;text-align:right}
.polynomial-term>div{min-width:0;overflow-x:auto;white-space:nowrap;padding:4px 0}
.lagrange-coefficient{white-space:nowrap;font-size:.92em}
.tree-extra{border:1px solid #e5ebe2;border-radius:9px;background:#fbfcfa;max-width:100%;width:100%;padding:10px 18px;margin:24px 0 0}
.tree-extra summary{font-size:12px;text-align:center;cursor:pointer;color:#4b765a}
.tree-extra .polynomial-terms{margin:16px auto}
.tree-branch .branch-formula{overflow-x:auto;max-width:100%}
.tree-branch .branch-formula .math-frac{font-size:14px}
@media(max-width:600px){
 .error-panel{padding:0 18px!important}
 .error-panel>summary h2{font-size:15px}
 .polynomial-term{font-size:13px;gap:6px;grid-template-columns:minmax(50px,auto) minmax(0,1fr)}
 .polynomial-term .math-frac{font-size:12px}
 .lagrange-chart-panel{min-height:395px}
 .graph-hint{font-size:10px}
}

/* Menú único de ejemplos, con casos de error listos para demostrar. */
.example-divider{height:1px;background:#e9efe8;margin:4px 6px}
#linear-examples .example-options{min-width:245px}
.example-options button[data-linear-example="error"],.example-options button[data-linear-example="exacto"],.example-options button[data-lagrange-example="error"],.example-options button[data-lagrange-example="exacto"]{color:#2f6b45;font-weight:600}
@media(max-width:600px){#linear-examples .example-options{min-width:220px}}
