/* Cantiere Vivo · app pilota
   Regole: testo grande, pulsanti da almeno 64 px (guanti), contrasto alto (sole), una mano in verticale,
   pericoli in cima e in rosso. Niente font esterni: parte subito anche con poco campo. */
:root {
  --ink: #15191b; --ink2: #3d4448; --muted: #646b70; --paper: #f3f1ec; --card: #ffffff; --line: #d9d4ca;
  --amb: #e5a100; --amb-bg: #fff5d6; --grn: #1f7a47; --grn-bg: #e3f3e9; --red: #b42d2d; --red-bg: #fbe5e3;
  --blu: #1f5f9e; --blu-bg: #e4eef9; --r: 16px; --tap: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.4 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font-size: 26px; } h2 { font-size: 21px; } h3 { font-size: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--blu); outline-offset: 2px; }

/* barra in alto */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--ink); color: #fff; }
.top .brand { white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.top .brand i { width: 26px; height: 26px; border-radius: 7px; background: var(--amb); display: grid; gap: 3px; padding: 6px 5px; }
.top .brand i b { display: block; height: 3px; border-radius: 2px; background: var(--ink); }
.top .brand i b:nth-child(2) { width: 70%; } .top .brand i b:nth-child(3) { width: 45%; }
.top .where { color: #c9cdd0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sp { flex: 1; }
.top .who { flex-shrink: 1; min-width: 0; background: #2a3033; border: 0; color: #fff; border-radius: 999px; padding: 8px 14px; font-size: 15px; min-height: 44px; max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--amb); color: var(--ink); border-radius: 999px; padding: 4px 10px; font-size: 14px; font-weight: 700; }
.net svg { width: 18px; height: 18px; }

/* schede per l'ufficio */
.tabs { display: flex; gap: 6px; padding: 10px 16px 0; overflow-x: auto; }
.tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 16px; min-height: 48px; font-weight: 600; white-space: nowrap; }
.tabs button[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

main { padding: 16px; max-width: 1180px; margin: 0 auto; }
main.phone { max-width: 600px; padding-bottom: 260px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: 15px; } .tiny { font-size: 13px; }
.kick { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eeebe4; border-radius: 999px; padding: 4px 12px; font-size: 15px; font-weight: 600; }
.chip.grn { background: var(--grn-bg); color: var(--grn); } .chip.red { background: var(--red-bg); color: var(--red); } .chip.amb { background: var(--amb-bg); color: #7a5600; } .chip.blu { background: var(--blu-bg); color: var(--blu); }

/* pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 12px 20px; border-radius: 14px; border: 2px solid var(--ink); background: var(--card); font-weight: 700; text-align: center; }
.btn svg { width: 26px; height: 26px; flex: none; }
.btn.full { width: 100%; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.grn { background: var(--grn); border-color: var(--grn); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.amb { background: var(--amb); border-color: var(--amb); color: var(--ink); }
.btn.ghost { border-color: var(--line); }
.btn.sm { min-height: 44px; padding: 8px 14px; font-size: 16px; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: default; }

/* chi sei */
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.who-btn { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.who-btn .av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #e9e5dc; flex: none; }
.who-btn b { display: block; } .who-btn span { color: var(--muted); font-size: 15px; }

/* operaio: pericoli in cima */
.danger { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--red); color: #fff; font-weight: 700; }
.danger.soft { background: var(--amb-bg); color: #4a3500; border: 2px solid var(--amb); }
.danger svg { width: 28px; height: 28px; flex: none; margin-top: 1px; }
.danger .txt { flex: 1; }
.danger .letto { min-height: 48px; min-width: 88px; border-radius: 12px; border: 2px solid currentColor; background: transparent; color: inherit; font-weight: 800; }
.danger .letto[aria-pressed="true"] { background: rgba(255,255,255,.22); border-style: dashed; }
.danger.soft .letto[aria-pressed="true"] { background: rgba(0,0,0,.06); }

.today h2 { font-size: 26px; margin: 4px 0 8px; }
.today .det { font-size: 18px; color: var(--ink2); }
.nota { background: var(--blu-bg); color: #10365c; border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.tavola { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; width: 100%; padding: 0; }
.tavola img { width: 100%; max-height: 220px; object-fit: cover; object-position: center; }
.tavola span { position: absolute; right: 8px; bottom: 8px; background: rgba(21,25,27,.86); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 15px; font-weight: 700; }
.mat { display: flex; gap: 10px; align-items: flex-start; }
.mat svg { width: 24px; height: 24px; flex: none; color: var(--blu); margin-top: 2px; }

/* barra fissa con i tre pulsanti */
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(243,241,236,.97); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.actions .inner { max-width: 600px; margin: 0 auto; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.three button { min-height: 84px; border-radius: 16px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; font-size: 17px; line-height: 1.1; padding: 6px; }
.three button svg { width: 30px; height: 30px; }
.three .f { background: var(--grn); color: #fff; } .three .p { background: var(--red); color: #fff; } .three .m { background: var(--amb); color: var(--ink); }
.talk { margin-top: 8px; width: 100%; min-height: 64px; border-radius: 16px; border: 0; background: var(--ink); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.talk svg { width: 26px; height: 26px; color: var(--amb); }
.talk.on { background: var(--red); } .talk.on svg { color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
/* telefono: al posto della scritta "Cantiere Vivo" c'è il nome del cantiere (con ▾ per cambiarlo, tranne operaio e caposquadra) */
@media (max-width: 520px) { .top { padding: 10px 12px; gap: 8px; } .top .brand span { display: none; } .top .where { min-width: 0; flex: 0 1 auto; max-width: none; } .top .where-btn { font-size: 16px; color: inherit; } }
.danger.done { padding: 8px 12px; font-weight: 600; font-size: 15px; background: #f6e4e2; color: #6e1d1d; border: 0; }
.danger.soft.done { background: #fbf3dc; color: #5a4300; }
.danger.done svg { width: 20px; height: 20px; }
.danger.done .letto { min-height: 40px; min-width: 64px; font-size: 14px; }

/* elenco invii */
.sent { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.sent:first-child { border-top: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.problema { background: var(--red); } .dot.materiale { background: var(--amb); } .dot.fatto { background: var(--grn); }
.reply { margin-top: 8px; background: var(--grn-bg); color: #0f4a2a; border-radius: 10px; padding: 8px 12px; font-size: 16px; }

/* fogli a schermo intero (Fatto, Problema, Materiale, tavola) */
.sheet { position: fixed; inset: 0; z-index: 50; background: var(--paper); overflow-y: auto; display: flex; flex-direction: column; }
.sheet header { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--ink); color: #fff; z-index: 2; }
.sheet header button { background: transparent; border: 0; color: #fff; min-width: 48px; min-height: 48px; display: grid; place-items: center; }
.sheet header button svg { width: 28px; height: 28px; }
.sheet header h2 { font-size: 20px; }
.sheet .body { padding: 16px; max-width: 600px; width: 100%; margin: 0 auto; flex: 1; }
.sheet .foot { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(243,241,236,.97); border-top: 1px solid var(--line); }
.sheet .foot .inner { max-width: 600px; margin: 0 auto; display: grid; gap: 8px; }
.choices { display: grid; gap: 10px; }
.choice { min-height: var(--tap); border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 19px; text-align: left; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.choice[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.mic-big { width: 100%; min-height: 140px; border-radius: 22px; border: 0; background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 19px; touch-action: none; user-select: none; -webkit-user-select: none; }
.mic-big svg { width: 48px; height: 48px; color: var(--amb); }
.mic-big.on { background: var(--red); } .mic-big.on svg { color: #fff; animation: pulse 1s infinite; }
textarea, input[type="text"], input[type="number"], input[type="email"], select { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 18px; }
textarea { min-height: 110px; resize: vertical; }
label.lab { display: block; font-weight: 700; margin-bottom: 6px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.capito { border: 2px solid var(--amb); border-radius: var(--r); background: #fff; padding: 4px 16px; }
.capito dl { display: grid; grid-template-columns: 92px 1fr; gap: 10px 12px; margin: 12px 0; }
.capito dt { color: var(--muted); } .capito dd { margin: 0; font-weight: 700; } .capito dd.red { color: var(--red); }
.viewer { flex: 1; overflow: auto; background: #fff; }
.viewer img { max-width: none; transform-origin: 0 0; }

/* capocantiere e ufficio */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 880px) { .grid2 { grid-template-columns: 1fr; } }
.issue { border-left: 6px solid var(--line); }
.issue.u4, .issue.u3 { border-left-color: var(--red); } .issue.u2 { border-left-color: var(--amb); } .issue.u1 { border-left-color: var(--grn); }
.issue .quote { color: var(--ink2); font-style: italic; }
.issue dl { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; margin: 8px 0; font-size: 16px; }
.issue dt { color: var(--muted); } .issue dd { margin: 0; font-weight: 600; } .issue dd.red { color: var(--red); }
.thread { margin-top: 8px; }
.thread p { margin: 6px 0; background: #f2f0ea; border-radius: 10px; padding: 8px 12px; font-size: 16px; }
.reply-box { display: flex; gap: 8px; margin-top: 10px; }
.reply-box input { flex: 1; min-height: 48px; font-size: 16px; }
.bar { height: 10px; border-radius: 999px; background: #e8e4dc; overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--grn); border-radius: 999px; }
.team { display: grid; gap: 6px; }
.team + .team { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
audio { width: 100%; height: 40px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi b { display: block; font-size: 26px; letter-spacing: -.02em; }
.firma { width: 100%; height: 150px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; display: block; }
.firma-img { height: 70px; border-bottom: 1px solid var(--line); }
pre.gio { white-space: pre-wrap; font: 16px/1.5 var(--font); margin: 0; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 200px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100vw - 32px); text-align: center; }
.menu { position: fixed; top: 64px; right: 12px; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.18); padding: 8px; display: grid; gap: 4px; min-width: 250px; }
.menu button { min-height: 52px; text-align: left; padding: 10px 14px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; }
.menu button:hover { background: #f2f0ea; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

@media print {
  .top, .tabs, .no-print, .actions { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
}

/* cantiere vero: inviti */
.codice { font: 800 34px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; text-align: center; padding: 14px; border: 2px dashed var(--line); border-radius: 14px; background: #fff; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; }
a.btn { text-decoration: none; color: var(--ink); } a.btn.grn, a.btn.dark, a.btn.red { color: #fff; }
select { appearance: auto; min-height: 52px; }
@media (max-width: 520px) { .top:has(.net) .brand span { display: none; } }
/* programma */
ol.fasi { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
ol.fasi li.fatta { color: var(--muted); } ol.fasi li.fatta b { text-decoration: line-through; text-decoration-thickness: 1px; }
ol.fasi li.ora::marker { color: var(--amb); font-weight: 800; } ol.fasi li.ora b { background: #fff3cf; padding: 0 4px; border-radius: 4px; }
.mini-tav { width: 120px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.fase-ed { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.fase-ed .n { font-weight: 800; color: var(--muted); text-align: center; }
.fase-ed .det-in { grid-column: 2 / -1; font-size: 16px; }
.tabs { overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } .tabs button { flex: none; }
/* sicurezza */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; }
.pill input { width: 20px; height: 20px; }
.avv { border-left: 6px solid var(--red); background: var(--red-bg); padding: 10px 12px; border-radius: 10px; display: grid; gap: 4px; }
.avv.ok { border-left-color: var(--grn); background: var(--grn-bg); }
.small.grn { color: var(--grn); font-weight: 700; }
.btn.on { background: var(--red); border-color: var(--red); color: #fff; }
/* preparazione guidata */
ol.passi { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ol.passi > li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
ol.passi > li.cur { border: 2px solid var(--ink); }
.passo-t { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; background: none; border: 0; text-align: left; font-size: 18px; }
.passo-t .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #eeebe4; font-weight: 800; flex: none; }
li.ok .passo-t .num { background: var(--grn); color: #fff; }
.passo-c { padding: 0 16px 16px; }
.guida { display: flex; gap: 10px; background: var(--blu-bg); color: #10365c; border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.guida svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.grid-f { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
input[type="date"] { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; font-size: 18px; min-height: 52px; }
input:disabled { background: #f2f0ea; color: var(--muted); }
button.link { background: none; border: 0; color: var(--blu); text-decoration: underline; font-size: inherit; padding: 8px; min-height: 44px; }
.pann-c { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: start; border-top: 1px solid var(--line); padding-top: 12px; }
.pann-n { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; color: var(--ink2); }
@media (max-width: 760px) { .pann-c { grid-template-columns: 1fr; } .pann-c > div:last-child { text-align: left !important; } }
.avvisi-b { border: 2px solid var(--amb); background: #fffaf0; font-size: 16px; }
label.scelta { display: flex; gap: 12px; align-items: flex-start; } label.scelta input { width: 24px; height: 24px; flex: none; margin-top: 2px; }

/* ── leggi il progetto ─────────────────────────────────────────────── */
.griglia-dati { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.griglia-dati input { width: 100%; }
.fonte summary { font-size: 13px; color: var(--blu); cursor: pointer; margin-top: 4px; }
.fonte div { background: var(--blu-bg); border-radius: 10px; padding: 8px 10px; margin-top: 4px; color: #10365c; }
.tab-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-lav { width: 100%; border-collapse: collapse; font-size: 15px; }
.tab-lav th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.tab-lav td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tab-lav .num { text-align: right; white-space: nowrap; }
.giro { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blu); animation: giro 1s linear infinite; flex: none; }
@keyframes giro { to { transform: rotate(360deg); } }
.file-riga { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ── tempi e proposte ─────────────────────────────────────────────── */
.cifre { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.cifre .grande { display: block; font-size: 24px; line-height: 1.15; margin: 2px 0; }
.red { color: var(--red); } .grn { color: var(--grn); }
.proposta { border-left: 6px solid var(--amb); }
.effetto { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 15px; background: #f7f5f0; border-radius: 10px; padding: 8px 12px; }
.gantt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gantt { min-width: 760px; position: relative; font-size: 13px; }
.g-testa, .g-riga, .g-linee { display: grid; grid-template-columns: 220px 1fr; align-items: center; }
.g-testa { height: 26px; border-bottom: 1px solid var(--line); }
.g-riga { height: 26px; border-bottom: 1px solid #efece5; }
.g-nome { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.g-asse { position: relative; height: 100%; }
.g-testa .g-asse span { position: absolute; top: 5px; color: var(--muted); white-space: nowrap; border-left: 1px solid var(--line); padding-left: 3px; }
.g-bar { position: absolute; top: 6px; height: 14px; border-radius: 4px; background: var(--blu); }
.g-bar.crit { background: var(--red); }
.g-bar.ora { outline: 2px solid var(--amb); }
.g-linee { position: absolute; inset: 0; pointer-events: none; }
.g-linee .g-asse { height: 100%; }
.g-oggi, .g-contratto { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--blu); }
.g-contratto { border-left: 2px dashed var(--red); }
.leg { display: inline-block; width: 18px; height: 10px; border-radius: 3px; background: var(--blu); vertical-align: middle; }
.leg.crit { background: var(--red); }
.istogramma { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.istogramma span { flex: 1; min-width: 2px; background: var(--ink2); border-radius: 2px 2px 0 0; }
.istogramma .soglia { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--red); }
.istogramma .soglia span { position: absolute; right: 0; top: -20px; background: none; color: var(--red); font-size: 12px; font-weight: 700; }
@media print {
  .top, .tabs, .no-print, .menu, .toast, .avvisi-b { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  .gantt-scroll { overflow: visible; } .gantt { min-width: 0; }
  details { display: block; } details > summary { display: none; } details > *:not(summary) { display: block; }
}
/* sopralluoghi del coordinatore */
.sp { flex: 1; }
.ctr.e-no { background: linear-gradient(90deg, var(--red-bg), transparent 60%); }
.opz-esito.sel { border-color: var(--ink) !important; background: #fff; }
.foglio-vb { max-width: 900px; margin: 0 auto; padding: 16px; background: #fff; color: #111; font: 14px/1.45 "Times New Roman", Georgia, serif; }
.foglio-vb h3 { font-size: 15px; margin: 18px 0 6px; }
.foglio-vb p { margin: 8px 0; text-align: justify; }
.vb-t { width: 100%; border-collapse: collapse; margin: 10px 0; }
.vb-t th, .vb-t td { border: 1px solid #222; padding: 4px 6px; vertical-align: top; text-align: left; }
.vb-t th { background: #eee; font-weight: 700; }
.vb-t.testa td:first-child { width: 28%; font-weight: 700; }
.vb-t .titolo { text-align: center; font-size: 17px; }
.vb-t.controlli td:first-child { width: 28px; text-align: center; } .vb-t.controlli td.c { text-align: center; width: 70px; font-weight: 700; }
.vb-t.controlli td:nth-child(2) { width: 34%; font-size: 12px; }
.vb-t.firme td { height: 110px; width: 50%; } .vb-t.firme img { max-height: 80px; max-width: 100%; }
.esiti .box { display: inline-block; width: 16px; height: 16px; border: 1px solid #222; text-align: center; line-height: 15px; font-size: 12px; margin-right: 6px; }
.vb-foto { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.vb-foto figure { margin: 0; break-inside: avoid; } .vb-foto img { width: 100%; height: 180px; object-fit: cover; border: 1px solid #999; } .vb-foto figcaption { font-size: 11px; text-align: center; }
@media print { .foglio-vb { padding: 0; max-width: none; font-size: 11pt; } .vb-t tr { break-inside: avoid; } }
@media (max-width: 600px) { .vb-t.controlli { font-size: 11px; } .vb-t.controlli td:nth-child(2) { font-size: 11px; } }
input:not([type]), input[type="time"] { width: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 18px; min-width: 0; }
input[type="time"] { padding: 10px 12px; min-height: 52px; }
.vb-riga { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.vb-riga > label:nth-child(3) { grid-column: 1; } .vb-riga > button { justify-self: start; }
.vb-riga.lav { grid-template-columns: 90px 1fr; }
.vb-riga label { min-width: 0; display: block; }
@media (min-width: 720px) { .vb-riga { grid-template-columns: 1fr 1fr 1fr auto; } .vb-riga > label:nth-child(3) { grid-column: auto; } .vb-riga.lav { grid-template-columns: 90px 1fr 2fr auto; } }
.griglia-dati label { display: block; min-width: 0; }
.vb-riga.lav > label:nth-child(3) { grid-column: 1 / -1; }
@media (min-width: 720px) { .vb-riga.lav > label:nth-child(3) { grid-column: auto; } }
.cantiere-btn b { color: var(--ink); font-size: 18px; }
/* cronoprogramma di progetto: barra grigia sotto quella dell'impresa */
.g-rif { position: absolute; top: 22px; height: 4px; border-radius: 2px; background: #8a8a8a; opacity: .75; }
.tab-scroll { overflow-x: auto; }
.tab-cp { width: 100%; border-collapse: collapse; font-size: 14px; }
.tab-cp th, .tab-cp td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tab-cp td:first-child { white-space: normal; min-width: 180px; }
.tab-cp th { font-size: 12px; color: var(--muted, #666); font-weight: 600; }
.bar.fatta b { background: var(--grn); }

/* ═══ Stile 2 (9/11): ordinato e familiare come le app del telefono ═══════════════
   sfondo grigio chiaro, schede bianche senza bordo, separatori sottili, titoli grandi,
   un solo colore per le azioni; i colori pieni restano per gli allarmi e i pulsanti dell'operaio 
   Solo per chi lavora in ufficio: la schermata dell'operaio e del caposquadra resta com'era (body.campo). */
body:not(.campo) {
  --ink: #1c1c1e; --ink2: #3a3a3c; --muted: #6e6e73; --paper: #f2f2f7; --card: #ffffff; --line: #e3e3e8;
  --blu: #0a66d6; --blu-bg: #e8f1fd; --r: 14px;
}
body:not(.campo) h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
body:not(.campo) h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
body:not(.campo) .kick { color: var(--muted); }
body:not(.campo) .card { border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.03); }
body:not(.campo) .btn { border-width: 1px; border-color: #d1d1d6; }
body:not(.campo) .btn.ghost { border-color: #d1d1d6; background: #fff; }
body:not(.campo) .btn.dark { background: var(--blu); border-color: var(--blu); }
body:not(.campo) input:not([type]), body:not(.campo) input[type="text"], body:not(.campo) input[type="number"], body:not(.campo) input[type="date"], body:not(.campo) input[type="time"], body:not(.campo) input[type="email"], body:not(.campo) select, body:not(.campo) textarea { border-width: 1px !important; border-color: #d1d1d6 !important; }
/* intestazione chiara e leggera */
body:not(.campo) .top { background: rgba(249,249,251,.92); color: var(--ink); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
body:not(.campo) .top .where { color: var(--muted); }
body:not(.campo) .top .where-btn { background: none; border: 0; padding: 6px 8px; min-height: 40px; border-radius: 10px; font-size: 15px; color: var(--ink2); font-weight: 600; max-width: 42vw; }
body:not(.campo) .top .where-btn:hover { background: #e9e9ee; }
body:not(.campo) .top .who { background: #e9e9ee; color: var(--ink); }

/* ═══ Navigazione: barra in basso sul telefono, menu a sinistra sul computer ═══ */
.nav-bar { display: flex; }
.nav-voce { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 6px 2px 4px; border: 0; background: none; color: #8e8e93; font-size: 11px; font-weight: 600; }
.nav-voce svg { width: 26px; height: 26px; }
.nav-voce span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav-voce[aria-current="page"] { color: var(--blu); }
.nav-n { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; line-height: 20px; padding: 0 5px; }
.nav-altro { display: none; }
.nav-titolo { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 14px 16px 6px; }
.nav-riga { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-top: 1px solid var(--line); background: #fff; font-size: 17px; text-align: left; }
.nav-riga::after { content: '›'; color: #c7c7cc; font-size: 24px; }
.nav-riga[aria-current="page"] { color: var(--blu); font-weight: 600; }
@media (max-width: 899px) {
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(249,249,251,.94); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .nav-altro.aperto { display: block; position: absolute; left: 0; right: 0; bottom: 100%; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.08); max-height: 70vh; overflow: auto; padding-bottom: 8px; }
  body.con-nav main { padding-bottom: 96px !important; }
  body.con-nav .toast { bottom: 96px; }
}
@media (min-width: 900px) {
  body.con-nav { padding-left: 240px; }
  body.con-nav .top { margin-left: -240px; padding-left: 256px; }
  .nav { position: fixed; top: 0; left: 0; bottom: 0; width: 240px; z-index: 25; background: #f9f9fb; border-right: 1px solid var(--line); padding: 76px 10px 16px; overflow: auto; }
  .nav-bar { flex-direction: column; gap: 2px; }
  .nav-voce { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 16px; color: var(--ink); font-weight: 500; }
  .nav-voce svg { width: 22px; height: 22px; color: var(--blu); }
  .nav-voce[aria-current="page"] { background: #e4e4ea; color: var(--ink); font-weight: 700; }
  .nav-n { position: static; margin-left: auto; }
  .nav-altro-btn { display: none; }
  .nav-altro { display: block; margin-top: 10px; }
  .nav-titolo { padding: 8px 12px 4px; }
  .nav-riga { min-height: 40px; border: 0; border-radius: 10px; background: none; font-size: 15px; padding: 0 12px; color: var(--ink2); }
  .nav-riga::after { content: none; }
  .nav-riga[aria-current="page"] { background: #e4e4ea; color: var(--ink); }
  body.con-nav main { margin-left: auto; margin-right: auto; }
}
/* Da fare per te */
.voce-dafare { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; text-align: left; border-left: 4px solid transparent; }
.voce-dafare.scaduto { border-left-color: var(--red); }
.voce-dafare.oggi { border-left-color: var(--blu); }
.voce-dafare .voce-azione { margin-top: 4px; color: var(--blu); font-weight: 700; font-size: 16px; }
@media print { .nav { display: none !important; } body.con-nav { padding-left: 0; } }
/* selettore a segmenti (come nelle app del telefono) */
.segmenti { display: flex; background: #e4e4ea; border-radius: 10px; padding: 3px; gap: 2px; }
.segmenti button { flex: 1; border: 0; background: none; border-radius: 8px; min-height: 40px; font-size: 15px; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.segmenti button span { color: var(--muted); font-weight: 500; }
.segmenti button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dettagli-lav summary { cursor: pointer; color: var(--blu); font-weight: 600; padding: 4px 0; }
.dettagli-lav[open] summary { margin-bottom: 6px; }

.g-freccia { position: absolute; right: 0; top: -2px; font-size: 11px; font-weight: 700; color: var(--red); background: #fff; padding: 0 4px; border-radius: 4px; }

/* Programma: la fine prevista in cima, unica strada per Tempi e proposte */
.fine-lav { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; flex-wrap: wrap; }
.fine-lav > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.fine-lav b { font-size: 22px; }
.fine-lav .voce-azione, .fine-giornata .voce-azione { color: var(--blu); font-weight: 700; white-space: nowrap; }
.indietro { align-self: flex-start; border: 0; background: none; color: var(--blu); font-weight: 600; font-size: 16px; padding: 6px 0; min-height: 40px; }
/* Piano del giorno: chiudere la giornata sta in fondo */
.fine-giornata { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.fine-giornata > div { flex: 1 1 260px; }
/* Sicurezza oggi: un avviso, le letture per squadra */
.avv-gruppo { display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--red); }
.avv-gruppo.ok { border-left-color: var(--grn); }
.avv-testo { display: flex; gap: 10px; align-items: flex-start; font-size: 17px; }
.avv-testo svg { flex: none; width: 22px; height: 22px; color: var(--red); }
.avv-gruppo.ok .avv-testo svg { color: var(--grn); }
.avv-sq { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 0; border-top: 1px solid var(--line); }
/* il "?" delle spiegazioni dopo le prime volte */
.spiega { margin-top: 6px; }
.spiega summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #e4e4ea; color: var(--ink2); font-weight: 700; cursor: pointer; }
.spiega summary::-webkit-details-marker { display: none; }
.spiega[open] summary { background: var(--blu); color: #fff; }
.spiega p { margin: 6px 0 0; max-width: 640px; }
/* numeri grandi: mai a capo (sul telefono si rimpiccioliscono) */
.kpi b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(20px, 5.4vw, 26px); }
.riga-av { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.riga-av > span:first-child { min-width: 0; }
.riga-av > :last-child { flex: none; white-space: nowrap; }
/* computer: tutte le pagine dell'ufficio con la stessa larghezza, allineate allo stesso bordo */
@media (min-width: 900px) {
  body.con-nav main:not(.phone) { max-width: 1100px !important; }
  .nav-riga { padding-left: 46px; }
  .nav-titolo { padding-left: 12px; }
}
.avv-sq { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
/* la striscia colorata a sinistra resta anche nello stile ordinato (che toglie i bordi alle schede) */
body:not(.campo) .avv-gruppo, body:not(.campo) .voce-dafare { border-left: 4px solid transparent; }
body:not(.campo) .avv-gruppo { border-left-color: var(--red); }
body:not(.campo) .avv-gruppo.ok { border-left-color: var(--grn); }
body:not(.campo) .voce-dafare.scaduto { border-left-color: var(--red); }
body:not(.campo) .voce-dafare.oggi { border-left-color: var(--blu); }
@media (max-width: 520px) {
  body:not(.campo) .top .where-btn { max-width: 52vw; font-size: 16px; color: var(--ink); font-weight: 700; padding: 6px 4px; overflow: hidden; text-overflow: ellipsis; }
  .top .who { max-width: 38vw; padding: 8px 12px; }
}
/* prescrizioni: foto della risoluzione e verbali fuori dall'app */
.foto-pr { display: block; margin-top: 8px; max-width: 220px; max-height: 160px; border-radius: 10px; object-fit: cover; }
.foto-pr-btn { display: inline-flex; align-items: center; gap: 6px; }
.foto-pr-btn img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.foto-pr-btn.pronta { border-color: var(--grn); color: var(--grn); }
.carta { border-top: 1px solid var(--line); padding-top: 10px; }
.carta summary { cursor: pointer; padding: 6px 0; }
.carta label { display: flex; flex-direction: column; gap: 4px; }
.carta[open] { display: flex; flex-direction: column; gap: 10px; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px 0; min-height: 32px; }
/* chi fa cosa sul programma esecutivo */
.passi-prog { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.passi-prog li { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 12px; padding: 10px 12px; border: 1px solid var(--line); }
.passi-prog li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.passo-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: #e4e4ea; color: var(--ink2); }
.passi-prog li.fatto .passo-n { background: var(--grn); color: #fff; }
.passi-prog li.ora { border-color: var(--blu); box-shadow: 0 0 0 1px var(--blu) inset; }
.passi-prog li.ora .passo-n { background: var(--blu); color: #fff; }
.passi-prog li.ora.rosso { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.passi-prog li.ora.rosso .passo-n { background: var(--red); }
.passi-prog li.ora .passo-st { color: var(--blu); font-weight: 600; }
.passi-prog li.ora.rosso .passo-st { color: var(--red); }
@media (max-width: 640px) { .passi-prog { grid-template-columns: 1fr; } }
/* i documenti del cantiere: promemoria e resoconto */
.elenco-doc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.elenco-doc li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.elenco-doc li:first-child { border-top: 0; }
.elenco-doc li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-segno { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: #e4e4ea; color: var(--ink2); }
.elenco-doc li.c .doc-segno { background: var(--grn); color: #fff; }
.elenco-doc li.m .doc-segno { background: #fbecc8; color: #7a5400; }
.doc-dove { color: var(--grn); word-break: break-word; }
.amb-t { color: #8a5f00; }
.elenco-doc .link-btn { align-self: flex-start; text-align: left; color: var(--blu); }
/* visore delle tavole: a schermo intero, si muove come una mappa */
.visore { background: #1b1f22; }
.visore header { background: #1b1f22; color: #fff; border-bottom: 1px solid #2c3236; }
.visore header button { color: #fff; }
.vs-tit { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vs-tit b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-tit span { color: #b9c0c4; }
.vs-pag { display: inline-flex; align-items: center; gap: 4px; color: #fff; }
.vs-pag button { background: #2c3236; border: 0; color: #fff; border-radius: 10px; min-width: 44px; min-height: 44px; font-size: 22px; }
.vs-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; background: #e9e9e4; cursor: grab; outline: none; user-select: none; -webkit-user-select: none; }
.vs-stage.mira { cursor: crosshair; box-shadow: inset 0 0 0 4px var(--red); }
.vs-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.vs-t { position: absolute; display: block; max-width: none; image-rendering: auto; -webkit-user-drag: none; pointer-events: none; }
.vs-layer > img.vs-t:only-child { left: 0; top: 0; }
.vs-pin { position: absolute; width: 40px; height: 40px; margin: -40px 0 0 -20px; color: #fff; background: var(--red); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.4); pointer-events: none; }
.vs-pin svg { width: 22px; height: 22px; transform: rotate(45deg); }
.vs-avviso { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(27,31,34,.9); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 15px; text-align: center; }
.vs-foot { display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #1b1f22; flex-wrap: wrap; }
.vs-foot > .btn.red { flex: 1 1 260px; }
.vs-zoom { display: flex; gap: 8px; flex: 1 1 220px; }
.visore .vs-zoom .btn, body:not(.campo) .visore .vs-zoom .btn { flex: 1; background: #2c3236; color: #fff; border: 0; min-height: 52px; font-size: 20px; }
.vs-pin[hidden], .vs-avviso[hidden] { display: none; }
.visore .body, .visore .foot { display: none; }
.tavola .tav-ok { position: absolute; left: 8px; bottom: 8px; background: var(--grn); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; font-style: normal; }
/* archivio delle tavole */
.carica-tav.sopra { outline: 3px dashed var(--blu); outline-offset: -6px; }
.griglia-tav { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.tav-card { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
.tav-ant { width: 110px; height: 110px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 0; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; }
.tav-ant img { width: 100%; height: 100%; object-fit: contain; }
.tv-cod { width: 150px; max-width: 100%; font-weight: 700; font-size: 15px !important; padding: 6px 10px !important; }
.tv-tit { width: 100%; resize: none; font: inherit; font-size: 15px; line-height: 1.3; min-height: 0; padding: 6px 10px; field-sizing: content; max-height: 8.5em; }
.tv-origine { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; display: grid; gap: 6px; }
.tv-origine legend { padding: 0 4px; font-weight: 600; }
.tv-quote { background: none; border: 0; padding: 0; text-align: left; font-size: 13px; line-height: 1.35; color: var(--red); font-weight: 600; cursor: pointer; }
.tv-lav { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; padding: 4px 0; }
.tv-lav label { display: flex; gap: 8px; align-items: center; }
.riga-prop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
@media (max-width: 520px) { .griglia-tav { grid-template-columns: 1fr; } .tav-card { grid-template-columns: 84px 1fr; } .tav-ant { width: 84px; height: 84px; } }
.visore { overflow: hidden; }
[data-trascina].sopra { outline: 3px dashed var(--blu); outline-offset: -6px; }
.file-gruppo summary { cursor: pointer; padding: 6px 0; }
.file-gruppo[open] > .stack { margin-top: 8px; }
/* pratiche: difetti, chiarimenti, materiali */
.pratica.scaduta { box-shadow: inset 4px 0 0 var(--red); }
.filo { display: flex; flex-direction: column; gap: 10px; border-left: 3px solid var(--line); padding-left: 12px; }
.filo-r { display: flex; flex-direction: column; gap: 4px; }
.riga-az { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.riga-az.fatta b { text-decoration: line-through; color: var(--muted); }
.nav-altro .nav-titolo ~ .nav-titolo { margin-top: 14px; }
/* layout di cantiere sopra la tavola */
.vs-svg { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; overflow: visible; }
.vs-el.sel { filter: drop-shadow(0 0 4px #000); }
.vs-strumenti { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: #1b1f22; scrollbar-width: none; }
.vs-str { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #3a4146; background: #2c3236; color: #fff; border-radius: 999px; padding: 6px 12px 6px 6px; font-size: 14px; min-height: 40px; }
.vs-str i { font-style: normal; display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; font-size: 11px; font-weight: 800; color: #fff; padding: 0 4px; }
.vs-str[aria-pressed="true"] { background: #fff; color: #111; }
.vs-azioni { display: flex; gap: 8px; align-items: center; padding: 6px 12px; background: #1b1f22; color: #d6dadc; flex-wrap: wrap; }
.legenda-layout { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.legenda-layout span { display: inline-flex; gap: 6px; align-items: center; }
.legenda-layout i { font-style: normal; display: grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; color: #fff; font-size: 10px; font-weight: 800; padding: 0 3px; }
.ly-ant { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; cursor: zoom-in; }
.ly-ant img { display: block; width: 100%; height: auto; }
.ly-ant svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vs-azioni [hidden], .visore [hidden] { display: none !important; }
.riga-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.riga-link b { white-space: nowrap; }
.riga-link:first-of-type { border-top: 0; }

/* modello 3D */
.segmenti button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.m3d-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.m3d-box.pieno { position: fixed; inset: 0; z-index: 60; border-radius: 0; border: 0; }
.m3d-barra { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.m3d-barra .segmenti { overflow-x: auto; }
.m3d-barra .segmenti button { flex: 0 0 auto; padding: 0 14px; min-height: 36px; font-size: 14px; }
.m3d-cat { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip-btn { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; color: var(--ink2); min-height: 36px; }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-btn[aria-pressed="true"] .muted { color: rgba(255,255,255,.7); }
.m3d-cat .chip-btn[aria-pressed="false"] { text-decoration: line-through; opacity: .7; }
.m3d { position: relative; height: min(62vh, 620px); min-height: 300px; background: #eef1f5; touch-action: none; }
.m3d-box.pieno .m3d { flex: 1; height: auto; }
.v3d, .v3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.m3d-attesa { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.m3d-comandi { padding: 8px 10px; gap: 6px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.m3d-sez { display: inline-flex; align-items: center; gap: 6px; }
.m3d-sez input[type=range] { width: 160px; }
.m3d-info { padding: 10px 12px; border-top: 1px solid var(--line); max-height: 34vh; overflow: auto; }
.m3d-box.pieno .m3d-info:has(p.muted) { display: none; }
.m3d-q { width: 100%; border-collapse: collapse; margin-top: 8px; }
.m3d-q td { padding: 3px 0; border-top: 1px solid var(--line); vertical-align: top; }
.m3d-q td:first-child { width: 48%; padding-right: 8px; }
.m3d-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.m3d-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.m3d-legenda i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.riga-lsm { border-top: 1px solid var(--line); padding-top: 10px; }
.riga-lsm select { min-height: 34px; font-size: 14px; padding: 4px 8px; width: auto; }
/* SAL */
.tab-wrap { overflow-x: auto; }
.sal-t { width: 100%; border-collapse: collapse; }
.sal-t th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 4px; }
.sal-t td { border-bottom: 1px solid var(--line); padding: 6px 4px; vertical-align: middle; }
.sal-t .num, .sal-conti .num { text-align: right; white-space: nowrap; }
.sal-t input { width: 96px; text-align: right; min-height: 34px; padding: 4px 6px; }
.sal-t input[data-sal-pc] { width: 64px; }
.sal-t tr.cresce td:nth-child(4) { color: var(--grn); font-weight: 600; }
.sal-conti { width: 100%; max-width: 560px; margin-left: auto; border-collapse: collapse; margin-top: 10px; }
.sal-conti td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.sal-conti input { min-height: 30px; padding: 2px 6px; }
.sal-conti tr.tot td { border-top: 2px solid var(--ink); border-bottom: 0; font-size: 1.05em; }
/* lingua dell'operaio */
.lingua-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 15px; min-height: 40px; color: var(--ink); }
.orig { font-size: 13px; opacity: .75; margin-top: 4px; font-weight: 400; }
[dir="rtl"] .orig { direction: ltr; text-align: left; }
.choices.lingue { grid-template-columns: 1fr 1fr; }
.zone-av { display: grid; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
