/* Cifre: Atkinson Hyperlegible disegna lo zero barrato (Ø); per le sole cifre si usa Inter (licenza SIL OFL, css/fonts/OFL.txt) */
@font-face { font-family: "Cifre"; src: url("fonts/cifre-Regular.woff2") format("woff2"); font-weight: 400; unicode-range: U+0030-0039; font-display: swap; }
@font-face { font-family: "Cifre"; src: url("fonts/cifre-Bold.woff2") format("woff2"); font-weight: 700; unicode-range: U+0030-0039; font-display: swap; }
/* Layout: colonna unica centrata; in alto il campo dell'espressione con anteprima, sotto lo svolgimento riga per riga */
:root {
  --bg: #f2f4f8; --surface: #ffffff; --ink: #172033; --muted: #5a6479; --line: #d8dde7;
  --accent: #2747c9; --accent-ink: #ffffff; --accent-soft: #e6eafb;
  --hl-bg: #fff07a; --ok: #1f7a4a; --ok-bg: #e4f4ea;
  --warn: #a14f08; --warn-bg: #fcefe1; --chip-bg: #eceff5;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --ui: "Cifre", "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --math: "STIX Two Text", "Cambria Math", "Times New Roman", serif;
  /* colori delle aree nelle spiegazioni */
  --a-aritmetica: #2747c9; --a-algebra: #8a3fb8; --a-geometria: #1d7f6a; --a-analisi: #b5462c; --a-probabilita: #9a6a00; --a-discreta: #4f5b75;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f131b; --surface: #171d29; --ink: #e6eaf2; --muted: #9aa3b6; --line: #2a3243;
    --accent: #8fa3ff; --accent-ink: #0c1122; --accent-soft: #1f2848;
    --hl-bg: rgba(255, 226, 64, .3); --ok: #6fd39b; --ok-bg: #16281f;
    --warn: #f2a660; --warn-bg: #2d2015; --chip-bg: #232b3b;
    --a-aritmetica: #8fa3ff; --a-algebra: #cf9cf0; --a-geometria: #5fd0b4; --a-analisi: #f39a7f; --a-probabilita: #e9c062; --a-discreta: #a9b4cc;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f131b; --surface: #171d29; --ink: #e6eaf2; --muted: #9aa3b6; --line: #2a3243;
  --accent: #8fa3ff; --accent-ink: #0c1122; --accent-soft: #1f2848;
  --hl-bg: rgba(255, 226, 64, .3); --ok: #6fd39b; --ok-bg: #16281f;
  --warn: #f2a660; --warn-bg: #2d2015; --chip-bg: #232b3b;
  --a-aritmetica: #8fa3ff; --a-algebra: #cf9cf0; --a-geometria: #5fd0b4; --a-analisi: #f39a7f; --a-probabilita: #e9c062; --a-discreta: #a9b4cc;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* senza questa regola .cam e gli altri blocchi con display proprio restano visibili */
body { background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 15px; line-height: 1.5; margin: 0; }
.app { max-width: 820px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 48px; }
h1 { font-family: var(--display); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-family: var(--display); font-size: 1.25rem; margin: 0; line-height: 1.2; }
.sub { color: var(--muted); margin: 6px 0 20px; }
button { font-family: var(--ui); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- inserimento ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
label.lbl, .lbl { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.inrow { display: flex; gap: 8px; flex-wrap: wrap; }
#expr { flex: 1 1 260px; min-width: 0; font: 1.15rem var(--math); padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.btn { font: 700 .95rem var(--ui); border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.keys button { font: 1.05rem var(--math); min-width: 40px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.keys button:hover { border-color: var(--muted); }
.preview { margin-top: 12px; padding: 10px 12px; background: var(--bg); border-radius: 10px; min-height: 48px; display: flex; align-items: center; gap: 10px; overflow-x: auto; }
.preview .math { font-size: 1.35rem; white-space: nowrap; }
.preview.bad { background: var(--warn-bg); color: var(--warn); }
.preview .tag { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 0; }
.examples span { font-size: .85rem; color: var(--muted); margin-right: 2px; }
.examples button { font: .95rem var(--math); background: var(--chip-bg); color: var(--ink); border: 0; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.examples button:hover { background: var(--accent-soft); }
.help { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }

/* ---- matematica ---- */
.math { font-family: var(--math); }
.math i.v, .why i, .formula i { font-style: italic; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .12em; line-height: 1.15; }
.fr > .fn { border-bottom: 1.2px solid currentColor; padding: 0 .2em .06em; }
.fr > .fd { padding: .06em .2em 0; }
sup { font-size: .66em; line-height: 0; vertical-align: .62em; }
sup .fr { font-size: .9em; }
/* radice: segno disegnato (si allunga con il radicando), linea sopra il radicando, indice in alto a sinistra */
.rad { display: inline-flex; align-items: stretch; vertical-align: middle; white-space: nowrap; margin: 0 .04em; position: relative; }
.rad.rad-n { padding-left: .12em; }
.rad > .ri { position: absolute; left: .02em; top: .12em; font-size: .52em; line-height: 1; }
.rad > svg.rs { width: .58em; flex: none; align-self: stretch; height: auto; min-height: 1.1em; overflow: visible; }
.rad > .rx { border-top: 1.15px solid currentColor; padding: .08em .04em 0 .05em; display: inline-flex; align-items: center; line-height: 1.15; }
sup .rad { font-size: .9em; }
.nw { white-space: nowrap; display: inline-block; }
.pdf-pages .hl .rad { position: relative; z-index: 1; }
.per { text-decoration: overline; }
.br { color: var(--muted); }
.o { padding: 0 .05em; }
.hl { background: var(--hl-bg); border-radius: 4px; box-shadow: 0 0 0 2px var(--hl-bg); }

/* ---- svolgimento ---- */
.sol { margin-top: 24px; }
.sol-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.start { padding: 12px 16px; }
.line { font-size: 1.3rem; overflow-x: auto; white-space: nowrap; padding: 4px 0; }
ol.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step { border-left: 2px solid var(--line); margin-left: 16px; padding: 10px 0 12px 20px; position: relative; }
.sn { position: absolute; left: -14px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); color: var(--accent); font: 700 .78rem/22px var(--ui); text-align: center; font-variant-numeric: tabular-nums; }
.sh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rn { font-weight: 700; }
.ra { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--chip-bg); border-radius: 6px; padding: 1px 7px; color: var(--muted); }
.sd { margin-top: 4px; font-size: 1.05rem; color: var(--ink); overflow-x: auto; }
.sd .note { display: block; font-family: var(--ui); font-size: .88rem; color: var(--muted); margin-top: 3px; white-space: normal; }
.sl { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.sl .eq { font: 1.3rem var(--math); color: var(--muted); }
details { margin-top: 6px; }
summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: .9rem; width: max-content; }
.why { margin-top: 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-width: 65ch; }
.why p { margin: 0 0 8px; }
.why .formula { font-size: 1.15rem; padding: 8px 10px; background: var(--accent-soft); border-radius: 8px; overflow-x: auto; }
.why .err { background: var(--warn-bg); color: var(--ink); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.why .err b { color: var(--warn); display: block; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.why .err ul { margin: 0; padding-left: 1.1em; }
.why-rule + .why-rule { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.why .why-name { margin-bottom: 4px; }
/* più calcoli nello stesso passaggio */
.sd-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.sd-list li { display: block; }
.sd-rule { display: block; margin-top: 1px; }
/* fattori semplificati: il numero barrato e, sopra a destra, quello che ne resta */
.canc { position: relative; display: inline-block; padding-right: .62em; margin-top: .35em; }
.canc-old { text-decoration: line-through; text-decoration-color: #c2410c; text-decoration-thickness: 1.5px; color: var(--muted); }
.canc-new { position: absolute; right: -.1em; top: -.6em; font-size: .72em; font-weight: 700; color: #c2410c; }
.sd-list .sd { margin-top: 0; }
.sd-rule { font-size: .75rem; color: var(--muted); }
/* titoli delle fasi e piano */
.phase-h { margin: 14px 0 2px; }
.phase-h:first-child { margin-top: 2px; }
.phase-h span { font: 700 .78rem var(--ui); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.plan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 14px; font-size: .92rem; }
.plan > b { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.plan-i { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); border-radius: 999px; padding: 3px 10px 3px 4px; }
.plan-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 .72rem var(--ui); }
.plan-arrow { color: var(--muted); }
.seg.small button { padding: 4px 10px; font-size: .8rem; }
.result { margin-top: 8px; margin-left: 16px; padding: 14px 16px; border: 2px solid var(--accent); border-radius: 12px; background: var(--surface); }
.result .big { font-size: 1.8rem; }
.result .approx { color: var(--muted); font-size: .95rem; }
.verified { display: inline-block; margin-top: 8px; font-size: .85rem; color: var(--ok); background: var(--ok-bg); border-radius: 6px; padding: 3px 9px; }
.confirm-box { margin-top: 20px; padding: 14px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); }
.confirm-box p { margin: 0 0 12px; }
.err-box { margin-top: 20px; padding: 14px 16px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); }
.muted { color: var(--muted); }
footer { margin-top: 36px; font-size: .82rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- da una foto ---- */
.photo-card { margin-bottom: 16px; }
.ph-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-actions label.btn { display: inline-flex; align-items: center; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin-top: 12px; padding: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ph-status { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .92rem; }
.ph-status.warn { background: var(--warn-bg); color: var(--warn); }
.ph-status.bad { background: var(--warn-bg); color: var(--warn); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; margin-right: 8px; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ph-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.seg { display: inline-flex; background: var(--chip-bg); border-radius: 999px; padding: 3px; }
.seg button { font: 700 .88rem var(--ui); border: 0; background: transparent; color: var(--muted); padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.ph-hint { margin: 8px 0; font-size: .85rem; color: var(--muted); }
.stage { position: relative; width: 100%; max-width: 640px; margin: 0 auto; border-radius: 8px; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; background: var(--chip-bg); }
.stage img { display: block; width: 100%; height: auto; pointer-events: none; }
.stage.drawing { cursor: crosshair; touch-action: none; }
.stage.drawing .box { pointer-events: none; }
.box { position: absolute; border: 2px dashed rgba(39, 71, 201, .75); background: rgba(39, 71, 201, .06); border-radius: 6px; cursor: pointer; padding: 0; }
.box::before { content: ""; position: absolute; inset: -8px; }
.box.sel { border-style: solid; border-color: #2747c9; background: rgba(255, 232, 40, .38); }
.box.unreadable { border-color: rgba(161, 79, 8, .8); }
.box:focus-visible { outline: 3px solid #2747c9; outline-offset: 2px; }
.box .badge { position: absolute; top: -12px; left: -12px; width: 24px; height: 24px; border-radius: 50%; background: #2747c9; color: #fff; font: 700 12px/24px var(--ui); text-align: center; box-shadow: 0 0 0 2px #fff; }
.draw-ghost { position: absolute; border: 2px dashed #2747c9; background: rgba(39, 71, 201, .12); border-radius: 4px; pointer-events: none; }
.ph-queue { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ph-queue li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.qn { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 .78rem/24px var(--ui); text-align: center; }
.qb { min-width: 0; overflow-x: auto; }
.qb .math { font-size: 1.1rem; white-space: nowrap; }
.qerr { color: var(--warn); font-size: .88rem; }
.qwarn { display: block; color: var(--warn); font-size: .8rem; margin-top: 2px; }
.icon { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.icon:hover { background: var(--chip-bg); color: var(--ink); }

.seq { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent); }
.seq-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; font-size: .9rem; }
.seq-text span { color: var(--muted); }
.seq-nav { display: flex; gap: 8px; }

.cam { position: fixed; inset: 0; z-index: 50; background: #000; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.cam-frame { position: absolute; inset: 12% 8% 22% 8%; border: 2px solid rgba(255,255,255,.55); border-radius: 12px; pointer-events: none; }
.cam-tip-old { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 0; right: 0; text-align: center; color: #fff; margin: 0; font-size: .9rem; text-shadow: 0 1px 3px #000; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); background: rgba(0,0,0,.55); }
.cam-bar .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

.shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; }
.shutter:active { background: rgba(255,255,255,.6); }
body.noscroll { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.cam-msg { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); margin: 0; padding: 12px 16px; border-radius: 12px; background: rgba(0,0,0,.72); color: #fff; text-align: center; font-size: .95rem; }
.shutter:disabled { opacity: .35; cursor: default; }
.cam-bar .btn { font-size: .85rem; padding: 8px 12px; }

/* ---- struttura a schermate ---- */
.bar { display: flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 14px; }
.brand { font: 700 1.05rem var(--display); background: none; border: 0; color: var(--ink); padding: 6px 4px; cursor: pointer; }
.back { width: 40px; height: 40px; display: inline-grid; place-items: center; color: var(--ink); }
.view { display: block; }
.home { display: flex; flex-direction: column; align-items: center; text-align: center; padding-block: 12px 8px; }
.home h1 { font-size: clamp(1.7rem, 1.2rem + 2.4vw, 2.6rem); max-width: 18ch; margin-bottom: 28px; }
.cam-big { width: 148px; height: 148px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 14px 34px -12px rgba(39, 71, 201, .7), 0 0 0 10px var(--accent-soft); transition: transform .12s; }
.cam-big:hover { transform: scale(1.03); }
.cam-big:active { transform: scale(.97); }
.cam-big:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
.cam-big-label { margin: 22px 0 26px; font-weight: 700; }
.home-alt { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.home-alt label.btn { display: inline-flex; align-items: center; }
.linkish { margin-top: 18px; background: none; border: 0; color: var(--accent); font: 700 .92rem var(--ui); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.home-note { margin-top: 28px; font-size: .85rem; color: var(--muted); max-width: 46ch; }

/* ---- spiegazioni: indice in fondo alla home ---- */
.teoria-idx { align-self: stretch; text-align: left; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.t-idx-h { font-size: 1.45rem; }
.t-idx-sub { color: var(--muted); margin: 6px 0 22px; max-width: 60ch; }
.t-block { margin-top: 26px; }
.t-block h3 { display: flex; align-items: center; gap: 10px; font: 700 1.05rem var(--display); margin: 0 0 10px; }
.t-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 .85rem var(--ui); flex: none; }
.t-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.t-list li + li { border-top: 1px solid var(--line); }
.t-row { display: grid; grid-template-columns: 22px 1fr auto; grid-template-areas: "ico title soon" "ico area soon"; column-gap: 12px; align-items: center; padding: 11px 14px; color: var(--ink); text-decoration: none; }
.t-row:hover { background: var(--bg); }
.t-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.t-row .t-ico { grid-area: ico; }
.t-title { grid-area: title; font-weight: 700; line-height: 1.3; }
.t-area { grid-area: area; font-size: .78rem; color: var(--muted); }
.t-soon { grid-area: soon; font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.t-ico { color: var(--area, var(--accent)); flex: none; }
.t-aritmetica { --area: var(--a-aritmetica); } .t-algebra { --area: var(--a-algebra); } .t-geometria { --area: var(--a-geometria); }
.t-analisi { --area: var(--a-analisi); } .t-probabilita { --area: var(--a-probabilita); } .t-discreta { --area: var(--a-discreta); }

/* ---- spiegazioni: pagina della scheda ---- */
.teoria { padding-block: 4px 8px; }
.t-crumb { display: flex; align-items: center; gap: 8px; margin: 28px 0 8px; color: var(--area); font-weight: 700; font-size: .85rem; }
.t-h1 { margin-bottom: 18px; }
.t-solve { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.t-solve-h { margin: 0 0 12px; font-weight: 700; }
.t-solve-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.t-solve-btns .btn { display: inline-flex; align-items: center; gap: 8px; }
.t-try { margin: 14px 0 0; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.t-chip { font: 1.05rem var(--math); background: var(--chip-bg); color: var(--ink); border: 0; border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.t-chip:hover { background: var(--accent-soft); }
.t-body { margin-top: 30px; font-size: 1.02rem; line-height: 1.6; }
.t-body p { margin: 0 0 12px; max-width: 64ch; }
.t-intro { font-size: 1.08rem; }
.t-sec { margin-top: 30px; }
.t-sec h2 { margin-bottom: 10px; }
.t-body .math { font-size: 1.12em; }
.t-rule { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 4px 0 14px; padding: 12px 16px; border-left: 4px solid var(--area, var(--accent)); background: var(--surface); border-radius: 0 10px 10px 0; }
.t-rule .math { font-size: 1.3rem; }
.t-rule-note { color: var(--muted); font-size: .92rem; }
.t-ex { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.t-ex-lbl { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.t-ex-note { color: var(--muted); font-size: .92rem; }
.t-fig { margin: 6px 0 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.t-fig svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; overflow: visible; }
.t-fig figcaption { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.t-fig .f-l { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.t-fig .f-a { fill: var(--area, var(--accent)); fill-opacity: .16; stroke: var(--area, var(--accent)); stroke-width: 2; stroke-linejoin: round; }
.t-fig .f-s { fill: var(--area, var(--accent)); fill-opacity: .55; stroke: none; }
.t-fig .f-d { fill: none; stroke: var(--area, var(--accent)); stroke-width: 1.6; stroke-dasharray: 5 4; }
.t-fig .f-g { fill: none; stroke: var(--line); stroke-width: 1; }
.t-fig .f-k { fill: none; stroke: var(--area, var(--accent)); stroke-width: 2; }
.t-fig .f-t { fill: var(--ink); font: 600 15px var(--ui); }
.t-fig .f-m { fill: var(--muted); font: 13px var(--ui); }
.t-fig .f-x { fill: var(--ink); font: italic 16px var(--math); }
.t-tip { background: var(--ok-bg); color: var(--ink); padding: 10px 14px; border-radius: 10px; }
.t-tip b { color: var(--ok); }
.t-steps { margin: 0; padding-left: 22px; }
.t-steps li { margin-bottom: 8px; }
.t-steps li .math { margin-right: 12px; }
.t-warn ul { margin: 0; padding-left: 20px; }
.t-warn li { margin-bottom: 6px; }
.t-warn h2 { color: var(--warn); }
.t-prova { display: flex; flex-wrap: wrap; gap: 8px; }
.t-wip { background: var(--chip-bg); padding: 14px 16px; border-radius: 12px; }
.t-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 40px; }
.t-nav-a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.3; }
.t-nav-a span { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); margin-bottom: 2px; }
.t-nav-a:hover { border-color: var(--muted); }
.t-next { text-align: right; }
@media (max-width: 480px) { .t-nav { grid-template-columns: 1fr; } .t-next { text-align: left; } }
.ph-status { margin: 0 0 12px; }
.sticky-action { position: sticky; bottom: 0; padding: 4px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (prefers-reduced-motion: reduce) { .cam-big { transition: none; } }
.qtag { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.qins { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft, transparent); color: var(--accent); font: inherit; font-size: .72rem; cursor: pointer; }
.qins.off { border-color: var(--line); color: var(--muted); background: none; text-decoration: line-through; }
.box.reading { border-color: rgba(39, 71, 201, .45); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { background: rgba(39, 71, 201, .14); } }
.qread { color: var(--muted); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .box.reading { animation: none; } }
.seq-raw { margin-top: 4px; }
.seq-raw summary { font-size: .82rem; }
.seq-raw code { display: block; margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--surface); font: .8rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.qagree { margin-left: 8px; font-weight: 700; color: var(--muted); }
.qagree.ok { color: var(--ok); }
.qagree.warn { color: var(--warn); }
.seq-alt { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.alt-lbl { font-size: .82rem; color: var(--muted); }
.alt { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; max-width: 100%; overflow-x: auto; }
.alt .math { white-space: nowrap; }
.alt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.alt-n { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.seq-raw code { white-space: pre-wrap; }
.retake { margin: 4px 0 12px; padding: 14px 16px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn); }
.retake-h { font-size: 1.1rem; color: var(--warn); margin: 0 0 6px; }
.retake-list { margin: 0 0 12px; padding-left: 1.2em; }
.retake-list li { margin: 4px 0; }
.retake-list li.avviso { color: var(--muted); }
.retake-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-status .btn { margin-left: 8px; vertical-align: middle; }

.cam-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px; background: linear-gradient(rgba(0,0,0,.6), transparent); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cam-meter { width: min(260px, 70%); height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.cam-meter-bar { height: 100%; width: 0; background: #f2a660; transition: width .12s linear, background .2s; }
.cam-meter-bar.ok { background: #6fd39b; }
.cam-meter-bar.bad { background: #ff7a6b; }
.cam-hint { margin: 0; color: #fff; font-size: .95rem; text-align: center; text-shadow: 0 1px 3px #000; min-height: 1.4em; }
.cam-opts { display: flex; gap: 8px; }
.cam-chip { font: 700 .8rem var(--ui); color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.cam-chip[aria-pressed="true"] { background: #fff; color: #111; border-color: #fff; }
.cam-focus { position: fixed; width: 64px; height: 64px; border: 2px solid #ffd84d; border-radius: 10px; pointer-events: none; z-index: 51; }
@media (prefers-reduced-motion: reduce) { .cam-meter-bar { transition: none; } }
.shutter.pressed { transform: scale(.9); background: rgba(255,255,255,.6); }
.shutter { transition: transform .1s; touch-action: none; -webkit-user-select: none; user-select: none; }
.seq-check { margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.seq-check.ok { background: var(--ok-bg); color: var(--ok); }
.seq-check.bad { background: var(--warn-bg); color: var(--warn); }
.seq-check .math { font-size: 1.05rem; color: var(--ink); }
.seq-ops { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: .9rem; background: var(--warn-bg); color: var(--warn); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.seq-ops .math { color: var(--ink); }
.seq-ops .ops-expr { flex-basis: 100%; font-size: 1.05rem; overflow-x: auto; white-space: nowrap; }

/* ---- azioni sullo svolgimento ---- */
.sol-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-row > #ph-solve { flex: 2 1 220px; }
.action-row > .pdf-btn { flex: 1 1 140px; }
.pdf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* ---- fascicolo stampabile (PDF) ---- */
/* Stili del fascicolo fuori da @media print: servono anche per misurare le espressioni
   alla larghezza della pagina A4 prima di aprire la stampa. */
#print-area { display: none; }
#print-area.measuring { display: block; position: absolute; left: -10000px; top: 0; width: 182mm; visibility: hidden; }
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body.printing { background: #fff !important; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; }
}
#print-area, .pdf-pages {
  --ink: #111; --muted: #555; --line: #bbb; --hl-bg: #fff3a6; --ok: #146c3c; --warn: #9a4a06; --surface: #fff; --accent: #2747c9;
  --k: 1; /* riduzione delle espressioni troppo lunghe */
  background: #fff; color: var(--ink); font-family: var(--ui); font-size: 11pt; line-height: 1.45;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pr-head { border-bottom: 2px solid #111; padding-bottom: 5px; margin-bottom: 10px; }
.pr-head h1 { font-size: 15pt; }
.pr-head p { margin: 1px 0 0; color: var(--muted); font-size: 9pt; }
.pr-ex { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1.5px solid #111; }
/* due colonne: calcolo a sinistra, regola a destra */
.pr-row { display: grid; grid-template-columns: 56% 44%; break-inside: avoid; }
.pr-row > .pr-ex-l { min-width: 0; padding: 4px 10px 5px 0; border-top: 1px dotted var(--line); }
.pr-row > .pr-ex-r { padding: 4px 0 5px 10px; border-top: 1px dotted var(--line); border-left: 1px solid var(--line); font-size: 8pt; line-height: 1.35; color: #333; }
.pr-top { align-items: end; break-after: avoid; }
.pr-colh { padding-left: 10px; font-size: 7.5pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pr-title { font-size: 11.5pt; margin: 0; }
.pr-start { font-size: calc(12pt * var(--k)); margin: 2px 0 4px; width: 56%; padding-right: 10px; white-space: nowrap; break-after: avoid; }
.pr-n { display: inline-grid; place-items: center; min-width: 13pt; height: 13pt; margin-right: 6px; border: 1px solid #111; border-radius: 50%; font: 700 7.5pt var(--ui); color: #111; vertical-align: middle; }
.pr-detail { font-size: calc(9pt * var(--k)); color: var(--muted); white-space: nowrap; }
.pr-detail .note { display: block; font-family: var(--ui); font-size: 7.5pt; margin: 1px 0 0 19pt; white-space: normal; }
.pr-line { display: flex; gap: 6px; align-items: center; margin: 2px 0 0 19pt; font-size: calc(11pt * var(--k)); white-space: nowrap; }
.pr-eq { font-family: var(--math); color: var(--muted); }
.pr-rname { font-weight: 700; font-size: 8.5pt; color: #111; }
.pr-ex-r .pr-f { color: #111; font-size: 8.5pt; margin: 1px 0; }
.pr-ex-r p { margin: 2px 0 0; }
.pr-err { color: var(--warn); }
.pr-end { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; break-inside: avoid; }
.pr-result { display: flex; gap: 10px; align-items: center; padding: 4px 9px; border: 1.5px solid #111; border-radius: 5px; }
.pr-result > span:first-child { font-size: 7.5pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pr-result .math { font-size: 12.5pt; }
.pr-check { margin: 0; font-size: 8.5pt; }
.pr-check.ok { color: var(--ok); }
.pr-check.bad { color: var(--warn); }
.pr-miss { color: var(--muted); font-style: italic; font-size: 9pt; }
.pr-task { margin: 0 0 1px; font: 700 7.5pt var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pr-phase { margin: 8px 0 1px; font: 700 7.5pt var(--ui); letter-spacing: .08em; text-transform: uppercase; color: #2747c9; break-after: avoid; }
.pr-plan { margin: 0 0 6px; font-size: 8.5pt; color: #333; }
.pr-plan b { font-size: 7.5pt; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.pr-plan-i { white-space: nowrap; }
.pr-detail + .pr-detail { margin-top: 2px; }
.pr-n-sub { visibility: hidden; }
.pr-row-cont > .pr-ex-l, .pr-row-cont > .pr-ex-r { border-top: 0; padding-top: 0; }
.pr-rule-i + .pr-rule-i { margin-top: 4px; padding-top: 3px; border-top: 1px dotted var(--line); }
.pr-basic { font-weight: 400; color: var(--muted); }
#print-area .hl, .pdf-pages .hl { box-shadow: none; }
/* html2canvas dipinge le frazioni (inline-flex) sotto lo sfondo evidenziato: posizionate restano sopra */
.pdf-pages .hl .fr, .pdf-pages .hl sup, .pdf-pages .hl sub { position: relative; z-index: 1; }
/* pagine A4 per il file PDF, fuori dallo schermo */
.pdf-pages { position: absolute; left: -10000px; top: 0; }
.pdf-page { width: 182mm; height: 265mm; overflow: hidden; background: #fff; margin-bottom: 10px; }
.pr-split { border-bottom: 0; margin-bottom: 0; }
/* finestra del PDF */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 24, .5); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.sheet-card { width: 100%; max-width: 440px; background: var(--surface); color: var(--ink); border-radius: 16px; padding: 18px 16px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.sheet-card p { margin: 6px 0 14px; color: var(--muted); }
.sheet-actions { display: grid; gap: 8px; }
.sheet-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; }
.sheet-close { display: block; margin: 10px auto 0; }
@media (min-width: 640px) { .sheet { align-items: center; } }
.sol-pdf { margin-top: 14px; }
/* esercizio con espressioni troppo lunghe: una colonna, spiegazione sotto ogni passaggio */
.pr-one .pr-row { grid-template-columns: 100%; }
.pr-one .pr-colh { display: none; }
.pr-one .pr-start { width: auto; }
.pr-one .pr-row > .pr-ex-l { padding-right: 0; }
.pr-one .pr-row > .pr-ex-r { border-top: 0; border-left: 2px solid var(--line); margin: 0 0 4px 19pt; padding: 1px 0 1px 8px; }
/* ultima risorsa, se non sta nemmeno su tutta la riga: si va a capo */
.pr-wrap .pr-line, .pr-wrap .pr-detail, .pr-wrap .pr-start { white-space: normal; flex-wrap: wrap; }
.pr-wrap .pr-line { display: block; }
.pr-wrap .pr-eq { margin-right: 6px; }

/* tabella della regola di Ruffini */
table.ruffini { border-collapse: collapse; margin: 4px 0 6px; font-family: var(--math); font-size: .95em; }
table.ruffini td { padding: 2px 8px; text-align: right; min-width: 1.6em; }
table.ruffini td.rf-r { border-right: 1.5px solid currentColor; font-weight: 700; }
table.ruffini tr:nth-child(1) td:first-child, table.ruffini tr:nth-child(3) td:first-child { border-right: 1.5px solid currentColor; }
table.ruffini td.rf-last { border-left: 1.5px solid currentColor; }
table.ruffini tr:nth-child(2) td { border-bottom: 1.5px solid currentColor; }
table.ruffini tr.rf-res td.rf-last { font-weight: 700; }
#to-factor { margin-top: 12px; }

.result .ce { margin: 6px 0 0; font-size: .92rem; color: var(--muted); }

/* ---- disequazioni e sistemi ---- */
.nl-wrap { overflow-x: auto; margin: 6px 0; max-width: 100%; }
svg.nline { display: block; max-width: 100%; height: auto; font-family: var(--math); }
.nl-guide { stroke: var(--line); stroke-dasharray: 3 3; }
.nl-lbl, .nl-row { fill: var(--ink); font-size: 12px; }
.nl-row { fill: var(--muted); font-family: var(--ui); font-size: 11px; }
.nl-axis { stroke: var(--muted); stroke-width: 1; }
.nl-sol { stroke: var(--accent); stroke-width: 4; stroke-linecap: butt; opacity: .55; }
.nl-sol.nl-final { opacity: 1; stroke: var(--ok); }
.nl-in { fill: var(--ink); stroke: var(--ink); stroke-width: 1.5; }
.nl-out { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.result .intv { margin: 4px 0 0; font-family: var(--math); font-size: 1.05rem; }
.sg-wrap { overflow-x: auto; max-width: 100%; margin: 4px 0; }
table.signs { border-collapse: collapse; font-family: var(--math); font-size: .95em; }
table.signs th, table.signs td { padding: 2px 6px; text-align: center; white-space: nowrap; }
table.signs th:first-child { text-align: right; padding-right: 10px; border-right: 1.5px solid currentColor; font-weight: 400; }
table.signs tr:first-child th { border-bottom: 1.5px solid currentColor; font-weight: 700; }
table.signs td.sg-p { color: var(--ok); font-weight: 700; }
table.signs td.sg-m { color: var(--warn); font-weight: 700; }
table.signs .sg-pt { border-left: 1px dashed var(--line); border-right: 1px dashed var(--line); min-width: 1.2em; }
table.signs th.sg-gap { min-width: 1.4em; }
table.signs tr.sg-tot { border-top: 1.5px solid currentColor; }
table.signs tr.sg-tot th { font-weight: 700; }
.sg-den { font-family: var(--ui); font-size: .75em; color: var(--muted); }
.sys { display: inline-flex; flex-direction: column; gap: 2px; border-left: 2px solid currentColor; border-radius: 10px 0 0 10px; padding: 2px 0 2px 10px; vertical-align: middle; }
.sys-row { display: block; white-space: nowrap; }
.det { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
table.mat { border-collapse: collapse; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; font-family: var(--math); display: inline-table; vertical-align: middle; }
table.mat td { padding: 1px 8px; text-align: right; }
.pr-detail .nl-wrap, .pr-detail .sg-wrap { white-space: normal; overflow: visible; }
.pr-detail table.signs { font-size: calc(8.5pt * var(--k)); color: var(--ink); }
.pr-detail svg.nline { width: 70mm; }
.pr-end .nl-wrap svg.nline { width: 70mm; }
.pr-intv { font-family: var(--math); font-size: 11pt; }

/* ---- triangoli ---- */
table.tri { border-collapse: collapse; margin: 4px 0 8px; font-family: var(--math); font-size: .95em; }
.big table.tri { font-size: .62em; }
.tri-h { font-family: var(--ui); font-size: .5em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
table.tri td { padding: 3px 10px 3px 0; white-space: nowrap; }
table.tri tr:last-child td { font-size: .9em; color: var(--muted); padding-top: 4px; }
.sl .line { min-width: 0; flex: 1 1 auto; }
.step .sd { overflow-x: auto; max-width: 100%; }
/* segno di integrale */
.int { font-size: 1.35em; line-height: 1; vertical-align: -0.12em; font-style: normal; }
/* studio di funzione */
.study { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; font-size: .92rem; }
svg.plot { max-width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--muted, #666); }
svg.plot .crv { stroke: var(--accent); }
svg.plot .asy { stroke: var(--warn); }
svg.plot .pt-ext { fill: var(--ok, #16a34a); }
svg.plot .pt-flex { fill: var(--warn, #d97706); }
svg.plot .pt-ax { fill: currentColor; }
svg.plot .pt-hole { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
table.study-t { border-collapse: collapse; font-family: var(--math); }
table.study-t th { text-align: left; padding: 3px 10px 3px 0; font-family: var(--ui, inherit); font-weight: 600; font-size: .85em; white-space: nowrap; vertical-align: top; }
table.study-t td { padding: 3px 0; }
.steps table.signs { margin: 6px 0; }
table.signs td.sg-no { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--line) 3px 4px); }
svg.plot .grid { stroke: var(--line); stroke-width: .6; }
svg.plot .ln { stroke: var(--muted); stroke-width: 1.6; }
svg.plot .ln-new { stroke: var(--accent); stroke-width: 2.2; }
svg.plot .seg { stroke: var(--accent); stroke-width: 2.4; }
svg.plot .poly { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.cart-res { font-family: var(--math); font-size: 1.15rem; line-height: 1.6; }
svg.plot .pt-none { display: none; }
svg.plot .asy-l { stroke: var(--warn); stroke-dasharray: 5 4; stroke-width: 1.2; }
svg.plot .ln-f { stroke: var(--muted); stroke-width: 0.8; opacity: .45; stroke-dasharray: 3 3; }
svg.plot .crv-f { stroke: var(--muted); stroke-width: 1; opacity: .5; }
svg.plot .crv-g { stroke: var(--muted); stroke-width: 1.8; }
svg.plot .crv-r { stroke: var(--warn); stroke-width: 2.2; }
svg.plot .ln-g { stroke: var(--warn); stroke-width: 1.8; }
svg.plot .area-fill { fill: var(--accent-soft, rgba(39,71,201,.18)); stroke: none; }
svg.plot .crv2 { stroke: var(--warn); }
svg.plot .solid-l { stroke: var(--accent); stroke-dasharray: 4 3; stroke-width: 1.4; }
svg.plot .bar { fill: var(--line); }
svg.plot .bar-on { fill: var(--accent); }
.wrap-t { white-space: normal; display: inline-block; font-size: .8em; line-height: 1.35; }
table.ladder { border-collapse: collapse; margin: 6px 0; font-family: var(--math); }
table.ladder td { padding: 1px 10px; text-align: right; }
table.ladder td:first-child { border-right: 1.5px solid currentColor; }
table.ruff { border-collapse: collapse; margin: 6px 0; font-family: var(--math); }
table.ruff td { padding: 2px 8px; text-align: center; }
table.ruff td:first-child { border-right: 1.5px solid currentColor; }
table.ruff tr.ruff-r td { border-top: 1.5px solid currentColor; }
table.ruff td.ruff-rest { border-left: 1.5px solid currentColor; font-weight: 700; }
/* matrici */
.mat { display: inline-block; vertical-align: middle; margin: 3px 4px; padding: 0 3px; border-left: 1.6px solid currentColor; border-right: 1.6px solid currentColor; border-radius: 7px; }
.mat table { border-collapse: collapse; }
.mat td { padding: 1px 7px; text-align: center; font-family: var(--math); }
.mat td.aug { border-left: 1px solid currentColor; }
/* le formule dentro il testo non vanno a capo a metà (per esempio fra 3 e il segno >) */
.t-body p:not(.t-ex) .math, .t-warn li .math, .t-steps .t-ex-note .math, .t-fig figcaption .math { white-space: nowrap; }
/* tabelle delle schede (derivate, integrali, formule) */
.t-tabwrap { overflow-x: auto; margin: 4px 0 14px; }
.t-tab { border-collapse: collapse; min-width: 60%; margin: 0 auto; }
.t-tab th { text-align: left; font-weight: 600; color: var(--muted); font-size: .9rem; padding: 6px 14px; border-bottom: 2px solid var(--line); }
.t-tab td { padding: 7px 14px; border-bottom: 1px solid var(--line); }
.t-lim { font-family: var(--math); white-space: nowrap; }
/* matrici scritte nel testo delle schede */
.t-mat { display: inline-table; vertical-align: middle; border-collapse: separate; border-spacing: 8px 2px; border-left: 2px solid currentColor; border-right: 2px solid currentColor; border-radius: 6px; margin: 2px 4px; font-family: var(--math); }
.t-mat td { text-align: center; padding: 0 2px; }
/* installazione dell'app */
.install { margin: 14px auto 0; text-align: center; }
.install .btn svg { margin-right: 6px; vertical-align: -3px; }
.install-ios { font-size: .92rem; max-width: 30em; margin: 0 auto; }
/* sotto la soluzione: le spiegazioni da ripassare */
.ripassa { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.ripassa .lbl { width: 100%; }
.ripassa-a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.ripassa-a:hover { border-color: var(--accent); }
.ripassa-a svg { color: var(--accent); flex: none; }
/* Allenati */
.t-allena .al-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.al-q { font-size: 1.15rem; margin-bottom: 12px; }
.al-q .math { font-size: 1.25rem; }
.al-form { display: flex; gap: 8px; }
.al-in { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.al-in:focus { outline: none; border-color: var(--accent); }
.al-keys { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.al-key { min-width: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: 1rem var(--math); cursor: pointer; }
.al-hint { font-size: .88rem; margin: 6px 0 0; }
.al-fb { margin: 10px 0 0; min-height: 1.4em; }
.al-fb.al-ok { color: var(--ok); }
.al-fb.al-no { color: var(--warn); }
.al-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.al-score { font-size: .88rem; margin: 10px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* condividere */
.t-share-row { margin: -4px 0 14px; }
.btn svg { vertical-align: -3px; margin-right: 6px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.al-lv { margin-bottom: 14px; }
.al-up { display: block; margin-top: 4px; color: var(--ink); }
/* simboli: spiegazione al passaggio del mouse e pagina con l'elenco */
abbr.sym { text-decoration: none; cursor: help; }
.math .sym:hover, .math [title]:hover { background: var(--hl-bg); border-radius: 3px; }
.sim-tab td { vertical-align: top; }
.sim-tab .sim-s { font: 600 1.15rem var(--math); white-space: nowrap; }
.sim-tab code { font-size: .88rem; white-space: nowrap; }
.help-sym { margin: 6px 0 4px; font-size: .92rem; }
.t-simboli { font-size: .9rem; margin-top: 18px; }
