/* Cortana — cornice e dashboard. Vetro tenue sopra le foto di casa. */

@font-face { font-family: "Bricolage"; src: url("/web/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/web/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900; font-display: swap; }

:root {
  --lilla: #C9C2F2;
  --salvia: #B7E0CF;
  --pesca: #F6C9AE;
  --cielo: #AFCBEF;
  --rosa: #F3C4D6;
  --giallo: #F3E3A6;
  --inchiostro: #2B2740;
  --tinta: 201 194 242;            /* RGB estratto dalla foto corrente (aggiornato da app.js) */
  --testo: #FBFAFF;
  --testo-2: rgba(251, 250, 255, .72);
  --testo-3: rgba(251, 250, 255, .58);
  --vetro: rgba(255, 255, 255, .13);
  --vetro-forte: rgba(255, 255, 255, .2);
  --bordo: rgba(255, 255, 255, .22);
  --luce: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(255, 255, 255, .05);
  --ombra: 0 20px 60px -20px rgba(20, 16, 40, .55);
  --sfoca: blur(28px) saturate(150%);
  --display: "Bricolage", "Segoe UI Variable Display", system-ui, sans-serif;
  --testo-font: "Figtree", "Segoe UI Variable Text", system-ui, sans-serif;
  --menu-l: 100px;
  --tocco: 52px;            /* altezza minima dei comandi: si usano col dito, anche da lontano */
  --tocco-p: 44px;
  --agenda-l: 330px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--inchiostro); }
/* niente ingrandimento automatico del testo (iPhone in orizzontale): spingerebbe il testo fuori dai pulsanti */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--testo-font); color: var(--testo); font-size: 17px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cielo); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
input, textarea { user-select: text; -webkit-user-select: text; }

/* ------------------------------------------------------------ foto di sfondo */
#foto { position: fixed; inset: 0; overflow: hidden; }
#foto .strato {
  position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; opacity: 0;
  transition: opacity 1.8s ease, filter 0.9s ease, transform 0.9s ease;
  will-change: opacity, transform;
}
#foto .strato.attivo { opacity: 1; animation: respiro 26s ease-in-out infinite alternate; }
@keyframes respiro { from { transform: scale(1); } to { transform: scale(1.06) translate(-0.6%, -0.4%); } }
#foto .velo {
  position: absolute; inset: 0; pointer-events: none; transition: background 0.9s ease;
  background:
    linear-gradient(to top, rgba(30, 24, 52, .55), rgba(30, 24, 52, 0) 38%),
    linear-gradient(to bottom, rgba(30, 24, 52, .25), rgba(30, 24, 52, 0) 22%);
}
#foto.vuota { background:
  radial-gradient(60% 70% at 15% 20%, rgba(201,194,242,.55), transparent 70%),
  radial-gradient(50% 60% at 85% 30%, rgba(175,203,239,.45), transparent 70%),
  radial-gradient(60% 60% at 60% 95%, rgba(246,201,174,.45), transparent 70%),
  var(--inchiostro); }

/* in dashboard la foto diventa luce diffusa */
body.in-app #foto .strato { filter: blur(48px) saturate(130%) brightness(.78); transform: scale(1.15); animation: none; }
body.in-app #foto .velo { background:
  linear-gradient(135deg, rgb(var(--tinta) / .28), rgba(43, 39, 64, .35) 55%, rgba(246, 201, 174, .16)); }

/* ------------------------------------------------------------ cornice */
#cornice { position: fixed; inset: 0; display: flex; align-items: flex-end; padding: 5vh 5vw; cursor: pointer; }
body.in-app #cornice { pointer-events: none; opacity: 0; }
.cornice-info { text-shadow: 0 2px 24px rgba(20, 16, 40, .45); transition: opacity .6s; }
.cornice-ora {
  font-family: var(--display); font-weight: 250; font-size: clamp(72px, 13vw, 190px);
  line-height: .9; letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}
.cornice-riga { display: flex; gap: 1.2em; align-items: center; margin-top: .6em;
  font-size: clamp(17px, 1.9vw, 26px); color: var(--testo-2); font-weight: 400; }
.cornice-meteo { display: inline-flex; align-items: center; gap: .4em; }
.cornice-meteo svg { width: 1.35em; height: 1.35em; }
.cornice-maniglia { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); opacity: .55; }
.cornice-maniglia span { display: block; width: 72px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.75); }
.cornice-vuota { position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  font-family: var(--display); font-size: 26px; font-weight: 300; color: var(--testo-2); }
.cornice-vuota p { margin: .2em; }

/* ------------------------------------------------------------ app */
#app {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: var(--menu-l) minmax(0, 1fr) var(--agenda-l);
  gap: 18px; padding: 18px; padding-left: max(18px, var(--sa-l));
  animation: sale .7s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sale { from { opacity: 0; transform: translateY(6vh); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

.vetro {
  background: var(--vetro); border: 1px solid var(--bordo); box-shadow: var(--luce), var(--ombra);
  backdrop-filter: var(--sfoca); -webkit-backdrop-filter: var(--sfoca);
}

/* menu */
#menu {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 8px; border-radius: 30px; overflow-y: auto;
  scrollbar-width: none;
}
#menu::-webkit-scrollbar { display: none; }
.voce-menu {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border: 0; flex: 0 0 auto;
  background: transparent; border-radius: 20px; color: var(--testo-2); font-size: 12.5px; font-weight: 550;
  transition: background .25s, color .25s;
}
.voce-menu svg { width: 27px; height: 27px; }
.voce-menu:hover { color: var(--testo); }
.voce-menu[aria-current="page"] { background: var(--vetro-forte); color: var(--testo); box-shadow: var(--luce); }
.voce-menu.cornice-btn { margin-top: auto; }
@media (max-height: 860px) and (min-width: 981px) {
  .voce-menu { padding: 6px 4px; gap: 2px; font-size: 11.5px; }
  .voce-menu svg { width: 24px; height: 24px; }
  .menu-sep { margin: 4px 14px; }
}
.menu-sep { height: 1px; background: var(--bordo); margin: 6px 14px; }

/* vista centrale */
#vista { overflow-y: auto; border-radius: 34px; padding: 30px 34px 110px; scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent; outline: none; }
.titolo-pagina { font-family: var(--display); font-weight: 400; font-size: 38px; letter-spacing: -0.02em;
  margin: 0 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--tocco); }
.titolo-pagina > span { flex: 1; min-width: 0; }
h2 { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; margin: 0 0 14px; }
.sezione { margin-top: 30px; }
.titolo-pagina + .sezione, .testata + .sezione, .chat .sezione { margin-top: 0; }
.campo.stretto { flex: 0 0 110px; min-width: 0; }
.muto { color: var(--testo-3); }
.piccolo { font-size: 14.5px; }

/* home: testata con orologio */
.testata { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--bordo); }
.ora-grande { font-family: var(--display); font-weight: 250; font-size: clamp(64px, 8.5vw, 112px);
  line-height: .88; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.data-grande { font-size: 19px; color: var(--testo-2); margin-top: 10px; }
.saluto { font-family: var(--display); font-size: 22px; font-weight: 300; color: var(--testo-2); }

.meteo-blocco { display: flex; align-items: center; gap: 16px; }
.meteo-blocco svg.grande { width: 72px; height: 72px; }
.meteo-temp { font-family: var(--display); font-size: 54px; font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
.meteo-desc { color: var(--testo-2); font-size: 15px; }
.ore { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.ore::-webkit-scrollbar { display: none; }
.ora-meteo { flex: 0 0 auto; width: 68px; text-align: center; padding: 12px 0; border-radius: 20px; }
.ora-meteo:first-child { background: rgba(255,255,255,.12); }
.ora-meteo svg { width: 28px; height: 28px; display: block; margin: 6px auto; }
.ora-meteo .t { font-weight: 600; }
.ora-meteo .p { font-size: 13px; color: var(--cielo); }

.griglia-home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 34px; }
@media (max-width: 1250px) { .griglia-home { grid-template-columns: 1fr; } }

/* liste di elementi */
.elenco { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.riga { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 20px; min-height: 64px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.riga .principale { flex: 1; min-width: 0; }
.riga .titolo { font-weight: 600; }
.riga .sotto { font-size: 14.5px; color: var(--testo-2); margin-top: 2px; }
.vuoto { padding: 20px 22px; border-radius: 20px; border: 1px dashed rgba(255,255,255,.26); color: var(--testo-2); line-height: 1.5; }

/* timer */
.conto { font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 400;
  color: var(--pesca); min-width: 84px; text-align: right; }

/* note */
.note { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.nota { position: relative; padding: 18px 18px 50px; border-radius: 16px 16px 16px 4px; color: var(--inchiostro);
  min-height: 130px; font-size: 16.5px; line-height: 1.38; box-shadow: 0 10px 26px -14px rgba(20,16,40,.6);
  white-space: pre-wrap; word-break: break-word; }
.nota[data-colore="giallo"] { background: color-mix(in srgb, var(--giallo) 88%, white); }
.nota[data-colore="rosa"] { background: color-mix(in srgb, var(--rosa) 88%, white); }
.nota[data-colore="verde"] { background: color-mix(in srgb, var(--salvia) 88%, white); }
.nota[data-colore="azzurro"] { background: color-mix(in srgb, var(--cielo) 88%, white); }
.nota[data-colore="lilla"] { background: color-mix(in srgb, var(--lilla) 88%, white); }
.nota[data-colore="pesca"] { background: color-mix(in srgb, var(--pesca) 88%, white); }
.nota .azioni-nota { position: absolute; right: 6px; bottom: 4px; display: flex; gap: 2px; }
.nota .azioni-nota button { border: 0; background: transparent; color: rgba(43,39,64,.6); width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; }
.nota .azioni-nota svg { width: 20px; height: 20px; }
.nota .azioni-nota button:hover { background: rgba(43,39,64,.08); color: var(--inchiostro); }
.nota.fissata::before { content: ""; position: absolute; top: -5px; left: 18px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--inchiostro); box-shadow: 0 2px 4px rgba(0,0,0,.3); }

/* pulsanti e campi */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--bordo);
  background: var(--vetro-forte); padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 16px; box-shadow: var(--luce);
  transition: background .2s, transform .15s, opacity .2s; min-height: var(--tocco);
  white-space: normal; text-align: center; line-height: 1.2; overflow-wrap: anywhere; max-width: 100%; }
.btn:hover { background: rgba(255,255,255,.28); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn:active { transform: scale(.97); }
.btn svg { width: 21px; height: 21px; flex: 0 0 auto; }
.btn.chiaro { background: rgba(255,255,255,.92); color: var(--inchiostro); border-color: transparent; }
.btn.chiaro:hover { background: #fff; }
.btn.piccolo { padding: 9px 16px; min-height: var(--tocco-p); font-size: 15px; }
.btn.icona { padding: 0; width: var(--tocco); flex: 0 0 auto; }
.btn.icona.piccolo { width: var(--tocco-p); }
.btn.pericolo { background: #E5484D; border-color: transparent; color: #fff; }
.btn.pericolo:hover { background: #F05B60; }
.campo { width: 100%; padding: 13px 18px; border-radius: 18px; border: 1px solid var(--bordo); font-size: 17px;
  background: rgba(255,255,255,.1); outline: none; min-height: var(--tocco); }
select.campo { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; }
select.campo option { color: var(--inchiostro); }
.campo:focus { border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.15); }
.campo::placeholder { color: var(--testo-3); }
.modulo { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.modulo .campo { flex: 1; min-width: 180px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--bordo); background: rgba(255,255,255,.08);
  padding: 10px 18px; border-radius: 999px; font-size: 15.5px; font-weight: 550; min-height: 46px; transition: background .2s; }
.chip:hover { background: rgba(255,255,255,.16); }
.chip svg { width: 18px; height: 18px; }
.chip[aria-pressed="true"] { background: rgba(255,255,255,.85); color: var(--inchiostro); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }

/* interruttore */
.interruttore { position: relative; width: 64px; height: 38px; border-radius: 999px; border: 0; flex: 0 0 auto;
  background: rgba(255,255,255,.18); box-shadow: inset 0 1px 3px rgba(0,0,0,.25); transition: background .25s; }
.interruttore::after { content: ""; position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .25s cubic-bezier(.3,.7,.3,1); }
.interruttore[aria-checked="true"] { background: linear-gradient(135deg, #A99CF0, #8DB7EC); }
.interruttore[aria-checked="true"]::after { transform: translateX(26px); }

/* dispositivi */
.stanze { display: flex; flex-direction: column; gap: 26px; }
.dispositivi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; align-items: start; }
.disp { padding: 18px; border-radius: 26px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; gap: 16px; transition: background .3s; }
.disp.acceso { background: linear-gradient(140deg, rgb(var(--tinta) / .32), rgba(255,255,255,.12)); border-color: rgba(255,255,255,.3); }
.disp-testa { display: flex; align-items: center; gap: 14px; min-height: var(--tocco); }
.disp-icona { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,255,255,.12); flex: 0 0 auto; }
.disp.acceso .disp-icona { background: rgba(255,255,255,.85); color: var(--inchiostro); }
.disp-icona svg { width: 27px; height: 27px; }
.disp-nome { font-weight: 650; font-size: 18px; line-height: 1.25; }
.disp-stato { font-size: 14.5px; color: var(--testo-2); margin-top: 2px; }
.disp input[type=range] { width: 100%; height: 40px; accent-color: #fff; cursor: pointer; }
.telecomando { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.telecomando button { border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08); border-radius: 18px;
  min-height: 58px; display: grid; place-items: center; transition: background .15s, transform .1s; }
.telecomando button:hover { background: rgba(255,255,255,.16); }
.telecomando button:active { transform: scale(.94); background: rgba(255,255,255,.3); }
.telecomando button svg { width: 25px; height: 25px; }

/* notizie */
.notizie { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.notizia { padding: 18px; border-radius: 22px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.notizia.prima { grid-column: 1 / -1; background: rgba(255,255,255,.13); }
.notizia h3 { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.22; margin: 0 0 8px; letter-spacing: -0.01em; }
.notizia.prima h3 { font-size: 27px; font-weight: 400; }
.notizia p { margin: 0; color: var(--testo-2); font-size: 15px; max-width: 70ch; }
.notizia .quando { margin-top: 10px; font-size: 13px; color: var(--testo-3); }

/* sistema */
.indicatori { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.indicatore { padding: 18px; border-radius: 22px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.indicatore .valore { font-family: var(--display); font-size: 38px; font-weight: 300; letter-spacing: -0.02em; }
.barra { height: 8px; border-radius: 9px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: 10px; }
.barra > i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--salvia), var(--cielo)); }
.barra.alta > i { background: linear-gradient(90deg, var(--pesca), #F3A6A6); }
.testo-lungo { white-space: pre-wrap; line-height: 1.6; color: var(--testo-2); max-width: 75ch; }

/* chat */
.chat { display: flex; flex-direction: column; height: 100%; }
.messaggi { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 16px; }
.msg { max-width: min(70ch, 82%); padding: 12px 16px; border-radius: 20px; white-space: pre-wrap; word-break: break-word;
  user-select: text; -webkit-user-select: text; }
.msg.io { align-self: flex-end; background: rgba(255,255,255,.88); color: var(--inchiostro); border-bottom-right-radius: 6px; }
.msg.lei { align-self: flex-start; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.14); border-bottom-left-radius: 6px; }
.msg.attesa { color: var(--testo-3); font-style: italic; }
.chat-invio { display: flex; gap: 10px; }

/* agenda: binario verticale */
#agenda { border-radius: 30px; padding: 22px 20px; overflow-y: auto; scrollbar-width: none; }
#agenda::-webkit-scrollbar { display: none; }
.agenda-testa { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.agenda-testa .mese { font-family: var(--display); font-size: 22px; font-weight: 400; text-transform: capitalize; }
.giorno { position: relative; padding: 0 0 18px 54px; min-height: 72px; }
.giorno::before { content: ""; position: absolute; left: 21px; top: 62px; bottom: 6px; width: 2px;
  background: linear-gradient(rgba(255,255,255,.28), rgba(255,255,255,.06)); }
.giorno:last-child::before { display: none; }
.giorno-num { position: absolute; left: 0; top: 0; width: 44px; text-align: center; }
/* stessa scatola per tutti i giorni: i numeri restano allineati, "oggi" cambia solo il fondo */
.giorno-num b { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto; border-radius: 50%;
  font-family: var(--display); font-size: 23px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.giorno-num small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--testo-3); text-transform: capitalize; }
.giorno.oggi .giorno-num b { background: rgba(255,255,255,.9); color: var(--inchiostro); font-size: 19px; font-weight: 600; }
.evento { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 16px; margin-bottom: 6px;
  background: rgba(255,255,255,.1); font-size: 15.5px; min-height: 44px; }
.evento .h { font-variant-numeric: tabular-nums; color: var(--testo-2); font-size: 14px; min-width: 44px; }
.evento .cosa { flex: 1; min-width: 0; }
.evento[data-tipo="evento"] { border-left: 3px solid var(--cielo); }
.evento[data-tipo="promemoria"] { border-left: 3px solid var(--pesca); }
.evento[data-tipo="routine"] { border-left: 3px solid var(--lilla); background: rgba(255,255,255,.06); }
.evento.passato { opacity: .45; }
.giorno-libero { font-size: 14.5px; color: var(--testo-3); padding-top: 11px; }

/* accesso */
#accesso { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20;
  background: rgba(30, 24, 52, .25); backdrop-filter: blur(30px) saturate(140%); -webkit-backdrop-filter: blur(30px) saturate(140%); }
.pin-vetro { text-align: center; padding: 40px 44px; border-radius: 40px; background: var(--vetro);
  border: 1px solid var(--bordo); box-shadow: var(--luce), var(--ombra); }
.pin-titolo { font-family: var(--display); font-size: 40px; font-weight: 300; letter-spacing: -0.02em; }
.pin-sotto { color: var(--testo-2); margin-top: 4px; min-height: 1.45em; }
.pin-sotto.errore { color: #FFC2C2; }
.pin-punti { display: flex; justify-content: center; gap: 18px; margin: 26px 0 30px; }
.pin-punti i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); transition: background .15s, transform .15s; }
.pin-punti i.pieno { background: #fff; border-color: #fff; transform: scale(1.1); }
.pin-punti.scuoti { animation: scuoti .4s; }
@keyframes scuoti { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pin-tastiera { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px; justify-content: center; }
.pin-tastiera button { width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--bordo);
  background: rgba(255,255,255,.1); font-family: var(--display); font-size: 32px; font-weight: 300; box-shadow: var(--luce); }
.pin-tastiera button:active { background: rgba(255,255,255,.35); }
.pin-tastiera button.vuoto { visibility: hidden; }
.pin-tastiera button.cancella { font-size: 16px; font-family: var(--testo-font); border-color: transparent; background: transparent; box-shadow: none; }

/* voce */
.voce-anello { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255,255,255,.9), rgb(var(--tinta) / .6) 55%, rgba(175,203,239,.15) 75%);
  box-shadow: 0 0 60px rgb(var(--tinta) / .7); animation: pulsa 1.4s ease-in-out infinite; }
.voce-anello span { width: 30px; height: 30px; border-radius: 50%; background: var(--inchiostro); opacity: .75; }
#voce[data-fase="pensa"] .voce-anello { animation: gira 1.2s linear infinite;
  background: conic-gradient(from 0deg, var(--lilla), var(--cielo), var(--salvia), var(--pesca), var(--lilla)); }
#voce[data-fase="parla"] .voce-anello { animation: pulsa .6s ease-in-out infinite; }
@keyframes pulsa { 50% { transform: scale(1.08); } }
@keyframes gira { to { transform: rotate(360deg); } }
.voce-testo, .voce-risposta { text-align: center; padding: 12px 20px; border-radius: 22px; font-size: 19px;
  background: rgba(30, 24, 52, .45); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.voce-testo:empty, .voce-risposta:empty { display: none; }
.voce-risposta { font-size: 17px; color: var(--testo-2); }
.mic-stato { position: fixed; right: 22px; top: 22px; z-index: 15; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8); background: rgba(183,224,207,.95); box-shadow: 0 0 14px rgba(183,224,207,.85); }
.mic-stato::before { content: ""; position: absolute; inset: -14px; }   /* area di tocco più grande del puntino */
.mic-stato.carica { background: transparent; animation: pulsa 1s infinite; }
.mic-stato.errore { background: #F3A6A6; box-shadow: 0 0 12px rgba(243,166,166,.8); }

/* Cortana in azione */
.evidenziato { animation: evidenzia 2.2s ease-out; }
@keyframes evidenzia {
  0% { box-shadow: 0 0 0 0 rgb(var(--tinta) / 0), var(--luce); transform: scale(1); }
  15% { box-shadow: 0 0 0 6px rgba(255,255,255,.55), 0 0 50px rgb(var(--tinta) / .8); transform: scale(1.025); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0), 0 0 0 rgb(var(--tinta) / 0); transform: scale(1); }
}
.azione-cortana { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 41; display: flex;
  align-items: center; gap: 12px; padding: 10px 22px 10px 10px; border-radius: 999px; font-weight: 600; font-size: 17px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4); box-shadow: var(--luce), var(--ombra);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  animation: scende .45s cubic-bezier(.2,.9,.3,1.2); transition: opacity .5s, transform .5s; }
.azione-cortana.via { opacity: 0; transform: translate(-50%, -12px); }
.azione-icona { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--lilla), var(--cielo)); color: var(--inchiostro); }
.azione-icona svg { width: 20px; height: 20px; }
@keyframes scende { from { opacity: 0; transform: translate(-50%, -24px) scale(.96); } }

/* avvisi: in basso al centro, sopra la barra sul telefono; Cortana in azione resta in alto */
#avvisi { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 50; display: flex;
  flex-direction: column-reverse; gap: 10px; align-items: center; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.avviso { display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%; padding: 13px 20px 13px 13px;
  border-radius: 22px; background: rgba(255,255,255,.95); color: var(--inchiostro); font-weight: 600; font-size: 16.5px; line-height: 1.35;
  box-shadow: 0 18px 50px -12px rgba(20,16,40,.55); pointer-events: auto; cursor: pointer;
  animation: avviso .32s cubic-bezier(.2,.9,.3,1.15); transition: opacity .25s, transform .25s; }
.avviso.via { opacity: 0; transform: translateY(10px) scale(.97); }
.avviso-segno { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #DDF3E8; color: #1F7A55; }
.avviso-segno svg { width: 19px; height: 19px; stroke-width: 2.4; }
.avviso.errore { background: #FFF1F1; }
.avviso.errore .avviso-segno { background: #E5484D; color: #fff; }
.avviso.info .avviso-segno, .avviso.attesa .avviso-segno { background: #ECE9FB; color: #5B4FC4; }
.rotella { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: gira .8s linear infinite; }
@keyframes avviso { from { opacity: 0; transform: translateY(14px) scale(.96); } }

/* finestra modale */
.modale-sfondo { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 16px;
  background: rgba(30,24,52,.42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: dissolvi .18s ease; }
.modale-sfondo.via { opacity: 0; transition: opacity .18s; }
@keyframes dissolvi { from { opacity: 0; } }
.modale { width: min(560px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; padding: 24px 28px 26px;
  border-radius: 32px; background: rgba(70, 62, 105, .66); border: 1px solid var(--bordo); box-shadow: var(--luce), var(--ombra);
  backdrop-filter: var(--sfoca); -webkit-backdrop-filter: var(--sfoca); animation: compare .26s cubic-bezier(.2,.9,.3,1.1); outline: none; }
@keyframes compare { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modale-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -10px 14px 0; }
.modale-testa h2 { margin: 0; font-size: 24px; }
.modale-corpo { overflow-y: auto; margin: 0 -6px; padding: 2px 6px; flex: 1 1 auto; min-height: 0; }
.modale .campo { margin-bottom: 12px; }
.modale .azioni { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.modale .azioni .btn { min-width: 124px; }
.modale p { margin: 0 0 12px; line-height: 1.5; }
.btn.fantasma { background: transparent; border-color: transparent; box-shadow: none; }
.btn.fantasma:hover { background: rgba(255,255,255,.14); }

/* pulsante principale volante (Aggiungi, Nuova nota...) */
.fab { position: fixed; z-index: 30; display: inline-flex; align-items: center; gap: 10px; height: 64px; padding: 0 26px 0 20px;
  border: 0; border-radius: 999px; background: #fff; color: var(--inchiostro); font-size: 17px; font-weight: 700;
  box-shadow: 0 16px 40px -10px rgba(20,16,40,.6), 0 0 0 6px rgba(255,255,255,.14); animation: compare .35s cubic-bezier(.2,.9,.3,1.2);
  transition: transform .15s, box-shadow .2s; }
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: scale(.95); }
.fab svg { width: 26px; height: 26px; stroke-width: 2.2; }
body:not(.in-app) .fab { display: none; }
.titolo-pagina .azioni-titolo { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ------------------------------------------------------------ agenda mensile */
.cal-testa { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-scelta { display: flex; gap: 8px; flex: 1; min-width: 200px; }
.cal-sel { flex: 1; min-width: 0; text-transform: capitalize; }
.cal-griglia { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 22px; }
.cal-gs { text-align: center; font-size: 13.5px; color: var(--testo-3); padding: 4px 0 6px; text-transform: capitalize; }
.cal-cella { aspect-ratio: auto; height: clamp(50px, 8.6vh, 84px); width: 100%; border: 0; border-radius: 14px; background: rgba(255,255,255,.07);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; }
.cal-cella.fuori { opacity: .38; }
.cal-num { font-family: var(--display); font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1; }
.cal-cella.oggi .cal-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.9); color: var(--inchiostro); font-weight: 600; font-size: 16px; }
.cal-cella.scelto { background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.7); }
.cal-punti { display: flex; gap: 3px; height: 6px; }
.cal-punti i { width: 6px; height: 6px; border-radius: 50%; background: var(--cielo); }
.cal-punti i[data-tipo="promemoria"] { background: var(--pesca); }
.cal-punti i[data-tipo="routine"] { background: var(--lilla); }
.cal-giorno .evento { font-size: 15.5px; padding: 12px 14px; }

/* ------------------------------------------------------------ galleria */
.titolo-pagina .azioni-titolo { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.percorso { margin-bottom: 18px; }
.album-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.album { position: relative; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; border: 1px solid var(--bordo);
  padding: 0; background: rgba(255,255,255,.1); text-align: left; box-shadow: var(--ombra); }
.album img, .album-vuoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.album-vuoto { display: grid; place-items: center; color: var(--testo-3); }
.album-vuoto svg { width: 40px; height: 40px; }
.album::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(30,24,52,.75), transparent 55%); }
.album-nome, .album-quante { position: absolute; left: 14px; z-index: 1; }
.album-nome { bottom: 28px; font-family: var(--display); font-size: 19px; font-weight: 500; }
.album-quante { bottom: 10px; font-size: 13px; color: var(--testo-2); }
.griglia-foto { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; padding-bottom: 80px; }
.foto { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.08);
  -webkit-touch-callout: none; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.foto .spunta { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; display: none; place-items: center;
  border: 2px solid #fff; background: rgba(30,24,52,.3); }
.foto .spunta svg { width: 16px; height: 16px; opacity: 0; }
.selezionando .foto .spunta { display: grid; }
.foto.scelta img { transform: scale(.88); border-radius: 10px; }
.foto.scelta .spunta { background: #fff; color: var(--inchiostro); }
.foto.scelta .spunta svg { opacity: 1; }
.foto .giorni { position: absolute; left: 6px; bottom: 6px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(30,24,52,.6); }
.barra-selezione { position: sticky; bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px;
  border-radius: 22px; margin-top: -60px; z-index: 3; }
.barra-selezione .quante { font-weight: 650; margin-right: auto; padding-left: 6px; }
.caricamento-foto { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); z-index: 42; width: min(420px, 90vw);
  padding: 14px 18px; border-radius: 22px; font-weight: 600; }
.caricamento-foto .barra > i { transition: width .2s; width: 0; }
.visore { position: fixed; inset: 0; z-index: 38; background: rgba(15, 12, 28, .94); display: grid; place-items: center; touch-action: pan-y; }
.visore img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.visore .btn.icona { position: absolute; background: rgba(255,255,255,.14); }
.visore-chiudi { top: 16px; right: 16px; }
.visore-prec { left: 16px; top: 50%; transform: translateY(-50%); }
.visore-succ { right: 16px; top: 50%; transform: translateY(-50%); }
.visore-barra { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; justify-content: center; width: min(720px, 94vw); }
.visore-info { flex-basis: 100%; text-align: center; color: var(--testo-2); font-size: 14px; }

/* ------------------------------------------------------------ telefono */
.mic-centrale { position: relative; flex: 0 0 auto; width: 66px; height: 66px; margin: -26px 6px 0; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: var(--inchiostro);
  background: radial-gradient(circle at 35% 30%, #fff, var(--lilla) 60%, var(--cielo));
  box-shadow: 0 10px 30px -6px rgb(var(--tinta) / .9), 0 0 0 6px rgba(255,255,255,.18), var(--luce); }
.mic-centrale svg { width: 28px; height: 28px; position: relative; z-index: 1; }
.mic-onda { position: absolute; inset: 0; border-radius: 50%; }
body[data-voce="ascolto"] .mic-centrale .mic-onda { animation: onda 1.2s ease-out infinite; box-shadow: 0 0 0 0 rgba(255,255,255,.7); }
body[data-voce="pensa"] .mic-centrale { background: conic-gradient(from 0deg, var(--lilla), var(--cielo), var(--salvia), var(--pesca), var(--lilla)); animation: gira 1.4s linear infinite; }
body[data-voce="pensa"] .mic-centrale svg { animation: gira 1.4s linear infinite reverse; }
@keyframes onda { to { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }
.foglio-sfondo { position: fixed; inset: 0; z-index: 36; background: rgba(20,16,40,.35); display: flex; align-items: flex-end; }
.foglio { width: 100%; border-radius: 30px 30px 0 0; padding: 10px 16px calc(24px + var(--sa-b)); animation: sale .35s ease; }
.foglio-maniglia { width: 46px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.5); margin: 2px auto 14px; }
.foglio-griglia { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.foglio-voce { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 16px 4px; border: 0; border-radius: 20px;
  background: rgba(255,255,255,.08); font-size: 13.5px; font-weight: 550; min-height: 84px; justify-content: center; }
.foglio-voce svg { width: 28px; height: 28px; }
.foglio-griglia { gap: 8px !important; }

@media (max-width: 700px) {
  body.telefono { overflow: hidden; }
  body.telefono #cornice { display: none; }
  body.telefono #app { padding: 0; gap: 0; grid-template-rows: minmax(0, 1fr) auto; }
  body.telefono #vista { border-radius: 0; border: 0; box-shadow: none; padding: calc(18px + var(--sa-t)) 16px 30px;
    background: rgba(255,255,255,.06); }
  body.telefono #menu { position: relative; z-index: 5; margin: 0; border-radius: 26px 26px 0 0; overflow: visible; justify-content: space-around;
    align-items: flex-end; padding: 6px 10px calc(8px + var(--sa-b)); border-bottom: 0; }
  body.telefono .voce-menu { min-width: 0; flex: 1; font-size: 12px; padding: 7px 2px; }
  body.telefono .titolo-pagina { font-size: 31px; }
  body.telefono #vista { font-size: 16.5px; }
  body.telefono .ora-grande { font-size: 72px; }
  body.telefono .testata { padding-bottom: 18px; margin-bottom: 18px; }
  body.telefono .meteo-blocco svg.grande { width: 56px; height: 56px; }
  body.telefono .meteo-temp { font-size: 42px; }
  body.telefono .griglia-foto { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  body.telefono .foto { border-radius: 6px; }
  body.telefono .album-griglia { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  body.telefono .note { grid-template-columns: repeat(2, 1fr); }
  body.telefono .pin-tastiera { grid-template-columns: repeat(3, 74px); }
  body.telefono .pin-tastiera button { width: 74px; height: 74px; }
  body.telefono .pin-vetro { padding: 30px 24px; }
  body.telefono .mic-stato { display: none; }
  body.telefono .visore .visore-prec, body.telefono .visore .visore-succ { display: none; }
  body.telefono .agenda-in-home .giorno { padding-left: 54px; }
  body.telefono .modale-sfondo { place-items: end stretch; padding: 0; }
  body.telefono .modale { width: 100%; max-height: 90vh; border-radius: 30px 30px 0 0; padding: 18px 20px calc(22px + var(--sa-b));
    animation: sale .3s cubic-bezier(.2,.9,.3,1); }
  body.telefono .modale .azioni { flex-wrap: nowrap; }
  body.telefono .modale .azioni .btn { flex: 1; min-width: 0; }
  body.telefono .fab { width: 62px; height: 62px; padding: 0; justify-content: center; }
  body.telefono .fab span { display: none; }
  body.telefono .vista-con-fab #vista, body.telefono #vista { padding-bottom: 96px; }
}

/* tablet in verticale e schermi stretti */
@media (max-width: 980px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
  #vista { grid-row: 1; padding: 22px 20px 30px; }
  #agenda { display: none; }
  #menu { grid-row: 2; flex-direction: row; overflow-x: auto; padding: 6px; border-radius: 26px; }
  .voce-menu { flex: 0 0 auto; min-width: 70px; }
  .voce-menu.cornice-btn { margin-top: 0; margin-left: auto; }
  .menu-sep { display: none; }
  .vista-agenda #agenda { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.riga > select { flex: 0 0 auto; width: auto; min-width: 170px; max-width: 46%; }
.modulo .campo.stretto { flex: 0 0 120px; min-width: 0; }

/* ------------------------------------------------------------ aggiunta dispositivi */
.modale { max-height: 88vh; overflow-y: auto; }
.modale .azioni { flex-wrap: wrap; }
.modulo-colonna { display: flex; flex-direction: column; gap: 4px; }
.modulo-colonna label { display: flex; flex-direction: column; gap: 7px; font-size: 15px; color: var(--testo-2); }
.modulo-colonna .chips { margin-bottom: 10px; }
.lista-amazon .riga { gap: 12px; }
.lista-amazon .riga > span.piccolo { flex: 0 0 34%; text-align: right; }
.lista-amazon .disp-icona { flex: 0 0 auto; width: 40px; height: 40px; }
.disp-testa .btn.icona { flex: 0 0 auto; }
.riga-volume { display: flex; align-items: center; gap: 8px; }
.riga-volume svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .8; }
.disp .modulo { margin: 0; flex-wrap: nowrap; }
.disp .modulo .campo { min-width: 0; padding: 10px 14px; }
.nota-disp { display: flex; align-items: flex-start; gap: 8px; text-align: left; font-size: 12.5px; color: var(--testo-2);
  background: rgba(255,255,255,.06); border: 1px dashed rgba(255,255,255,.22); border-radius: 14px; padding: 9px 12px; }
.nota-disp svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }

/* ------------------------------------------------------------ telecamere */
.disp-cam { grid-column: span 2; }
@media (max-width: 700px) { .disp-cam { grid-column: auto; } }
.griglia-cam { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cam { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(10,8,20,.45); color: inherit; cursor: pointer; }
.cam-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.cam-img.pronta { opacity: 1; }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center;
  font-size: 13.5px; color: var(--testo-2); }
.cam-nome { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(20,16,36,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cam-nome svg, .cam-espandi svg { width: 15px; height: 15px; }
.cam-espandi { position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 999px; background: rgba(20,16,36,.5); }
.visore-cam { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: rgba(8,6,16,.94);
  padding: max(12px, var(--sa-t)) 12px max(12px, var(--sa-b)); }
.visore-testa { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 12px; font-weight: 650; }
.visore-testa > span { display: flex; align-items: center; gap: 6px; }
.visore-testa svg { width: 18px; height: 18px; }
.live { margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #E5484D; color: #fff; }
.visore-corpo { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; }
.visore-corpo .cam-img { position: static; opacity: 1; width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.visore-corpo .cam-msg { position: absolute; }
.pagina { display: contents; }
.barra-modalita { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; padding: 14px 14px 14px 20px;
  border-radius: 24px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.barra-modalita .principale { flex: 1 1 200px; min-width: 0; }
.barra-modalita .titolo { font-weight: 650; }
.barra-modalita .sotto { font-size: 14.5px; color: var(--testo-2); }
.segmentato { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(20,16,40,.22); }
.segmentato button { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px;
  background: transparent; font-weight: 600; font-size: 16px; color: var(--testo-2); transition: background .2s, color .2s; }
.segmentato button svg { width: 20px; height: 20px; }
.segmentato button[aria-pressed="true"] { background: #fff; color: var(--inchiostro); box-shadow: 0 4px 14px -6px rgba(20,16,40,.5); }
.griglia-modalita { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .griglia-modalita { grid-template-columns: 1fr; } }
.col-modalita h3 { margin: 4px 0 8px; font-size: 15px; }
.riga-imp { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.visore-comandi { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; }
.visore-comandi .btn[aria-pressed=true] { background: #fff; color: var(--inchiostro); }
.visore-corpo video.cam-img { position: static; opacity: 1; width: 100%; height: 100%; object-fit: contain; border-radius: 14px; background: #000; }
.tasto-cam { display: inline-flex; align-items: center; gap: 6px; }
.tasto-cam svg { width: 18px; height: 18px; }
.tasto-cam[aria-pressed=true] { background: #fff; color: var(--inchiostro); }
.tasto-cam[aria-label="Parla attraverso la telecamera"][aria-pressed=true] { background: #E5484D; color: #fff; border-color: #E5484D; }

/* ------------------------------------------------------------ promemoria e chat */
.timer-veloci { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.timer-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 92px; border-radius: 24px;
  border: 1px solid var(--bordo); background: rgba(255,255,255,.09); box-shadow: var(--luce); transition: background .2s, transform .12s; }
.timer-btn:hover { background: rgba(255,255,255,.17); }
.timer-btn:active { transform: scale(.95); background: rgba(255,255,255,.3); }
.timer-btn b { font-family: var(--display); font-size: 34px; font-weight: 400; line-height: 1.05; }
.timer-btn span { font-size: 14px; color: var(--testo-2); }
.form-prom { display: flex; flex-direction: column; gap: 12px; }
.form-prom-riga { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-prom-riga .campo[type=datetime-local] { width: auto; flex: 0 1 260px; }
.form-prom-riga .btn { margin-left: auto; }
.campo-con-unita { display: inline-flex; align-items: center; gap: 10px; }
.campo-con-unita .campo { width: 110px; text-align: center; }
.campo-con-unita span { color: var(--testo-2); }
#vista:has(.chat) { padding-bottom: 26px; }
.chat-invio { padding-top: 10px; }
.chat-invio .campo { flex: 1; }
.chat-vuota { margin: auto; max-width: 560px; text-align: center; padding: 20px 10px; }
.chat-vuota p { color: var(--testo-2); font-size: 18px; margin: 14px 0 20px; }
.chat-vuota .chips { justify-content: center; }
.chat-logo { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: var(--inchiostro);
  background: radial-gradient(circle at 35% 30%, #fff, var(--lilla) 60%, var(--cielo)); box-shadow: 0 10px 30px -8px rgb(var(--tinta) / .9); }
.chat-logo svg { width: 32px; height: 32px; }
.msg { font-size: 17px; line-height: 1.5; }
.puntini { display: inline-flex; gap: 5px; padding: 4px 2px; }
.puntini i { width: 8px; height: 8px; border-radius: 50%; background: var(--testo-2); animation: puntino 1.2s infinite ease-in-out; }
.puntini i:nth-child(2) { animation-delay: .15s; } .puntini i:nth-child(3) { animation-delay: .3s; }
@keyframes puntino { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
@media (max-width: 700px) {
  .barra-modalita { display: grid; grid-template-columns: 1fr auto; padding: 16px; }
  .barra-modalita .principale { grid-column: 1 / -1; }
  .barra-modalita .segmentato { width: 100%; }
  .barra-modalita .segmentato button { flex: 1; justify-content: center; padding: 0 10px; }
  .form-prom-riga .btn { margin-left: 0; width: 100%; }
  .form-prom-riga .segmentato { width: 100%; }
  .form-prom-riga .segmentato button { flex: 1; justify-content: center; }
  .form-prom-riga .campo[type=datetime-local] { flex: 1 1 100%; }
  .timer-veloci { grid-template-columns: repeat(4, 1fr); }
  .timer-btn { min-height: 80px; }
  .timer-btn b { font-size: 28px; }
}

/* ------------------------------------------------------------ voce */
.voce-testo { font-size: 21px; font-weight: 600; }
.voce-risposta { font-size: 18px; max-height: 32vh; overflow-y: auto; line-height: 1.45; }
.controllo-voce { display: flex; gap: 10px; align-items: center; flex: 0 1 auto; min-width: 0; }
.controllo-voce select { min-width: 200px; max-width: 280px; }
@media (max-width: 700px) {
  .riga:has(> select), .riga:has(> .controllo-voce) { flex-wrap: wrap; }
  .riga:has(> select) .principale, .riga:has(> .controllo-voce) .principale { flex-basis: 100%; }
  .riga > select { max-width: none; flex: 1 1 100%; }
  .controllo-voce { flex: 1 1 100%; }
  .controllo-voce select { flex: 1; max-width: none; min-width: 0; }
}
.caricamento { display: flex; align-items: center; gap: 12px; padding: 18px 4px; color: var(--testo-2); font-size: 17px; }
.caricamento .rotella { width: 22px; height: 22px; }
.tessere { display: flex; flex-direction: column; gap: 10px; }
.tessera { display: flex; align-items: center; gap: 16px; padding: 16px 18px; min-height: 82px; text-align: left; border-radius: 22px;
  border: 1px solid var(--bordo); background: rgba(255,255,255,.1); transition: background .2s, transform .12s; }
.tessera:hover { background: rgba(255,255,255,.18); }
.tessera:active { transform: scale(.98); }
.tessera > svg { width: 22px; height: 22px; opacity: .6; flex: 0 0 auto; }
.tessera-icona { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(135deg, rgba(201,194,242,.5), rgba(175,203,239,.35)); }
.tessera-icona svg { width: 27px; height: 27px; }
.tessera-testo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tessera-testo b { font-size: 17.5px; font-weight: 650; }
.tessera-testo small { font-size: 14.5px; color: var(--testo-2); }
@media (max-width: 700px) { body.telefono .modale .azioni { flex-wrap: wrap; } body.telefono .modale .azioni .btn { flex: 1 1 40%; } }

/* barra compatta in basso (telefono e tablet in verticale) */
body.barra-compatta #menu { position: relative; z-index: 5; flex-direction: row; overflow: visible; justify-content: space-around;
  align-items: flex-end; padding: 6px 10px calc(8px + var(--sa-b)); }
body.barra-compatta .voce-menu { min-width: 0; flex: 1; max-width: 140px; }
body.barra-compatta .voce-menu.cornice-btn { margin: 0; }
body.barra-compatta .mic-centrale { width: 72px; height: 72px; margin-top: -30px; }
body:not(.barra-compatta) .mic-centrale { display: none; }
@media (min-width: 701px) { .foglio { max-width: 760px; margin: 0 auto; border-radius: 30px 30px 0 0; } .foglio-griglia { grid-template-columns: repeat(5, 1fr); } }
/* mentre Cortana ascolta o parla, il resto si attenua */
#app { transition: filter .35s; }
body[data-voce="ascolto"] #app, body[data-voce="pensa"] #app, body[data-voce="parla"] #app { filter: brightness(.62) saturate(.9); }
.chips-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 480px; }
.chips-4 .chip { justify-content: center; padding: 10px 6px; }

/* il testo non esce mai dai pulsanti: va a capo con ordine, oppure si accorcia con «…» nelle barre */
.chip { white-space: normal; text-align: center; line-height: 1.2; overflow-wrap: anywhere; max-width: 100%; }
.segmentato { max-width: 100%; }
.segmentato button { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.voce-menu { max-width: 100%; }
.voce-menu, .foglio-voce { overflow: hidden; text-overflow: ellipsis; }
.disp-nome, .riga .titolo, .tessera-testo b { overflow-wrap: anywhere; }
.fab span { white-space: nowrap; }
.tasto-cam { white-space: nowrap; }
.foglio-voce { white-space: nowrap; }
@media (max-width: 430px) { .foglio-griglia { grid-template-columns: repeat(3, 1fr) !important; } .foglio-voce { min-height: 90px; } }
.controllo-volume { display: flex; align-items: center; gap: 10px; flex: 0 1 360px; min-width: 220px; }
.controllo-volume svg { width: 22px; height: 22px; flex: 0 0 auto; opacity: .85; }
.controllo-volume input[type=range] { flex: 1; min-width: 0; height: 40px; accent-color: #fff; cursor: pointer; }
.volume-num { min-width: 2.2ch; text-align: right; font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .riga:has(> .controllo-volume) { flex-wrap: wrap; }
  .riga:has(> .controllo-volume) .principale { flex-basis: 100%; }
  .controllo-volume { flex: 1 1 100%; }
}
.volume-num { min-width: 4.2ch; }
body[data-voce="ascolto"] .fab, body[data-voce="pensa"] .fab, body[data-voce="parla"] .fab { opacity: 0; pointer-events: none; }

/* ---- Fire TV: volume, app, telecomando rotondo ---- */
.riga-volume.tv { gap: 12px; }
.riga-volume.tv input[type=range] { flex: 1; min-width: 0; }
.vol-valore { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; color: var(--testo-2); }
.tasto-muto { flex: 0 0 auto; width: var(--tocco, 52px); height: var(--tocco, 52px); border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); transition: background .15s, transform .1s; }
.tasto-muto svg { width: 24px; height: 24px; opacity: 1 !important; }
.tasto-muto[aria-pressed=true] { background: #fff; color: var(--inchiostro); }
.tasto-muto:active { transform: scale(.92); }
.chip.in-corso { opacity: .6; position: relative; }
.chip.in-corso::after { content: ""; width: 12px; height: 12px; margin-left: 4px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.tc { border: 1px solid rgba(255,255,255,.12); border-radius: 20px; background: rgba(255,255,255,.04); overflow: hidden; }
.tc-testa { width: 100%; min-height: 54px; background: transparent; border: 0; color: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 0 16px; font-weight: 600; font-size: 16px; text-align: left; }
.tc-testa span { flex: 1; }
.tc-testa svg { width: 22px; height: 22px; flex: 0 0 auto; }
.tc-testa .tc-freccia { transition: transform .25s ease; opacity: .8; }
.tc.aperto .tc-freccia { transform: rotate(180deg); }
.tc-corpo { display: grid; justify-items: center; gap: 16px; padding: 0 16px; max-height: 0; opacity: 0;
  transition: max-height .35s ease, opacity .25s ease, padding .35s ease; }
.tc.aperto .tc-corpo { max-height: 520px; opacity: 1; padding: 6px 16px 18px; }
.croce { position: relative; width: min(240px, 72vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.16), rgba(255,255,255,.06) 70%);
  border: 1px solid rgba(255,255,255,.2); box-shadow: inset 0 2px 10px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.18); }
.croce button { position: absolute; display: grid; place-items: center; color: inherit; border-radius: 50%; border: 0; background: transparent; padding: 0;
  transition: background .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.croce button svg { width: 30px; height: 30px; }
.croce .croce-su, .croce .croce-giu { left: 32%; width: 36%; height: 30%; }
.croce .croce-su { top: 1%; } .croce .croce-giu { bottom: 1%; }
.croce .croce-sx, .croce .croce-dx { top: 32%; width: 30%; height: 36%; }
.croce .croce-sx { left: 1%; } .croce .croce-dx { right: 1%; }
.croce button:not(.croce-ok):active { background: rgba(255,255,255,.14); }
.croce button:disabled { opacity: .3; cursor: not-allowed; }
.croce .croce-ok { left: 30%; top: 30%; width: 40%; height: 40%; font-weight: 700; font-size: 19px; letter-spacing: .04em;
  background: rgba(255,255,255,.9); color: var(--inchiostro); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.croce .croce-ok:active { transform: scale(.93); background: #fff; }
.croce button.premuto { animation: premuto .35s ease; }
@keyframes premuto { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.45); } 100% { box-shadow: 0 0 0 16px rgba(255,255,255,0); } }
.telecomando.due { grid-template-columns: repeat(2, 1fr); width: min(240px, 72vw); }
.nota-piccola { margin: 0; font-size: 13px; color: var(--testo-2); text-align: center; }
@media (prefers-reduced-motion: reduce) { .tc-corpo, .tc-freccia, .croce button { transition: none; animation: none; } }

/* ------------------------------------------------------------ Cortana in ascolto (sovrapposizione) */
#voce { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 20px 18px calc(22px + var(--sa-b)); pointer-events: auto; touch-action: none; animation: voce-entra .28s ease; }
#voce[hidden] { display: none; }
@keyframes voce-entra { from { opacity: 0; } }
.voce-velo { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 85%, rgb(var(--tinta) / .38), rgba(14,10,30,.78) 70%);
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); }
.voce-pannello { position: relative; width: min(640px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-bottom: 18px; animation: voce-sale .35s cubic-bezier(.2,.9,.3,1.2); }
@keyframes voce-sale { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.voce-fase { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; font-weight: 650; color: var(--testo-2); }
.voce-anello { position: relative; width: 120px; height: 120px; cursor: pointer; }
.voce-anello span { position: absolute; inset: 30px; width: auto; height: auto; border-radius: 50%; opacity: 1; z-index: 2;
  background: radial-gradient(circle at 38% 32%, #fff, var(--lilla) 55%, var(--cielo)); box-shadow: 0 0 40px rgb(var(--tinta) / .9); }
.voce-anello i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); opacity: 0;
  animation: voce-onda 2.2s ease-out infinite; }
.voce-anello i + i { animation-delay: 1.1s; }
@keyframes voce-onda { 0% { transform: scale(.45); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
#voce.parli .voce-anello i { animation-duration: 1.1s; border-color: #fff; }
#voce.parli .voce-anello span { animation: pulsa .55s ease-in-out infinite; }
#voce[data-fase="pensa"] .voce-anello span { background: conic-gradient(from 0deg, var(--lilla), var(--cielo), var(--salvia), var(--pesca), var(--lilla));
  animation: gira 1.1s linear infinite; }
#voce[data-fase="pensa"] .voce-anello i { animation-duration: 3s; }
#voce[data-fase="parla"] .voce-anello span { animation: pulsa .7s ease-in-out infinite; }
.voce-onde { display: flex; gap: 6px; align-items: center; height: 34px; }
.voce-onde b { width: 6px; height: 8px; border-radius: 6px; background: rgba(255,255,255,.75); transition: height .2s; }
#voce[data-fase="ascolto"] .voce-onde b { animation: voce-barra 1.3s ease-in-out infinite; }
#voce.parli[data-fase="ascolto"] .voce-onde b { animation-duration: .55s; }
.voce-onde b:nth-child(2) { animation-delay: -.2s !important; } .voce-onde b:nth-child(3) { animation-delay: -.45s !important; }
.voce-onde b:nth-child(4) { animation-delay: -.1s !important; } .voce-onde b:nth-child(5) { animation-delay: -.6s !important; }
.voce-onde b:nth-child(6) { animation-delay: -.3s !important; } .voce-onde b:nth-child(7) { animation-delay: -.75s !important; }
@keyframes voce-barra { 0%, 100% { height: 8px; } 50% { height: 30px; } }
#voce:not([data-fase="ascolto"]) .voce-onde { display: none; }
.voce-testo { font-size: 22px; font-weight: 600; line-height: 1.35; max-width: 100%; overflow-wrap: anywhere; }
.voce-testo:empty { display: none; }
.voce-risposta { font-size: 18px; max-height: 34vh; overflow-y: auto; line-height: 1.45; max-width: 100%; overflow-wrap: anywhere; }
.voce-sugg { font-size: 14px; color: var(--testo-2); text-align: center; min-height: 1em; }
.voce-azioni { position: relative; display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.voce-chiudi { padding: 0; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); box-shadow: 0 10px 30px -8px rgba(0,0,0,.5);
  transition: transform .12s, background .15s; }
.voce-chiudi svg { width: 30px; height: 30px; }
.voce-chiudi:hover { background: rgba(255,255,255,.24); }
.voce-chiudi:active { transform: scale(.92); }
.voce-fine { border: 0; min-height: 56px; padding: 0 24px; border-radius: 30px; font-weight: 650; font-size: 16px; color: var(--inchiostro);
  background: rgba(255,255,255,.92); box-shadow: 0 10px 30px -8px rgba(0,0,0,.45); transition: transform .12s; }
.voce-fine:active { transform: scale(.95); }
.voce-fine[hidden] { display: none; }
/* il ✕ sta esattamente dove c'è il tasto microfono della barra: «stesso tasto» */
body.barra-compatta .voce-azioni { flex-direction: column; gap: 14px; }
body.barra-compatta #voce { padding-bottom: calc(14px + var(--sa-b)); }
@media (prefers-reduced-motion: reduce) { #voce *, #voce { animation: none !important; } }
.istruzioni { display: grid; gap: 12px; }
.istruzioni h3 { margin: 6px 0 0; font-size: 16px; }
.istruzioni p { margin: 0; line-height: 1.45; }
.passi { margin: 0; padding-left: 22px; display: grid; gap: 8px; line-height: 1.45; }
.istruzioni .btn { justify-self: start; text-decoration: none; }
.impronta { font-family: ui-monospace, monospace; font-size: 11px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ ricette */
.cerca-ricette { margin-bottom: 6px; }
.cerca-ricette .campo { flex: 1; min-width: 0; }
.cerca-ricette .btn.in-corso { opacity: .65; }
.sezione h2 { display: flex; align-items: center; gap: 10px; }
.ricette { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.ricette.tre { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ricetta { border-radius: 24px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); overflow: hidden;
  transition: background .2s, transform .15s; }
.ricetta.consigliata { background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.06)); }
.ricetta.aperta { grid-column: 1 / -1; background: rgba(255,255,255,.13); }
.ricetta-testa { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 16px; text-align: left;
  background: transparent; border: 0; color: inherit; cursor: pointer; }
.ricetta-testa:active { transform: scale(.99); }
.ricetta-testa .principale { flex: 1; min-width: 0; }
.ricetta h3 { font-family: var(--display); font-weight: 550; font-size: 20px; line-height: 1.2; margin: 0 0 6px; overflow-wrap: anywhere; }
.ricetta-testa p { margin: 0 0 10px; color: var(--testo-2); font-size: 15px; line-height: 1.4; }
.ricetta-freccia { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 4px; opacity: .7; transition: transform .25s; }
.ricetta.aperta .ricetta-freccia { transform: rotate(180deg); }
.ricetta-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ricetta-meta span { font-size: 12.5px; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,.1); color: var(--testo-2); }
.ricetta-meta .salvata { background: var(--salvia); color: var(--inchiostro); font-weight: 600; }
.ricetta-corpo { padding: 0 18px 20px; animation: voce-entra .25s ease; }
.ricetta-corpo h4 { margin: 18px 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--testo-2); }
.ricetta-azioni { display: flex; flex-wrap: wrap; gap: 10px; }
.btn.grande { min-height: 58px; padding: 0 24px; font-size: 17px; border-radius: 30px; }
.btn.grande svg { width: 24px; height: 24px; }
.ingredienti { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.ingredienti li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); line-height: 1.35; }
.ingredienti b { font-weight: 650; }
.ingredienti.grande li { font-size: 19px; padding: 10px 0; }
.passi-ricetta { margin: 0; padding-left: 24px; display: grid; gap: 10px; line-height: 1.5; }
.passi-ricetta li::marker { font-weight: 700; color: var(--testo-2); }
.note-ricetta ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.note-ricetta { margin-top: 6px; }
.fonte { display: inline-block; margin-top: 16px; font-size: 13.5px; color: var(--testo-2); }
.ricetta.scheletro { min-height: 150px; padding: 20px; display: grid; gap: 12px; align-content: start; }
.ricetta.scheletro i { display: block; height: 16px; border-radius: 8px; background: rgba(255,255,255,.12); animation: scheletro 1.4s ease-in-out infinite; }
.ricetta.scheletro i:first-child { height: 22px; width: 70%; } .ricetta.scheletro i:last-child { width: 45%; }
@keyframes scheletro { 50% { opacity: .45; } }
.banner-cucina { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 18px; border-radius: 22px; text-align: left;
  background: linear-gradient(120deg, var(--pesca), var(--rosa)); color: var(--inchiostro); border: 0; cursor: pointer; }
.banner-cucina svg { width: 28px; height: 28px; flex: 0 0 auto; }
.banner-cucina .principale { flex: 1; display: grid; gap: 2px; }
.banner-cucina b { font-size: 17px; }

/* ------------------------------------------------------------ cucina passo passo */
.cucina-progresso { height: 8px; border-radius: 8px; background: rgba(255,255,255,.14); overflow: hidden; }
.cucina-progresso span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--salvia), var(--cielo)); transition: width .4s ease; }
.cucina-dove { margin: 12px 0 14px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; font-weight: 650; color: var(--testo-2); }
.cucina-passo { padding: 26px 26px; border-radius: 28px; animation: voce-sale .35s ease; }
.cucina-passo p { margin: 0; font-size: clamp(22px, 3.2vw, 32px); line-height: 1.4; font-weight: 500; overflow-wrap: anywhere; }
.cucina-passo p.muto { font-size: 15px; margin-top: 12px; }
.cucina-comandi { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 20px 0 8px; }
.cucina-comandi .btn { width: 100%; }
.cucina-comandi .btn:disabled { opacity: .35; }
.cucina-mic { width: 84px; height: 84px; border-radius: 50%; border: 0; display: grid; place-items: center; color: var(--inchiostro);
  background: radial-gradient(circle at 35% 30%, #fff, var(--lilla) 60%, var(--cielo));
  box-shadow: 0 10px 30px -6px rgb(var(--tinta) / .9), 0 0 0 6px rgba(255,255,255,.18); transition: transform .12s; }
.cucina-mic svg { width: 34px; height: 34px; }
.cucina-mic:active { transform: scale(.93); }
.cucina-aiuto { text-align: center; font-size: 14px; margin-bottom: 18px; }
.cucina-tutto { margin-top: 12px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.cucina-tutto summary { min-height: 54px; display: flex; align-items: center; padding: 0 18px; font-weight: 600; cursor: pointer; list-style: none; }
.cucina-tutto summary::-webkit-details-marker { display: none; }
.cucina-tutto summary::after { content: "⌄"; margin-left: auto; opacity: .7; }
.cucina-tutto[open] summary::after { transform: rotate(180deg); }
.cucina-tutto > ul, .cucina-tutto > ol { padding: 0 18px 18px 40px; }
.cucina-tutto > ul { padding-left: 18px; }
.cucina-tutto .passi-ricetta button { background: none; border: 0; color: inherit; text-align: left; padding: 4px 0; line-height: 1.5; cursor: pointer; font: inherit; }
.cucina-tutto .passi-ricetta li.attuale { color: var(--testo); font-weight: 650; }
.cucina-tutto .passi-ricetta li:not(.attuale) { color: var(--testo-2); }
.note-ricetta.vetro { margin-top: 14px; padding: 6px 18px 16px; border-radius: 20px; }
@media (max-width: 520px) {
  .cucina-comandi { grid-template-columns: 1fr 1fr; }
  .cucina-mic { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .cucina-passo { padding: 20px; }
}

/* cucina: pensata per il tablet al muro (si legge da lontano, si tocca con le mani sporche) */
@media (min-width: 981px) {
  body[data-pagina="cucina"] #app { grid-template-columns: var(--menu-l) minmax(0, 1fr); }
  body[data-pagina="cucina"] #agenda { display: none; }
}
.cucina { display: grid; gap: 22px; }
.cucina-sx, .cucina-dx { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cucina-dove { margin: 0; display: flex; align-items: baseline; gap: 4px; }
.cucina-dove b { font-family: var(--display); font-size: 44px; line-height: 1; color: var(--testo); letter-spacing: 0; }
.cucina-dove span { font-size: 16px; }
.cucina-passo { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 200px; padding: 30px 32px; }
.cucina-passo p { font-size: clamp(24px, 3.3vw, 42px); line-height: 1.35; }
.cucina-comandi { margin: 0; gap: 18px; }
.cucina-comandi .btn.grande { min-height: 76px; font-size: 20px; border-radius: 40px; }
.cucina-mic { width: 104px; height: 104px; }
.cucina-mic svg { width: 40px; height: 40px; }
.cucina-aiuto { margin: 0; font-size: 15px; }
.cucina-box { padding: 6px 20px 16px; border-radius: 24px; }
.cucina-box h4 { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--testo-2); }
.cucina-box h4 svg { width: 20px; height: 20px; }
.cucina-box h4 .muto { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.cucina-ingr { grid-template-columns: 1fr; gap: 0; }
.cucina-ingr li { font-size: 18px; padding: 11px 10px; border-radius: 12px; transition: background .2s; }
.cucina-ingr li.ora { background: rgba(255,255,255,.9); color: var(--inchiostro); border-bottom-color: transparent; }
.cucina-tutto { margin-top: 0; }
.titolo-pagina .btn svg { width: 20px; height: 20px; }
/* tablet orizzontale e PC: passo a sinistra, ingredienti sempre visibili a destra */
@media (min-width: 900px) and (orientation: landscape) {
  .cucina { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: stretch; min-height: calc(100vh - 220px); }
  .cucina-dx { max-height: calc(100vh - 200px); overflow-y: auto; scrollbar-width: none; }
}
/* tablet verticale: tutto in colonna, ingredienti su due colonne sotto il passo */
@media (min-width: 600px) and (orientation: portrait) {
  .cucina-ingr { grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .cucina-passo { min-height: 260px; }
  .cucina-passo p { font-size: clamp(26px, 4.2vw, 42px); }
}
@media (max-width: 520px) {
  .cucina-dove b { font-size: 34px; }
  .cucina-comandi .btn.grande { min-height: 62px; font-size: 17px; }
  .cucina-mic { width: 88px; height: 88px; }
  .cucina-passo { min-height: 0; padding: 22px; }
}
.cucina-comandi:not(:has(.cucina-mic)) { grid-template-columns: 1fr 1fr; }
.cerca-stato { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 20px; background: rgba(255,255,255,.08); color: var(--testo-2); }
.cerca-stato .rotella { flex: 0 0 auto; }
/* telefono: lo stato dell'ascolto di «Cortana» si vede sul tasto del microfono */
.mic-centrale::after { content: ""; position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9); background: transparent; opacity: 0; transition: opacity .2s; }
body[data-voce="attesa"] .mic-centrale::after { opacity: 1; background: #7FD8A8; box-shadow: 0 0 10px rgba(127,216,168,.9); }
body[data-voce="carica"] .mic-centrale::after { opacity: 1; border-right-color: transparent; animation: gira .8s linear infinite; }
.riga-pin { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0 6px; }
.pin-tv { width: 160px; font-size: 26px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.nota-disp.forte { color: var(--testo); border-style: solid; }
/* galleria al tocco: niente menu dell'immagine né selezione del testo tenendo premuto, scorrimento fluido */
.griglia-foto .foto { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: pan-y; }
.griglia-foto .foto img { -webkit-user-drag: none; pointer-events: none; }
/* cornice: i gesti li gestisce Cortana (niente zoom o scorrimento del browser) */
#cornice { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ------------------------------------------------------------ notch, Dynamic Island e barra Home (iPhone/iPad)
   Con viewport-fit=cover e la barra di stato trasparente la pagina va sotto la notch: ogni bordo rispetta le
   «zone sicure» del dispositivo, in verticale e in orizzontale (in orizzontale la notch è di lato). */
:root { --sa-t: env(safe-area-inset-top, 0px); --sa-r: env(safe-area-inset-right, 0px);
        --sa-b: env(safe-area-inset-bottom, 0px); --sa-l: env(safe-area-inset-left, 0px); }
html, body { min-height: 100dvh; }
#app { padding-top: max(18px, var(--sa-t)); padding-right: max(18px, var(--sa-r));
       padding-bottom: max(18px, var(--sa-b)); padding-left: max(18px, var(--sa-l)); }
@media (max-width: 980px) {
  #app { padding: max(12px, var(--sa-t)) max(12px, var(--sa-r)) max(12px, var(--sa-b)) max(12px, var(--sa-l)); }
  body.barra-compatta:not(.telefono) #menu { padding-bottom: 6px; }   /* la zona sicura c'è già nel margine dell'app */
}
@media (max-width: 700px) {
  body.telefono #app { padding: 0 var(--sa-r) 0 var(--sa-l); }
  body.telefono .modale { max-height: calc(100dvh - var(--sa-t) - 12px); }
}
#cornice { padding: max(5vh, calc(var(--sa-t) + 12px)) max(5vw, calc(var(--sa-r) + 12px))
                    max(5vh, calc(var(--sa-b) + 12px)) max(5vw, calc(var(--sa-l) + 12px)); }
#accesso { padding: var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l); }
.mic-stato { top: calc(22px + var(--sa-t)); right: calc(22px + var(--sa-r)); }
.azione-cortana { top: calc(22px + var(--sa-t)); }
#voce { padding-top: calc(20px + var(--sa-t)); padding-left: calc(18px + var(--sa-l)); padding-right: calc(18px + var(--sa-r)); }
.visore-chiudi { top: calc(16px + var(--sa-t)); right: calc(16px + var(--sa-r)); }
.visore-prec { left: calc(16px + var(--sa-l)); }
.visore-succ { right: calc(16px + var(--sa-r)); }
.visore-barra { bottom: calc(18px + var(--sa-b)); }
.visore-cam { padding-left: max(12px, var(--sa-l)); padding-right: max(12px, var(--sa-r)); }
.modale-sfondo { padding: max(16px, var(--sa-t)) max(16px, var(--sa-r)) max(16px, var(--sa-b)) max(16px, var(--sa-l)); }
@media (max-width: 700px) { body.telefono .modale-sfondo { padding: var(--sa-t) 0 0; } }
.foglio-sfondo { padding-top: var(--sa-t); }

/* ricette: filtri e pagine */
.cerca-ricette { gap: 10px; }
.filtri-btn { flex: 0 0 auto; position: relative; }
.filtri-btn svg { width: 20px; height: 20px; }
.filtri-conta { min-width: 22px; height: 22px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--inchiostro); color: #fff; padding: 0 6px; }
.filtri-ricette { margin: 10px 0 4px; padding: 6px 18px 16px; border-radius: 24px; display: grid; gap: 6px; animation: voce-sale .25s ease; }
.filtri-ricette[hidden] { display: none; }
.filtri-gruppo h4 { margin: 12px 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--testo-2); }
.filtri-gruppo .chip { min-height: 46px; padding: 0 16px; }
.filtri-gruppo .chip[aria-pressed=true] { background: #fff; color: var(--inchiostro); border-color: #fff; }
.filtri-azioni { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.conta-titolo { font-family: var(--testo-font); font-size: 14px; font-weight: 600; color: var(--testo-2); background: rgba(255,255,255,.1);
  border-radius: 12px; padding: 2px 10px; }
.conta-titolo:empty { display: none; }
.paginatore { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.paginatore .btn { min-width: var(--tocco, 52px); min-height: var(--tocco, 52px); padding: 0 14px; }
.paginatore .btn:disabled { opacity: .35; }
.altre { display: flex; justify-content: center; margin-top: 14px; }
.ricetta-meta .durata-veloce { background: rgba(183,224,207,.3); color: var(--testo); }
.ricetta-meta .durata-lenta { background: rgba(246,201,174,.28); color: var(--testo); }
/* telefono: la zona della notch / Dynamic Island resta FUORI dalla parte che scorre, così il contenuto non ci
   passa mai sotto (prima il margine c'era solo in cima alla pagina e scorrendo i testi finivano sotto l'isola) */
@media (max-width: 700px) {
  /* la pagina scorre fino in cima, ma sotto la notch / Dynamic Island passa attraverso una fascia sfocata e
     sfumata, come nelle app di iOS: niente taglio netto e niente colore piatto */
  body.telefono #app { padding: 0 var(--sa-r) 0 var(--sa-l); }
  body.telefono #vista { padding-top: calc(26px + var(--sa-t)); }
  /* la barra Home di iOS è sottile: basta metà della zona sicura sotto il menu, non tutta */
  body.telefono.barra-compatta #menu { padding-bottom: calc(var(--sa-b) * .75 + 4px); }
  /* in cima: dal colore esatto della barra del telefono si sfuma nella pagina, sfocando quello che ci scorre sotto.
     Così non c'è più il bordo netto tra la barra (che il telefono colora da solo) e la pagina */
  /* a riposo la barra di stato sta sulla foto e non copre niente; appena scorri compare una fascia morbida
     (colore della barra + sfocatura che si dissolve gradualmente), come le barre di iOS */
  body.telefono.in-app::before {
    content: ""; position: fixed; left: 0; right: 0; top: 0; height: calc(var(--sa-t) + 24px); z-index: 30; pointer-events: none;
    opacity: 0; transition: opacity .25s ease;
    background: linear-gradient(to bottom, var(--colore-barra, transparent) 0, var(--colore-barra, transparent) var(--sa-t),
                transparent 100%);
    backdrop-filter: blur(12px) saturate(1.15); -webkit-backdrop-filter: blur(12px) saturate(1.15);
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 var(--sa-t), rgba(0,0,0,.7) calc(var(--sa-t) + 8px),
                        rgba(0,0,0,.25) calc(var(--sa-t) + 16px), transparent 100%);
            mask-image: linear-gradient(to bottom, #000 0, #000 var(--sa-t), rgba(0,0,0,.7) calc(var(--sa-t) + 8px),
                        rgba(0,0,0,.25) calc(var(--sa-t) + 16px), transparent 100%);
  }
  body.telefono.in-app.scorsa::before { opacity: 1; }
}

/* iPhone, app dalla schermata Home: i livelli a tutto schermo usano l'altezza vera dello schermo (vedi altezzaVera) */
html.alto-fisso, html.alto-fisso body { height: var(--alto); min-height: var(--alto); }
html.alto-fisso #app, html.alto-fisso #foto, html.alto-fisso #cornice, html.alto-fisso #accesso,
html.alto-fisso .modale-sfondo, html.alto-fisso .foglio-sfondo, html.alto-fisso .visore, html.alto-fisso #voce {
  bottom: auto; height: var(--alto); }

/* promemoria: giorno e ora, leggibili anche su iPhone */
.quando-prom { display: flex; flex-direction: column; gap: 12px; }
.quando-prom[hidden] { display: none; }
.giorni-rapidi .chip { min-height: 46px; padding: 0 18px; }
.giorni-rapidi .chip[aria-pressed=true] { background: #fff; color: var(--inchiostro); border-color: #fff; }
.quando-campi { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; max-width: 520px; }
.quando-campi label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.quando-campi label > span { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--testo-2); padding-left: 6px; }
/* i selettori di data e ora di iOS: stessa altezza degli altri campi, testo a sinistra, niente bordo bianco */
input.campo[type=date], input.campo[type=time], input.campo[type=datetime-local] {
  -webkit-appearance: none; appearance: none; min-height: 52px; min-width: 0; width: 100%; color-scheme: dark;
  display: flex; align-items: center; text-align: left; line-height: 1.2; }
input.campo::-webkit-date-and-time-value { text-align: left; margin: 0; }
input.campo::-webkit-datetime-edit { padding: 0; }
input.campo::-webkit-calendar-picker-indicator { opacity: .75; cursor: pointer; }

.notizia.con-link { cursor: pointer; }
.notizia.con-link:active { transform: scale(.99); }

/* notifiche e rilevamenti */
.azioni-riga { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rilevamenti { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.rilevamento { position: relative; padding: 0; border: 1px solid var(--bordo); border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9;
  background: rgba(0,0,0,.25); cursor: pointer; color: #fff; }
.rilevamento img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rilevamento span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; font-size: 13px; text-align: left;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); display: flex; flex-direction: column; line-height: 1.25; }
.rilevamento span b { font-size: 14px; }
@media (max-width: 700px) { .rilevamenti { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.riga.a-capo { flex-wrap: wrap; }
.riga.a-capo > .segmentato { flex: 1 1 100%; }
.riga.a-capo > .segmentato button { flex: 1; justify-content: center; }

/* accesso con password */
.pwd-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; width: min(360px, 78vw); }
.pwd-form[hidden] { display: none; }
.pwd-form .campo { text-align: center; font-size: 19px; letter-spacing: .04em; }
.pwd-form .btn { justify-content: center; min-height: 54px; }
.pwd-form.scuoti { animation: scuoti .4s; }
.pin-punti[hidden], .pin-tastiera[hidden] { display: none; }

.form-password { display: flex; flex-direction: column; gap: 4px; }
.forza-password { min-height: 1.4em; font-size: 14px; margin: -4px 0 8px 6px; color: var(--testo-2); }
.forza-password[data-livello=debole] { color: #FFC2C2; }
.forza-password[data-livello=buona] { color: #CDE7B0; }
.forza-password[data-livello=forte] { color: #9BE3B8; }
