/* Laboratorio Fisica v0.1 beta: stile locale, non modifica il padre. */
:root{--phys-blue:#235cb1;--phys-ink:#16263c;--phys-muted:#52647c;--phys-line:#dce4f0;--phys-amber:#b87813}
body{color:var(--phys-ink)}.lab-topbar-inner{flex-wrap:wrap;justify-content:space-between}
.lab-topbar-inner .lab-tool-version{font-size:13px;color:#e0e9f4}
.phys-main{padding-top:26px}.phys-breadcrumb{margin:0 0 16px;font-size:.87rem}
.phys-breadcrumb a{color:#215ca8}.phys-breadcrumb span{color:#697c95}
.phys-hero{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(220px,.6fr);align-items:center;gap:32px}
.phys-hero h1{margin:7px 0 14px}.phys-hero p{max-width:720px}
.phys-hero-graphic{background:#f1f7ff;border-radius:18px;padding:16px;border:1px solid #dbe8f9}
.phys-hero-graphic svg{display:block;width:100%;height:auto}
.phys-section-title{margin:30px 0 13px;color:#1d3e68}
.phys-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.phys-card{display:flex;gap:14px;background:#fff;border:1px solid var(--phys-line);border-radius:16px;padding:22px;color:inherit;text-decoration:none;min-height:160px;box-shadow:0 5px 14px #1c477508}
.phys-card:hover,.phys-card:focus-visible{border-color:#86acd9;box-shadow:0 8px 21px #1c47751b}
.phys-card h3{margin:0 0 8px;font-size:1.16rem;color:#173e78}.phys-card p{color:var(--phys-muted);margin:0;font-size:.9rem}
.phys-card-icon{flex:0 0 42px;height:42px;display:grid;place-items:center;background:#eaf2ff;border-radius:12px;font-size:24px}
.phys-card-side{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.phys-card .open-label{margin-top:auto}.phys-coming{opacity:.7;background:#fafcff}.phys-coming .phys-card-icon{background:#eef0f4}
.phys-disclaimer{border:1px solid #e2ca91;border-radius:12px;background:#fff9eb;color:#604917;padding:15px 18px;margin:28px 0;font-size:.89rem}
.phys-links{border-top:1px solid var(--phys-line);padding-top:18px;margin-top:24px;color:var(--phys-muted);font-size:.92rem}
.phys-links a{color:#225caa}.phys-pill{font-size:.77rem;font-weight:800;border-radius:20px;padding:4px 10px;color:#215286;background:#eaf2ff}
.phys-pill.amber{color:#725114;background:#fff2d1}
.phys-layout{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:19px;align-items:start;margin-top:22px}
.phys-panel{padding:23px}.phys-panel h2{font-size:1.28rem;margin:0 0 12px}.phys-panel h3{font-size:1rem;color:#1b4578;margin:15px 0 8px}
.phys-form{display:grid;gap:14px}.phys-field{display:grid;gap:5px}.phys-field label{display:block;margin:0;font-weight:750;color:#33465f;font-size:.9rem}
.phys-field input,.phys-field select{width:100%;max-width:none;padding:10px 12px;border-radius:9px;border:1.5px solid #abbcd0;background:#fff;color:#16263c;font:inherit}
.phys-field select{cursor:pointer}.phys-field small{color:#52647c;font-size:.77rem}
.phys-number-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}.phys-unit{font-weight:700;color:#506781;font-size:.88rem;min-width:45px}
.phys-controls{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.phys-controls button{font-size:.86rem;padding:11px 13px}
.phys-controls button:disabled{opacity:.5;cursor:not-allowed}
.phys-error{display:none;background:#fff0f0;border:1px solid #e9acac;border-radius:9px;padding:12px;color:#8b2020;font-weight:650;font-size:.86rem}.phys-error:not(:empty){display:block}
.phys-viewport{border-radius:14px;border:1px solid #dce4f0;background:#fbfdff;padding:10px}
.phys-viewport svg{display:block;width:100%;height:auto;aspect-ratio:860/330}
.phys-readouts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:17px 0}
.phys-readout{min-width:0;background:#f3f7fd;border:1px solid #e0eaf5;border-radius:12px;padding:11px 13px}
.phys-readout span{display:block;color:#566a81;font-size:.77rem;font-weight:700}
.phys-readout strong{display:block;font-size:1.14rem;color:#173e78;overflow-wrap:anywhere}
.phys-timeline{margin:12px 0}.phys-timeline label{display:flex;justify-content:space-between;gap:10px;font-size:.84rem;font-weight:700;color:#425a78}
.phys-timeline input[type=range]{width:100%;padding:0;margin:9px 0;accent-color:#235cb1}
.phys-legend{display:flex;flex-wrap:wrap;gap:14px;color:#49627c;font-size:.83rem;margin:12px 0}
.phys-dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:5px;background:#2563b7}
.phys-dot.red{background:#d54e4e}.phys-dot.gold{background:#d18a1c}.phys-dot.green{background:#18946c}
.phys-formula{padding:15px;border-radius:12px;background:#f5f9ff;border:1px solid #dbe8fa;line-height:1.8;overflow-wrap:anywhere}
.phys-formula p{margin:3px 0}.phys-formula strong{color:#1a477d}
.phys-graphs{display:grid;gap:16px}.phys-graph-panel{background:#fff;border:1px solid var(--phys-line);border-radius:14px;padding:14px;min-width:0}
.phys-graph-panel h3{margin:0 0 9px;font-size:.97rem;color:#244365}.phys-graph{width:100%;display:block;aspect-ratio:760/225}
.phys-chart-legend{color:#506781;font-size:.81rem;margin:8px 0 0}
.phys-table-wrap{overflow-x:auto}.phys-table{border-collapse:collapse;width:100%;font-size:.87rem;min-width:440px}
.phys-table th,.phys-table td{text-align:right;padding:10px 12px;border-bottom:1px solid #e3eaf3;white-space:nowrap}
.phys-table th:first-child,.phys-table td:first-child{text-align:left}.phys-table th{background:#f2f6fd;color:#254b7b;font-weight:750}
.phys-note{color:#52647c;font-size:.84rem;line-height:1.65}.phys-note strong{color:#24476e}
.phys-status{font-size:.83rem;font-weight:700;color:#3d5876;margin:8px 0 0;min-height:1.4em}
.phys-secondary{margin-top:22px}.phys-sub-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.phys-section{margin:24px 0 0}.phys-section h2{font-size:1.38rem;margin:0 0 13px}
.phys-kbd{padding:2px 6px;background:#eff4fb;border-radius:4px;font-size:.86em}
@media(max-width:840px){.phys-layout{grid-template-columns:1fr}.phys-form{grid-template-columns:repeat(2,minmax(0,1fr))}.phys-form .phys-wide{grid-column:1/-1}.phys-panel{padding:20px}}
@media(max-width:630px){.phys-hero{grid-template-columns:1fr}.phys-hero-graphic{max-width:360px}.phys-cards,.phys-sub-grid{grid-template-columns:1fr}.phys-form{grid-template-columns:1fr}.phys-panel{padding:16px}.phys-readouts{grid-template-columns:repeat(2,minmax(0,1fr))}.phys-readout strong{font-size:1rem}.phys-viewport{padding:2px}.phys-viewport svg{aspect-ratio:860/350}.phys-controls button{flex:1 1 auto}}
@media(prefers-reduced-motion:reduce){.phys-card{transition:none}}

.phys-field[hidden],.phys-note[hidden]{display:none!important}
/* Le tabelle possono scorrere nel proprio pannello senza allargare la pagina. */
.phys-layout>* ,.phys-sub-grid>*,.phys-graphs>*{min-width:0}
.phys-table-wrap{max-width:100%;overflow-x:auto;min-width:0}
@media(max-width:630px){.phys-sub-grid{grid-template-columns:minmax(0,1fr)}}

/* Su schermi stretti i disegni mantengono etichette leggibili con scroll locale. */
@media(max-width:630px){
  .phys-viewport{overflow-x:auto;overscroll-behavior-x:contain}
  .phys-viewport svg{width:620px;max-width:none;height:auto;aspect-ratio:auto}
  .phys-graph-panel{overflow-x:auto;overscroll-behavior-x:contain}
  .phys-graph{width:580px;max-width:none;height:auto;aspect-ratio:auto}
}

/* v0.2 — Svolgimento guidato: ogni passaggio presenta formula,
   sostituzione e risultato, senza risorse tipografiche esterne. */
.phys-guide-section{margin-top:24px;padding:28px}
.phys-guide-header h2{font-size:1.52rem;color:#173e78;margin:5px 0 10px}
.phys-guide-header .eyebrow{font-size:.78rem;letter-spacing:.07em;margin:0}
.phys-guide-header .phys-guide-caption{color:#506781;line-height:1.65;margin:0 0 22px;max-width:920px}
.phys-guide-list{list-style:none;counter-reset:phys-guide;display:grid;gap:16px;padding:0;margin:0}
.phys-guide-step{counter-increment:phys-guide;position:relative;min-width:0;padding:20px 20px 17px 70px;border:1px solid #dce5f2;background:#fbfdff;border-radius:13px}
.phys-guide-step::before{content:counter(phys-guide);position:absolute;left:20px;top:20px;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;color:#fff;background:#235cb1;font-weight:800;font-size:.98rem}
.phys-guide-step h3{color:#163e72;font-size:1.12rem;line-height:1.35;margin:0 0 8px}
.phys-guide-intro{margin:0 0 15px;color:#40556c;line-height:1.65;font-size:.95rem}
.phys-guide-row{display:grid;grid-template-columns:minmax(125px,160px) minmax(0,1fr);gap:12px;align-items:start;padding:10px 13px;border-top:1px solid #e8eef6}
.phys-guide-label{font-size:.78rem;text-transform:uppercase;letter-spacing:.035em;font-weight:800;color:#506883;line-height:1.6}
.phys-guide-equation{font-size:1.03rem;line-height:1.7;min-width:0;overflow-x:auto;overflow-y:hidden;white-space:nowrap;overscroll-behavior-x:contain;padding-bottom:3px;font-variant-numeric:tabular-nums}
.phys-guide-result{background:#eaf4ef;border-radius:8px;border-top:0;margin-top:5px}
.phys-guide-result .phys-guide-label,.phys-guide-result .phys-guide-equation{color:#176345;font-weight:800}
.phys-guide-note{border-left:3px solid #d2a243;padding-left:12px;color:#56647a;margin:13px 0 0;font-size:.85rem;line-height:1.6}
.phys-guide-step sub,.phys-guide-step sup{line-height:0;font-size:.72em}
.phys-frac{display:inline-flex;vertical-align:middle;flex-direction:column;align-items:center;justify-content:center;line-height:1.25;text-align:center;font-size:.95em;margin:0 .12em}
.phys-frac>span:first-child{border-bottom:1.3px solid currentColor;padding:0 .2em .14em}
.phys-frac>span:last-child{padding:.12em .2em 0}
.phys-guide-footnote{color:#63758b;font-size:.84rem;line-height:1.6;margin:17px 0 0}
@media(max-width:630px){.phys-guide-section{padding:16px}.phys-guide-step{padding:18px 12px 16px 50px}.phys-guide-step::before{left:12px;top:18px;width:29px;height:29px}.phys-guide-step h3{font-size:1.02rem}.phys-guide-row{grid-template-columns:minmax(0,1fr);gap:2px;padding:10px 9px}.phys-guide-equation{font-size:.95rem;white-space:normal;overflow-x:visible;overflow-wrap:anywhere}}

/* v0.3 — formule dimensionate, una per riga, sempre allineate a sinistra. */
.phys-guide-equation { white-space:normal; overflow:visible; font-variant-numeric:normal; line-height:1.6 }
.phys-guide-math-line { display:block; width:100%; max-width:100%; overflow-x:auto; overflow-y:hidden;
  padding:5px 1px; margin:1px 0; overscroll-behavior-inline:contain; white-space:nowrap }
.phys-guide-math-line + .phys-guide-math-line { border-top:1px dotted #e8eef5; }
.phys-guide-math-line mjx-container, .phys-inline-equation mjx-container { display:inline-block!important;
  max-width:none; text-align:left!important; margin:0!important; }
.phys-guide-equation mjx-container svg, .phys-formula mjx-container svg { vertical-align:-.18em }
.phys-guide-intermediate { background:#f6f9fe }
.phys-guide-result { margin-top:8px }
.phys-formula p { display:block; padding:8px 0; margin:0; border-bottom:1px solid #e2eaf4 }
.phys-formula p:last-child { border-bottom:0 }
.phys-formula p strong { display:block; font-size:.89rem; margin-bottom:5px }
.phys-formula span[id] { display:block; max-width:100%; overflow-x:auto; overflow-y:hidden;
  white-space:nowrap; padding:5px 0; text-align:left }
.phys-guide-section mjx-container, .phys-formula mjx-container { color:inherit }
@media(max-width:630px) {
  .phys-guide-math-line { font-size:.92rem; line-height:1.55; white-space:nowrap;
    overflow-x:auto; overflow-wrap:normal }
  .phys-guide-row { min-width:0 }
  .phys-guide-equation { min-width:0 }
  .phys-guide-step { min-width:0 }
}
/* Anche i paragrafi numerici del riepilogo sono scorrevoli su 320 px. */
.phys-formula p[id] { display:block; max-width:100%; overflow-x:auto; overflow-y:hidden;
  white-space:nowrap; overscroll-behavior-x:contain }

/* v0.4 — fallback MathML resistente a errori di caricamento MathJax. */
.phys-guide-math-line math, .phys-formula [data-tex] math { font-family: math, "Cambria Math", "STIX Two Math", serif;
  font-size:1.06em; max-width:none; white-space:nowrap; vertical-align:middle; }
.phys-guide-math-line [data-render="svg"] svg, .phys-formula [data-render="svg"] svg { max-width:none; }
.phys-guide-math-line[data-render="mathml"], .phys-formula [data-render="mathml"] { overflow-x:auto; }
.phys-formula .phys-inline-equation { overflow-x:auto; }

/* MathJax.tex2svg conserva MathML assistivo: non va mostrato visivamente. */
mjx-assistive-mml {position:absolute!important; width:1px!important; height:1px!important;
  padding:0!important; margin:0!important; overflow:hidden!important;
  clip:rect(1px,1px,1px,1px)!important; white-space:nowrap!important;
  border:0!important; opacity:0!important; }

/* v0.5: selezione temporale direttamente sui grafici. */
.phys-graph.phys-scrubbable{cursor:crosshair}
.phys-graph.phys-scrubbable:focus-visible{outline:3px solid #235cb1;outline-offset:3px;border-radius:4px}

/* v0.6 – esperimento B, due serie grafiche e vettori proporzionali. */
.phys-compare-controls{border:1px solid #cbd9ee;border-radius:11px;background:#f6f9ff;padding:12px}
.phys-compare-switch{display:flex!important;align-items:center;gap:11px;cursor:pointer;line-height:1.35}
.phys-compare-switch input{width:20px!important;height:20px;flex:0 0 auto;accent-color:#235cb1}
.phys-compare-switch span{display:grid;gap:4px}.phys-compare-switch small{display:block;font-size:.78rem;font-weight:400;color:#566d88}
.phys-compare-fields{display:grid;grid-template-columns:1fr;gap:12px;margin-top:15px;padding-top:14px;border-top:1px solid #cbd9ee}
.phys-compare-fields[hidden],.phys-compare-summary[hidden],.phys-b-legend[hidden]{display:none!important}
.phys-compare-summary{margin-top:20px;border-color:#d9c8ed;background:#fdfbff}
.phys-compare-summary h2{color:#6b438d}
.phys-dot.purple{background:#8e59bd}
@media(max-width:630px){.phys-compare-summary{padding:16px}.phys-compare-summary .phys-table{min-width:380px}}

/* v0.7 beta: primo piano all'animazione e scelta diretta del tempo. */
.phys-animation {scroll-margin-top:18px}
.phys-animation-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.phys-animation-heading h2 {margin:0}
.phys-scene-play {border-radius:8px;padding:9px 15px;font:inherit;font-size:.87rem;font-weight:750;white-space:nowrap;flex-shrink:0}
.phys-jump-form {display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:0 0 15px;padding:12px 14px;background:#f3f7fd;border:1px solid #d7e4f5;border-radius:12px}
.phys-jump-form label {font-weight:750;color:#23446d;font-size:.9rem}
.phys-jump-form input {width:90px;max-width:100%;border:1.5px solid #9bb5d4;border-radius:8px;padding:8px 10px;background:white;color:#1c3657;font:inherit}
.phys-jump-form input[aria-invalid="true"] {border-color:#bd3535}
.phys-jump-form button {font:inherit;font-size:.85rem;font-weight:750;padding:9px 13px}
.phys-jump-hint {flex-basis:100%;font-size:.83rem;color:#526781}
.phys-jump-error {flex-basis:100%;color:#9d2424;font-size:.85rem;font-weight:700}
.phys-jump-error:empty {display:none}
@media(max-width:630px){.phys-jump-form {align-items:center}.phys-jump-form label {flex-basis:100%}.phys-animation-heading{gap:6px}.phys-scene-play{padding:8px 10px}}

/* v0.8: esportazione misure e istante selezionato esplicito. */
.phys-export {display:grid;gap:6px;margin-top:13px;border-top:1px solid #dae5f2;padding-top:13px}
.phys-export button {justify-self:start;border-radius:8px;font:inherit;font-weight:750;font-size:.86rem;padding:10px 15px}
.phys-export .phys-note{margin:0;font-size:.81rem}
.phys-jump-selected{font-weight:800;color:#185284;background:#e4f0ff;border-radius:7px;padding:7px 10px;font-size:.86rem}
.phys-jump-hint{clear:both}

/* v0.8.1 beta: scala geometrica reale per il lancio obliquo. */
.phys-scale-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:9px 13px;
  border:1px solid #d9e5f3;background:#f6f9fe;border-radius:10px;padding:10px 12px;margin-bottom:11px}
.phys-scale-toolbar label{font-weight:800;color:#23476d;font-size:.87rem}
.phys-scale-toolbar select{font:inherit;font-size:.84rem;min-width:0;max-width:100%;
  border:1px solid #a9bfd9;border-radius:8px;color:#1b385a;background:#fff;padding:8px 11px}
.phys-scale-info{display:inline-flex;border-radius:7px;padding:5px 9px;font-size:.8rem;
  font-weight:800;color:#175b45;background:#e9f5ee;line-height:1.35}
@media(max-width:630px){.phys-scale-toolbar{display:grid;gap:7px}.phys-scale-toolbar select{width:100%}}
