/* Trama 1.7.0 — ogni larghezza ha la sua impaginazione.
   Sotto i 700 px: il telefono (barra in basso). Dai 700 ai 1099: la barra a sinistra stretta, con le icone e la parola sotto
   (tablet in verticale, finestra del computer a metà o a due terzi). Dai 1100 in su: la barra a sinistra intera, come prima.
   Più: il primo avvio nuovo (.o17-*), il Vocale (.vx-*), la barra senza «Svuota la testa». */

/* ============================ la barra a sinistra stretta: 700–1099 ============================ */
@media (min-width: 700px) and (max-width: 1099px) {
  :root, html:not([data-palette]):not([data-t16-off]) { --nav-w: 84px; }
  html .shell .nav { padding: .9rem .45rem .7rem; align-items: stretch; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
  html .shell .nav::-webkit-scrollbar { display: none; }
  html .shell .nav .brand { justify-content: center; padding: .2rem 0 .9rem; font-size: 0; gap: 0; }
  html .shell .nav .brand .mark, html .shell .nav .brand svg { width: 26px; height: 26px; }
  html .shell .nav .brand small { display: none; }
  html .shell .nav-main { display: flex; flex-direction: column; gap: .15rem; }
  html .shell .nav-main > a, html .shell .nav-main .s-navsub > a {
    flex-direction: column; justify-content: center; align-items: center; gap: .28rem; text-align: center;
    padding: .55rem .15rem .5rem !important; min-height: 60px; border-radius: 14px; font-size: .7rem; line-height: 1.1; font-weight: 600;
    position: relative; border: 0 !important; letter-spacing: 0; }
  html .shell .nav-main > a > span:last-of-type, html .shell .nav-main .s-navsub > a > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  html .shell .nav-main > a .ti-tile { width: 30px; height: 30px; }
  html .shell .nav-main .s-navsub > a svg, html .shell .nav-main .s-navsub > a .ti-tile { width: 22px; height: 22px; }
  html .shell .nav-main .s-navsub { margin: .5rem 0 0; padding: .5rem 0 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: .15rem; }
  html .shell .nav-main .nb53, html .shell .nav-main .menu-badge, html .shell .nav-main .p-pill, html .shell .nav-main .plan-pill {
    position: absolute; top: 4px; right: 8px; margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: .62rem; line-height: 18px; border-radius: 9px; }
  html .shell .nav-group { display: none !important; }
  html .shell .nav .nav-user { flex-direction: column; justify-content: center; gap: .2rem; padding: .7rem .1rem .2rem !important; font-size: 0; }
  html .shell .nav .nav-user .cog { display: none; }
  html .shell .nav .nav-user #nav-user { display: none; }
  /* il contenuto: meno margine ai lati, la barra «Dimmi cosa fare» segue la larghezza */
  html .main { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
  html .capture { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
  html .chat-input-row, html .chat-preview { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}

/* ============================ larghezze intermedie: niente si sovrappone ============================ */
/* le intestazioni con titolo e pulsanti vanno a capo invece di uscire dallo schermo */
@media (max-width: 1099px) {
  html .page-head { flex-wrap: wrap; row-gap: .6rem; }
  html .page-head > * { min-width: 0; }
  html .page-head .row, html .page-head .actions { flex-wrap: wrap; row-gap: .4rem; }
}
/* il telefono largo (finestra a un terzo, telefono orizzontale piccolo): il contenuto non si allarga all'infinito */
@media (min-width: 560px) and (max-width: 699px) {
  html #view { max-width: 620px; margin-left: auto; margin-right: auto; }
}
/* l'Agenda: sotto i 1200 px la colonna «Senza orario» va sotto la settimana, così i giorni restano leggibili */
@media (min-width: 700px) and (max-width: 1199px) {
  html .cal-layout { grid-template-columns: minmax(0, 1fr); }
}
/* Impostazioni: elenco e pannello sono due colonne che si stringono insieme; le righe non si sovrappongono mai */
@media (min-width: 700px) and (max-width: 1099px) {
  html .t10-set.desk { grid-template-columns: minmax(260px, .9fr) minmax(0, 1.1fr); gap: 20px; }
}
html .t10-row > span:not(.v):not(.ti-tile):not(.tf) { min-width: 0; }
html .t10-row .grow, html .t10-row > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
html .t10-row .v { flex: 0 1 auto; min-width: 0; }
html .t10-row .t { overflow: hidden; text-overflow: ellipsis; }

/* ============================ la barra: il pulsante «Vocale» al posto del microfono ============================ */
.capture .cap-vx { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; margin-right: 4px; flex: none; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 700 13.5px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.capture .cap-vx .vx-ic { width: 18px; height: 18px; color: var(--dawn); }
.capture .cap-vx:hover { border-color: var(--ink-3); }
.capture .cap-vx.lock { color: var(--ink-2); }
.capture .cap-vx.lock .vx-ic { color: var(--ink-3); }
.capture .cap-mic, .capture .cap-dump { display: none !important; }
.capture.in-sheet .cap-vx { display: none; }
@media (max-width: 899px) { .capture .cap-vx span { display: none; } .capture .cap-vx { width: 36px; padding: 0; justify-content: center; } }
/* nel ＋ del telefono */
.s-vx { display: flex; align-items: center; gap: 14px; width: 100%; margin: 12px 0 4px; padding: 14px 16px; border: 0; border-radius: 18px; text-align: left; cursor: pointer;
  background: var(--ink); color: var(--bg); font: inherit; position: relative; }
.s-vx .vx-ic { width: 30px; height: 30px; color: var(--dawn); flex: none; }
.s-vx b { display: block; font-size: 17px; font-weight: 800; }
.s-vx small { display: block; font-size: 14px; opacity: .78; margin-top: 2px; }
.s-vx.lock { background: var(--surface-2); color: var(--ink); }
.s-vx.lock .vx-ic { color: var(--ink-3); }
.s-vx .vx-lk { position: absolute; right: 14px; top: 12px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--dawn-ink); background: var(--dawn-soft); border-radius: 999px; padding: 3px 8px; }

/* ============================ il Vocale ============================ */
html.vx-lock, html.o17-lock { overflow: hidden; }
.vx { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; background: rgba(12,13,16,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .22s ease; }
.vx.in { opacity: 1; } .vx.out { opacity: 0; }
.vx-in { width: min(440px, 100%); height: min(720px, 100%); background: #14161B; color: #F2F1EC; border-radius: 30px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.7); transform: translateY(18px) scale(.98); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.vx.in .vx-in { transform: none; }
@media (max-width: 699px) { .vx { background: #14161B; } .vx-in { width: 100%; height: 100%; border-radius: 0; box-shadow: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); } }
.vx-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.vx-top b { display: flex; align-items: center; gap: 8px; font: 800 17px/1 var(--sans); letter-spacing: .01em; }
.vx-top .vx-tic { width: 20px; height: 20px; color: #F0A92A; }
.vx-x { border: 0; background: rgba(255,255,255,.09); color: #F2F1EC; font: 600 15px/1 var(--sans); padding: 10px 14px; border-radius: 999px; cursor: pointer; }
.vx-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 28px; text-align: center; min-height: 0; }
.vx-orb { --lv: .15; position: relative; width: 210px; height: 210px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, #2A2E37, #1B1E25 70%); box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset; }
.vx-glow { position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(240,169,42,.38), rgba(240,169,42,0) 68%);
  transform: scale(calc(.82 + var(--lv) * .55)); opacity: calc(.35 + var(--lv) * .9); transition: transform .12s linear, opacity .12s linear; }
.vx-bars { position: relative; display: flex; align-items: center; gap: 6px; height: 96px; }
.vx-bars i { width: 7px; height: 96px; border-radius: 4px; background: linear-gradient(#FFD27A, #F0A92A); transform: scaleY(.14); transition: transform .08s linear; }
.vx[data-st="work"] .vx-bars i { animation: vxWait 1.2s ease-in-out infinite; animation-delay: calc(var(--k, 0) * 1ms); }
.vx[data-st="work"] .vx-bars i:nth-child(odd) { animation-delay: -.6s; }
.vx[data-st="work"] .vx-glow { animation: vxBreath 1.6s ease-in-out infinite; }
.vx[data-st="err"] .vx-bars i { transform: scaleY(.1); background: #5A5F6B; }
@keyframes vxWait { 0%, 100% { transform: scaleY(.18); } 50% { transform: scaleY(.55); } }
@keyframes vxBreath { 0%, 100% { transform: scale(.85); opacity: .4; } 50% { transform: scale(1.05); opacity: .8; } }
.vx-time { margin-top: 22px; font: 600 15px/1 var(--sans); font-variant-numeric: tabular-nums; color: #A9ACB4; letter-spacing: .04em; }
.vx-say { margin: 18px 0 0; font: 600 21px/1.35 var(--serif, Georgia); color: #F2F1EC; max-height: 9.5em; overflow: auto; }
.vx-say.live { font-family: var(--sans); font-weight: 600; font-size: 19px; }
.vx-ex { margin: 10px 0 0; font-size: 15px; line-height: 1.45; color: #A9ACB4; }
.vx-foot { padding: 0 22px 24px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
.vx-go { height: 58px; border: 0; border-radius: 18px; background: #F0A92A; color: #1A1306; font: 800 18px/1 var(--sans); cursor: pointer; }
.vx-go:disabled { background: rgba(255,255,255,.1); color: #C9CBD1; cursor: default; }
.vx-alt { height: 48px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: transparent; color: #F2F1EC; font: 700 15.5px/1 var(--sans); cursor: pointer; }
.vx-foot small { color: #A9ACB4; font-size: 13.5px; min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { .vx[data-st="work"] .vx-bars i, .vx[data-st="work"] .vx-glow { animation: none; } }

/* ============================ il primo avvio ============================ */
.o17 { position: fixed; inset: 0; z-index: 9400; display: grid; place-items: center; background: var(--bg); opacity: 0; transition: opacity .25s ease; }
.o17.out { opacity: 0 !important; }
.o17:not(.out) { opacity: 1; }
@media (min-width: 700px) { .o17 { background: color-mix(in srgb, var(--ink) 42%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); } }
.o17-card { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--bg); padding: calc(14px + env(safe-area-inset-top)) 22px calc(18px + env(safe-area-inset-bottom)); overflow: hidden; }
@media (min-width: 700px) { .o17-card { width: 470px; height: min(780px, 94vh); border-radius: 30px; padding: 18px 28px 24px; box-shadow: var(--shadow-lg); } }
.o17-top { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.o17-bars { flex: 1; display: flex; gap: 5px; }
.o17-bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.o17-bars i b { display: block; height: 100%; width: 0; background: var(--dawn); border-radius: 2px; }
.o17-bars i.done b { width: 100%; }
.o17-bars i.on b { width: 100%; animation: o17Fill linear both; }
.o17-bars i.on b[style=""] { animation: none; }
@keyframes o17Fill { from { width: 0; } to { width: 100%; } }
.o17-skip { border: 0; background: transparent; color: var(--ink-2); font: 700 15px/1 var(--sans); padding: 10px 2px 10px 8px; cursor: pointer; }
.o17-body { flex: 1; min-height: 0; display: flex; flex-direction: column; opacity: 0; transform: translateY(10px); transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1); overflow-y: auto; scrollbar-width: none; }
.o17-body::-webkit-scrollbar { display: none; }
.o17-body.in { opacity: 1; transform: none; }
.o17-body[data-o17tap] { cursor: pointer; user-select: none; -webkit-user-select: none; }
.o17-art { flex: 1; min-height: 250px; display: grid; place-items: center; padding: 18px 0 8px; }
.o17-copy h1, .o17-form h1 { font: 600 clamp(30px, 8.4vw, 36px)/1.08 var(--serif); letter-spacing: -.012em; color: var(--ink); margin: 0; }
.o17-copy p { font-size: 17.5px; line-height: 1.5; color: var(--ink-2); margin: 12px 0 6px; max-width: 34ch; }
.o17-copy { padding-bottom: 6px; }
.o17-foot { padding-top: 14px; }
.o17-go { width: 100%; height: 58px; border: 0; border-radius: 18px; background: var(--ink); color: var(--bg); font: 800 17.5px/1 var(--sans); cursor: pointer; }
.o17-go:disabled { opacity: .35; cursor: default; }
/* scena 1: la barra che scrive */
.o17-a1 { align-content: center; gap: 0; }
.o17-a1 > * { width: 100%; max-width: 380px; }
.o17-bar { display: flex; align-items: center; gap: 4px; height: 58px; padding: 0 8px 0 18px; border: 1.5px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 14px 34px -18px rgba(22,24,30,.35); transition: border-color .2s, transform .25s; }
.o17-bar.sent { border-color: var(--dawn); transform: scale(.985); }
.o17-typed { font: 600 18px/1 var(--sans); color: var(--ink); white-space: nowrap; overflow: hidden; }
.o17-caret { width: 2px; height: 24px; background: var(--dawn); animation: o17Blink 1s steps(1) infinite; flex: none; }
.o17-send { margin-left: auto; width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.o17-send svg, .o17-cap button svg { width: 20px; height: 20px; }
@keyframes o17Blink { 50% { opacity: 0; } }
.o17-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; min-height: 216px; }
.o17-it { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2);
  opacity: 0; transform: translateY(-26px) scale(.96); transition: opacity .35s ease, transform .5s cubic-bezier(.2,.9,.25,1.15); }
.o17-it.in { opacity: 1; transform: none; }
.o17-it .ti-tile, .o17-prev .ti-tile { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.o17-it b, .o17-prev b { display: block; font-size: 16.5px; font-weight: 700; color: var(--ink); }
.o17-it small, .o17-prev small { display: block; font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
/* scena 2: la trama che si tesse */
.o17-weave { position: relative; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 9px; }
.o17-row { display: flex; align-items: center; gap: 12px; }
.o17-row span { width: 18px; font: 700 13px/1 var(--sans); color: var(--ink-3); text-align: center; flex: none; }
.o17-thr { height: 18px; border-radius: 9px; background: var(--c); width: 0; animation: o17Weave .7s cubic-bezier(.3,.8,.3,1) forwards; animation-delay: calc(.25s + var(--i) * .45s);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.0) 0 9px, rgba(255,255,255,.22) 9px 11px); }
.o17-thr.now { animation-name: o17WeaveNow; animation-duration: 1.4s; }
@keyframes o17Weave { to { width: calc(100% - 30px); } }
@keyframes o17WeaveNow { to { width: calc(78% - 30px); } }
.o17-lume { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FFE5A8, var(--dawn) 62%); box-shadow: 0 0 0 7px color-mix(in srgb, var(--dawn) 22%, transparent), 0 0 26px 6px color-mix(in srgb, var(--dawn) 45%, transparent);
  left: 30px; bottom: -2px; opacity: 0; animation: o17Lume 1.4s cubic-bezier(.3,.8,.3,1) forwards; animation-delay: 2.95s; }
@keyframes o17Lume { 0% { opacity: 0; left: 30px; } 15% { opacity: 1; } 100% { opacity: 1; left: calc(78% - 11px); } }
/* scena 3: le sezioni */
.o17-tiles { width: 100%; max-width: 380px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.o17-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 6px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2);
  opacity: 0; transform: scale(.7); animation: o17Pop .55s cubic-bezier(.2,.9,.3,1.3) forwards; animation-delay: calc(.2s + var(--i) * .16s); }
.o17-tile .ti-tile { width: 48px; height: 48px; border-radius: 14px; }
.o17-tile b { font-size: 15px; font-weight: 700; color: var(--ink); }
@keyframes o17Pop { to { opacity: 1; transform: none; } }
/* «Facciamola tua» e «Prova adesso» */
.o17-form { padding: 22px 0 4px; }
.o17-l { display: block; margin: 24px 0 10px; font-size: 16px; font-weight: 700; color: var(--ink); }
.o17-l small { font-weight: 500; color: var(--ink-2); font-size: 14.5px; margin-left: 4px; }
.o17-in { width: 100%; height: 56px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); padding: 0 16px; font: 600 18px/1 var(--sans); color: var(--ink); outline: 0; }
.o17-in:focus { border-color: var(--ink); }
.o17-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.o17-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 15px 0 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 650 15.5px/1 var(--sans); cursor: pointer; }
.o17-chip .ti { width: 22px; height: 22px; }
.o17-chip.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.o17-chip.on .ti .l { stroke: var(--bg); }
.o17-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--fill); }
.o17-seg button { min-height: 46px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font: 700 15px/1.15 var(--sans); cursor: pointer; padding: 4px 6px; }
.o17-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.o17-p { font-size: 17px; line-height: 1.5; color: var(--ink-2); margin: 12px 0 0; }
.o17-cap { display: flex; align-items: center; gap: 6px; height: 60px; margin-top: 22px; padding: 0 8px 0 16px; border: 1.5px solid var(--ink); border-radius: 18px; background: var(--surface); }
.o17-cap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 600 18px/1 var(--sans); color: var(--ink); }
.o17-cap button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.o17-prev { display: flex; align-items: center; gap: 13px; min-height: 72px; margin-top: 12px; padding: 12px 14px; border-radius: 16px; border: 1.5px dashed var(--line); }
.o17-prev.on { border-style: solid; border-color: var(--line-2); background: var(--surface); animation: o17Pop .35s ease both; }
.o17-ph { color: var(--ink-2); font-size: 15.5px; }
.o17-ex { display: flex; flex-wrap: wrap; gap: 8px; }
.o17-ex button { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: 600 15px/1 var(--sans); cursor: pointer; }
@media (max-height: 700px) { .o17-art { min-height: 200px; padding-top: 8px; } .o17-list { min-height: 190px; gap: 8px; } .o17-form { padding-top: 10px; } .o17-l { margin-top: 18px; } }
@media (prefers-reduced-motion: reduce) {
  .o17-thr { animation: none; width: calc(100% - 30px); } .o17-thr.now { width: calc(78% - 30px); }
  .o17-lume { animation: none; opacity: 1; left: calc(78% - 11px); }
  .o17-tile { animation: none; opacity: 1; transform: none; }
  .o17-it { transition: none; }
}
.o17-hint { margin: -4px 0 12px; font-size: 15px; line-height: 1.4; color: var(--ink-2); }
