/* ═══════════════════════════════════════════════════════════════════════════════════════════
   GecoChat Web — stile «Geco v2» (25/10/2026, squadra «web app nuovo stile»).
   Regole: ~/GecoChat-BUILD/DESIGN-SYSTEM.md (approvato da Mario).
   SOLO ASPETTO: si carica DOPO lo <style> di index.html e ridisegna le parti che ci sono già.
   Nessuna API, WebSocket, login, chiamata o /developers dipende da questo file.
   Spegnerlo per un browser: aggiungere ?stile=vecchio all'indirizzo (?stile=nuovo lo riaccende).
   Il file vero si genera con costruisci.cjs (sostituisce ico‹nome› con l'icona SVG).
   ═══════════════════════════════════════════════════════════════════════════════════════════ */

/* ── 1. TOKEN (§1.2) — scuro di serie, chiaro col sistema o con la scelta a mano ── */
:root{
  color-scheme: dark;
  --sfondo:#0E1512; --superficie:#161F1B; --superficie2:#1E2A24; --separatore:#26332D; --bordo:#5E7268;
  --testo:#EEF4F0; --testo2:#9AAEA4; --disattivato:#55665D; --marchio:#1AD474;
  --accento:#2EDB82; --accentoPieno:#2EDB82; --accentoPremuto:#25C574; --suAccento:#04170D;
  --bollaMia:#135C40; --bollaAltri:#1E2A24; --testoBollaMia2:#B5D3C4; --linkBollaMia:#9FF0C4;
  --errore:#FF6B6B; --suErrore:#1A0505; --avviso:#FFB547; --gecoOro:#F2C14E;
  --velo:rgba(0,0,0,.56); --materialeBarra:rgba(14,21,18,.74);
  --ombra1:none; --ombra2:0 4px 16px rgba(0,0,0,.45); --ombra3:0 12px 40px rgba(0,0,0,.6);
  --tinta:rgba(46,219,130,.14); --avvisoFondo:rgba(255,181,71,.12); --erroreFondo:rgba(255,107,107,.12);
  --azPin:#2EDB82; --azSuPin:#04170D; --azCartella:#8E8CF0; --azSilenzia:#FFB547; --azArchivia:#9AAEA4; --azAltro:#3A4A42;
}
@media (prefers-color-scheme: light){ :root:not([data-tema="scuro"]){
  color-scheme: light;
  --sfondo:#F4F7F6; --superficie:#FFFFFF; --superficie2:#E8EEEB; --separatore:#DCE3DF; --bordo:#7A8981;
  --testo:#10201A; --testo2:#55635C; --disattivato:#9AA6A0; --marchio:#1AD474;
  --accento:#0A7A45; --accentoPieno:#0A7A45; --accentoPremuto:#08653A; --suAccento:#FFFFFF;
  --bollaMia:#CDEFDC; --bollaAltri:#ECF0EE; --testoBollaMia2:#55635C; --linkBollaMia:#08653A;
  --errore:#C0262D; --suErrore:#FFFFFF; --avviso:#94590A; --gecoOro:#8A6100;
  --velo:rgba(16,32,26,.32); --materialeBarra:rgba(244,247,246,.78);
  --ombra1:0 1px 2px rgba(16,32,26,.06),0 2px 8px rgba(16,32,26,.05); --ombra2:0 4px 16px rgba(16,32,26,.12); --ombra3:0 12px 40px rgba(16,32,26,.18);
  --tinta:rgba(10,122,69,.10); --avvisoFondo:rgba(148,89,10,.10); --erroreFondo:rgba(192,38,45,.08);
  --azPin:#0A7A45; --azSuPin:#FFFFFF; --azCartella:#4B49B8; --azSilenzia:#94590A; --azArchivia:#55635C; --azAltro:#3A4A42;
}}
:root[data-tema="chiaro"]{
  color-scheme: light;
  --sfondo:#F4F7F6; --superficie:#FFFFFF; --superficie2:#E8EEEB; --separatore:#DCE3DF; --bordo:#7A8981;
  --testo:#10201A; --testo2:#55635C; --disattivato:#9AA6A0; --marchio:#1AD474;
  --accento:#0A7A45; --accentoPieno:#0A7A45; --accentoPremuto:#08653A; --suAccento:#FFFFFF;
  --bollaMia:#CDEFDC; --bollaAltri:#ECF0EE; --testoBollaMia2:#55635C; --linkBollaMia:#08653A;
  --errore:#C0262D; --suErrore:#FFFFFF; --avviso:#94590A; --gecoOro:#8A6100;
  --velo:rgba(16,32,26,.32); --materialeBarra:rgba(244,247,246,.78);
  --ombra1:0 1px 2px rgba(16,32,26,.06),0 2px 8px rgba(16,32,26,.05); --ombra2:0 4px 16px rgba(16,32,26,.12); --ombra3:0 12px 40px rgba(16,32,26,.18);
  --tinta:rgba(10,122,69,.10); --avvisoFondo:rgba(148,89,10,.10); --erroreFondo:rgba(192,38,45,.08);
  --azPin:#0A7A45; --azSuPin:#FFFFFF; --azCartella:#4B49B8; --azSilenzia:#94590A; --azArchivia:#55635C; --azAltro:#3A4A42;
}
/* «Aumenta contrasto» (§1.4): testo2 = testo, bordi pieni, barre senza trasparenza */
@media (prefers-contrast: more){ :root{ --testo2:var(--testo); --bordo:var(--testo); --separatore:var(--bordo); --materialeBarra:var(--superficie); --testoBollaMia2:var(--testo); } }

/* I nomi di oggi puntano ai token nuovi: tutto ciò che usa var(--bg), var(--geco)… cambia da solo */
:root{
  --bg:var(--sfondo); --bg2:var(--superficie); --panel:var(--superficie2); --line:var(--separatore);
  --geco:var(--accentoPieno); --geco2:var(--accentoPremuto); --txt:var(--testo); --dim:var(--testo2);
  --bubble-me:var(--bollaMia); --bubble-you:var(--bollaAltri); --accent:var(--accento);
  --molla:linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938, 1.017 22.5%, 1.03 25.4%, 1.019 31%, .998 41.4%, 1); /* molla smorzamento ≈0,8 */
  --mollaPiena:linear(0, .02 1.6%, .087 3.6%, .37 9.6%, .617 15.8%, .79 22.6%, .903 30.4%, .962 38.6%, .99 48%, 1); /* molla smorzamento 1 */
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Google Sans Text", "Noto Sans", sans-serif;
}

/* ── 2. BASE: font di sistema, testo che segue il browser (rem), lingue ── */
html{ font-size:100%; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
html, body{ background:var(--sfondo); color:var(--testo); font:400 1rem/1.4 var(--font); -webkit-font-smoothing:antialiased; }
:lang(ja) body, body:lang(ja){ font-family: system-ui, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif; }
:lang(zh) body, body:lang(zh){ font-family: system-ui, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
:lang(ja) body, :lang(zh) body{ line-height:1.6; line-break:strict; word-break:normal; overflow-wrap:anywhere; }
:lang(it) body{ hyphens:manual; }
button, input, select, textarea{ font-family:inherit; }
input, select, textarea{ color:var(--testo); accent-color:var(--accentoPieno); }
input[type=checkbox], input[type=radio]{ width:1.125rem; height:1.125rem; accent-color:var(--accentoPieno); flex:none; }
a{ color:var(--accento); }
::selection{ background:color-mix(in srgb, var(--accentoPieno) 30%, transparent); }
/* fuoco da tastiera sempre visibile (§7) — oggi il campo di scrittura lo toglieva */
:focus-visible{ outline:2px solid var(--accento) !important; outline-offset:2px !important; }
#composer input:focus-visible, #cerca:focus-visible, #gText:focus-visible{ outline-offset:0 !important; }
/* cambio tema: dissolvenza di 200 ms, mai uno scatto di luce */
html.geco-cambio-tema, html.geco-cambio-tema *{ transition: background-color .2s ease, color .2s ease, border-color .2s ease !important; }

/* Tasti: area minima 44 px, premuto = scala 0,97 subito (alla pressione, non al rilascio) */
.btn{ min-height:2.75rem; min-width:2.75rem; border-radius:12px; font-weight:600; line-height:1.2;
  background:var(--accentoPieno) !important; color:var(--suAccento) !important; border:1px solid transparent !important;
  transition: transform .1s ease-out, background-color .15s ease; -webkit-tap-highlight-color:transparent; }
.btn:hover{ background:var(--accentoPremuto) !important; }
.btn.ghost{ background:transparent !important; color:var(--accento) !important; border:1px solid var(--bordo) !important; }
.btn.ghost:hover{ background:var(--tinta) !important; }
.btn:active, #send:active, #allega:active, .chip:active{ transform:scale(.97); }
.btn:disabled, button:disabled{ opacity:1; color:var(--disattivato) !important; border-color:var(--separatore) !important; background:var(--superficie2) !important; cursor:not-allowed; }
.pill{ background:var(--superficie2); border:1px solid var(--separatore); color:var(--testo2); font-size:.8125rem; padding:.5rem .875rem; }
.err{ color:var(--errore) !important; }
.lock{ color:var(--testo2); font-size:.8125rem; line-height:1.4; max-width:26rem; margin:0 auto; }

/* Icona come maschera: il tasto resta lo stesso (id, clic, titolo), cambia solo il disegno */
.geco-ico, #setBtn, #appBtn, #gecoBtn, #gcxBtn, #tgcBtn, #lpxBtn, #logout, #send, #allega, #chatMenuBtn, #caBtn, #back, #gClose, #gBack, #gModo, #gSend, #visoreChiudi{
  font-size:0 !important; line-height:0 !important; display:inline-flex; align-items:center; justify-content:center; }
#setBtn::before, #appBtn::before, #gecoBtn::before, #gcxBtn::before, #tgcBtn::before, #lpxBtn::before, #logout::before, #send::before, #allega::before,
#chatMenuBtn::before, #caBtn::before, #back::before, #gClose::before, #gBack::before, #gModo::before, #gSend::before, #visoreChiudi::before{
  content:""; display:block; width:1.375rem; height:1.375rem; background:currentColor;
  -webkit-mask:var(--ico) center/contain no-repeat; mask:var(--ico) center/contain no-repeat; }
#setBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M12.22%202h-.44a2%202%200%200%200-2%202v.18a2%202%200%200%201-1%201.73l-.43.25a2%202%200%200%201-2%200l-.15-.08a2%202%200%200%200-2.73.73l-.22.38a2%202%200%200%200%20.73%202.73l.15.1a2%202%200%200%201%201%201.72v.51a2%202%200%200%201-1%201.74l-.15.09a2%202%200%200%200-.73%202.73l.22.38a2%202%200%200%200%202.73.73l.15-.08a2%202%200%200%201%202%200l.43.25a2%202%200%200%201%201%201.73V20a2%202%200%200%200%202%202h.44a2%202%200%200%200%202-2v-.18a2%202%200%200%201%201-1.73l.43-.25a2%202%200%200%201%202%200l.15.08a2%202%200%200%200%202.73-.73l.22-.39a2%202%200%200%200-.73-2.73l-.15-.08a2%202%200%200%201-1-1.74v-.5a2%202%200%200%201%201-1.74l.15-.09a2%202%200%200%200%20.73-2.73l-.22-.38a2%202%200%200%200-2.73-.73l-.15.08a2%202%200%200%201-2%200l-.43-.25a2%202%200%200%201-1-1.73V4a2%202%200%200%200-2-2z%27%2F%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%273%27%2F%3E%3C%2Fsvg%3E") } #appBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%273%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271.5%27%2F%3E%3Crect%20x%3D%2714%27%20y%3D%273%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271.5%27%2F%3E%3Crect%20x%3D%2714%27%20y%3D%2714%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271.5%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%2714%27%20width%3D%277%27%20height%3D%277%27%20rx%3D%271.5%27%2F%3E%3C%2Fsvg%3E") } #gecoBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M9.94%2015.5A2%202%200%200%200%208.5%2014.06l-6.13-1.58a.5.5%200%200%201%200-.96L8.5%209.94A2%202%200%200%200%209.94%208.5l1.58-6.13a.5.5%200%200%201%20.96%200L14.06%208.5A2%202%200%200%200%2015.5%209.94l6.13%201.58a.5.5%200%200%201%200%20.96L15.5%2014.06a2%202%200%200%200-1.44%201.44l-1.58%206.13a.5.5%200%200%201-.96%200z%27%2F%3E%3Cpath%20d%3D%27M20%203v4M22%205h-4M4%2017v2M5%2018H3%27%2F%3E%3C%2Fsvg%3E") } #gcxBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%273%27%20y%3D%273%27%20width%3D%2718%27%20height%3D%2718%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27m7%2011%202-2-2-2M11%2013h4%27%2F%3E%3C%2Fsvg%3E") }
#tgcBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%272%27%20y%3D%274%27%20width%3D%2720%27%20height%3D%2716%27%20rx%3D%272%27%2F%3E%3Cpath%20d%3D%27M6%208h.01M10%208h.01M14%208h.01M18%208h.01M8%2012h.01M12%2012h.01M16%2012h.01M7%2016h10%27%2F%3E%3C%2Fsvg%3E") } #lpxBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2713%27%20r%3D%278%27%2F%3E%3Cpath%20d%3D%27M12%209v4l2%202M5%203%202%206M22%206l-3-3%27%2F%3E%3C%2Fsvg%3E") } #logout{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M9%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h4M16%2017l5-5-5-5M21%2012H9%27%2F%3E%3C%2Fsvg%3E") } #send, #gSend{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m5%2012%207-7%207%207M12%2019V5%27%2F%3E%3C%2Fsvg%3E") }
#allega{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M5%2012h14M12%205v14%27%2F%3E%3C%2Fsvg%3E") } #chatMenuBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%275%27%20cy%3D%2712%27%20r%3D%271%27%2F%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%271%27%2F%3E%3Ccircle%20cx%3D%2719%27%20cy%3D%2712%27%20r%3D%271%27%2F%3E%3C%2Fsvg%3E") } #caBtn{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M22%2016.92v3a2%202%200%200%201-2.18%202%2019.79%2019.79%200%200%201-8.63-3.07%2019.5%2019.5%200%200%201-6-6%2019.79%2019.79%200%200%201-3.07-8.67A2%202%200%200%201%204.11%202h3a2%202%200%200%201%202%201.72%2012.84%2012.84%200%200%200%20.7%202.81%202%202%200%200%201-.45%202.11L8.09%209.91a16%2016%200%200%200%206%206l1.27-1.27a2%202%200%200%201%202.11-.45%2012.84%2012.84%200%200%200%202.81.7A2%202%200%200%201%2022%2016.92z%27%2F%3E%3C%2Fsvg%3E") } #back{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27m15%2018-6-6%206-6%27%2F%3E%3C%2Fsvg%3E") }
#gClose, #visoreChiudi{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M18%206%206%2018M6%206l12%2012%27%2F%3E%3C%2Fsvg%3E") } #gBack{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M3%2012h18M3%206h18M3%2018h18%27%2F%3E%3C%2Fsvg%3E") } #gModo{ --ico:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%2021v-7M4%2010V3M12%2021v-9M12%208V3M20%2021v-5M20%2012V3M1%2014h6M9%208h6M17%2016h6%27%2F%3E%3C%2Fsvg%3E") }

/* ── 3. ACCESSO (#login) ── */
#login{ min-height:100%; height:auto; padding:2rem 1rem calc(2rem + env(safe-area-inset-bottom)); gap:1.25rem;
  background: radial-gradient(60rem 30rem at 50% -10%, var(--tinta), transparent 70%), var(--sfondo); }
#login h1{ font-size:2rem; line-height:1.2; font-weight:700; letter-spacing:-.02em; display:flex; flex-direction:column; align-items:center; gap:1rem; }
#login h1::before{ content:""; width:4.5rem; height:4.5rem; border-radius:22%; background:url("icone/geco-192.png") center/cover; box-shadow:var(--ombra2); }
:lang(ja) #login h1, :lang(zh) #login h1{ letter-spacing:0; line-height:1.35; }
#login .sub{ color:var(--testo2); font-size:1.0625rem; line-height:1.45; max-width:26rem; }
#login .sub b{ color:var(--testo); }
#qrwrap{ background:#fff !important; padding:1rem; border-radius:24px; box-shadow:var(--ombra3); border:1px solid var(--separatore); max-width:100%; }
#qrwrap canvas{ max-width:100%; height:auto !important; }
#login .pill{ border-radius:999px; }

/* ── 4. STRUTTURA: lista a sinistra (360) + chat a destra; sul telefono una alla volta ── */
#app.on{ display:flex; height:100%; height:100dvh; overflow:hidden; overflow:clip; } /* la chat che entra da destra non allarga la pagina sul telefono */
#side{ width:22.5rem; min-width:20rem; max-width:22.5rem; background:var(--superficie); border-right:1px solid var(--separatore); position:relative; }

/* Testata della lista: riga 1 = foto, nome, Esci · riga 2 = barra degli strumenti (icone da 44 px) */
#side header{ display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); align-items:center; gap:.25rem .25rem;
  padding:.75rem 1rem .5rem; border-bottom:0; background:var(--superficie); }
#side header #meAv{ grid-column:1; grid-row:1; width:2.75rem; height:2.75rem; border:0; background:transparent; justify-self:start; }
#side header .me{ grid-column:2 / 7; grid-row:1; min-width:0; padding-left:.25rem; }
#side header .me b{ font-size:1.375rem; line-height:1.27; font-weight:700; letter-spacing:-.01em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
:lang(ja) #side header .me b, :lang(zh) #side header .me b{ letter-spacing:0; }
#side header .me small{ color:var(--testo2); font-size:.8125rem; font-variant-numeric:tabular-nums; display:block; }
#side header #logout{ grid-column:7; grid-row:1; justify-self:end; }
#side header > button{ padding:0 !important; width:100%; max-width:3rem; height:2.75rem; justify-self:center; border-radius:12px;
  background:transparent !important; border:0 !important; color:var(--testo2) !important; }
#side header > button:hover{ background:var(--superficie2) !important; color:var(--testo) !important; }
#side header > button#gecoBtn{ color:var(--accento) !important; }

/* Ricerca */
#side > div:has(> #cerca){ padding:.25rem 1rem .5rem !important; border-bottom:0 !important; }
#cerca{ background:var(--superficie2) url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27%237A8981%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Ccircle%20cx%3D%2711%27%20cy%3D%2711%27%20r%3D%278%27%2F%3E%3Cpath%20d%3D%27m21%2021-4.3-4.3%27%2F%3E%3C%2Fsvg%3E") no-repeat .875rem center / 1.125rem !important; border:1px solid transparent !important; border-radius:12px !important;
  color:var(--testo) !important; min-height:2.75rem; padding:.5rem .875rem .5rem 2.5rem !important; font-size:1.0625rem !important; }
#cerca::placeholder{ color:var(--testo2); }
#cerca:focus{ border-color:var(--bordo) !important; }

/* Filtri (chip) */
#chips{ gap:.5rem; padding:.25rem 1rem .75rem; border-bottom:1px solid var(--separatore); }
.chip{ min-height:2.25rem; padding:.375rem .875rem; border-radius:999px; border:0; background:var(--superficie2); color:var(--testo);
  font-size:.9375rem; font-weight:500; display:inline-flex; align-items:center; transition:transform .1s ease-out, background-color .15s; user-select:none; }
.chip:hover{ background:color-mix(in srgb, var(--superficie2) 80%, var(--testo) 8%); }
.chip.on{ background:var(--accentoPieno); color:var(--suAccento); border:0; }

/* Righe della lista: avatar 52, nome, ora, anteprima su 2 righe, separatore che parte dal testo */
#chats{ overscroll-behavior:contain; }
.rowWrap .row, .row{ gap:.75rem; padding:0 1rem; min-height:4.5rem; align-items:center; border-bottom:0; background:var(--superficie); }
.row .meta{ align-self:stretch; display:flex; flex-direction:column; justify-content:center; padding:.625rem 0; border-bottom:1px solid var(--separatore); min-width:0; }
.rowWrap:last-child .row .meta{ border-bottom-color:transparent; }
#chats .rowWrap .row:hover{ background:var(--superficie2); }
#chats .rowWrap .row:active{ background:var(--superficie2); }
#chats .rowWrap .row.sel{ background:color-mix(in srgb, var(--accentoPieno) 14%, var(--superficie)); }
#chats .rowWrap .row.sel .meta{ border-bottom-color:transparent; }
.row > .av, .row > span[style*="border-radius:50%"]{ width:3.25rem !important; height:3.25rem !important; font-size:1.375rem !important; border:0 !important; flex:none; }
.av{ background:var(--superficie2); border:0; }
.row .meta .nm{ font-size:1.0625rem; line-height:1.29; font-weight:600; align-items:baseline; }
.row .meta .nm > span:last-child{ font-size:.8125rem !important; font-weight:400; color:var(--testo2) !important; font-variant-numeric:tabular-nums; }
.row .meta .pv{ color:var(--testo2); font-size:.9375rem; line-height:1.33; white-space:normal; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-top:.125rem; }
.row .meta .pv:empty{ display:none; }
:lang(ja) .row .meta .pv, :lang(zh) .row .meta .pv{ line-height:1.55; }
.tag{ font-size:.6875rem; font-weight:600; padding:.0625rem .375rem; border-radius:999px; background:var(--tinta); color:var(--accento); border:0; vertical-align:.1em; margin-left:.25rem; }
/* azioni dello scorrimento (fissa, cartella, silenzia, archivia, altro): colori leggibili */
.actb{ width:4.5rem; font-size:1.125rem; gap:.25rem; color:#fff; }
.actb span{ font-size:.75rem; font-weight:600; }
.actb[data-a="pin"]{ background:var(--azPin) !important; color:var(--azSuPin) !important; }
.actb[data-a="folder"]{ background:var(--azCartella) !important; color:#fff !important; }
.actb[data-a="mute"]{ background:var(--azSilenzia) !important; color:var(--suAccento) !important; }
.actb[data-a="arch"]{ background:var(--azArchivia) !important; color:var(--sfondo) !important; }
.actb[data-a="more"]{ background:var(--azAltro) !important; color:#fff !important; }

/* ── 5. CHAT: testata di vetro, bolle, campo di scrittura ── */
#main{ background:var(--sfondo); position:relative; }
#main .empty{ color:var(--testo2); font-size:1.0625rem; }
#main .empty > div:first-child{ font-size:0 !important; width:5rem; height:5rem; border-radius:22%; background:url("icone/geco-192.png") center/cover; opacity:.9; box-shadow:var(--ombra2); }
#mhead{ position:relative; z-index:2; min-height:3.75rem; padding:.5rem 1rem; gap:.75rem; border-bottom:1px solid var(--separatore);
  background:var(--materialeBarra); -webkit-backdrop-filter:blur(20px) saturate(180%); backdrop-filter:blur(20px) saturate(180%); flex-wrap:wrap; }
#mhead > div:not(.av){ min-width:0; flex:1 1 10rem; }
#mhead #cName{ font-size:1.0625rem; font-weight:600; line-height:1.29; display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#mhead #cSub{ color:var(--testo2) !important; font-size:.8125rem !important; line-height:1.38; }
#mhead #cSub span[style*="cursor:pointer"]{ color:var(--accento) !important; text-decoration:underline; text-underline-offset:2px; text-decoration-thickness:1px; }
#mhead #cSub #segnalaAmico{ text-decoration:none !important; }
#mhead .av, #mhead > span[style*="border-radius:50%"]{ width:2.5rem !important; height:2.5rem !important; border:0 !important; flex:none; }
#mhead > button{ margin-left:0 !important; min-height:2.75rem; padding:0 .75rem !important; border-radius:12px; font-size:.9375rem !important;
  background:transparent !important; border:0 !important; color:var(--accento) !important; }
#mhead > button:hover{ background:var(--tinta) !important; }
#mhead > button#chatMenuBtn, #mhead > button#caBtn, #mhead > button#back{ width:2.75rem; padding:0 !important; font-size:0 !important; }
#mhead > div:not(.av) + button, #mhead > div:not(.av) ~ button:first-of-type{ margin-left:auto !important; }
/* fasce sotto la testata: AI, «è un'AI», cifratura */
#aiBanner{ background:var(--avvisoFondo) !important; color:var(--avviso) !important; font-size:.8125rem !important; padding:.375rem 1rem !important; }
#animaBanner{ background:var(--avvisoFondo) !important; color:var(--avviso) !important; font-size:.8125rem !important; padding:.375rem 1rem !important; }
#privacyBar{ color:var(--testo2) !important; font-size:.75rem !important; padding:.375rem 1rem !important; }
#privacyBar #privacyDot{ background:var(--accento) !important; }

#msgs{ padding:1rem max(1rem, calc((100% - 52rem) / 2)) 1.25rem; gap:.125rem; background:var(--sfondo); scroll-padding-bottom:1rem; overscroll-behavior:contain; }
.b{ max-width:min(78%, 35rem); padding:.5rem .75rem; border-radius:18px; font-size:1rem; line-height:1.35; color:var(--testo); box-shadow:none; }
:lang(ja) .b, :lang(zh) .b{ line-height:1.6; }
.b.me{ background:var(--bollaMia); border-radius:18px; }
.b.you{ background:var(--bollaAltri); border-radius:18px; }
.b.me:not(:has(+ .b.me)){ border-bottom-right-radius:6px; }
.b.you:not(:has(+ .b.you)){ border-bottom-left-radius:6px; }
.b.me + .b.you, .b.you + .b.me, .b.geco + .b, .b + .b.geco, .b.sys + .b, .b + .b.sys{ margin-top:.5rem; }
.b .t{ font-size:.75rem; color:var(--testo2); margin-top:.125rem; font-variant-numeric:tabular-nums; line-height:1.3; }
.b.me .t{ color:var(--testoBollaMia2); }
.b.me a{ color:var(--linkBollaMia); }
.b .who{ font-size:.8125rem; color:var(--accento); font-weight:600; margin-bottom:.125rem; }
.b.sys{ background:var(--superficie2); color:var(--testo2); font-size:.8125rem; border-radius:999px; padding:.25rem .75rem; max-width:90%; text-align:center; }
.b.geco{ background:var(--bollaAltri); border:1px solid var(--separatore); }
.b.geco .who{ color:var(--accento); }
.b pre.code{ background:var(--superficie2); color:var(--testo); border:1px solid var(--separatore); border-radius:12px; font-size:.8125rem; }
.b.me pre.code{ background:color-mix(in srgb, var(--bollaMia) 70%, var(--sfondo)); }
.b .leggiTutto{ border-color:var(--bordo) !important; color:var(--accento) !important; min-height:2rem; border-radius:999px !important; padding:.25rem .75rem !important; font-size:.8125rem !important; }
/* spunte: inviato / consegnato in grigio-verde, letto in verde leggibile (prima azzurro su verde: 2,4:1) */
.b.me .t [id^="tk_"]{ color:var(--testoBollaMia2) !important; }
.b.me .t [id^="tk_"][style*="4fa3ff"], .b.me .t [id^="tk_"][style*="79, 163, 255"]{ color:var(--linkBollaMia) !important; font-weight:700; }
/* la riga «modello · PC · GECO» sotto le risposte AI e le citazioni */
.b [style*="border-left:3px solid #14b8a6"]{ border-left-color:var(--accento) !important; background:var(--tinta) !important; color:var(--testo2) !important; border-radius:6px !important; }
.b span[style*="rgba(255,255,255,.08)"]{ background:var(--superficie2) !important; border:1px solid var(--separatore); }
/* bolla nuova: sale dal campo di scrittura (molla piena). Solo l'ultima, così aprire una chat non fa «ballare» niente */
#msgs > .b:last-child{ animation: geco-sale .35s var(--mollaPiena) both; }
@keyframes geco-sale{ from{ opacity:0; transform:translateY(.5rem) scale(.98); } to{ opacity:1; transform:none; } }

/* barra di risposta e di invio file */
#replyBar{ background:var(--tinta) !important; border-left:3px solid var(--accento) !important; color:var(--testo2) !important; font-size:.8125rem !important; padding:.5rem 1rem !important; }
#replyBar button{ min-width:2.75rem; min-height:2.75rem; color:var(--testo2) !important; }
#barraInvio{ background:var(--materialeBarra) !important; border-top:1px solid var(--separatore) !important; color:var(--testo2) !important; font-size:.8125rem !important; }
#barraInvio #invioBarra{ background:var(--accentoPieno) !important; }
#barraInvio #invioStop{ min-width:2.75rem; min-height:2.75rem; color:var(--testo2) !important; }

/* campo di scrittura: pillola, «+» a sinistra, Invia rotondo a destra (§8.2) */
#composer{ align-items:flex-end; gap:.5rem; padding:.5rem max(1rem, calc((100% - 52rem) / 2)) calc(.5rem + env(safe-area-inset-bottom)); border-top:1px solid var(--separatore);
  background:var(--materialeBarra); -webkit-backdrop-filter:blur(20px) saturate(180%); backdrop-filter:blur(20px) saturate(180%); }
#composer #allega{ width:2.75rem !important; height:2.75rem; flex:none; border-radius:50% !important; background:transparent !important; border:0 !important; color:var(--accento) !important; }
#composer #allega:hover{ background:var(--tinta) !important; }
#composer input#text{ min-width:0; flex:1 1 auto; min-height:2.75rem; border-radius:22px; background:var(--superficie2); border:1px solid transparent; padding:.625rem 1rem; font-size:1rem; color:var(--testo); }
#composer input#text::placeholder{ color:var(--testo2); }
#composer input#text:focus{ border-color:var(--bordo); }
#composer #send{ width:2.75rem !important; height:2.75rem; flex:none; border-radius:50% !important; background:var(--accentoPieno) !important; color:var(--suAccento) !important; border:0; transition:transform .1s ease-out, background-color .15s; }
#composer #send:hover{ background:var(--accentoPremuto) !important; }
#composer #send::before{ width:1.25rem; height:1.25rem; }
#composer > button:not(#allega):not(#send){ min-height:2.75rem; border-radius:12px; }

/* ── 6. MENU, FOGLI E PANNELLI ── */
/* menu del messaggio e menu ⚙️: materiale «menu», nasce dal punto toccato */
#msgMenu{ background:var(--superficie) !important; border:1px solid var(--separatore) !important; border-radius:14px !important; box-shadow:var(--ombra2) !important; color:var(--testo);
  padding:.375rem !important; min-width:13rem !important; max-width:calc(100vw - 1rem); animation: geco-menu .22s var(--mollaPiena) both; transform-origin:top left; }
#msgMenu > div{ min-height:2.75rem; padding:.5rem .75rem !important; border-radius:10px !important; font-size:.9375rem !important; display:flex; align-items:center; }
#msgMenu > div:hover{ background:var(--superficie2) !important; }
#msgMenu > div[style*="color:#f87171"], #msgMenu > div[style*="248, 113, 113"]{ color:var(--errore) !important; }
#msgMenu button{ min-width:2.5rem; min-height:2.5rem; border-radius:50% !important; }
#msgMenu button:hover{ background:var(--superficie2) !important; }
@keyframes geco-menu{ from{ opacity:0; transform:scale(.94); } to{ opacity:1; transform:none; } }

/* foglio (Impostazioni, Mercato, GECO, QR, Backup…): computer = finestra al centro; telefono = foglio dal basso */
#ovl{ background:var(--velo) !important; animation: geco-velo .2s ease-out both; padding:1rem; }
#ovl > div{ background:var(--superficie) !important; border:1px solid var(--separatore) !important; border-radius:20px !important; box-shadow:var(--ombra3);
  max-width:30rem !important; width:100% !important; max-height:min(88vh, 52rem) !important; padding:1.5rem !important; color:var(--testo);
  overscroll-behavior:contain; animation: geco-finestra .35s var(--mollaPiena) both; }
#ovl > div:has(#mkF), #ovl > div:has(#geSaldo), #ovl > div:has(#setAgenti){ max-width:36rem !important; }
#ovl > div > button[onclick="chiudiPannello()"]{ top:.75rem !important; right:.75rem !important; width:2.75rem; height:2.75rem; border-radius:50% !important;
  background:var(--superficie2) !important; color:var(--testo2) !important; font-size:0 !important; display:flex; align-items:center; justify-content:center; z-index:2; }
#ovl > div > button[onclick="chiudiPannello()"]::before{ content:""; width:1.125rem; height:1.125rem; background:currentColor; -webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M18%206%206%2018M6%206l12%2012%27%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M18%206%206%2018M6%206l12%2012%27%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; }
#ovl h3{ font-size:1.375rem !important; line-height:1.27; font-weight:700; letter-spacing:-.01em; padding-right:3rem; }
#ovl h4{ font-size:1.0625rem !important; font-weight:600; margin-top:1.5rem !important; }
:lang(ja) #ovl h3, :lang(zh) #ovl h3{ letter-spacing:0; line-height:1.45; }
#ovl label[style*="font-size:12px"]:not(:has(input)){ font-size:.8125rem !important; font-weight:600; color:var(--testo2) !important; }
#ovl input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), #ovl select, #ovl textarea{
  min-height:2.75rem; border-radius:12px !important; border:1px solid var(--bordo) !important; background:var(--superficie) !important; color:var(--testo) !important; font-size:1rem !important; padding:.5rem .75rem !important; }
#ovl input[type=time]{ min-height:2.75rem; }
#ovl .btn{ min-height:2.75rem; }
#ovl label:has(> input[type=checkbox]){ min-height:2.75rem; align-items:center; gap:.75rem !important; font-size:.9375rem !important; }
#ovl [style*="border-bottom:1px solid var(--line)"]{ border-bottom-color:var(--separatore) !important; }
#ovl [style*="background:var(--accent)"]{ background:var(--accentoPieno) !important; color:var(--suAccento) !important; min-height:2.75rem; border-radius:12px !important; }
/* Impostazioni: profilo in alto come una scheda, voci a tutta larghezza */
#ovl #setAv + div b, #ovl #setNomeVista{ font-size:1.0625rem; }
#ovl #setEsito{ color:var(--accento) !important; }
#ovl #setMinuti{ color:var(--testo2) !important; }
#ovl .geco-tema select{ width:100%; }

@keyframes geco-velo{ from{ opacity:0; } to{ opacity:1; } }
@keyframes geco-finestra{ from{ opacity:0; transform:translateY(.75rem) scale(.97); } to{ opacity:1; transform:none; } }
@keyframes geco-foglio{ from{ transform:translateY(100%); } to{ transform:none; } }

/* Mercato: ogni computer è una scheda; stato e prezzo leggibili */
#ovl > div:has(#mkF) > div[style*="#fbbf24"]{ background:var(--avvisoFondo) !important; border:0 !important; color:var(--testo) !important; border-radius:12px !important; padding:.75rem !important; font-size:.8125rem !important; }
#ovl > div:has(#mkF) > div[style*="padding:8px 0;border-bottom"]{ background:var(--superficie2); border:0 !important; border-radius:16px; padding:.875rem 1rem !important; margin-top:.75rem; }
#ovl > div:has(#mkF) [data-mkstato]{ font-weight:600; }
#ovl > div:has(#mkF) b[style], #ovl > div:has(#mkF) b{ font-variant-numeric:tabular-nums; }
#ovl .mkNol{ min-height:2.75rem; }
#ovl .mkMin{ min-height:2.75rem !important; }

/* Pagina GECO (geco.js, si vede solo se il server dice «attivo»): saldo grande, gratis in una scheda separata, pacchetti come schede */
#ovl #geSaldo > div:first-child{ font-size:.9375rem !important; }
#ovl #geSaldo b[style*="font-size:18px"]{ display:block; font-size:2.5rem !important; line-height:1.15; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; color:var(--testo); margin:.25rem 0; }
#ovl #geSaldo b[style*="font-size:18px"]::after{ content:" GECO"; font-size:1.0625rem; font-weight:600; letter-spacing:0; color:var(--gecoOro); }
#ovl #geSaldo > div[style*="border:1px solid var(--line)"]{ background:var(--superficie2); border:0 !important; border-radius:16px !important; padding:1rem !important; font-size:.9375rem !important; line-height:1.5; }
#ovl #gePac label:has(> input[type=radio]){ background:var(--superficie2); border:2px solid transparent !important; border-radius:14px; padding:.75rem 1rem !important; margin-top:.5rem; min-height:3.25rem; cursor:pointer; font-variant-numeric:tabular-nums; }
#ovl #gePac label:has(> input[type=radio]:checked){ border-color:var(--accentoPieno) !important; background:var(--tinta); }
#ovl #gePac label:has(> #geRecesso){ background:var(--superficie2); border-radius:14px; padding:.75rem 1rem; line-height:1.45; }
#ovl #gePac > div[style*="#f59e0b"]{ background:var(--avvisoFondo); color:var(--avviso) !important; border-radius:12px; padding:.5rem .75rem; font-weight:600; font-size:.8125rem !important; }
#ovl #geSto > div{ font-size:.875rem !important; padding:.625rem 0 !important; font-variant-numeric:tabular-nums; }
#ovl #geSto b{ font-variant-numeric:tabular-nums; }

/* Pannello @geco: cassetto da destra (sul telefono a tutto schermo) */
#gecoPanel{ background:var(--velo) !important; animation: geco-velo .2s ease-out both; }
#gecoPanel > div{ background:var(--superficie) !important; border-left:1px solid var(--separatore) !important; box-shadow:var(--ombra3); width:min(30rem, 100%) !important; animation: geco-da-destra .35s var(--mollaPiena) both; }
#gecoPanel > div > div:first-child{ border-bottom:1px solid var(--separatore) !important; min-height:3.75rem; padding:.5rem .75rem .5rem 1rem !important; background:var(--materialeBarra); }
#gecoPanel > div > div:first-child b{ font-size:1.0625rem; }
#gecoPanel > div > div:last-child{ border-top:1px solid var(--separatore) !important; padding:.5rem .75rem calc(.5rem + env(safe-area-inset-bottom)) !important; background:var(--materialeBarra); align-items:center; }
#gecoPanel .btn.ghost{ border:0 !important; min-height:2.75rem; min-width:2.75rem; padding:0 .75rem !important; }
#gecoPanel #gSend{ width:2.75rem; height:2.75rem; padding:0 !important; border-radius:50%; }
#gecoPanel #gText{ background:var(--superficie2) !important; border:1px solid transparent !important; color:var(--testo) !important; border-radius:22px !important; min-height:2.75rem; padding:.625rem 1rem !important; font-size:1rem; }
#gecoPanel #gMsgs{ padding:1rem !important; }
#gecoPanel [style*="background:#1b1b22"]{ background:var(--bollaAltri) !important; color:var(--testo) !important; border-radius:18px !important; }
#gecoPanel [style*="background:#14b8a6"]{ background:var(--bollaMia) !important; color:var(--testo) !important; border-radius:18px !important; }
#gecoPanel .gthread{ border-bottom-color:var(--separatore) !important; min-height:3.5rem; }
#gecoPanel .gthread:hover{ background:var(--superficie2); }
#gecoPanel [style*="color:#9a9aa6"]{ color:var(--testo2) !important; }
@keyframes geco-da-destra{ from{ transform:translateX(100%); } to{ transform:none; } }

/* visore a schermo intero */
#visoreChiudi{ width:2.75rem !important; height:2.75rem !important; }

/* colori fissi di oggi → colori del sistema (leggibili anche in chiaro) */
[style*="color:#22c55e"], [style*="color: rgb(34, 197, 94)"], [style*="color:#34d399"], [style*="color:#4ade80"]{ color:var(--accento) !important; }
[style*="color:#ef4444"], [style*="color: rgb(239, 68, 68)"], [style*="color:#f87171"], [style*="color:#ff8585"], [style*="color:#f66"]{ color:var(--errore) !important; }
[style*="color:#f59e0b"], [style*="color: rgb(245, 158, 11)"], [style*="color:#fbbf24"], [style*="color:#facc15"], [style*="color:#fb923c"]{ color:var(--avviso) !important; }
[style*="color:#14b8a6"], [style*="color:#5eead4"]:not([style*="background:#134e4a"]){ color:var(--accento) !important; }

/* ── 7. COMPUTER LARGO ── */
@media (min-width:1280px){
  #side{ width:24rem; max-width:24rem; }
}

/* ── 8. TELEFONO (≤ 720 px) — una schermata alla volta, la chat entra da destra ── */
@media (max-width:720px){
  #side{ width:100%; max-width:none; min-width:0; border-right:0; }
  #side header{ padding:.75rem 1rem .25rem; padding-top:calc(.75rem + env(safe-area-inset-top)); }
  #side header .me b{ font-size:1.75rem; line-height:1.2; letter-spacing:-.02em; }
  #main.on{ animation: geco-entra .35s var(--mollaPiena) both; }
  #side:not(.hide){ animation: geco-velo .2s ease-out both; }
  #mhead{ padding:.375rem .5rem; padding-top:calc(.375rem + env(safe-area-inset-top)); gap:.5rem; }
  #mhead #back{ display:inline-flex !important; }
  #mhead > button:not(#back):not(#chatMenuBtn):not(#caBtn){ font-size:.8125rem !important; padding:0 .5rem !important; }
  #msgs{ padding:.75rem .75rem 1rem; }
  .b{ max-width:85%; font-size:1.0625rem; }
  #composer{ padding:.375rem .5rem calc(.375rem + env(safe-area-inset-bottom)); }
  /* fogli dal basso, con la maniglia: si chiudono anche trascinandoli giù */
  #ovl{ align-items:flex-end !important; padding:0; }
  #ovl > div{ max-width:none !important; width:100% !important; border-radius:24px 24px 0 0 !important; border-bottom:0 !important; max-height:92vh !important; max-height:92dvh !important;
    padding:1.75rem 1rem calc(1.25rem + env(safe-area-inset-bottom)) !important; animation: geco-foglio .4s var(--molla) both; }
  #ovl > div::before{ content:""; position:absolute; top:.5rem; left:50%; width:2.25rem; height:.3125rem; margin-left:-1.125rem; border-radius:3px; background:var(--disattivato); }
  #gecoPanel > div{ width:100% !important; border-left:0 !important; }
}
@keyframes geco-entra{ from{ transform:translateX(2.5rem); opacity:0; } to{ transform:none; opacity:1; } }

/* ── 9. RIDUCI MOVIMENTO: niente scorrimenti né molle, solo dissolvenze brevi (il riscontro resta) ── */
@media (prefers-reduced-motion: reduce){
  #msgs > .b:last-child, #msgMenu, #ovl > div, #main.on, #gecoPanel > div, #side:not(.hide){ animation: geco-velo .2s ease-out both !important; }
  .btn:active, #send:active, #allega:active, .chip:active{ transform:none; }
  html.geco-cambio-tema, html.geco-cambio-tema *{ transition-duration:.2s !important; }
}
/* ── 10. RIDUCI TRASPARENZA: barre piene, niente sfocatura, linea sotto ── */
@media (prefers-reduced-transparency: reduce){
  :root{ --materialeBarra:var(--superficie); }
  #mhead, #composer, #gecoPanel > div > div:first-child, #gecoPanel > div > div:last-child{ -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }
}
@media (prefers-contrast: more){
  #mhead, #composer{ -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }
  .b.you, .b.geco, .chip, #cerca, #composer input#text{ border:1px solid var(--bordo) !important; }
}
/* stampa: niente vetro */
@media print{ #mhead, #composer{ backdrop-filter:none !important; } }
