/* TheTinker — grafite e arancione su base bianca (tema "grafite" per il fondo scuro) */
:root {
  --bg: #ffffff;
  --bg2: #f6f6f7;
  --panel: #ffffff;
  --panel2: #f3f3f5;
  --line: #e6e6ea;
  --line2: #d5d6db;
  --ink: #1f2226;
  --ink2: #4b5058;
  --muted: #7c818a;
  --graphite: #2b2e33;
  --orange: #f26a21;
  --orange2: #ff8a45;
  --orange-soft: #fff1e8;
  --ok: #17a467;
  --bad: #e2434b;
  --warn: #e59a13;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .06);
  --r: 14px;
  --sym-dark: #2b2e33;
  --sym-accent: #f26a21;
  --sym-light: #ffffff;
  --head: "Manrope", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --spin: 6s;
  color-scheme: light;
}
:root[data-theme="grafite"] {
  --bg: #1d1f23;
  --bg2: #191b1e;
  --panel: #25282d;
  --panel2: #2d3036;
  --line: #363a41;
  --line2: #464b53;
  --ink: #f2f1ee;
  --ink2: #c9cbd0;
  --muted: #979ca5;
  --orange-soft: #3a2a20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .2);
  --sym-dark: #e9e8e4;
  --sym-light: #25282d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); overflow-x: hidden; }
body { font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--orange); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15.5px; font-weight: 700; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── simbolo che gira su sé stesso ── */
.sym { display: inline-block; perspective: 300px; flex: none; }
.sym > span { display: block; width: 100%; height: 100%; animation: spinY var(--spin) linear infinite; transform-style: preserve-3d; }
.sym svg { width: 100%; height: 100%; display: block; }
@keyframes spinY { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }

/* ── barra superiore ── */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0); }
.top-in { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand .sym { width: 38px; height: 38px; }
.wordmark { font-family: var(--head); font-weight: 800; font-size: 21px; letter-spacing: -.02em; color: var(--ink); }
.wordmark b { color: var(--orange); font-weight: 800; }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.live.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.nav { max-width: 1400px; margin: 0 auto; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 8px 12px 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 9px 11px; color: var(--ink2); font-weight: 600; font-size: 13px; border-bottom: 2.5px solid transparent; border-radius: 8px 8px 0 0; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--panel2); }
.nav a.on { color: var(--ink); border-bottom-color: var(--orange); }
.nav a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on svg { stroke: var(--orange); }
.nav .badge { margin-left: 2px; }

/* ── pagina ── */
.page { max-width: 1400px; margin: 0 auto; padding: 22px 16px calc(60px + env(safe-area-inset-bottom, 0)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: 280px minmax(0, 1fr); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) { .g3, .g2, .g-side { grid-template-columns: minmax(0, 1fr); } h1 { font-size: 22px; } }
@media (max-width: 480px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .v { font-size: 22px; } .page { padding-left: 12px; padding-right: 12px; } .top-in { padding-top: 8px; } .wordmark { font-size: 19px; } .live span { display: none; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { display: flex; align-items: center; gap: 8px; }
.kpi { position: relative; overflow: hidden; }
.kpi .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--head); font-size: 28px; font-weight: 800; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12.5px; color: var(--muted); }
.kpi.accent { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.kpi.accent .k, .kpi.accent .s { color: #b8bcc3; }
.kpi.accent .v { color: var(--orange2); }
.kpi .spark { position: absolute; right: 10px; bottom: 10px; opacity: .9; }

/* ── pulsanti e campi ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s; }
a.btn { color: var(--ink); }
a.btn.primary, a.btn.dark { color: #fff; }
.btn:hover { border-color: var(--ink2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: #e05c15; }
.btn.dark { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn svg, .ico { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.fab { position: fixed; right: 20px; bottom: calc(22px + env(safe-area-inset-bottom, 0)); width: 56px; height: 56px; border-radius: 18px; background: var(--orange); color: #fff; border: 0; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(242, 106, 33, .4); cursor: pointer; z-index: 40; }
.fab svg { width: 26px; height: 26px; stroke: #fff; stroke-width: 2.2; }

.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > span { font-size: 12px; font-weight: 600; color: var(--ink2); }
.fld small { color: var(--muted); font-size: 11.5px; }
.inp, .fld input:not([type=checkbox]):not([type=color]), .fld select, .fld textarea {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s;
}
.fld textarea, textarea.inp { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.inp:focus, .fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 18%, transparent); }
.fld input[type=color] { width: 100%; height: 40px; padding: 3px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.search { position: relative; }
.search input { padding-left: 36px !important; }
.search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
.seg { display: inline-flex; background: var(--panel2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink2); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* ── etichette ── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; --c: var(--muted); color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.b-ok { --c: var(--ok); } .b-bad { --c: var(--bad); } .b-warn { --c: var(--warn); } .b-or { --c: var(--orange); } .b-gr { --c: var(--ink2); }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

/* ── elenchi e tabelle ── */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.li.click:hover { background: var(--panel2); }
.li .t { font-weight: 600; }
.li .d { font-size: 12.5px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th.n { font-family: var(--sans); }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--panel2); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .sym { width: 64px; height: 64px; margin-bottom: 8px; opacity: .9; }

/* ── prodotti ── */
.prod-card { cursor: pointer; padding: 0; overflow: hidden; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.prod-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 16px 34px rgba(0,0,0,.1); }
.prod-band { height: 74px; position: relative; background: linear-gradient(120deg, var(--p1), var(--p2)); }
.prod-logo { position: absolute; left: 16px; bottom: -26px; width: 64px; height: 64px; border-radius: 16px; background: var(--panel); border: 3px solid var(--panel); box-shadow: var(--shadow); overflow: hidden; display: grid; place-items: center; }
.prod-logo img { width: 100%; height: 100%; object-fit: contain; }
.prod-body { padding: 34px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prod-name { font-size: 18px; font-weight: 800; }
.prod-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.prod-stats div { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.prod-stats b { display: block; font-family: var(--head); font-size: 17px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,.08); }
.hero { border-radius: 18px; overflow: hidden; position: relative; background: linear-gradient(120deg, var(--p1), var(--p2)); color: var(--pf, #fff); padding: 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); margin-bottom: 16px; }
.hero-logo { width: 96px; height: 96px; border-radius: 22px; background: rgba(255,255,255,.95); display: grid; place-items: center; overflow: hidden; flex: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; }
.hero h1 { font-size: 32px; color: inherit; }
.hero .tag { opacity: .85; margin-top: 4px; }
.hero .badge { --c: currentColor; background: rgba(255,255,255,.18); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink2); border-bottom: 2.5px solid transparent; cursor: pointer; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--pa, var(--orange)); }
.color-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.color-chip i { width: 40px; height: 40px; border-radius: 9px; border: 1px solid rgba(0,0,0,.08); flex: none; }
.code { font-family: var(--mono); font-size: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; }
.keybox { display: flex; gap: 8px; align-items: center; }
.keybox code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; background: var(--panel2); border-radius: 8px; padding: 9px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── grafici ── */
.chart { width: 100%; height: 170px; display: block; }
.chart .bar { fill: var(--orange); }
.chart .bar2 { fill: var(--graphite); }
:root[data-theme="grafite"] .chart .bar2 { fill: #8d939c; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.meter { height: 8px; border-radius: 4px; background: var(--panel2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--orange); border-radius: 4px; }

/* ── chat ── */
.chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 12px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--graphite); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--panel2); border-bottom-left-radius: 5px; }
.msg.assistant .who { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--orange); margin-bottom: 4px; }
.composer { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.composer textarea { flex: 1; min-height: 44px; max-height: 200px; height: 44px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line2); background: var(--bg); resize: none; outline: none; }
.composer textarea:focus { border-color: var(--orange); }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 3px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line2); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--orange); color: var(--orange); }

/* ── social: anteprima del post ── */
.ig { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; max-width: 380px; }
.ig-h { display: flex; align-items: center; gap: 9px; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.ig-h i { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(#f58529, #dd2a7b, #8134af, #515bd4, #f58529); padding: 2px; display: grid; place-items: center; }
.ig-h i b { width: 100%; height: 100%; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 11px; }
.ig-img { aspect-ratio: 1; background: var(--panel2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.ig-act { display: flex; gap: 14px; padding: 9px 12px 4px; }
.ig-act svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.8; }
.ig-cap { padding: 2px 12px 12px; font-size: 13px; white-space: pre-wrap; }
.fb { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; max-width: 460px; }
.fb-h { display: flex; gap: 9px; padding: 11px 12px; align-items: center; }
.fb-h i { width: 36px; height: 36px; border-radius: 50%; background: #1877f2; color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; }
.fb-txt { padding: 0 12px 10px; white-space: pre-wrap; font-size: 14px; }
.fb-img { aspect-ratio: 1.91; background: var(--panel2) center/cover no-repeat; }
.post { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-thumb { width: 120px; height: 120px; border-radius: 12px; background: var(--panel2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.post-cap { white-space: pre-wrap; font-size: 13.5px; max-height: 6.2em; overflow: hidden; }
@media (max-width: 560px) { .post { grid-template-columns: 76px minmax(0, 1fr); } .post-thumb { width: 76px; height: 76px; } }

/* ── archivio ── */
.tree a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink2); font-weight: 500; cursor: pointer; }
.tree a:hover { background: var(--panel2); }
.tree a.on { background: var(--orange-soft); color: var(--ink); font-weight: 700; }
.tree a .n { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.tree .sub { padding-left: 16px; }
.drop { border: 2px dashed var(--line2); border-radius: 14px; padding: 20px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--orange); background: var(--orange-soft); color: var(--ink); }
.file-ic { width: 38px; height: 38px; border-radius: 9px; background: var(--panel2); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--ink2); flex: none; text-transform: uppercase; overflow: hidden; }
.file-ic img { width: 100%; height: 100%; object-fit: cover; }

/* ── finestre ── */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 16, 19, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow-y: auto; animation: fade .15s; }
.dialog { width: 100%; max-width: 620px; background: var(--panel); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: pop .18s; }
.dialog.wide { max-width: 920px; }
.dialog-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.dialog-b { padding: 10px 18px 6px; }
.dialog-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
@media (max-width: 560px) { .overlay { padding: 0; align-items: flex-end; } .dialog { border-radius: 18px 18px 0 0; max-height: 94vh; overflow-y: auto; } }

.toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0)); transform: translate(-50%, 20px); background: var(--graphite); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }

/* ── accesso ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(90% 60% at 50% -10%, var(--orange-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; text-align: center; }
.auth-card .sym { width: 104px; height: 104px; margin-bottom: 14px; }
.auth-card .wordmark { font-size: 34px; }
.auth-card .card { text-align: left; margin-top: 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.setup { max-width: 720px; }
.qr-box { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.qr-box svg { width: 240px; height: 240px; }
.sym-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sym-pick button { border: 2px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; }
.sym-pick button.on { border-color: var(--orange); background: var(--orange-soft); }
.sym-pick .sym { width: 56px; height: 56px; }
@media (max-width: 560px) { .sym-pick { grid-template-columns: repeat(2, 1fr); } }
.pre { white-space: pre-wrap; }
.mail-body { white-space: pre-wrap; font-size: 14px; line-height: 1.6; max-height: 60vh; overflow-y: auto; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.thread .m { padding: 10px 12px; border-radius: 12px; background: var(--panel2); white-space: pre-wrap; }
.thread .m.io { background: var(--orange-soft); margin-left: 14%; }
.thread .m .w { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
@media (prefers-reduced-motion: reduce) { .overlay, .dialog { animation: none; } }
