/* Laboratório: gráfico próprio, controles, missões e cartões de leitura. */
.lab-hub .lead.sm{padding-top:0}
.lab-card.soon{opacity:.62;cursor:default}@media (hover:hover){.lab-card.soon:hover{transform:none;box-shadow:var(--sh-1);border-color:var(--line)}}
.lab-prog{color:var(--brand);font-weight:700}
.soon-tag{display:inline-flex;align-items:center;gap:4px;font-size:.72rem;font-weight:800;color:var(--muted);background:var(--bg-2);padding:4px 10px;border-radius:var(--r-pill);white-space:nowrap}
.lab-body{display:flex;flex-direction:column;gap:14px}

/* missão */
.quest{display:flex;align-items:center;gap:12px;padding:12px 16px 12px 10px;border-radius:var(--r-lg);background:var(--brand-soft);border:2px solid color-mix(in srgb,var(--brand) 30%,var(--line));transition:background .3s,border-color .3s}
.quest.won,.quest.all{background:var(--ok-soft);border-color:var(--ok)}
.q-badge{flex:none;width:64px;height:64px;border-radius:20px;display:grid;place-items:center;color:var(--brand);background:color-mix(in srgb,var(--brand) 12%,var(--surface));transition:background .3s,color .3s}
.q-badge.done{color:#fff;background:var(--ok);animation:qBadge .6s var(--spring) both}
@keyframes qBadge{0%{transform:scale(.8)}50%{transform:scale(1.15)}100%{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.q-badge.done{animation:none}}
.q-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.q-body small{font-size:.74rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--brand)}
.quest.won .q-body small,.quest.all .q-body small{color:var(--ok-deep)}
.q-body b{font-size:1.02rem;line-height:1.3}
.quest.won .q-body b{font-size:1.5rem;color:var(--ok-deep);animation:pop .5s var(--spring) both}
.q-hint{display:flex;gap:8px;align-items:flex-start;font-size:.9rem;color:var(--ink-2);background:var(--surface);border-radius:12px;padding:8px 10px}
.q-hint .ico{color:var(--gold);margin-top:2px}
.q-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:2px}
.q-dots{display:flex;gap:5px}
.q-dots i{width:9px;height:9px;border-radius:50%;background:var(--line-2)}
.q-dots i.on{background:var(--ok)}.q-dots i.cur{background:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 25%,transparent)}

/* gráfico */
.lab-plot{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);padding:8px 8px 12px;box-shadow:var(--sh-1);display:flex;flex-direction:column;gap:8px}
.plot-svg{width:100%;height:auto;display:block;user-select:none;-webkit-user-select:none}
.pl-grid{stroke:var(--line);stroke-width:1}.pl-grid.major{stroke:var(--line-2)}
.pl-axis{stroke:var(--ink-2);stroke-width:1.6}
.pl-tick{fill:var(--muted);font:600 10px var(--font)}.pl-axname{fill:var(--ink-2);font:italic 700 12px var(--font)}
.pl-curve{fill:none;stroke:var(--brand);stroke-width:3.4;stroke-linecap:round;stroke-linejoin:round}
/* paleta das várias curvas (contraste ≥ 3:1 com o fundo nos dois temas) */
.plot-svg,.grapher{--cv0:#5B5CF6;--cv1:#E0405F;--cv2:#0B8F87;--cv3:#D96A00;--cv4:#2F7DE1;--cv5:#8B4FE0}
:root[data-theme=dark] .plot-svg,:root[data-theme=dark] .grapher{--cv0:#8A8BFF;--cv1:#FF6E8A;--cv2:#2DD4C4;--cv3:#FFA24D;--cv4:#5AA2FF;--cv5:#B48CFF}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .plot-svg,:root:not([data-theme=light]) .grapher{--cv0:#8A8BFF;--cv1:#FF6E8A;--cv2:#2DD4C4;--cv3:#FFA24D;--cv4:#5AA2FF;--cv5:#B48CFF}}
.pl-curve.c0{stroke:var(--cv0)}.pl-curve.c1{stroke:var(--cv1)}.pl-curve.c2{stroke:var(--cv2)}.pl-curve.c3{stroke:var(--cv3)}.pl-curve.c4{stroke:var(--cv4)}.pl-curve.c5{stroke:var(--cv5)}
.plot-svg.interactive{touch-action:none;cursor:grab}.plot-svg.interactive.panning{cursor:grabbing}
.plot-svg.interactive:focus-visible{outline:3px solid var(--brand);outline-offset:2px;border-radius:8px}
.pl-sym{stroke:var(--muted);stroke-width:1.4;stroke-dasharray:5 5;opacity:.7}
.pl-dot{pointer-events:none;stroke:var(--surface);stroke-width:2.5;transition:r .15s var(--ease)}
.pl-hit{fill:transparent;touch-action:none}
.pl-pt.drag-able .pl-hit{cursor:grab}.pl-pt.drag .pl-hit{cursor:grabbing}
.pl-pt.drag .pl-dot{r:9}@media (hover:hover){.pl-pt.drag-able:hover .pl-dot{r:9}}
.pl-pt:focus-visible{outline:none}.pl-pt:focus-visible .pl-dot{stroke:var(--ink);stroke-width:3}
.pt-v .pl-dot{fill:var(--gold)}.pt-y .pl-dot{fill:var(--flame)}.pt-r .pl-dot{fill:var(--ok)}
.pl-lab{font:700 11px var(--font);fill:var(--ink);paint-order:stroke;stroke:var(--surface);stroke-width:3.5px;stroke-linejoin:round;pointer-events:none}
.legend{display:flex;flex-wrap:wrap;gap:6px 14px;justify-content:center;font-size:.8rem;font-weight:700;color:var(--ink-2)}
.lg::before{content:"";display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;background:var(--c)}
.lg-v{--c:var(--gold)}.lg-r{--c:var(--ok)}.lg-y{--c:var(--flame)}
.lab-hint{text-align:center;font-size:.82rem}

/* fórmula e controles */
.lab-formula{text-align:center;font-size:1.35rem;padding:4px 0;overflow-x:auto}
.lab-ctls{gap:6px}
.ctl{display:grid;grid-template-columns:28px 38px 1fr 38px 52px;align-items:center;gap:8px;min-height:48px}
.ctl-name{font:italic 800 1.25rem Georgia,"Times New Roman",serif;text-align:center}
.ctl input[type=range]{width:100%;accent-color:var(--brand);height:30px;margin:0}
.ctl-val{font-weight:800;font-variant-numeric:tabular-nums;text-align:right}
.step-btn{width:38px;height:38px;border-radius:50%;border:2px solid var(--line-2);background:var(--surface);font-size:1.3rem;font-weight:800;line-height:1;color:var(--ink-2);display:grid;place-items:center;transition:transform .12s var(--ease),background .15s}
@media (hover:hover){.step-btn:hover{background:var(--brand-soft)}}.step-btn:active{transform:scale(.88)}

/* leitura */
.info-grid{display:grid;gap:10px}
.info-card{background:var(--surface);border:1px solid var(--line);border-left:5px solid var(--brand);border-radius:var(--r);padding:12px 14px;display:flex;flex-direction:column;gap:6px;box-shadow:var(--sh-1)}
.info-card.i-roots{border-left-color:var(--ok)}.info-card.i-vertex{border-left-color:var(--gold)}
.info-card small{font-size:.74rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.info-card .tex{overflow-x:auto;overflow-y:hidden;padding:4px 0;font-size:.98rem}
.info-card .read{color:var(--ink-2);font-size:.9rem}.info-card .read:empty{display:none}
.info-card.none .tex{color:var(--muted)}
@media (min-width:760px){.page.lab{max-width:720px}}

/* gráficos do movimento */
.pl-area{fill:var(--brand);opacity:.2}.pl-area.neg{fill:var(--bad)}
.pl-now{stroke:var(--ink-2);stroke-width:1.4;stroke-dasharray:3 4;opacity:.8}
.mt-svg{width:100%;height:auto;display:block}
.mt-road{stroke:var(--ink-2);stroke-width:3;stroke-linecap:round}
.mt-tick{stroke:var(--line-2);stroke-width:1.5}.mt-tick.zero{stroke:var(--ink-2);stroke-width:2}
.mt-body{fill:var(--flame);stroke:var(--surface);stroke-width:2}
.mt-wheel{fill:var(--ink);stroke:var(--surface);stroke-width:2}
.mt-arrow{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.mt-v{stroke:var(--brand)}.mt-a{stroke:var(--ok)}
.lg-mv{--c:var(--brand)}.lg-ma{--c:var(--ok)}
.mt-readout{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 16px;font-weight:800;font-variant-numeric:tabular-nums;font-size:.95rem}
.mt-readout i{font-family:Georgia,"Times New Roman",serif}
.mt-rv{color:var(--brand)}.mt-ra{color:var(--ok-deep)}
:root[data-theme=dark] .mt-ra{color:var(--ok)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .mt-ra{color:var(--ok)}}
.mt-time{display:flex;align-items:center;gap:10px;padding:0 4px}
.mt-time input[type=range]{flex:1;min-width:0;accent-color:var(--brand);height:30px;margin:0}
.mt-play{flex:none;display:inline-flex;align-items:center;gap:6px;min-width:112px;justify-content:center}
.mt-formula{display:flex;flex-direction:column;align-items:center;gap:2px;font:700 1.05rem var(--font);text-align:center}
.motion,.motion button{font-feature-settings:"calt" 0} /* mesmo motivo do plano livre: a fonte troca "2x" por "2×" */
.mt-ctl .ctl-name sub{font-size:.6em;font-style:normal;font-family:var(--font)}
.mt-graphs{gap:2px}
.mt-ctl .ctl-val{font-size:.95rem}

/* progressões */
.pl-curve.dash{stroke-width:2;stroke-dasharray:6 6;opacity:.7}
.pl-curve.lim{stroke:var(--gold);opacity:1}
.lg-s{--c:var(--gold)}.lg-lim{--c:var(--gold)}.lg[hidden]{display:none}
.seq,.seq button{font-feature-settings:"calt" 0} /* mesmo motivo do plano livre: a fonte troca "2x" por "2×" */
.sq-modes{display:flex;gap:8px;justify-content:center}
.sq-check{align-self:center}
.sq-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 6px;padding:2px 0}
.sq-term{display:flex;flex-direction:column;align-items:center;min-width:44px;padding:4px 8px;border-radius:12px;background:var(--surface);border:1px solid var(--line);font-variant-numeric:tabular-nums}
.sq-term small{font-size:.7rem;font-weight:700;color:var(--muted)}.sq-term b{font-size:.95rem}
.sq-op{font-size:.72rem;font-weight:800;color:var(--ok-deep)}
:root[data-theme=dark] .sq-op{color:var(--ok)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .sq-op{color:var(--ok)}}
.ctl[hidden]{display:none}

/* círculo trigonométrico (cores das curvas: seno = c1, cosseno = c4, tangente = c2) */
.trig{--tr-sin:var(--cv1);--tr-cos:var(--cv4);--tr-tan:var(--cv2)}
.trig{--cv0:#5B5CF6;--cv1:#E0405F;--cv2:#0B8F87;--cv4:#2F7DE1}
:root[data-theme=dark] .trig{--cv0:#8A8BFF;--cv1:#FF6E8A;--cv2:#2DD4C4;--cv4:#5AA2FF}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .trig{--cv0:#8A8BFF;--cv1:#FF6E8A;--cv2:#2DD4C4;--cv4:#5AA2FF}}
.trig,.trig button{font-feature-settings:"calt" 0}
.tr-svg{width:100%;max-width:360px;height:auto;display:block;margin:0 auto;touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer}
.tr-circle{fill:none;stroke:var(--line-2);stroke-width:2}
.tr-notch{fill:var(--line-2)}
.tr-tanline{stroke:var(--tr-tan);stroke-width:1.2;stroke-dasharray:4 5;opacity:.6}
.tr-ext{stroke:var(--tr-tan);stroke-width:1.4;stroke-dasharray:4 4;opacity:.8}
.tr-arc{fill:none;stroke:var(--gold);stroke-width:2.5}
.tr-radius{stroke:var(--ink-2);stroke-width:2.2}
.tr-proj{stroke:var(--muted);stroke-width:1.2;stroke-dasharray:3 4}
.tr-seg{stroke-width:4.5;stroke-linecap:round}
.tr-cos{stroke:var(--tr-cos)}.tr-sin{stroke:var(--tr-sin)}.tr-tan{stroke:var(--tr-tan)}
.tr-lab{font:800 12px var(--font);paint-order:stroke;stroke:var(--surface);stroke-width:3.5px;stroke-linejoin:round}
.tr-cos-t{fill:var(--tr-cos)}.tr-sin-t{fill:var(--tr-sin)}.tr-theta{fill:var(--gold);font-style:italic}
.tr-dot{fill:var(--gold);stroke:var(--surface);stroke-width:2.5;transition:r .15s var(--ease)}
.tr-hit{fill:transparent}
.tr-handle.drag .tr-dot{r:11}@media (hover:hover){.tr-handle:hover .tr-dot{r:11}}
.tr-handle:focus-visible{outline:none}.tr-handle:focus-visible .tr-dot{stroke:var(--ink);stroke-width:3}
.tr-head{text-align:center;font-size:1.15rem;min-height:1.8em}
.tr-values{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 16px;font-weight:800;font-variant-numeric:tabular-nums}
.tr-v-sin{color:var(--tr-sin)}.tr-v-cos{color:var(--tr-cos)}.tr-v-tan{color:var(--tr-tan)}
.tr-chips{display:flex;justify-content:center;gap:8px}
.tr-chip.active.tr-chip-sin{border-color:var(--tr-sin);color:var(--tr-sin);background:color-mix(in srgb,var(--tr-sin) 12%,var(--surface))}
.tr-chip.active.tr-chip-cos{border-color:var(--tr-cos);color:var(--tr-cos);background:color-mix(in srgb,var(--tr-cos) 12%,var(--surface))}
.tr-chip.active.tr-chip-tan{border-color:var(--tr-tan);color:var(--tr-tan);background:color-mix(in srgb,var(--tr-tan) 12%,var(--surface))}
.tr-pt-sin .pl-dot{fill:var(--tr-sin)}.tr-pt-cos .pl-dot{fill:var(--tr-cos)}.tr-pt-tan .pl-dot{fill:var(--tr-tan)}
.trig .info-card .tex .math-inline{display:inline-block;margin:2px 0}

/* tanque de Torricelli */
.torricelli{--water:#2F7DE1}
:root[data-theme=dark] .torricelli{--water:#5AA2FF}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .torricelli{--water:#5AA2FF}}
.torricelli,.torricelli button{font-feature-settings:"calt" 0}
.tk-svg{width:100%;max-width:420px;height:auto;display:block;margin:0 auto;touch-action:none;user-select:none;-webkit-user-select:none}
.tk-tank{fill:none;stroke:var(--ink-2);stroke-width:3;stroke-linejoin:round}
.tk-water{fill:var(--water);opacity:.28}
.tk-jet{fill:none;stroke:var(--water);stroke-width:4;stroke-linecap:round;stroke-dasharray:10 6;animation:tk-flow .6s linear infinite}
@keyframes tk-flow{to{stroke-dashoffset:-16}}
@media (prefers-reduced-motion:reduce){.tk-jet{animation:none;stroke-dasharray:none}}
.tk-land{fill:var(--ok);stroke:var(--surface);stroke-width:2}
.tk-land-t{fill:var(--ok-deep)}
:root[data-theme=dark] .tk-land-t{fill:var(--ok)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .tk-land-t{fill:var(--ok)}}
.tk-dim{stroke:var(--muted);stroke-width:1.4;stroke-dasharray:3 3}
.tk-dim-t{fill:var(--ink-2);font-style:italic}
.tk-handle{cursor:ns-resize}
.tk-knob{fill:var(--gold);stroke:var(--surface);stroke-width:2.5;transition:r .15s var(--ease)}
.tk-y .tk-knob{fill:var(--flame)}
.tk-handle.drag .tk-knob{r:10}@media (hover:hover){.tk-handle:hover .tk-knob{r:10}}
.tk-handle:focus-visible{outline:none}.tk-handle:focus-visible .tk-knob{stroke:var(--ink);stroke-width:3}
.tk-ctl{grid-template-columns:28px 38px 1fr 38px 68px}.tk-ctl .ctl-name{font-style:italic}.tk-ctl .ctl-val{white-space:nowrap}

/* geometria dinâmica */
.geo,.geo button{font-feature-settings:"calt" 0}
.geo-tri{fill:color-mix(in srgb,var(--brand) 16%,transparent);stroke:var(--brand);stroke-width:3;stroke-linejoin:round}
.geo-tri.flat{stroke:var(--bad);stroke-dasharray:6 5}
.geo-right{fill:none;stroke:var(--ink-2);stroke-width:1.8}
.geo-lab{font:800 11px var(--font);paint-order:stroke;stroke:var(--surface);stroke-width:3.5px;stroke-linejoin:round;pointer-events:none}
.geo-side{fill:var(--brand)}.geo-ang{fill:var(--ink-2)}.geo-name{fill:var(--ink);font-size:12px}
.pt-x .pl-dot{fill:var(--ink)}

/* plano livre */
.grapher .c0{--cv:var(--cv0)}.grapher .c1{--cv:var(--cv1)}.grapher .c2{--cv:var(--cv2)}.grapher .c3{--cv:var(--cv3)}.grapher .c4{--cv:var(--cv4)}.grapher .c5{--cv:var(--cv5)}
.pl-pt.pt-sm .pl-dot{r:5}.pt-x .pl-dot{fill:var(--ink)}
.gr-tools{display:flex;justify-content:center;gap:10px}
.gr-card{gap:10px}
.gr-h{font-size:1rem;margin:0}
.gr-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.gr-row-between{justify-content:space-between}
.gr-list{display:flex;flex-direction:column;gap:8px}
.gr-eq-row{display:flex;align-items:center;gap:8px}
.gr-swatch{flex:none;width:28px;height:28px;border-radius:50%;border:3px solid var(--cv);background:var(--cv);transition:background .15s}
.gr-swatch.off{background:transparent}
/* a fonte troca "2x" por "2×": aqui x é sempre a letra (regra mais específica, porque o atalho font: zera isso) */
.grapher,.grapher input,.grapher button,.grapher .pl-lab{font-feature-settings:"calt" 0}
.gr-input{flex:1;min-width:0;font:600 1.05rem var(--font);color:var(--ink);background:var(--bg-2);border:2px solid var(--line);border-radius:12px;padding:10px 12px;min-height:46px}
.gr-input:focus{outline:none;border-color:var(--brand)}
.gr-input.bad{border-color:var(--bad)}
.gr-del{flex:none;width:40px;height:40px;border-radius:50%;border:0;background:transparent;color:var(--muted);display:grid;place-items:center}
@media (hover:hover){.gr-del:hover{background:var(--bg-2);color:var(--ink)}}
.gr-err{margin:4px 0 0 36px;font-size:.84rem;font-weight:600;color:var(--bad-deep)}.gr-err:empty{display:none}
:root[data-theme=dark] .gr-err{color:var(--bad)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .gr-err{color:var(--bad)}}
.gr-keys{display:flex;flex-wrap:wrap;gap:6px}
.gr-key{min-width:40px;height:38px;padding:0 10px;border-radius:10px;border:1px solid var(--line-2);background:var(--surface);color:var(--ink);font:700 1rem var(--font)}
@media (hover:hover){.gr-key:hover{background:var(--brand-soft)}}.gr-key:active{transform:scale(.94)}
.gr-examples small{font-size:.74rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.gr-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.gr-chips .chip{padding:6px 12px;font-size:.86rem}
.gr-params{display:flex;flex-direction:column;gap:4px}
.gr-ctl{grid-template-columns:28px 38px 1fr 38px 52px 32px}
.gr-gear{width:32px;height:32px;border-radius:50%;border:0;background:transparent;color:var(--muted);font-weight:800;font-size:1.1rem}
.gr-gear[aria-expanded=true]{background:var(--bg-2);color:var(--ink)}@media (hover:hover){.gr-gear:hover{background:var(--bg-2);color:var(--ink)}}
.gr-lims{display:flex;flex-wrap:wrap;gap:8px;padding:0 0 8px 36px}
.gr-lims[hidden]{display:none}
.gr-lim{display:flex;flex-direction:column;gap:2px;font-size:.74rem;font-weight:700;color:var(--muted)}
.gr-lim input{width:84px;font:600 .95rem var(--font);color:var(--ink);background:var(--bg-2);border:1px solid var(--line);border-radius:10px;padding:6px 8px}
.gr-empty{font-size:.9rem;margin:0}
.gr-check{display:inline-flex;align-items:center;gap:6px;font-size:.86rem;font-weight:700;color:var(--ink-2)}
.gr-check input{accent-color:var(--brand);width:18px;height:18px}
.gr-pts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:.9rem}
.gr-pt{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.gr-pt b{font-variant-numeric:tabular-nums}
.gr-dot{width:10px;height:10px;border-radius:50%;background:var(--c,var(--ink))}
.gr-pt.pt-r{--c:var(--ok)}.gr-pt.pt-v{--c:var(--gold)}.gr-pt.pt-y{--c:var(--flame)}.gr-pt.pt-x{--c:var(--ink)}
.gr-who{font-weight:800;color:var(--muted);min-width:24px}
.gr-table-wrap{overflow-x:auto}
.gr-table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:.92rem}
.gr-table th,.gr-table td{padding:6px 10px;text-align:right;border-bottom:1px solid var(--line);white-space:nowrap}
.gr-table th{font-weight:800;color:var(--ink-2)}
.gr-table th[class^=c]{border-bottom:3px solid var(--cv)}

/* hub de treino */
.hub-hero{display:flex;align-items:center;gap:16px;width:100%;text-align:left;border:0;border-radius:var(--r-lg);padding:20px;color:#fff;background:linear-gradient(135deg,var(--brand) 0%,var(--brand-2) 100%);box-shadow:0 14px 34px color-mix(in srgb,var(--brand) 35%,transparent);transition:transform .15s var(--ease)}
.hub-hero:active{transform:scale(.985)}
.hub-hero-ico{flex:none;display:grid;place-items:center;width:54px;height:54px;border-radius:18px;background:rgba(255,255,255,.2)}
.hub-hero-text{flex:1;display:flex;flex-direction:column}.hub-hero-text b{font-size:1.2rem}.hub-hero-text small{opacity:.9}
