/* Fonogramma — stile dell'app (mobile-first, tema scuro/chiaro) */
:root {
  --bg: #0a0f1c;
  --bg2: #0d1426;
  --card: #121b30;
  --card2: #172340;
  --line: #24314f;
  --text: #e8eef9;
  --muted: #8d9cbc;
  --accent: #2dd4bf;
  --accent-ink: #04211d;
  --accent2: #818cf8;
  --s1: #ff5d7a;
  --s2: #4cc9f0;
  --s3: #ffb547;
  --s4: #c77dff;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --rec: #ef4444;
  --plot: #070b14;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --nav-h: 64px;
  --top-h: 56px;
  font-synthesis: none;
}
:root[data-theme="light"] {
  --bg: #f3f6fb;
  --bg2: #e9eef7;
  --card: #ffffff;
  --card2: #f2f5fb;
  --line: #dbe3f0;
  --text: #0f172a;
  --muted: #5b6b88;
  --accent: #0d9488;
  --accent-ink: #ffffff;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: .3em 0 .8em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.num { font-variant-numeric: tabular-nums; }
.lead { font-size: 1.02rem; }
.hidden { display: none !important; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: .6rem; }
.grow { flex: 1; min-width: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.lg { width: 26px; height: 26px; }
.ic.sm { width: 16px; height: 16px; }

/* ---------- Shell ---------- */
#app { display: grid; grid-template-rows: var(--top-h) 1fr var(--nav-h); height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: .6rem; padding: 0 12px;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; letter-spacing: -.02em; text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand span small { display: block; font-weight: 500; font-size: .7rem; color: var(--muted); letter-spacing: 0; }
.ctx-chip { margin-left: auto; display: flex; gap: .4rem; align-items: center; min-width: 0; }
.sync-chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .6rem; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.sync-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-chip.ok .dot { background: var(--ok); }
.sync-chip.off .dot { background: var(--bad); }
.sync-chip.busy .dot { background: var(--warn); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }

main#view { overflow: auto; min-height: 0; position: relative; grid-row: 2; }
.topbar { grid-row: 1; }
.page { max-width: 1180px; margin: 0 auto; padding: 16px 14px 32px; }

.nav {
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 5;
  grid-row: 3;
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600;
}
.nav a.on { color: var(--accent); }
.nav a.cta .ic { background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 7px; width: 38px; height: 38px; }
.nav a.cta.on .ic { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

@media (min-width: 900px) {
  #app { grid-template-columns: 92px 1fr; grid-template-rows: var(--top-h) 1fr; }
  .topbar { grid-column: 1 / 3; }
  .nav { grid-row: 2; grid-column: 1; flex-direction: column; justify-content: flex-start; gap: 6px; border-top: 0; border-right: 1px solid var(--line); padding: 12px 0; }
  .nav a { flex: none; padding: 10px 0; }
  main#view { grid-column: 2; grid-row: 2; }
  #toasts { bottom: 22px; left: calc(50% + 46px); }
}

/* ---------- Componenti ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 { display: flex; align-items: center; gap: .45rem; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.section-title h2 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1rem; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .06s ease, background .15s; user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.danger { background: color-mix(in srgb, var(--bad) 18%, var(--card2)); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.rec { background: var(--rec); color: #fff; border-color: transparent; }
.btn.lg { padding: .9rem 1.3rem; font-size: 1.05rem; border-radius: 14px; }
.btn.sm { padding: .38rem .65rem; font-size: .85rem; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer;
}
.icon-btn.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: .4rem .75rem; border-radius: 99px; border: 1px solid var(--line); background: var(--card2);
  font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--text);
}
.chip.on { background: color-mix(in srgb, var(--accent) 22%, var(--card2)); border-color: var(--accent); color: var(--text); }
.chips.small .chip { padding: .28rem .6rem; font-size: .8rem; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }

.seg { display: inline-flex; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: .45rem .85rem; border-radius: 9px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--card2); border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.badge.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: .8rem; color: var(--muted); font-weight: 600; }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=password], select, textarea {
  width: 100%; padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
input[type=range] { width: 100%; accent-color: var(--accent); }
label.check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text); cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: color-mix(in srgb, var(--card2) 60%, transparent); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--accent2) 25%, var(--card2)); color: var(--text); flex: none; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: .7rem .9rem; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

/* toast */
#toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .8rem; justify-content: space-between; background: #1d2742; color: #fff; padding: .7rem .9rem; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: .25s; border-left: 4px solid var(--accent); }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast-btn { background: none; border: 0; color: var(--accent); font-weight: 800; cursor: pointer; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; background: rgba(2, 6, 18, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 90; opacity: 0; transition: opacity .2s; }
.sheet-wrap.open { opacity: 1; }
.sheet { background: var(--card); width: 100%; max-height: 90dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; transform: translateY(30px); transition: transform .22s; border: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.sheet-head h3 { margin: 0; }
.sheet-body { padding: 6px 16px 14px; overflow: auto; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px 16px; border-top: 1px solid var(--line); }
@media (min-width: 760px) {
  .sheet-wrap { align-items: center; }
  .sheet { width: min(560px, 94vw); border-radius: 18px; }
  .sheet.wide { width: min(980px, 96vw); }
}

/* ---------- Home ---------- */
.hero { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .hero { grid-template-columns: 1.3fr 1fr; } }
.hero-main { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 30%, var(--card)) 0%, var(--card) 55%); }
.action-tile { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); background: var(--card2); border: 1px solid var(--line); cursor: pointer; text-decoration: none; color: var(--text); }
.action-tile .ic { width: 28px; height: 28px; color: var(--accent); }
.action-tile b { display: block; }

/* ---------- Mappa torace ---------- */
.bodymap { width: 100%; height: auto; max-height: 420px; display: block; margin: 0 auto; }
.bm-body { fill: color-mix(in srgb, var(--accent2) 10%, var(--card2)); stroke: color-mix(in srgb, var(--accent2) 40%, var(--line)); stroke-width: 1.5; }
.bm-rib { fill: none; stroke: color-mix(in srgb, var(--muted) 30%, transparent); stroke-width: 1; }
.bm-line, .bm-spine { fill: none; stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 2; stroke-linecap: round; }
.bm-spine { stroke-dasharray: 4 5; }
.bm-guide { fill: none; stroke: color-mix(in srgb, var(--muted) 30%, transparent); stroke-dasharray: 2 5; }
.bm-sternum { fill: color-mix(in srgb, var(--muted) 18%, transparent); stroke: color-mix(in srgb, var(--muted) 40%, transparent); }
.bm-scap { fill: color-mix(in srgb, var(--muted) 14%, transparent); stroke: color-mix(in srgb, var(--muted) 40%, transparent); }
.bm-heart { fill: color-mix(in srgb, var(--s1) 16%, transparent); stroke: color-mix(in srgb, var(--s1) 40%, transparent); stroke-dasharray: 3 3; }
.bm-side { font-size: 13px; font-weight: 800; fill: var(--muted); }
.bm-cap { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.bm-site { cursor: pointer; }
.bm-dot { fill: var(--card); stroke: var(--accent); stroke-width: 2.5; transition: .15s; }
.bm-site.opt .bm-dot { stroke-dasharray: 3 2; }
.bm-num { font-size: 11px; font-weight: 800; text-anchor: middle; fill: var(--text); pointer-events: none; }
.bm-site.done .bm-dot { fill: color-mix(in srgb, var(--ok) 70%, var(--card)); stroke: var(--ok); }
.bm-site.abn .bm-dot { fill: color-mix(in srgb, var(--warn) 75%, var(--card)); stroke: var(--warn); }
.bm-site.sel .bm-dot { fill: var(--accent); stroke: #fff; }
.bm-site.sel .bm-num { fill: var(--accent-ink); }
.bm-pulse { fill: none; stroke: var(--accent); stroke-width: 2; animation: pulse 1.6s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
.bm-site:hover .bm-dot { stroke-width: 3.5; }

/* ---------- Live ---------- */
.live { display: flex; flex-direction: column; height: 100%; }
.live-top { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.site-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border-radius: 11px; border: 1px solid var(--line); background: var(--card2); font-weight: 700; cursor: pointer; max-width: 100%; }
.site-btn .ic { color: var(--accent); }
.site-btn small { color: var(--muted); font-weight: 600; }
.live-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.plots { display: grid; grid-template-rows: 38% 62%; min-height: 0; gap: 2px; background: #02050b; position: relative; }
.plot { position: relative; min-height: 0; }
.plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.plot-tag { position: absolute; right: 8px; top: 6px; font-size: .72rem; color: #c9d6f3; background: rgba(5, 10, 22, .65); padding: 2px 8px; border-radius: 99px; pointer-events: none; }
.plot-tag.left { right: auto; left: 40px; }
.overlay-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #c9d6f3; padding: 20px; pointer-events: none; }
.overlay-msg .card { pointer-events: auto; max-width: 420px; }
.side { border-top: 1px solid var(--line); background: var(--bg); overflow: auto; }
.metrics { display: flex; gap: 8px; padding: 8px; overflow-x: auto; scrollbar-width: none; }
.metrics::-webkit-scrollbar { display: none; }
.metric { flex: none; min-width: 112px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.metric .k { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.metric .v { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.metric .v small { font-size: .75rem; color: var(--muted); font-weight: 600; }
.metric .d { font-size: .74rem; color: var(--muted); }
.metric.big .v { font-size: 1.9rem; color: var(--s1); }
.metric.alert { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.metric.alert .v { color: var(--warn); }
.metric.good .v { color: var(--ok); }
.sqi-bar { height: 5px; border-radius: 9px; background: var(--card2); margin-top: 5px; overflow: hidden; }
.sqi-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bad), var(--warn), var(--ok)); }
.side-extra { display: none; }
@media (max-width: 899px) {
  .live-top { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 8px; }
  .live-top::-webkit-scrollbar { display: none; }
  .live-top > * { flex: none; }
  .hide-sm { display: none; }
}
.controls { display: flex; gap: 8px; align-items: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.controls .main-btns { display: flex; gap: 8px; align-items: center; }
.controls .grow { display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.btn.start { min-width: 120px; }
.btn.recording { animation: recglow 1.2s infinite; }
@keyframes recglow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--rec) 30%, transparent); } }
.level { width: 64px; height: 8px; border-radius: 9px; background: var(--card2); overflow: hidden; position: relative; }
.level i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--ok), var(--warn) 75%, var(--bad)); }
.guide-card ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.guide-card li { margin: .2rem 0; }
.ens-canvas { width: 100%; height: 120px; display: block; border-radius: 10px; background: var(--plot); }
.guided-banner { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 4; background: rgba(8, 14, 30, .92); border: 1px solid var(--accent); color: #e8eef9; border-radius: 14px; padding: 10px 14px; width: min(94%, 560px); box-shadow: var(--shadow); }
.guided-banner .count { font-size: 2.2rem; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s linear; }

@media (min-width: 900px) {
  .live-body { grid-template-columns: 1fr 340px; grid-template-rows: 1fr; }
  .side { border-top: 0; border-left: 1px solid var(--line); }
  .metrics { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .metric { min-width: 0; }
  .metric.big { grid-column: 1 / 3; }
  .side-extra { display: block; padding: 0 8px 12px; }
}
@media (max-width: 899px) and (orientation: landscape) {
  .live-body { grid-template-columns: 1fr 240px; grid-template-rows: 1fr; }
  .side { border-top: 0; border-left: 1px solid var(--line); }
  .metrics { flex-direction: column; overflow: auto; }
}

/* ---------- Registrazione / player ---------- */
.rec-plots { background: #02050b; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.rec-plots canvas { display: block; width: 100%; touch-action: none; }
.rec-wave { height: 150px; }
.rec-spec { height: 220px; }
.rec-mini { height: 34px; cursor: pointer; }
.transport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--muted); font-weight: 700; font-size: .75rem; position: sticky; top: 0; background: var(--card); }
table.data tr.sel td { background: color-mix(in srgb, var(--accent) 16%, transparent); }
table.data tbody tr { cursor: pointer; }
.table-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.finding { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.finding:last-child { border-bottom: 0; }
.finding > span { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; margin-bottom: 5px; }

/* ---------- Visita ---------- */
.site-card { display: grid; gap: 10px; }
.site-card .head { display: flex; gap: 10px; align-items: center; }
.site-num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; background: var(--card2); border: 2px solid var(--accent); flex: none; }
.site-num.done { background: var(--ok); color: #04211d; border-color: var(--ok); }
.site-num.abn { background: var(--warn); color: #241a00; border-color: var(--warn); }
.auto-box { background: var(--card2); border-radius: 10px; padding: 8px 10px; font-size: .86rem; }
.rec-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .55rem; border-radius: 9px; background: var(--card2); border: 1px solid var(--line); font-size: .8rem; text-decoration: none; color: var(--text); }
.map-layout { display: grid; gap: 14px; }
@media (min-width: 900px) { .map-layout { grid-template-columns: 300px 1fr; align-items: start; } .map-layout .sticky { position: sticky; top: 10px; } }

/* ---------- Referto (stampa) ---------- */
.report { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 28px; border-radius: 10px; }
.report h1 { font-size: 1.4rem; color: #0f766e; }
.report h2 { font-size: 1.05rem; margin-top: 18px; border-bottom: 2px solid #e2e8f0; padding-bottom: 4px; }
.report table { width: 100%; border-collapse: collapse; font-size: .82rem; margin: 6px 0; }
.report th, .report td { border: 1px solid #e2e8f0; padding: 4px 6px; text-align: left; vertical-align: top; }
.report th { background: #f1f5f9; }
.report .thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.report .thumbs figure { margin: 0; break-inside: avoid; }
.report .thumbs img { width: 100%; border-radius: 6px; border: 1px solid #e2e8f0; }
.report .thumbs figcaption { font-size: .75rem; color: #475569; }
.report .disclaimer { font-size: .72rem; color: #64748b; margin-top: 18px; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  #app { display: block; height: auto; }
  .topbar, .nav, .no-print, #toasts { display: none !important; }
  main#view { overflow: visible; }
  .report { padding: 0; max-width: none; }
}
