/* Simulatore di chimica - stessa grafica e barra standard degli altri simulatori (23/10/2026) */
.ch { --bg:#fbfcfe; --pn:#ffffff; --panel:#f6f8fb; --field:#ffffff; --bd:#d3dbe6; --tx:#1f2937; --mu:#64748b; --ac:#2563eb; --ac2:#e8f0fe; --ok:#15803d; --okbg:#dcfce7; --bad:#dc2626; --warn:#b45309; --cv:#fbfcfe; --wire:#9aa7b8; --hov:rgba(15,23,42,.05); --shadow:0 14px 40px rgba(15,23,42,.22); --menu:#ffffff;
  --gr:#15803d; --tl:#0d9488; --vi:#7c3aed; --an:#2563eb; --water:#4f9cf7; --dot:rgba(15,23,42,.17); --ink:#1f2933;
  --c1:#2563eb; --c2:#16a34a; --c3:#d97706; --c4:#9333ea; --c5:#dc2626; --c6:#0891b2; --c7:#be185d; --c8:#65a30d;
  font-family:inherit; color:var(--tx); position:relative; text-align:left; font-size:.92rem; container-type:inline-size; display:block; width:100%; }
.ch[data-tema="scuro"] { --bg:#0b0d11; --pn:#14181f; --panel:rgba(255,255,255,.035); --field:rgba(255,255,255,.08); --bd:rgba(255,255,255,.14); --tx:#e8edf4; --mu:#9fb0c4; --ac:#4f8dfd; --ac2:#172033; --ok:#4ade80; --okbg:#0f3a2c; --bad:#f87171; --warn:#fbbf24; --cv:#0b0e13; --wire:#5d6a7d; --hov:rgba(255,255,255,.07); --shadow:0 14px 40px rgba(0,0,0,.55); --menu:#0f1217;
  --gr:#4ade80; --tl:#2dd4bf; --vi:#a78bfa; --an:#6aa8ff; --water:#3b82f6; --dot:rgba(255,255,255,.16); --ink:#e8edf4;
  --c1:#60a5fa; --c2:#34d399; --c3:#fbbf24; --c4:#c084fc; --c5:#f87171; --c6:#22d3ee; --c7:#f472b6; --c8:#a3e635; }
.ch *, .ch *::before, .ch *::after { box-sizing:border-box; }
.ch svg { flex:none; } .ch button { font:inherit; color:inherit; } .ch [hidden] { display:none !important; }
.chMu { color:var(--mu); font-size:.84rem; line-height:1.45; }
/* barra strumenti */
.chTb { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:0 0 6px; margin-bottom:6px; border:0; border-radius:0; background:none; }
.chBtn { display:inline-flex; align-items:center; justify-content:center; height:36px; min-width:36px; padding:0 8px; border:1px solid transparent; border-radius:9px; background:transparent; color:var(--tx); cursor:pointer; transition:background .12s,border-color .12s; }
.chBtn svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.chBtn:hover:not(:disabled) { background:var(--hov); }
.chBtn:disabled { opacity:.35; cursor:default; }
.chBtn:focus-visible, .chSpeed:focus-visible, .chPalI:focus-visible, .chPT:focus-visible { outline:2px solid var(--ac); outline-offset:2px; }
.chBtn[aria-pressed="true"] { background:color-mix(in srgb, var(--ac) 20%, transparent); border-color:var(--ac); color:var(--ac); }
.chBtn.chPlay { width:44px; background:#16a34a; color:#fff; border-color:#15803d; }
.chBtn.chPlay:hover:not(:disabled) { background:#15803d; }
.chBtn.chPlay.on { background:#dc2626; border-color:#b91c1c; } .chBtn.chPlay.on:hover { background:#b91c1c; }
.chSpeed, .ch select, .ch input[type=text], .ch input[type=search], .ch input[type=number] { height:34px; padding:0 9px; font:inherit; font-size:.86rem; border:1px solid var(--bd); border-radius:8px; background:var(--field); color:inherit; outline:none; }
.chSpeed { height:36px; width:auto; min-width:70px; }
.ch input:focus, .ch select:focus { border-color:var(--ac); box-shadow:0 0 0 3px color-mix(in srgb, var(--ac) 25%, transparent); }
.ch option { color:#111; background:#fff; }
.chSep { width:1px; height:24px; background:var(--bd); margin:0 5px; }
.chSp { flex:1; }
.chStat { display:inline-flex; align-items:center; gap:7px; font-size:.82rem; color:var(--mu); padding:0 8px; }
.chLed { width:9px; height:9px; border-radius:50%; background:var(--bd); display:inline-block; }
.chStat.on .chLed { background:var(--ok); box-shadow:0 0 8px var(--ok); } .chStat.on { color:var(--ok); }
.chSt { font-weight:700; font-variant-numeric:tabular-nums; }
.chB { display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 12px; font-size:.86rem; border:1px solid var(--bd); border-radius:9px; background:var(--field); color:var(--tx); cursor:pointer; }
.chB:hover:not(:disabled) { border-color:var(--ac); }
.chB.primary { background:var(--ac); border-color:var(--ac); color:#fff; font-weight:600; }
.chB.del { color:var(--bad); } .chB.del:hover { border-color:var(--bad); }
/* corpo */
.chBody { display:grid; gap:10px; align-items:stretch; }
.chPal, .chProp { display:flex; flex-direction:column; min-height:0; border:1px solid var(--bd); border-radius:12px; background:var(--panel); overflow:hidden; }
.chPalH { padding:10px 10px 0; }
.chSearch { position:relative; display:block; } .chSearch svg { position:absolute; left:10px; top:50%; width:16px; height:16px; transform:translateY(-50%); fill:none; stroke:var(--mu); stroke-width:2; stroke-linecap:round; pointer-events:none; }
.ch .chSearch input { width:100%; height:36px; padding:0 10px 0 33px; border-radius:999px; }
.chPalT { display:grid; grid-template-columns:repeat(5,1fr); gap:3px; padding:8px; border-bottom:1px solid var(--bd); }
.chPT { min-width:0; height:30px; box-sizing:border-box; padding:0; border-radius:9px; border:1px solid transparent; background:transparent; color:var(--mu); display:grid; place-items:center; cursor:pointer; }
.chPT .chMini { width:18px; height:18px; color:inherit; } .chPT .chMini svg { width:18px; height:18px; }
.chPT:hover { background:var(--hov); }
.chPT.on { background:color-mix(in srgb, var(--ac) 14%, transparent); color:var(--ac); border-color:color-mix(in srgb, var(--ac) 45%, transparent); }
.chPalL { flex:1; overflow:auto; padding:6px 8px 12px; }
.chPalS { display:flex; align-items:baseline; justify-content:space-between; gap:6px; padding:6px 4px 8px; font-size:.92rem; font-weight:700; line-height:1.25; color:var(--tx); } .chPalS small { color:var(--mu); font-weight:400; }
.chPalI { min-width:0; display:flex; align-items:center; gap:8px; padding:4px 8px 4px 4px; margin-bottom:4px; border-radius:10px; border:1px solid transparent; background:transparent; cursor:grab; user-select:none; touch-action:none; font-size:.8rem; line-height:1.2; color:var(--tx); }
.chPalI:hover { background:var(--hov); border-color:var(--bd); }
.chMini { flex:none; width:52px; height:34px; display:flex; align-items:center; justify-content:center; color:var(--ink); } .chMini svg { width:100%; height:100%; display:block; }
.chPalI .chMini { box-sizing:border-box; background:var(--field); border:1px solid var(--bd); border-radius:8px; padding:2px; }
.chPalTip { font-size:.74rem; color:var(--mu); padding:8px 12px 10px; line-height:1.4; border-top:1px solid var(--bd); }
/* lavagna */
.chZl { position:absolute; right:10px; bottom:10px; z-index:5; padding:3px 10px; border-radius:999px; background:var(--menu); border:1px solid var(--bd); font-size:.76rem; color:var(--mu); pointer-events:none; font-variant-numeric:tabular-nums; }
/* pannello proprieta' */
.chPSt { font-size:.78rem; color:var(--mu); display:flex; align-items:center; gap:6px; } .chPSt i { width:8px; height:8px; border-radius:50%; background:var(--mu); display:inline-block; } .chPSt.ok i { background:var(--ok); } .chPSt.wait i { background:var(--warn); } .chPSt.err i { background:var(--bad); }
/* blocchi */
/* scope */
/* finestre e menu */
.chModal { position:absolute; inset:0; z-index:80; display:flex; align-items:flex-start; justify-content:center; padding:70px 14px 14px; background:rgba(5,8,14,.55); }
.chMBox { width:min(480px,100%); max-height:80vh; overflow:auto; border:1px solid var(--bd); border-radius:14px; background:var(--menu); box-shadow:var(--shadow); }
.chMH { display:flex; align-items:center; justify-content:space-between; padding:10px 10px 10px 16px; border-bottom:1px solid var(--bd); }
.chMX { font:inherit; font-size:1.3rem; line-height:1; border:0; background:none; color:var(--mu); cursor:pointer; padding:0 6px; }
.chMB { padding:14px 16px; font-size:.9rem; line-height:1.5; } .chMB p { margin:0; }
.chMF { display:flex; justify-content:flex-end; gap:8px; padding:10px 16px 14px; }
.chList { list-style:none; margin:0; padding:0; display:grid; gap:6px; } .chList li { display:flex; gap:6px; }
.chOpenI { flex:1; display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:9px 12px; border:1px solid var(--bd); border-radius:9px; background:var(--field); cursor:pointer; text-align:left; } .chOpenI:hover { border-color:var(--ac); } .chOpenI small { color:var(--mu); }
.chFlash { position:absolute; left:50%; bottom:54px; transform:translate(-50%,10px); background:var(--tx); color:var(--pn); padding:9px 16px; border-radius:10px; font-size:.84rem; opacity:0; pointer-events:none; transition:.2s; z-index:90; max-width:90%; }
.chFlash.on { opacity:1; transform:translate(-50%,0); }
.chPop { position:absolute; z-index:60; width:300px; max-height:75%; overflow:auto; background:var(--menu); border:1px solid var(--bd); border-radius:12px; box-shadow:var(--shadow); padding:6px; }
.chPop button { display:flex; flex-direction:column; align-items:flex-start; gap:2px; width:100%; text-align:left; background:none; border:0; border-radius:8px; padding:8px 10px; color:var(--tx); cursor:pointer; }
.chPop button:hover { background:var(--hov); }
.chPop b { display:block; font-size:.86rem; } .chPop small { color:var(--mu); font-size:.78rem; line-height:1.3; display:block; }
.chPop button.cur b::after { content:" ✓"; color:var(--ac); }
.chPop button i { width:7px; height:7px; border-radius:50%; flex:none; margin-top:6px; } .chPop button span { display:block; min-width:0; }
.chPop button { flex-direction:row; align-items:flex-start; gap:10px; }
.chTb .chBtn.chVecB { width: auto; padding: 0 12px; }
.chTb .chBtn svg { width: 19px !important; height: 19px !important; flex: none; }
.chTb .chSpeed { box-sizing: border-box; height: 36px; }
.chTb .chSpeed { width: 80px; max-width: 80px; }
/* 23/10/2026: telefono (contenitore <= 700px): barra su una riga con menu ⋮ e palette a sole icone */
.ch.xMob .chTb { flex-wrap: nowrap; overflow: hidden; position: relative; }
.ch.xMob .chTb > * { flex: none; }
.ch.xMob .chTb .xMore { margin-left: auto; }
.ch.xMob .chTb .xMore svg { fill: currentColor; stroke: none; }
.ch.xMob .chSp, .ch.xMob .chStat { display: none; }
.ch .xMore[hidden], .ch .xPop[hidden] { display: none; }
.ch .xPop { position: fixed; z-index: 2000; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; width: max-content; max-width: calc(100vw - 16px); padding: 8px; border: 1px solid var(--bd); border-radius: 12px; background: var(--menu); box-shadow: 0 10px 30px rgba(0,0,0,.28); }
.ch .xPop [class*="Sep"] { display: none; }
.ch.xMob .chPal { position: relative; overflow: visible; height: auto; }
.ch.xMob .chPalT { border-bottom: 0; }
.ch.xMob .xPalOv { display: none; }
.ch.xMob.xPalOpen .xPalOv { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; max-height: min(62vh, 440px); border: 1px solid var(--bd); border-radius: 12px; background: var(--menu); box-shadow: 0 12px 32px rgba(0,0,0,.3); overflow: hidden; }
.ch.xMob .xPalOv .chPalL { flex: 1; min-height: 0; max-height: none; overflow: auto; }
.ch.xMob .chPalI { touch-action: pan-y; }

/* ---- layout simulatore web ---- */
.ch { --ed:#ffffff; --gut:#f3f5f9; --curl:rgba(37,99,235,.06); --errbg:rgba(220,38,38,.14);
  --hk:#7c3aed; --hs:#b45309; --hc:#6b7a8d; --hn:#0e7490; --hf:#1d4ed8; --hr:#be185d; --hg:#0f766e; --hq:#7c3aed; --hp:#0369a1; --ht:#be123c; --ha:#b45309; --hv:#15803d; --hx:#6b7a8d; --hsc:#b45309; --hsi:#be123c; --hsp:#7c3aed; --he:#0e7490; }
.ch[data-tema="scuro"] { --ed:#0d1117; --gut:#10151c; --curl:rgba(255,255,255,.045); --errbg:rgba(248,113,113,.2);
  --hk:#c792ea; --hs:#ecc48d; --hc:#6b7a8d; --hn:#f78c6c; --hf:#82aaff; --hr:#f78fb3; --hg:#5ccfe6; --hq:#c792ea; --hp:#7fdbca; --ht:#ff7b8b; --ha:#ffcb6b; --hv:#addb67; --hx:#6b7a8d; --hsc:#ffcb6b; --hsi:#ff7b8b; --hsp:#c792ea; --he:#5ccfe6; }
.ch .hk{color:var(--hk)} .ch .hs{color:var(--hs)} .ch .hc{color:var(--hc);font-style:italic} .ch .hn{color:var(--hn)} .ch .hf{color:var(--hf)} .ch .hr{color:var(--hr)} .ch .hg{color:var(--hg)} .ch .hq{color:var(--hq)}
.ch .hp{color:var(--hp)} .ch .ht{color:var(--ht)} .ch .ha{color:var(--ha)} .ch .hv{color:var(--hv)} .ch .hx{color:var(--hx)} .ch .hsc{color:var(--hsc)} .ch .hsi{color:var(--hsi)} .ch .hsp{color:var(--hsp)} .ch .he{color:var(--he)}
.chBody { grid-template-columns:200px minmax(0,1fr) minmax(0,1fr); grid-template-rows:clamp(560px,82vh,900px); grid-template-areas:"pal code prev"; }
.ch.xMob .chPal { grid-area:pal; }
.ch.xMob .chPalT { grid-template-columns:repeat(4,1fr); }
.chStat { min-width:0; }
.ch .xPop, .ch.xMob.xPalOpen .xPalOv { background:var(--menu); }
@media (prefers-reduced-motion:reduce) { .chFlash { transition:none; } }

/* 23/10/2026: schermo intero (Fullscreen API; su iPhone il simulatore copre tutta la finestra) */
html.xFsLock { overflow: hidden !important; }
.ch.xFs { box-sizing: border-box; padding: 8px 10px; overflow: auto; background: #0b0d11; }
.ch.xFs[data-tema="chiaro"] { background: #f4f6fa; }
.ch.xFs:not(:fullscreen) { position: fixed; inset: 0; z-index: 2147483000; width: auto; }
.ch .xFullB { background: #2563eb; color: #fff; border-color: #2563eb; box-shadow: 0 1px 6px rgba(37,99,235,.45); } .ch .xFullB:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; } .ch .xFullB[aria-pressed="true"] { background: #1e40af; border-color: #1e40af; color: #fff; }
.ch.xFs .chBody { grid-template-rows: calc(100vh - 72px); }
@container (max-width: 900px) { .ch.xFs .chBody { grid-template-rows: auto calc(100vh - 168px); } }

/* ---- layout simulatore di chimica (23/10/2026) ---- */
.ch { --ink:#1f2933; }
.chBody { grid-template-areas:none; grid-template-columns:210px minmax(0,1fr); grid-template-rows:clamp(580px,84vh,920px); }
.chMain { position:relative; min-width:0; min-height:0; border:1px solid var(--bd); border-radius:12px; background:var(--pn); overflow:hidden; }
.chSec { position:absolute; inset:0; overflow:auto; padding:12px; }
.chSec[hidden] { display:none !important; }
/* schede */
.chTabs { display:flex; align-items:center; gap:4px; margin:0 0 8px; border-bottom:1px solid var(--bd); flex-wrap:wrap; }
.chTabs [data-tab] { display:inline-flex; align-items:center; gap:7px; height:40px; padding:0 14px; border:0; border-bottom:3px solid transparent; background:none; color:var(--mu); font-weight:600; cursor:pointer; margin-bottom:-1px; border-radius:8px 8px 0 0; }
.chTabs [data-tab] svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.chTabs [data-tab]:hover { color:var(--tx); background:var(--hov); }
.chTabs [data-tab].on { color:var(--ac); border-bottom-color:var(--ac); }
.chTabs [data-tab]:focus-visible { outline:2px solid var(--ac); outline-offset:-2px; }
.chTabs .chSp { flex:1; }
.chPrj { display:flex; align-items:center; gap:10px; padding-bottom:4px; }
.chPrj .chPN { width:200px; max-width:38vw; height:32px; }
.chPSt { font-size:.78rem; color:var(--mu); display:flex; align-items:center; gap:6px; white-space:nowrap; } .chPSt i { width:8px; height:8px; border-radius:50%; background:var(--mu); display:inline-block; } .chPSt.ok i { background:var(--ok); } .chPSt.wait i { background:var(--warn); } .chPSt.err i { background:var(--bad); }
.chTb .chSp { flex:1; } .chTb .chStat { display:inline-flex; }
/* comuni */
.chMu { color:var(--mu); } .chSmall { font-size:.8rem; line-height:1.4; }
.chFld { display:grid; gap:4px; color:var(--mu); font-size:.8rem; min-width:0; } .chFld > span { font-weight:600; }
.chFld select, .chFld input[type=text] { width:100%; color:var(--tx); }
.chRow { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.chB { white-space:nowrap; } .chB:disabled { opacity:.4; cursor:default; }
.chSeg { display:inline-flex; border:1px solid var(--bd); border-radius:10px; overflow:hidden; background:var(--field); }
.chSeg button { display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 12px; border:0; border-right:1px solid var(--bd); background:none; cursor:pointer; font-size:.84rem; color:var(--tx); }
.chSeg button:last-child { border-right:0; } .chSeg button svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.chSeg button:hover { background:var(--hov); } .chSeg button.on { background:var(--ac); color:#fff; }
.chChips { display:inline-flex; gap:6px; flex-wrap:wrap; }
.chChip { height:30px; padding:0 12px; border:1px solid var(--bd); border-radius:999px; background:var(--field); cursor:pointer; font-size:.8rem; color:var(--tx); }
.chChip[aria-pressed="true"] { background:color-mix(in srgb, var(--ac) 18%, transparent); border-color:var(--ac); color:var(--ac); font-weight:600; }
.chCur { display:inline-flex; align-items:center; gap:6px; font-size:.82rem; padding:0 8px; } .chCur i { width:16px; height:16px; border-radius:50%; display:inline-block; border:1px solid rgba(0,0,0,.35); }
.chSl { display:grid; gap:4px; } .chSl label { display:flex; justify-content:space-between; align-items:baseline; font-size:.82rem; color:var(--mu); font-weight:600; } .chSl .chSlV { color:var(--tx); font-variant-numeric:tabular-nums; }
.chSl input[type=range], .chTavT { width:100%; accent-color:var(--ac); height:22px; margin:0; }
.chSl.off { opacity:.5; }
.chSecT { font-weight:700; font-size:.88rem; margin:12px 0 6px; }
.chStats { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:6px; margin:8px 0; }
.chStats > div { padding:7px 10px; border:1px solid var(--bd); border-radius:10px; background:var(--panel); min-width:0; }
.chStats dt { font-size:.72rem; color:var(--mu); } .chStats dd { margin:2px 0 0; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.chStats .big { grid-column:1/-1; background:color-mix(in srgb, var(--ac) 11%, var(--panel)); border-color:color-mix(in srgb, var(--ac) 45%, var(--bd)); } .chStats .big dd { font-size:1.35rem; }
.chWarn { margin:8px 0; padding:8px 10px; border-radius:9px; border:1px solid color-mix(in srgb, var(--warn) 55%, transparent); background:color-mix(in srgb, var(--warn) 12%, transparent); font-size:.84rem; line-height:1.4; }
.chOk { color:var(--ok); font-weight:700; margin:6px 0; } .chNo { color:var(--bad); font-weight:600; margin:6px 0; }
.chHint { padding:8px 10px; border-radius:9px; background:color-mix(in srgb, var(--ac) 10%, transparent); font-size:.84rem; margin:6px 0; }
.chPill { display:inline-block; padding:3px 11px; border-radius:999px; font-size:.78rem; font-weight:700; border:1px solid var(--bd); }
.chPill.pol { color:var(--bad); border-color:var(--bad); } .chPill.apo { color:var(--ok); border-color:var(--ok); } .chPill.bas { color:var(--ac); border-color:var(--ac); }
.chMeas { padding:8px 10px; border-radius:9px; border:1px dashed var(--bd); font-size:.84rem; margin:6px 0; line-height:1.5; }
.chTbl { width:100%; border-collapse:collapse; font-size:.82rem; font-variant-numeric:tabular-nums; } .chTbl th, .chTbl td { padding:5px 8px; text-align:left; border-bottom:1px solid var(--bd); } .chTbl th { color:var(--mu); font-weight:600; font-size:.74rem; }
.chTbl tr.lim td { background:color-mix(in srgb, var(--warn) 12%, transparent); } .chTbl td.ok { color:var(--ok); font-weight:700; } .chTbl td.bad { color:var(--bad); font-weight:700; }
.chLimT { color:var(--warn); font-weight:700; }
.chMi { width:84px; height:28px !important; text-align:right; }
.chDone { color:var(--ok); }
.chPalI.done b { color:var(--ok); }
.chPalI.cur { background:color-mix(in srgb, var(--ac) 12%, transparent); border-color:color-mix(in srgb, var(--ac) 50%, transparent); }
.chPalI { cursor:pointer; touch-action:pan-y; }
.chMini { color:var(--ink); } .ch[data-tema="scuro"] .chMini { color:var(--tx); }
.chMiniTx { font-weight:800; font-size:.74rem; letter-spacing:.2px; white-space:nowrap; color:var(--tx); }
.chMiniAt { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; font-weight:800; font-size:.72rem; }
.chMiniEl { position:relative; width:40px; height:34px; border-radius:7px; background:color-mix(in srgb, var(--c) 30%, var(--field)); border:1px solid var(--c); display:grid; place-items:center; }
.chMiniEl i { position:absolute; left:3px; top:1px; font-size:.55rem; font-style:normal; opacity:.8; } .chMiniEl b { font-size:.92rem; color:var(--tx); }
.chPalS span { font-size:.84rem; }
.chPalI small { display:block; color:var(--mu); font-weight:400; margin-top:1px; line-height:1.25; } .chPalI b { display:block; }
.chOp { font-size:1.4rem; font-weight:700; color:var(--mu); padding:0 6px; align-self:flex-end; margin-bottom:5px; }
.chSteps .chFm { font-size:1.4rem; font-weight:800; margin:0; }
.chFlash { white-space:nowrap; }
/* ---- tavola periodica ---- */
.chTav { display:flex; flex-direction:column; gap:10px; min-height:100%; }
.chTavCtl { display:grid; grid-template-columns:minmax(150px,220px) minmax(180px,320px) 1fr; gap:10px 16px; align-items:end; }
.chTavTW { display:grid; } .chTavTW.dim { opacity:.45; } .chTavTv { font-weight:700; color:var(--tx); font-size:.8rem; }
.chTavLg { display:flex; flex-wrap:wrap; gap:4px 12px; align-items:center; justify-content:flex-end; min-width:0; }
.chLgI { display:inline-flex; align-items:center; gap:6px; font-size:.74rem; color:var(--tx); border:1px solid transparent; background:none; border-radius:999px; padding:2px 8px; cursor:default; white-space:nowrap; }
button.chLgI { cursor:pointer; } button.chLgI:hover { border-color:var(--bd); } .chLgI.on { border-color:var(--ac); background:color-mix(in srgb, var(--ac) 14%, transparent); }
.chLgI i { width:12px; height:12px; border-radius:3px; display:inline-block; flex:none; }
.chLgB { display:inline-flex; align-items:center; gap:6px; } .chLgB i { width:130px; height:12px; border-radius:3px; display:inline-block; } .chLgB small { font-size:.72rem; color:var(--mu); }
.chTavW { container-type:inline-size; position:relative; flex:1; min-height:0; }
.chTavG { display:grid; grid-template-columns:repeat(18,minmax(0,1fr)); grid-template-rows:repeat(7,auto) 8px auto auto; gap:2px; }
.chEl { --c:#888; position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; aspect-ratio:1/1.05; min-width:0; padding:1px; border:1px solid color-mix(in srgb, var(--c) 70%, transparent); border-radius:5px; background:color-mix(in srgb, var(--c) 24%, var(--pn)); color:var(--tx); cursor:pointer; line-height:1.05; overflow:hidden; transition:opacity .15s, transform .1s; }
.chEl:hover { transform:scale(1.12); z-index:3; box-shadow:0 4px 14px rgba(0,0,0,.3); }
.chEl .z { position:absolute; left:3px; top:1px; font-size:clamp(.45rem,.9cqw,.62rem); font-style:normal; opacity:.75; }
.chEl .s { font-size:clamp(.78rem,1.9cqw,1.2rem); font-weight:800; }
.chEl .n { font-size:clamp(.4rem,.85cqw,.6rem); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; opacity:.85; }
.chEl .m { font-size:clamp(.4rem,.8cqw,.55rem); opacity:.6; }
.chEl.sel { outline:3px solid var(--tx); outline-offset:1px; z-index:4; }
.chEl.off { opacity:.2; }
.chEl:focus-visible { outline:3px solid var(--ac); z-index:5; }
@container (max-width:760px) { .chEl .m { display:none; } }
@container (max-width:560px) { .chEl .n { display:none; } .chEl .z { display:none; } .chEl .s { font-size:.74rem; } }
.chTavMk { grid-row:auto; display:flex; align-items:center; justify-content:center; font-size:.6rem; color:var(--mu); border:1px dashed var(--bd); border-radius:5px; }
.chInfo { grid-column:3 / 13; grid-row:1 / 4; z-index:2; min-width:0; }
.chInfoIn { height:100%; display:flex; align-items:center; gap:14px; padding:8px 12px; border:1px solid var(--bd); border-radius:12px; background:var(--panel); position:relative; overflow:hidden; }
.chInfoTile { --c:#888; flex:none; width:84px; height:94px; border-radius:10px; border:2px solid var(--c); background:color-mix(in srgb, var(--c) 28%, var(--pn)); display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; }
.chInfoTile i { position:absolute; left:6px; top:3px; font-style:normal; font-size:.78rem; } .chInfoTile b { font-size:2.1rem; line-height:1; } .chInfoTile small { font-size:.7rem; color:var(--mu); margin-top:3px; }
.chInfoTx { min-width:0; flex:1; } .chInfoTx h3 { margin:0 0 4px; font-size:1.15rem; }
.chInfoTx dl { display:grid; grid-template-columns:auto 1fr; gap:1px 12px; margin:0; font-size:.78rem; } .chInfoTx dt { color:var(--mu); } .chInfoTx dd { margin:0; font-weight:600; min-width:0; overflow-wrap:anywhere; }
.chConf { font-family:ui-monospace,Menlo,Consolas,monospace; font-weight:600; }
.chBohr { flex:none; width:130px; height:130px; }
.chNuc { fill:#ef4444; } .chNucT { fill:#fff; font-size:8px; font-weight:700; } .chShell { fill:none; stroke:var(--bd); stroke-width:.8; }
.chEle { fill:var(--ac); } .chOrb { transform-origin:0 0; animation:chSpin linear infinite; }
@keyframes chSpin { to { transform:rotate(360deg); } }
.chTavW.chNar .chInfo { position:static; margin-top:12px; }
.chTavW.chNar .chInfoIn { flex-wrap:wrap; }
.chTavW.chNar .chBohr { width:110px; height:110px; }
/* ---- molecole ---- */
.chSec[data-sec=mol], .chSec[data-sec=gas], .chSec[data-sec=lab] { padding:0; overflow:hidden; }
.chMol { display:flex; flex-direction:column; height:100%; }
.chMolBar { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; padding:8px 10px; border-bottom:1px solid var(--bd); }
.chMolMain { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 310px; }
.chMolCvW { position:relative; min-height:260px; background:var(--cv); } .chMolCv { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; outline:none; }
.chMolInfo { overflow:auto; padding:12px; border-left:1px solid var(--bd); background:var(--pn); min-width:0; }
.chMolInfo h3, .chMolName { margin:0 0 2px; font-size:1.1rem; } .chFm { font-size:1.35rem; font-weight:800; margin:2px 0 8px; }
.chMolInfo ul { margin:4px 0 8px; padding-left:18px; font-size:.82rem; line-height:1.5; } .chMolInfo ul small { display:block; color:var(--mu); }
.chSmi { display:grid; gap:6px; margin-top:12px; padding-top:10px; border-top:1px solid var(--bd); }
.chSmiIn { flex:1; min-width:120px; font-family:ui-monospace,Menlo,Consolas,monospace !important; }
.chSmiIn.err, .chSmiIn:invalid { border-color:var(--bad); }
.chGeo { font-weight:700; }
/* ---- reazioni ---- */
.chRea { display:grid; gap:12px; align-content:start; }
.chReaTop { display:grid; gap:8px; }
.chEqF .chRow { flex-wrap:nowrap; } .chEqIn { flex:1; min-width:0; font-family:ui-monospace,Menlo,Consolas,monospace !important; font-size:1rem !important; height:40px !important; }
.chReaBt .chSp { flex:1; } .chBadge { font-size:.78rem; color:var(--mu); font-weight:600; }
.chSteps { display:flex; flex-wrap:wrap; align-items:flex-end; gap:6px 4px; padding:14px 10px; border:1px solid var(--bd); border-radius:12px; background:var(--panel); }
.chSpc { flex:none; display:flex; flex-direction:column; align-items:center; gap:6px; }
.chStep { display:inline-flex; align-items:center; border:1px solid var(--bd); border-radius:999px; overflow:hidden; background:var(--field); }
.chStep button { width:30px; height:30px; border:0; background:none; font-size:1.1rem; cursor:pointer; color:var(--tx); } .chStep button:hover:not(:disabled) { background:var(--hov); } .chStep button:disabled { opacity:.3; cursor:default; }
.chStep b { min-width:26px; text-align:center; font-variant-numeric:tabular-nums; }
.chReaGrid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:12px; align-items:start; }
.chReaV { position:relative; height:300px; border:1px solid var(--bd); border-radius:12px; background:var(--cv); overflow:hidden; } .chReaCv { position:absolute; inset:0; width:100%; height:100%; display:block; }
.chReaSt { display:block; padding:0; }
.chTblW { overflow:auto; margin-top:8px; } .chMass { font-size:.84rem; margin:6px 0; }
.chStoich { padding-top:2px; } .chStoT { overflow:auto; }
/* ---- gas ---- */
.chGas { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); height:100%; }
.chGasV { position:relative; min-height:300px; background:var(--cv); border-right:1px solid var(--bd); } .chGasCv { position:absolute; inset:0; width:100%; height:100%; display:block; }
.chGasP { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:auto; padding:10px 12px; gap:8px; }
.chGasPn { display:grid; gap:8px; }
.chGasG { position:relative; height:230px; flex:none; border:1px solid var(--bd); border-radius:10px; background:var(--cv); overflow:hidden; } .chGasGcv { position:absolute; inset:0; width:100%; height:100%; display:block; }
.chGBtns { gap:6px; } .chGs { display:grid; grid-template-columns:1fr 1fr; gap:8px; } .chGs:has(> .chFld:only-child) { grid-template-columns:1fr; }
.chGR { margin:4px 0; } .chGAna { color:var(--mu); }
.chGExp b { display:block; } 
.chGRead { display:block; }
/* ---- laboratorio ---- */
.chLab { display:flex; flex-direction:column; height:100%; }
.chLabBar { margin:8px 10px; align-self:flex-start; }
.chLabMain { flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,400px); border-top:1px solid var(--bd); }
.chLabV { position:relative; min-height:280px; background:var(--cv); } .chLabCv { position:absolute; inset:0; width:100%; height:100%; display:block; }
.chLabP { display:flex; flex-direction:column; overflow:auto; border-left:1px solid var(--bd); padding:10px 12px; gap:8px; min-width:0; }
.chLabPn { display:grid; gap:8px; align-content:start; }
.chLabG { position:relative; height:230px; flex:none; border:1px solid var(--bd); border-radius:10px; background:var(--cv); overflow:hidden; } .chLabGc { position:absolute; inset:0; width:100%; height:100%; display:block; }
.chLabCtl { display:grid; grid-template-columns:1fr 1fr; gap:8px; } .chLabInfo { padding:7px 10px; border:1px solid var(--bd); border-radius:9px; background:var(--panel); font-size:.84rem; }
.chAdd { gap:6px; } .chPhBig { --c:#888; display:inline-flex; align-items:baseline; gap:8px; padding:6px 16px; border-radius:12px; background:color-mix(in srgb, var(--c) 40%, var(--pn)); border:2px solid var(--c); color:var(--tx); } .chPhBig small { font-weight:700; } .chPhBig b { font-size:1.8rem; font-variant-numeric:tabular-nums; }
.chUnk { display:grid; gap:6px; padding:8px 10px; border:1px dashed var(--bd); border-radius:10px; } .chUnkIn { width:90px; } .chUnkMsg { font-size:.84rem; font-weight:600; min-height:1.2em; } .chUnkMsg.chOk { color:var(--ok); } .chUnkMsg.chNo { color:var(--bad); }
.chIndRow { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:6px; } .chIndI { display:flex; align-items:center; gap:7px; font-size:.78rem; } .chIndI i { width:22px; height:22px; border-radius:50%; border:1px solid var(--bd); flex:none; }
/* ---- adattamenti ---- */
@container (max-width:1000px) {
  .chMolMain { grid-template-columns:minmax(0,1fr) 260px; }
  .chTavCtl { grid-template-columns:1fr 1fr; } .chTavLg { grid-column:1/-1; justify-content:flex-start; }
}
@container (max-width:860px) {
  .chBody { display:flex; flex-direction:column; height:auto; gap:8px; }
  .chBody > .chPal { flex:none; max-height:260px; } .chBody > .chMain { flex:none; height:clamp(540px,78vh,860px); }
  .chMolMain, .chGas, .chLabMain { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(260px,45%) minmax(0,1fr); }
  .chSec[data-sec=mol], .chSec[data-sec=gas], .chSec[data-sec=lab] { overflow:auto; }
  .chMol, .chGas, .chLab { height:auto; min-height:100%; } .chMolMain, .chGas, .chLabMain { grid-template-rows:380px auto; }
  .chMolInfo, .chLabP { border-left:0; border-top:1px solid var(--bd); } .chGasV { border-right:0; border-bottom:1px solid var(--bd); }
  .chReaGrid { grid-template-columns:minmax(0,1fr); }
  .chPrj .chPN { width:140px; } .chPSt span { display:none; }
  .chTabs [data-tab] { padding:0 10px; }
}
@container (max-width:520px) {
  .chTabs [data-tab] span { display:none; } .chTabs [data-tab].on span { display:inline; } .chTabs [data-tab] { padding:0 12px; }
  .chTavCtl { grid-template-columns:1fr; } .chInfoTile { width:64px; height:74px; } .chInfoTile b { font-size:1.6rem; }
  .chLabCtl, .chGs { grid-template-columns:1fr; }
}
.ch.xMob .chPal { grid-area:auto; }
.ch.xFs .chBody { grid-template-rows:calc(100vh - 112px); }
@container (max-width:860px) { .ch.xFs .chBody > .chMain { height:calc(100vh - 230px); } }
@media (prefers-reduced-motion:reduce) { .chOrb { animation:none; } .chEl { transition:none; } }

.chMolName { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 10px; } .chMolF { font-size:1.45rem; font-weight:800; } .chMolName span { font-size:1.02rem; font-weight:600; }
.chPT svg, .chSearch svg { fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.chPT svg { width:18px; height:18px; }

.chTavW.chNar .chInfoIn { display:grid; grid-template-columns:auto 1fr; gap:10px 14px; align-items:center; }
.chTavW.chNar .chInfoTx { grid-column:1 / -1; order:3; }
.chTavW.chNar .chBohr { justify-self:end; }

@container (max-width:520px) { .chMolBar > .chSeg:first-child button span { display:none; } .chMolBar > .chSeg:first-child button { padding:0 12px; } }
.chPalI b.chInMol { display:inline; color:var(--ac); font-weight:700; }
.chPalI { padding-left:8px; }

/* ==== 23/10/2026 menu componenti stile B (desktop): senza contenitore, ricerca a pillola, categorie tonde, griglia di icone ==== */
.ch:not(.xMob) .chPal { border: 0; background: transparent; border-radius: 0; overflow: visible; }
.ch:not(.xMob) .chPalH { padding: 2px 4px 8px; border-bottom: 0; }
.ch:not(.xMob) .chSearch input { border: 0; background: var(--field); box-shadow: 0 1px 5px rgba(20,30,50,.16); border-radius: 999px; }
.ch:not(.xMob) .chPalT { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 2px 8px; border-bottom: 0; justify-content: flex-start; }
.ch:not(.xMob) .chPT { width: 26px; height: 28px; flex: none; border-radius: 999px; border: 0; background: transparent; padding: 0; display: grid; place-items: center; }
.ch:not(.xMob) .chPT:hover { background: var(--hov); }
.ch:not(.xMob) .chPT.on { background: var(--ac); color: #fff; border: 0; }
.ch:not(.xMob) .chPT.on svg { stroke: #fff; }
.ch:not(.xMob) .chPalL { padding: 2px 2px 14px; }
.ch:not(.xMob) .chPalS { padding: 8px 4px 6px; } .ch:not(.xMob) .chPalTip { border-top: 0; } .ch:not(.xMob) .chPalI { border-radius: 12px; } .ch:not(.xMob) .chPalI:hover { background: var(--field); box-shadow: 0 2px 9px rgba(20,30,50,.16); border-color: transparent; }
