/* Sito di PrintAlarm 3D — proposta A (scelta da Dero il 26/11/2026):
   stile home page Apple, centrata. Inter per i testi, Michroma solo per il logo.
   Tema chiaro e scuro (Dero, 27/11/2026): scuro all'apertura, poi il pulsante
   sole/luna (scelta ricordata dal browser, testi.js). Scuro = grafite + verde dell'app.
   Caratteri dentro il sito (nessun servizio esterno).
   MISURE IN REM (Dero, 27/11/2026): 1rem = 16px sul telefono (com'era in px). Sul COMPUTER (mouse,
   finestra oltre 820px) la base scende al 67% e tutto si rimpicciolisce in proporzione; i testi
   non scendono sotto 12px (--fmin, si scrivono come max(var(--fmin), Xrem)). Bordi da 1px e soglie
   @media restano in px. Regole nuove: sempre in rem. */
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Michroma";
  src: url("fonts/Michroma-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --fmin: 0px;               /* testo minimo: 0 sul telefono, 12px sul computer (fondo al file) */
  --bg: #fff;
  --elev: #fff;              /* elementi sopra i fondi grigi (scelta attiva, icone, pulsanti tondi) */
  --text: #1d1d1f;
  --text-2: #515154;
  --text-3: #6e6e73;
  --list-text: #3a3a3c;
  --line: #e5e5ea;
  --soft: #f5f5f7;
  --soft-2: #ececf0;
  --pill: #f2f2f4;           /* fondo della scelta lingua e del pulsante tema */
  --green: #3bdb52;          /* pulsante e cerchi dei passi (con testo scuro) */
  --green-hover: #4fe565;
  --green-ink: #0b2a10;
  --green-logo: #178a2e;     /* "3D" del logo */
  --send-ink: #fff;          /* testo di «Invia» sul verde del logo */
  --send-hover: #127524;
  --green-text: #13782a;     /* collegamenti: contrasto 5,6:1 sul bianco */
  --green-text-hover: #0f6420;
  --green-soft: #e6f8e9;
  --green-soft-2: #d6f3db;
  --band-a: #eefbf0;
  --band-b: #e3f7e7;
  --shadow-s: rgba(0, 0, 0, 0.08);
  --shadow-m: rgba(0, 0, 0, 0.12);
  --shadow-shot: rgba(0, 0, 0, 0.22);
  --bad: #c5221f;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --brand: "Michroma", var(--font);
  color-scheme: light;
}
/* scuro: grafite e verde dell'app (#1E1F22, schede #2A2C30, bordi #3A3C41, testo #F5F5F7 / #B4B4BA) */
:root[data-theme="dark"] {
  --bg: #1e1f22;
  --elev: #3a3c41;
  --text: #f5f5f7;
  --text-2: #c7c7cc;
  --text-3: #a1a1a8;
  --list-text: #d1d1d6;
  --line: #3a3c41;
  --soft: #2a2c30;
  --soft-2: #33353a;
  --pill: #2a2c30;
  --green-logo: #3bdb52;
  --send-ink: #0b2a10;
  --send-hover: #4fe565;
  --green-text: #4fe565;
  --green-text-hover: #8af09a;
  --green-soft: rgba(59, 219, 82, 0.14);
  --green-soft-2: rgba(59, 219, 82, 0.22);
  --band-a: #213025;
  --band-b: #1b261f;
  --shadow-s: rgba(0, 0, 0, 0.35);
  --shadow-m: rgba(0, 0, 0, 0.45);
  --shadow-shot: rgba(0, 0, 0, 0.55);
  --bad: #ff6b5e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: max(var(--fmin), 1rem)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
b { font-weight: 600; color: var(--text); }
a { color: var(--green-text); text-decoration: none; }
a:hover { color: var(--green-text-hover); text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; }
p, li { text-wrap: pretty; }

/* logo DeroArts: versione per fondo chiaro o scuro */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }

.wrap, .wrap-wide { max-width: 70rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- in alto: nome a sinistra (porta alla pagina principale); a destra pulsante (Community o
   Scarica), tema e lingua ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.brand { display: flex; align-items: center; gap: 0.625rem; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--text); }
.wordmark { font-family: var(--brand); font-size: max(var(--fmin), 1.0625rem); white-space: nowrap; }
.wordmark span { color: var(--green-logo); }
.top-right { display: flex; align-items: center; gap: 0.625rem; }
.top-pill {
  display: inline-flex; align-items: center; gap: 0.4375rem; white-space: nowrap;
  background: var(--green-soft); color: var(--green-text); border-radius: 62.4375rem; padding: 0.5rem 1rem;
  font: 600 max(var(--fmin), 0.875rem) var(--font); transition: background 0.15s;
}
.top-pill:hover { background: var(--green-soft-2); color: var(--green-text-hover); text-decoration: none; }
.top-pill svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn {
  width: 2.375rem; height: 2.375rem; border-radius: 50%; border: 0; background: var(--pill); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.theme-btn:hover { color: var(--text); }
.theme-btn svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.lang { display: flex; gap: 0.25rem; background: var(--pill); border-radius: 62.4375rem; padding: 0.25rem; }
.lang button {
  border: 0; background: transparent; border-radius: 62.4375rem; padding: 0.375rem 0.875rem; cursor: pointer;
  font: 600 max(var(--fmin), 0.8125rem) var(--font); color: var(--text-3);
}
.lang button[aria-pressed="true"] { background: var(--elev); color: var(--text); box-shadow: 0 0.0625rem 0.125rem var(--shadow-s); }

/* ---------- titolo, frase, pulsante ---------- */
.hero {
  max-width: 55rem; padding-top: 3.5rem;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}
.hero h1 { font-size: max(var(--fmin), 3.5rem); line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.sub { margin: 0; font-size: max(var(--fmin), 1.3125rem); line-height: 1.45; color: var(--text-3); max-width: 43.75rem; text-wrap: balance; }
.btn {
  display: inline-flex; align-items: center; gap: 0.625rem; margin-top: 0.5rem;
  background: var(--green); color: var(--green-ink);
  font-weight: 700; font-size: max(var(--fmin), 1.125rem); padding: 1rem 2rem; border-radius: 62.4375rem;
  transition: background 0.15s, transform 0.08s;
}
.btn:hover { background: var(--green-hover); color: var(--green-ink); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.note { margin: 0; font-size: max(var(--fmin), 0.875rem); color: var(--text-3); }

/* telefono e tablet: al posto del download, "apri dal computer" + Copia link */
.only-mobile { display: none; }
html.mobile .only-mobile { display: flex; }
html.mobile .only-desktop { display: none; }
.mobile-get { flex-direction: column; align-items: center; gap: 0.875rem; margin-top: 0.5rem; width: 100%; }
.mobile-msg {
  margin: 0; text-align: center;
  font-size: max(var(--fmin), 1.0625rem); line-height: 1.4; color: var(--text); font-weight: 500; text-wrap: balance;
}
.mobile-msg svg { display: inline-block; width: 1.375rem; height: 1.375rem; vertical-align: -0.3125rem; margin-right: 0.5rem; fill: none; stroke: var(--green-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button.btn { border: 0; cursor: pointer; font-family: var(--font); margin-top: 0; }
.btn .lbl-done { display: none; }
.btn.copied .lbl-copy { display: none; }
.btn.copied .lbl-done { display: inline; }

/* ---------- la finestra dell'app su riquadro grigio ---------- */
.shot { padding-top: 3.5rem; }
.shot-panel {
  background: linear-gradient(180deg, var(--soft) 0%, var(--soft-2) 100%);
  border-radius: 2rem; padding: 3.5rem 1.5rem 0;
  display: flex; justify-content: center; overflow: hidden;
}
.shot-panel img {
  width: 21.25rem; height: auto; margin-bottom: -2.5rem;
  border-radius: 1rem;
  filter: drop-shadow(0 1.5rem 3rem var(--shadow-shot));
}
/* scuro: la finestra (grafite) si stacca dal riquadro con un bordo sottile */
:root[data-theme="dark"] .shot-panel img { box-shadow: 0 0 0 0.0625rem #4a4c52; }

/* ---------- sezioni ---------- */
.block { padding-top: 6rem; }
.block h2 { font-size: max(var(--fmin), 2.25rem); font-weight: 700; letter-spacing: -0.01em; text-align: center; margin-bottom: 2rem; }

/* come si usa: 3 riquadri grigi */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.steps li { background: var(--soft); border-radius: 1.25rem; padding: 1.75rem; display: flex; flex-direction: column; gap: 0.625rem; }
.num {
  width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--green); color: var(--green-ink);
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.steps h3 { font-size: max(var(--fmin), 1.3125rem); font-weight: 650; }
.steps p { margin: 0; font-size: max(var(--fmin), 1rem); line-height: 1.5; color: var(--text-2); }

/* nota sotto i passi: piccola, grigia, centrata, con una "i" discreta */
.tip {
  margin: 1.5rem auto 0; max-width: 45.71429em;   /* 640px col testo a 14px: segue il testo (12px minimo sul computer) */
  font-size: max(var(--fmin), 0.875rem); line-height: 1.5; color: var(--text-3); text-align: center; text-wrap: balance;
}
.tip svg { display: inline-block; width: 1.0625rem; height: 1.0625rem; vertical-align: -0.1875rem; margin-right: 0.375rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* installazione e cosa serve: riquadro bordato */
.box { border: 1px solid var(--line); border-radius: 1.5rem; padding: 2.5rem; display: flex; flex-wrap: wrap; gap: 2.5rem; }
.box h2 { font-size: max(var(--fmin), 1.875rem); text-align: left; margin-bottom: 0; }
.box-install { flex: 1 1 26.25rem; display: flex; flex-direction: column; gap: 1rem; }
.box-req { flex: 1 1 20rem; display: flex; flex-direction: column; gap: 0.875rem; }
.list { margin: 0; padding-left: 1.375rem; display: flex; flex-direction: column; gap: 0.75rem; font-size: max(var(--fmin), 1rem); line-height: 1.55; color: var(--list-text); }
.list li::marker { font-weight: 700; color: var(--green-text); }
.req { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.625rem; font-size: max(var(--fmin), 1rem); color: var(--list-text); }
.req li { display: flex; gap: 0.625rem; align-items: baseline; }
.req li::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--green); flex-shrink: 0; transform: translateY(-0.0625rem); }

/* ---------- in fondo ---------- */
.foot {
  padding-top: 5rem; padding-bottom: 3rem;
  text-align: center; display: flex; flex-direction: column; gap: 0.5rem; font-size: max(var(--fmin), 0.8125rem); color: var(--text-3);
}
.foot a:not(.deroarts) { color: var(--text-3); }   /* stesso grigio del testo, chiaro e scuro */
.foot a:not(.deroarts):hover { color: var(--text); }

/* logo DeroArts, piccolo e centrato come nell'app */
.deroarts { display: block; width: fit-content; margin: 0.75rem auto 0; line-height: 0; }
.deroarts img { height: 1rem; width: auto; }   /* collegamento a www.deroarts.com (nuova scheda) */

/* ---------- note legali ---------- */
.legal { max-width: 45rem; margin: 0 auto; padding: 2rem 1.5rem 0; }
.legal h1 { font-size: max(var(--fmin), 2.5rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.legal h2 { font-size: max(var(--fmin), 1.25rem); font-weight: 650; margin: 2.25rem 0 0.5rem; }
.legal p { margin: 0 0 0.625rem; color: var(--text-2); }

/* riquadro Community nella pagina principale, dopo «Come si usa» (variante C, Dero 27/11/2026) */
.community-band {
  display: flex; align-items: center; gap: 1.75rem;
  background: linear-gradient(180deg, var(--band-a) 0%, var(--band-b) 100%); border-radius: 1.75rem; padding: 2.5rem 3rem;
}
.cb-icon { width: 4rem; height: 4rem; border-radius: 1.125rem; background: var(--elev); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 0.125rem 0.625rem var(--shadow-s); }
.cb-icon svg { width: 2.125rem; height: 2.125rem; fill: none; stroke: var(--green-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cb-text { flex: 1; }
.community-band h2 { font-size: max(var(--fmin), 1.875rem); text-align: left; margin: 0 0 0.375rem; }
.community-band p { margin: 0; font-size: max(var(--fmin), 1.0625rem); line-height: 1.5; color: var(--text-2); }
.community-band .btn { margin-top: 0; white-space: nowrap; }

/* ---------- pagina Community a chat (a tutto schermo: si scorrono solo i messaggi) ---------- */
/* riquadro quasi a tutta larghezza, con gli stessi margini laterali di intestazione e piè di pagina */
body.chat-page { --edge: 1.25rem; --side: 18.75rem;   /* larghezza della barra a sinistra */ height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.chat-page .top { flex-shrink: 0; width: 100%; max-width: none; padding: 0.875rem var(--edge); }
.chat-app {
  flex: 1; min-height: 0; width: calc(100% - 2 * var(--edge)); margin: 0 auto;
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: 1.25rem; overflow: hidden; background: var(--bg);
}
.chat-side {
  background: var(--soft); border-right: 1px solid var(--line); min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.125rem; padding: 1.5rem 0.875rem 1rem;
}
.side-head { padding: 0 0.5rem; }
.side-head h1 { font-size: max(var(--fmin), 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
.side-head p { margin: 0.375rem 0 0; font-size: max(var(--fmin), 0.875rem); line-height: 1.45; color: var(--text-3); }
.side-head p[hidden] { display: none; }
.side-note { margin: 0 0.5rem; font-size: max(var(--fmin), 0.875rem); }
.chat-list { display: flex; flex-direction: column; gap: 0.25rem; }
.chat-item {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; cursor: pointer;
  border: 0; background: transparent; border-radius: 0.875rem; padding: 0.625rem; font: inherit; color: var(--text);
}
.chat-item:hover { background: var(--soft-2); }
.chat-item.on, .side-guide.on { background: var(--elev); box-shadow: 0 0.0625rem 0.1875rem var(--shadow-s); }
.chat-item-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.chat-item-text strong { font-size: max(var(--fmin), 0.9375rem); font-weight: 600; }
.chat-item-text small { font-size: max(var(--fmin), 0.8125rem); color: var(--text-3); }
.chat-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; background: var(--green-soft); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-icon svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: var(--green-text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* in fondo alla barra: «Scrivici», poi una linea leggera ed «Esci» (linea ed «Esci» solo dopo
   l'accesso con GitHub); stesse righe delle chat così la barra resta ordinata */
.side-bottom { margin-top: auto; display: flex; flex-direction: column; }
.side-signout { position: relative; margin-top: 0.9375rem; }
.side-signout::before { content: ""; position: absolute; left: 0; right: 0; top: -0.5rem; border-top: 1px solid var(--line); }
.side-write, .side-signout {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; cursor: pointer;
  border: 0; background: transparent; border-radius: 0.875rem; padding: 0.625rem; font: inherit; color: var(--text);
}
.side-write:hover, .side-signout:hover { background: var(--soft-2); }
.side-guide.on:hover { background: var(--elev); }
.side-signout[hidden] { display: none; }
.side-signout .chat-icon { background: var(--elev); }
.side-signout .chat-icon svg { stroke: var(--text-3); }

/* modulo «Scrivici» (finestra sopra la pagina; su iPhone a tutto schermo) */
dialog.write { border: 0; padding: 0; background: transparent; width: calc(100% - 2rem); max-width: 27.5rem; color: var(--text); }
dialog.write::backdrop { background: rgba(0, 0, 0, 0.4); }
.write-card {
  background: var(--bg); border: 1px solid var(--line); border-radius: 1.5rem; padding: 1.375rem;
  display: flex; flex-direction: column; gap: 0.75rem; box-shadow: 0 1.25rem 3.75rem var(--shadow-m);
}
.write-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.write-head h2 { font-size: max(var(--fmin), 1.375rem); font-weight: 700; letter-spacing: -0.01em; }
.write-close {
  width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: var(--pill); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.write-close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0.1875rem; background: var(--pill); border-radius: 0.75rem; padding: 0.1875rem; }
.seg button { border: 0; background: transparent; border-radius: 0.5625rem; padding: 0.5rem; font: 600 max(var(--fmin), 0.875rem) var(--font); color: var(--text-3); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--elev); color: var(--text); box-shadow: 0 0.0625rem 0.125rem var(--shadow-s); }
.write textarea, .write input {
  width: 100%; border: 1px solid var(--line); border-radius: 0.875rem; background: var(--soft); color: var(--text);
  font: max(var(--fmin), 0.9375rem)/1.45 var(--font); padding: 0.75rem 0.875rem; outline: none; resize: vertical;
}
.write textarea:focus, .write input:focus { border-color: var(--green-text); }
.write textarea::placeholder, .write input::placeholder { color: var(--text-3); }
.write-note { margin: 0; font-size: max(var(--fmin), 0.78125rem); color: var(--text-3); text-align: center; }
.write .write-hp { position: absolute; left: -625rem; width: 0.0625rem; height: 0.0625rem; opacity: 0; pointer-events: none; }
.write-note a { color: var(--text-3); text-decoration: underline; text-underline-offset: 0.125rem; }
.write-note a:hover { color: var(--text); }
.write-msg { margin: 0; font-size: max(var(--fmin), 0.875rem); color: var(--text-2); }
.write-msg.ok { color: var(--green-text); }
.write-msg.bad { color: var(--bad); }
/* «Invia»: come «Invia» della chat (aeroplano di carta, verde del «3D» del logo) */
.write-send { width: 100%; justify-content: center; gap: 0.5625rem; font-size: max(var(--fmin), 1rem); padding: 0.8125rem 1.5rem; background: var(--green-logo); color: var(--send-ink); }
.write-send:hover { background: var(--send-hover); color: var(--send-ink); }
.write-send svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.write-send:disabled { opacity: 0.6; cursor: default; }
.btn.write-send { max-width: none; }   /* telefono: largo quanto le caselle (il .btn del telefono si ferma a 360px) */
/* sul computer il modulo è una finestra: grande il 70% in più (Dero, 27/11) */
@media (min-width: 761px) {
  dialog.write { max-width: 46.75rem; }
  .write-card { padding: 2.25rem; gap: 1.125rem; border-radius: 1.75rem; }
  .write-head h2 { font-size: max(var(--fmin), 1.75rem); }
  .write-close { width: 2.5rem; height: 2.5rem; }
  .write-close svg { width: 1.1875rem; height: 1.1875rem; }
  .seg { border-radius: 0.875rem; padding: 0.25rem; }
  .seg button { padding: 0.75rem; font-size: max(var(--fmin), 1rem); border-radius: 0.6875rem; }
  .write textarea, .write input { font-size: max(var(--fmin), 1.0625rem); padding: 1rem 1.125rem; border-radius: 1rem; }
  .write textarea { min-height: 14.375rem; }
  .write-note { font-size: max(var(--fmin), 0.875rem); }
  .write-send { font-size: max(var(--fmin), 1.125rem); padding: 1.125rem 1.75rem; }
  .write-send svg { width: 1.25rem; height: 1.25rem; }
}

.chat-pane { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { flex-shrink: 0; display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.5rem; border-bottom: 1px solid var(--line); }
.chat-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.chat-title strong { font-size: max(var(--fmin), 1rem); font-weight: 650; }
.chat-title span { font-size: max(var(--fmin), 0.8125rem); color: var(--text-3); }
.chat-back {
  display: none; align-items: center; gap: 0.125rem; border: 0; background: none; cursor: pointer;
  color: var(--green-text); font: 600 max(var(--fmin), 1rem) var(--font); padding: 0.25rem 0.375rem 0.25rem 0;
}
.chat-back svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.5rem 1.5rem 0.75rem; display: flex; flex-direction: column; }
/* pochi messaggi: chat e casella per scrivere in basso, come nelle app di messaggi */
.chat-scroll > .giscus { margin-top: auto; }
/* GUIDA: nello stesso riquadro delle chat, a tutta larghezza: schede grigie come i passi della pagina
   principale, 1 colonna (telefono), 2 o 3 secondo lo spazio del riquadro (misurato con @container,
   quindi vale anche al 67% del computer). Testi in comune con la home: testi.js (COMUNI). */
.chat-app.in-guide .chat-scroll > .giscus { display: none; }
.guide { width: 100%; container-type: inline-size; }
.guide[hidden] { display: none; }
.g-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 0.75rem 0 1.5rem; }
.g-sec { background: var(--soft); border-radius: 1.25rem; padding: 1.375rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.875rem; min-width: 0; }
.g-sec h2 { display: flex; align-items: center; gap: 0.75rem; font-size: max(var(--fmin), 1.25rem); font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
.g-ico { width: 2.25rem; height: 2.25rem; border-radius: 0.6875rem; background: var(--green-soft); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.g-ico svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--green-text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.g-sec h3 { font-size: max(var(--fmin), 1rem); font-weight: 600; line-height: 1.4; }
.g-sec p { margin: 0; font-size: max(var(--fmin), 1rem); line-height: 1.55; color: var(--text-2); }
.g-note { color: var(--text-3) !important; font-size: max(var(--fmin), 0.875rem) !important; }
/* elenchi: pallini verdi; installazione: numeri verdi in cerchio */
.g-dots, .g-num { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6875rem; font-size: max(var(--fmin), 1rem); line-height: 1.55; color: var(--list-text); }
.g-dots li { position: relative; padding-left: 1.125rem; }
.g-dots li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--green); }
.g-num { counter-reset: g-num; }
.g-num li { position: relative; padding-left: 2.25rem; counter-increment: g-num; }
.g-num li::before {
  content: counter(g-num); position: absolute; left: 0; top: 0.0625rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--green); color: var(--green-ink); font-size: max(var(--fmin), 0.8125rem); font-weight: 700; line-height: 1.5rem; text-align: center;
}
/* programmare una stampa: i tre passi, ognuno nel suo riquadro (affiancati quando c'è spazio) */
.g-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
.g-steps li { display: flex; align-items: flex-start; gap: 0.875rem; background: var(--bg); border-radius: 1rem; padding: 1.125rem 1.25rem; }
.g-steps .num { width: 2.25rem; height: 2.25rem; flex-shrink: 0; font-size: max(var(--fmin), 1.0625rem); }
.g-steps h3 { font-size: max(var(--fmin), 1.125rem); margin: 0.375rem 0 0.25rem; }
/* domande frequenti: si aprono e si chiudono */
.g-faqs { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 2rem; align-items: start; }
.g-faq { border-top: 1px solid var(--line); }
.g-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 0; cursor: pointer; list-style: none; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary h3 { font-weight: 600; }
.g-faq summary:hover h3 { color: var(--green-text); }
.g-chev { width: 1.25rem; height: 1.25rem; flex-shrink: 0; fill: none; stroke: var(--text-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.g-faq[open] .g-chev { transform: rotate(180deg); }
.g-faq p { padding: 0 2.25rem 1rem 0; }
/* 2 colonne: cosa serve accanto all'installazione, il resto a tutta larghezza o a coppie */
@container (min-width: 40rem) {
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem; }
  .g-wide, #g-primo-avvio { grid-column: 1 / -1; }
  .g-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-steps li { flex-direction: column; gap: 0.25rem; padding: 1.25rem; }
  .g-steps h3 { margin-top: 0.625rem; }
}
/* 3 colonne: installazione, cosa serve e primo avvio affiancati; avvisi su due colonne */
@container (min-width: 72rem) {
  .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; padding-top: 1rem; }
  #g-primo-avvio { grid-column: auto; }
  .g-warn { grid-column: span 2; }
  .g-cols { display: block; columns: 2; column-gap: 2.5rem; }
  .g-cols li { break-inside: avoid; margin-bottom: 0.6875rem; }
  .g-cols { margin-bottom: -0.6875rem; }
  .g-faqs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.chat-note {
  flex-shrink: 0; margin: 0; padding: 0.5rem 1.5rem 0.625rem; border-top: 1px solid var(--line);
  font-size: max(var(--fmin), 0.78125rem); line-height: 1.4; color: var(--text-3); text-align: center;
}
.chat-jump {
  position: absolute; right: 1.5rem; bottom: 3.5rem; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--elev); box-shadow: 0 0.25rem 0.875rem var(--shadow-m);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--green-text);
}
.chat-jump[hidden] { display: none; }
.chat-jump svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* piè di pagina: solo il logo DeroArts, piccolo, centrato sotto «Le chat sono pubbliche…» (cioè al
   centro della colonna della chat: a sinistra lo spazio della barra, 300 px). Note legali e privacy:
   nella pagina principale e nel modulo «Scrivici» */
.chat-foot {
  flex-shrink: 0; width: calc(100% - 2 * var(--edge)); margin: 0 auto;
  display: flex; justify-content: center; align-items: center; gap: 0.5rem;
  padding: 0.5625rem 0 0.6875rem var(--side); font-size: max(var(--fmin), 0.78125rem); color: var(--text-3);
}
.foot-dero { line-height: 0; }
.foot-dero img { height: 0.8125rem; width: auto; }

/* telefono stretto: il pulsante in alto mostra solo la sua icona (il testo resta per i lettori di
   schermo), così c'è posto per il nome, il tema e la lingua. 520px: sopra ci sta anche
   «Download PrintAlarm 3D» della Community (27/11) */
@media (max-width: 520px) {
  .top-right .top-pill { padding: 0; width: 2.125rem; height: 2.125rem; justify-content: center; flex-shrink: 0; }
  .top-right .top-pill span { position: absolute; width: 0.0625rem; height: 0.0625rem; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Community a chat sul telefono: prima l'elenco, poi la chat a tutto schermo con «indietro» */
@media (max-width: 760px) {
  body.chat-page { --edge: 1rem; }
  .chat-app { width: 100%; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); }
  .chat-app[data-view="list"] .chat-pane { display: none; }
  .chat-app[data-view="chat"] .chat-side { display: none; }
  .chat-side { border-right: 0; background: var(--bg); padding: 0.5rem 1rem 0.75rem; gap: 1rem; }
  .side-head { padding: 0; }
  .chat-list { gap: 0.5rem; }
  .chat-item { background: var(--soft); padding: 0.75rem; }
  dialog.write { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; }
  .write-card { min-height: 100%; border: 0; border-radius: 0; padding: calc(1rem + env(safe-area-inset-top)) 1rem 1rem; box-shadow: none; }
  .chat-back { display: inline-flex; }
  .chat-head { padding: 0.625rem 0.875rem; gap: 0.625rem; }
  .chat-head .chat-icon { width: 2.125rem; height: 2.125rem; border-radius: 0.625rem; }
  .chat-scroll { padding: 0.25rem 0.75rem 0.5rem; }
  .g-grid { padding: 0.5rem 0 1rem; gap: 0.75rem; }
  .g-sec { padding: 1.125rem 1.125rem 1.25rem; border-radius: 1rem; }
  .g-steps li { padding: 1rem; }
  .chat-note { padding: 0.375rem 0.875rem calc(0.5rem + env(safe-area-inset-bottom)); font-size: max(var(--fmin), 0.75rem); }
  .chat-jump { right: 0.875rem; bottom: 3.125rem; }
  body.in-chat .top, body.in-chat .chat-foot { display: none; }
  .chat-foot { font-size: max(var(--fmin), 0.75rem); padding: 0.5rem 0 calc(0.625rem + env(safe-area-inset-bottom)); }   /* telefono: al centro */
  .foot-dero img { height: 0.75rem; }
}

/* ---------- telefono e finestre strette ---------- */
@media (max-width: 820px) {
  .wrap, .wrap-wide { padding: 0 1rem; }
  .top { padding-top: 0.875rem; padding-bottom: 0.875rem; }
  .wordmark { font-size: max(var(--fmin), 0.9375rem); }
  .top-right { gap: 0.5rem; }
  .top-pill { padding: 0.4375rem 0.75rem; font-size: max(var(--fmin), 0.8125rem); }
  .theme-btn { width: 2.125rem; height: 2.125rem; }
  .lang button { padding: 0.375rem 0.6875rem; }
  .hero { padding-top: 2rem; gap: 1rem; }
  .hero h1 { font-size: max(var(--fmin), 2.375rem); line-height: 1.1; }
  .sub { font-size: max(var(--fmin), 1.125rem); }
  .btn { width: 100%; justify-content: center; max-width: 22.5rem; }
  .shot { padding-top: 2.5rem; }
  .shot-panel { border-radius: 1.5rem; padding: 2.25rem 1rem 0; }
  .shot-panel img { width: 16.25rem; margin-bottom: -2rem; }
  .block { padding-top: 4rem; }
  .block h2 { font-size: max(var(--fmin), 1.875rem); margin-bottom: 1.5rem; }
  .steps { grid-template-columns: 1fr; gap: 0.875rem; }
  .steps li { padding: 1.375rem; }
  .box { padding: 1.5rem; gap: 2rem; }
  .box h2 { font-size: max(var(--fmin), 1.625rem); margin-bottom: 0; }
  .box-install, .box-req { flex-basis: 100%; }
  .foot { padding-top: 3.5rem; }
  .legal { padding: 1.25rem 1rem 0; }
  .community-band { flex-direction: column; text-align: center; padding: 1.75rem 1.25rem; gap: 1rem; }
  .community-band h2 { text-align: center; margin-bottom: 0.375rem; }
  .legal h1 { font-size: max(var(--fmin), 2rem); }
}

/* ---------- COMPUTER: tutto al 67% (Dero, 27/11/2026) ----------
   Al 100% il sito appare come in Chrome al 67%: misure vere (rem), nessuno zoom del browser.
   Solo con mouse e finestra larga: telefono e tablet restano come sono. Testi almeno 12px.
   La chat giscus segue con i temi «-computer» (community.js). */
@media (min-width: 821px) and (hover: hover) and (pointer: fine) {
  html { font-size: 67%; }
  :root { --fmin: 12px; }
  /* barra della Community: i suoi testi restano a 12px, quindi non si stringe come il resto
     (al 67% sarebbe 201px e le frasi andrebbero a capo male) */
  body.chat-page { --side: 280px; }
}
