@font-face { font-family: 'Roboto Flex'; font-style: normal; font-weight: 400 800; font-stretch: 100% 130%; font-display: swap; src: url(fonts/robotoflex-latin.woff2) format('woff2'); }
/* Tema "Espressivo" in versione VVF: rosso scuro del portale, bianco caldo, colori tonali per sezione. */
:root {
  color-scheme: light;
  --bg: #FFF8F7; --s1: #FBEFED; --s2: #F4E3E1; --s3: #E9D3D0;
  --on: #201A1A; --var: #534341; --out: #857371;
  --p: #8B1117; --onp: #fff; --pc: #FFDAD6; --onpc: #410004;
  --ok: #00696B; --okc: #C5EAE6;
  --sc: #F4E3E1; --onsc: #2B1513; --sa: #8B1117;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: #E9DCDA; }
body { font: 16px/1.45 'Roboto Flex', Roboto, system-ui, sans-serif; color: var(--on); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 3px solid var(--sa); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none; }
.disp { font-weight: 800; font-stretch: 125%; font-variation-settings: 'wdth' 125, 'wght' 800; letter-spacing: -.01em; line-height: 1.02; }
.lab { font-weight: 650; font-variation-settings: 'wdth' 108, 'wght' 650; }
#app { width: min(100vw, 460px); height: 100dvh; margin: 0 auto; background: var(--bg); position: relative; overflow: hidden; display: flex; flex-direction: column; }
.scr { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; background: var(--bg); }

/* emblema e righe a chevron (come le strisce dei mezzi) */
.emblem { flex: none; border-radius: 50%; background: var(--p); color: #fff; display: grid; place-items: center; overflow: hidden; }
.emblem img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.chev { height: 6px; background: var(--s3); position: relative; flex: none; }
.chev i { position: absolute; inset: 0 auto 0 0; width: calc(var(--p, 0) * 1%); background: repeating-linear-gradient(-45deg, var(--p) 0 9px, #fff 9px 18px); transition: width var(--sps-d) var(--sps); }

/* home */
.top { display: flex; align-items: center; gap: 12px; padding: 18px 20px 10px; }
.top h1 { font-size: 40px; flex: 1; }
.ib { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--s2); flex: none; transition: border-radius var(--sp-d) var(--sp), transform var(--sp-d) var(--sp); }
.ib:active { border-radius: 16px; transform: scale(.94); }
.scroll { flex: 1; overflow: auto; padding: 8px 16px 150px; }
.sc { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; width: 100%; text-align: left; border-radius: 32px; background: var(--s2); padding: 18px; margin: 0 0 12px; transition: border-radius var(--sp-d) var(--sp), transform var(--sp-d) var(--sp); }
.sc:active { border-radius: 18px; transform: scale(.985); }
.sc.first { background: var(--pc); color: var(--onpc); grid-template-columns: 88px 1fr; padding: 22px 20px; }
.shape { width: 72px; height: 72px; background: var(--p); color: #fff; display: grid; place-items: center; font-size: 22px; border-radius: 30%; transition: border-radius var(--sp-d) var(--sp); }
.first .shape { width: 88px; height: 88px; border-radius: 50%; font-size: 26px; }
.sc:active .shape { border-radius: 50%; }
.first:active .shape { border-radius: 28%; }
.sc.done .shape { background: var(--ok); }
.sc .t { font-size: 21px; line-height: 1.15; font-variation-settings: 'wdth' 110, 'wght' 650; font-weight: 650; overflow-wrap: anywhere; }
.first .t { font-size: 26px; }
.sc .s { font-size: 14px; color: var(--var); margin-top: 4px; }
.first .s { color: #7B3A36; }
.wave { display: block; height: 14px; margin-top: 12px; overflow: hidden; color: var(--p); }
.wave svg { width: 500px; height: 14px; animation: wv 1.4s linear 3; }
@keyframes wv { to { transform: translateX(-25px); } }
.fab { position: absolute; right: 20px; bottom: calc(22px + env(safe-area-inset-bottom)); height: 72px; padding: 0 28px 0 22px; border-radius: 24px; background: var(--p); color: #fff; display: flex; align-items: center; gap: 12px; font-size: 19px; box-shadow: 0 6px 18px #8b111755; transition: border-radius var(--sp-d) var(--sp), transform var(--sp-d) var(--sp); }
.fab:active { border-radius: 36px; transform: scale(.94); }
.empty { padding: 32px 12px; color: var(--var); }

/* scheda */
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 8px; }
.bar .ttl { flex: 1; min-width: 0; }
.bar .ttl b { display: block; font-size: 19px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variation-settings: 'wdth' 112, 'wght' 700; font-weight: 700; }
.bar .ttl small { display: block; font-size: 12px; color: var(--var); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px 10px; scrollbar-width: none; flex: none; }
.chip { flex: none; height: 44px; padding: 0 18px; border-radius: 12px; background: var(--s2); font-size: 15px; display: flex; align-items: center; gap: 8px; transition: border-radius var(--sp-d) var(--sp), background .3s, color .3s; }
.chip.on { border-radius: 22px; background: var(--sa); color: #fff; }
.chip.done::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.chip.att::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: #B26A00; }
.chip.on::before { background: #fff; }
.pane { flex: 1; overflow: auto; padding: 6px 16px 170px; overscroll-behavior: contain; }
h2.sec { font-size: 38px; margin: 12px 4px 14px; color: var(--onsc); transition: color .3s; overflow-wrap: anywhere; }
.group { background: var(--s1); border-radius: 28px; padding: 18px; margin: 0 0 14px; }
.flabel { font-size: 14px; color: var(--var); margin: 0 0 10px 2px; font-weight: 560; }
.portale { color: var(--var); font-size: 13px; margin: 10px 2px 0; }
.note { font-size: 14px; color: var(--var); margin: 10px 2px 0; }
.warn { color: #93000A; }
input[type=text], input[type=search], input[type=number], input[type=password], textarea { width: 100%; background: var(--bg); color: var(--on); border: 0; border-radius: 18px; padding: 14px 16px; font: inherit; box-shadow: inset 0 0 0 1.5px var(--out); }
input:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2.5px var(--sa); }
textarea { resize: vertical; line-height: 1.55; }
.slot { min-height: 60px; border-radius: 20px; border: 2px dashed var(--out); display: flex; align-items: center; padding: 0 16px; color: var(--var); }
.val { min-height: 60px; border-radius: 20px; background: var(--sc); color: var(--onsc); display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 16px; gap: 8px; }
.val .c { font-weight: 800; font-variation-settings: 'wdth' 125, 'wght' 800; font-size: 22px; margin-right: 10px; }
.val .nm { font-weight: 600; font-size: 18px; }
.chg { height: 44px; padding: 0 14px; border-radius: 14px; font-weight: 600; color: var(--sa); }
.sugs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sug { display: grid; grid-template-columns: 58px 1fr; align-items: center; text-align: left; min-height: 62px; padding: 8px 14px; border-radius: 20px; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--s3); transition: border-radius var(--sp-d) var(--sp), transform var(--sp-d) var(--sp); width: 100%; }
.sug:active { border-radius: 32px; transform: scale(.97); }
.sug .c { font-weight: 800; font-size: 20px; color: var(--sa); }
.sug .n { font-weight: 560; font-size: 17px; }
.sug small { display: block; font-size: 12px; color: var(--var); font-weight: 400; }
.sugl { color: var(--var); font-size: 13px; margin: 12px 2px 0; }
.reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--sps-d) var(--sps); }
.reveal.open { grid-template-rows: 1fr; }
.reveal > div { overflow: hidden; min-height: 0; }
.adv { display: grid; grid-template-columns: 56px 1fr; gap: 14px; border-radius: 28px; padding: 18px; margin: 0 0 14px; background: var(--okc); color: #00201E; }
.adv.warn { background: #FFE2A8; color: #271900; }
.adv .ic { width: 56px; height: 56px; background: var(--ok); color: #fff; display: grid; place-items: center; border-radius: 50%; animation: morph 1.1s var(--sp) both; }
.adv.warn .ic { background: #8A5A00; }
@keyframes morph { 0% { border-radius: 50%; transform: scale(.4) rotate(-40deg); } 45% { border-radius: 30%; transform: scale(1.12) rotate(8deg); } 100% { border-radius: 50%; transform: none; } }
.adv h3 { font-size: 20px; font-weight: 700; font-variation-settings: 'wdth' 112, 'wght' 700; }
.adv .rif { font-size: 13px; opacity: .8; }
.adv p { margin: 6px 0 0; font-size: 15px; }
.q { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.q > span { font-size: 19px; line-height: 1.15; font-weight: 650; font-variation-settings: 'wdth' 110, 'wght' 650; }
.grp { display: flex; gap: 4px; flex: none; }
.grp button { height: 60px; min-width: 72px; padding: 0 18px; border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--s3); font-weight: 650; display: flex; align-items: center; justify-content: center; transition: border-radius var(--sp-d) var(--sp), background .25s, color .25s, min-width var(--sp-d) var(--sp), gap var(--sp-d) var(--sp); }
.grp button i { display: block; width: 0; overflow: hidden; transition: width var(--sp-d) var(--sp); }
.grp button.on { border-radius: 30px; background: var(--sa); color: #fff; box-shadow: none; min-width: 96px; gap: 6px; }
.grp button.on i { width: 20px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.cchip { height: 48px; padding: 0 18px; border-radius: 14px; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--s3); display: flex; align-items: center; transition: border-radius var(--sp-d) var(--sp), background .25s, color .25s; }
.cchip.on { background: var(--sa); color: #fff; border-radius: 24px; box-shadow: none; }
.step { display: flex; align-items: center; gap: 12px; padding-top: 14px; }
.step button { width: 60px; height: 60px; border-radius: 20px; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--s3); font-size: 28px; transition: border-radius var(--sp-d) var(--sp), transform var(--sp-d) var(--sp); }
.step button:active { border-radius: 50%; transform: scale(.9); }
.step output { font-size: 42px; min-width: 56px; text-align: center; }
.btn { height: 56px; padding: 0 24px; border-radius: 18px; background: var(--pc); color: var(--onpc); font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: border-radius var(--sp-d) var(--sp), transform var(--sp-d) var(--sp), background .2s; }
.btn:active { border-radius: 28px; transform: scale(.96); }
.btn.pri { background: var(--p); color: #fff; }
.btn.ghost { background: var(--s2); color: var(--on); }
.btn.ok { background: var(--ok); color: #fff; }
.acts { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tog { height: 44px; padding: 0 16px; border-radius: 14px; background: var(--s2); font-weight: 600; transition: border-radius var(--sp-d) var(--sp); }
.tog:active { border-radius: 22px; }
.tog.danger { color: #93000A; }
.pulse { animation: pl 1s var(--sp); }
@keyframes pl { 0% { box-shadow: 0 0 0 0 #00696b88; } 100% { box-shadow: 0 0 0 18px #00696b00; } }
.sumchips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sumchips .cchip { height: 40px; font-size: 14px; background: var(--okc); box-shadow: none; color: #00201E; }

/* barra flottante */
.dock { position: absolute; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: 72px; border-radius: 36px; background: var(--on); color: #fff; display: flex; align-items: center; gap: 6px; padding: 0 10px; box-shadow: 0 8px 24px #0004; z-index: 5; }
.dock .ib { background: #ffffff22; color: #fff; }
.dock .lbl { flex: 1; font-size: 14px; line-height: 1.15; padding-left: 8px; opacity: .85; }
.dock .go { height: 52px; padding: 0 22px; border-radius: 26px; background: var(--sa); color: #fff; font-weight: 650; display: flex; align-items: center; gap: 6px; transition: border-radius var(--sp-d) var(--sp), transform var(--sp-d) var(--sp); }
.dock .go:active { border-radius: 16px; transform: scale(.95); }

/* foto */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.ph { margin: 0; background: var(--bg); border-radius: 22px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--s3); }
.ph img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.ph figcaption { padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--var); align-items: center; }
.ph .tog { height: 38px; padding: 0 12px; font-size: 13px; }

/* riepilogo */
.todo { background: #FFE2A8; color: #271900; border-radius: 28px; padding: 18px; margin: 0 0 14px; }
.todo h3 { font-size: 20px; margin-bottom: 6px; }
.todo ul { margin: 0; padding-left: 20px; }
.prog { margin: 0 2px 16px; }
.prog .bar2 { height: 10px; border-radius: 5px; background: var(--s3); overflow: hidden; margin-top: 8px; }
.prog .bar2 i { display: block; height: 100%; width: calc(var(--p, 0) * 1%); background: var(--ok); border-radius: 5px; transition: width var(--sps-d) var(--sps); }
.rsec { margin: 22px 0 8px; display: flex; align-items: center; gap: 10px; }
.rsec h3 { flex: 1; font-size: 24px; }
.voce { background: var(--s1); border-radius: 24px; padding: 16px; margin: 0 0 10px; transition: opacity .3s, background .3s; }
.voce.fatto { opacity: .55; background: var(--okc); }
.voce .vl { font-size: 13px; color: var(--var); }
.voce .vv { font-size: 21px; line-height: 1.25; margin: 4px 0 6px; font-weight: 650; overflow-wrap: anywhere; user-select: all; }
.voce.lungo .vv { font-size: 16px; font-weight: 400; line-height: 1.6; white-space: pre-wrap; max-height: 260px; overflow: auto; background: var(--bg); border-radius: 16px; padding: 12px; margin-top: 8px; }
.voce .vh { font-size: 12px; color: var(--var); }
.voce .row { display: flex; gap: 8px; margin-top: 12px; }
.voce .row .btn { height: 48px; padding: 0 16px; flex: 1; font-size: 15px; }
.vuoti { font-size: 13px; color: var(--var); margin: 4px 4px 0; }

/* pannello dal basso */
.scrim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 20; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--bg); border-radius: 32px 32px 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform var(--sp-d) var(--sp); max-height: 88%; overflow: auto; box-shadow: 0 -10px 40px #0003; outline: none; }
.sheet::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--out); margin: 0 auto 14px; opacity: .6; }
.sh.open .scrim { opacity: .4; pointer-events: auto; }
.sh.open .sheet { transform: none; }
.sheet h3 { font-size: 24px; margin-bottom: 10px; }
.text { background: var(--bg); border-radius: 20px; padding: 16px; font-size: 17px; line-height: 1.6; box-shadow: inset 0 0 0 1.5px var(--out); white-space: pre-wrap; overflow-wrap: anywhere; }
.preview { white-space: pre-wrap; background: var(--bg); border-radius: 20px; padding: 14px; box-shadow: inset 0 0 0 1.5px var(--out); overflow-wrap: anywhere; font: inherit; }
.w { display: inline-block; white-space: pre-wrap; opacity: 0; animation: wd var(--sp-d) var(--sp) forwards; animation-delay: calc(var(--i) * 26ms); }
@keyframes wd { from { opacity: 0; transform: translateY(10px) scale(.9); } to { opacity: 1; transform: none; } }
.del { background: #FFDAD6; color: #93000A; text-decoration: line-through; border-radius: 6px; }
.ins { background: #BDEFD0; color: #00391C; border-radius: 6px; }
.busy { display: flex; align-items: center; gap: 14px; color: var(--var); }
.busy i { width: 28px; height: 28px; border-radius: 50%; border: 4px solid var(--pc); border-top-color: var(--p); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* transizioni tra schermate */
::view-transition-group(surf) { animation-duration: var(--sp-d); animation-timing-function: var(--sp); overflow: clip; animation-name: -ua-view-transition-group-anim-surf, srad; }
::view-transition-old(surf), ::view-transition-new(surf) { height: 100%; object-fit: cover; }
@keyframes srad { from { border-radius: 24px; } to { border-radius: 0; } }
html[data-vt=back]::view-transition-group(surf) { animation-name: -ua-view-transition-group-anim-surf, srad2; }
@keyframes srad2 { from { border-radius: 0; } to { border-radius: 24px; } }
html[data-vt=reveal]::view-transition-old(root) { animation: none; }
html[data-vt=reveal]::view-transition-new(root) { animation: reveal var(--sps-d) var(--sps) both; mix-blend-mode: normal; }
@keyframes reveal { from { clip-path: circle(0 at var(--x) var(--y)); } to { clip-path: circle(var(--r) at var(--x) var(--y)); } }
@media (prefers-reduced-motion: reduce) { *, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; } }
.group .group { background: var(--bg); margin: 12px 0 0; padding: 14px; border-radius: 22px; }
.adv p.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.adv .more { margin-top: 6px; height: 40px; padding: 0 2px; font-weight: 650; text-decoration: underline; color: inherit; }
.sc > div, .voce, .group { min-width: 0; }
.sc .wave { max-width: 100%; }
.sug .why { color: var(--sa); font-weight: 560; margin-top: 2px; }
