/* 2.08 Il gestionale sul telefono come un'app (base.html, _app_head.html, app-telefono.js).
   Barra in basso con le pagine di tutti i giorni del ruolo + Menu a tutto schermo con TUTTE le voci (3 per riga, in una
   schermata), pagine ferme (niente scorrimento a destra e sinistra), campi che non fanno ingrandire l'iPhone. v1 */

.app-tabs, .app-install, .bar-edit-open { display: none; }
.nav-sub-ico { display: none; }

@media (max-width: 900px) {
  /* ---------- la pagina sta ferma: niente spostamenti a destra e sinistra ---------- */
  html:has(.gest-shell), html:has(.gest-shell) body { overflow-x: clip; }
  .gest-shell { max-width: 100vw; }
  .gest-shell > .page-shell { min-width: 0; max-width: 100%; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .gest-shell img, .gest-shell video, .gest-shell canvas, .gest-shell iframe { max-width: 100%; }
  .gest-shell .phone-screen iframe { max-width: none; }   /* anteprima del menu: 390 px rimpiccioliti, non tagliati */
  .gest-shell pre, .gest-shell code { white-space: pre-wrap; overflow-wrap: anywhere; }
  /* iPhone: campi di almeno 16px, altrimenti Safari ingrandisce la pagina quando li tocchi e poi resta "storta" */
  .gest-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  .gest-shell select, .gest-shell textarea { font-size: 16px; }
  /* campi e riquadri si stringono con lo schermo invece di spingere fuori (date, orari, liste di scelte) */
  .gest-shell input:not([type="checkbox"]):not([type="radio"]), .gest-shell select, .gest-shell textarea { min-width: 0; max-width: 100%; }
  .gest-shell form > *, .gest-shell .card > *, .gest-shell label { min-width: 0; }
  .gest-shell .sc-moments > *, .gest-shell .sc-moment > * { min-width: 0; }
  .gest-shell .ins-people > *, .gest-shell .brand-grid > *, .gest-shell .phone-wrap > * { min-width: 0; }
  .gest-shell .phone-wrap, .gest-shell .phone-wrap .phone { max-width: 100%; }
  .gest-shell .seg { flex-wrap: wrap; max-width: 100%; }
  /* tabelle larghe (es. orari della Vetrina): scorrono dentro il loro riquadro, la pagina resta ferma */
  .gest-shell .sc-matrix { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ---------- in alto: logo, campanella e Menu sempre a portata ---------- */
  .gest-shell > .sidebar { top: 0; padding-top: max(10px, env(safe-area-inset-top)); }

  /* ---------- Menu aperto: tutte le voci in UNA schermata, 3 per riga ---------- */
  .gest-shell > .sidebar.is-open { position: fixed; inset: 0; z-index: 120; width: 100%; max-width: 100vw; height: 100%; max-height: none;
    box-sizing: border-box; flex-wrap: wrap; align-content: flex-start; gap: 10px; overflow-x: hidden; overflow-y: auto;
    overscroll-behavior: contain; background: var(--bg);
    padding: max(10px, env(safe-area-inset-top)) 12px calc(100px + env(safe-area-inset-bottom)); }
  .gest-shell > .sidebar.is-open > .side-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%;
    min-width: 0; padding-top: 2px; border-top: 0; overflow: visible; }
  .gest-shell > .sidebar.is-open .mode-switch { grid-column: 1 / -1; margin: 0 0 4px; }
  .gest-shell > .sidebar.is-open .nav-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .gest-shell > .sidebar.is-open .nav-group + .nav-group { margin-top: 8px; }
  .gest-shell > .sidebar.is-open .nav-group-title { grid-column: 1 / -1; margin: 2px 0 0; padding: 0 2px; }
  /* i menu a tendina si "aprono" in riquadri: ogni pagina e' un riquadro con l'icona del suo gruppo */
  .gest-shell > .sidebar.is-open .nav-drop, .gest-shell > .sidebar.is-open .nav-sub,
  .gest-shell > .sidebar.is-open .nav-sub[hidden] { display: contents; }
  .gest-shell > .sidebar.is-open .nav-drop-btn { display: none; }
  .gest-shell > .sidebar.is-open .nav-sub-ico { display: contents; }
  .gest-shell > .sidebar.is-open .side-nav a { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 5px; min-width: 0; height: auto; min-height: 60px; margin: 0; padding: 7px 4px; border-radius: 14px; background: var(--surface);
    border: 1px solid var(--line); color: var(--ink); font-size: 11.5px; font-weight: 500; line-height: 1.2; text-align: center;
    white-space: normal; overflow-wrap: anywhere; hyphens: auto; }
  .gest-shell > .sidebar.is-open .side-nav a svg { flex: none; width: 20px; height: 20px; }
  .gest-shell > .sidebar.is-open .side-nav a[aria-current="page"] { border-color: var(--ink); font-weight: 650; }
  .gest-shell > .sidebar.is-open .side-nav a .nav-badge { position: absolute; top: 4px; right: 4px; margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; }
  .gest-shell > .sidebar.is-open > .sidebar-foot { padding-top: 10px; }
  /* sede in una riga sola */
  .gest-shell > .sidebar.is-open > .form-hint, .gest-shell > .sidebar.is-open > .sede-manage { width: auto; margin: 0; font-size: 13px; }
  .gest-shell > .sidebar.is-open > .form-hint { flex: 1 1 auto; min-width: 0; }
  .gest-shell > .sidebar.is-open > .sede-manage { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
  @media (max-height: 700px) { .gest-shell > .sidebar.is-open .side-nav a { min-height: 54px; padding: 6px 3px; } }

  /* ---------- barra in basso ---------- */
  .app-tabs { position: fixed; left: max(10px, calc(50% - 300px)); right: max(10px, calc(50% - 300px)); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 130; display: grid;
    grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px; border-radius: 22px;
    background: rgba(24, 24, 28, .88); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
    backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); }
  .app-tabs a, .app-tabs button { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 0;
    min-height: 52px; padding: 6px 2px; border: 0; border-radius: 16px; background: none; color: rgba(255, 255, 255, .72);
    font: 600 10px/1.1 var(--font, system-ui), sans-serif; letter-spacing: -.1px; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .app-tabs span:not(.tab-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-tabs svg { width: 22px; height: 22px; }
  .app-tabs, .app-tabs a, .app-tabs button { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
  /* Menu aperto: in cima "Barra in basso" e "Personalizza il menu", uno accanto all'altro */
  .gest-shell > .sidebar.is-open .nav-edit-row { grid-column: 1 / -1; margin: 0 0 4px; }
  .gest-shell > .sidebar.is-open .nav-edit-row .bar-edit-open { margin: 0; }
  .gest-shell > .sidebar.is-open .menu-edit-open { flex: 1 1 0; justify-content: center; min-height: 40px; padding: 0 8px; border: 1px dashed var(--field-line);
    border-radius: 12px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
  .gest-shell > .sidebar.is-open .bar-edit-open { flex: 1 1 0; grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; margin: 0 0 4px; border: 1px dashed var(--field-line); border-radius: 12px; background: transparent; color: var(--ink);
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
  .app-tabs .tab-long { font-size: 9px; letter-spacing: -.25px; }
  .app-tabs [aria-current="page"], .app-tabs .is-active { color: #FFFFFF; background: rgba(255, 255, 255, .1); }
  body.nav-is-open .app-tabs [aria-current="page"] { color: rgba(255, 255, 255, .72); background: none; }
  .app-tabs .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: #FF453A; color: #FFFFFF; font-size: 10.5px; line-height: 17px; text-align: center; }
  .app-tabs .tab-badge-info { background: rgba(255, 255, 255, .24); }
  .app-tabs .tab-badge[hidden] { display: none; }
  /* foglio della comanda aperto (Sala › tavolo): la barra lascia il posto ai suoi pulsanti */
  body:has(.pad-ticket.is-open) .app-tabs { display: none; }

  /* ---------- cose fissate in basso: stanno sopra la barra ---------- */
  .gest-shell .ast-fab { right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); width: 48px; min-height: 48px; padding: 0; justify-content: center; font-size: 20px; }
  .gest-shell .ast-fab-label { display: none; }   /* solo ✨: non copre prezzi e pulsanti */
  .gest-shell .notify-panel { left: 10px; right: 10px; bottom: calc(86px + env(safe-area-inset-bottom)); width: auto; max-height: min(62vh, 560px); }
  .gest-shell .ticket-bar:not([hidden]) { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .gest-shell .pad-menu { padding-bottom: 96px; }
  .gest-shell .join-bar { bottom: calc(86px + env(safe-area-inset-bottom)); }
  body:has(.gest-shell) .toast, body:has(.gest-shell) .toast[popover] { bottom: calc(90px + env(safe-area-inset-bottom)); inset: auto 12px calc(90px + env(safe-area-inset-bottom)) 12px; max-width: none; }

}

/* ---------- invito a usare RACE come app (una volta, solo nel browser del telefono) ---------- */
.app-install:not([hidden]) { max-width: 720px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico txt x" "ico btn x";
  align-items: center; gap: 4px 12px; margin: 0 0 16px; padding: 12px 12px 12px 14px; border-radius: var(--r-lg, 18px);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.app-install-ico { grid-area: ico; align-self: start; }
.app-install-ico img { display: block; width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 1px rgba(10, 10, 20, .12); }   /* 2.12 icona bianca col nodo blu */
.app-install > div { grid-area: txt; display: grid; gap: 2px; min-width: 0; }
.app-install strong { font-size: 15px; }
.app-install small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.app-install .button { grid-area: btn; justify-self: start; margin-top: 6px; }
.app-install-close { grid-area: x; align-self: start; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); cursor: pointer; }

/* ---------- Cassa sul telefono: cassa veloce col tastierino in cima, il resto sotto. La pagina resta "agganciata" al
   tastierino come a una calamita (app-telefono.js): per scendere bisogna trascinare un po' di piu'. ---------- */
@media (max-width: 900px) {
  .gest-shell > .page-shell:has(> .qk) { display: flex; flex-direction: column; padding-top: 12px; }
  .gest-shell > .page-shell:has(> .qk) > .qk-tabs { order: -3; margin-bottom: 14px; }
  .gest-shell > .page-shell:has(> .qk) > .qk, .gest-shell > .page-shell:has(> .qk) > .qk-conti { order: -2; }
  .gest-shell > .page-shell:has(> .qk) > .qk { gap: 12px; margin-bottom: 36px; }
  .gest-shell > .page-shell:has(> .qk) > .qk-conti { margin-bottom: 24px; }
  /* il titolo «Cassa» c'e' gia' nella barra in basso: sotto il tastierino restano solo i suoi pulsanti */
  .gest-shell > .page-shell:has(> .qk) > .page-heading > div:first-child { display: none; }
  /* Conti da incassare: prima i conti dei tavoli, poi l'incasso di oggi (totale, metodi, mance) */
  .gest-shell .qk-conti { display: flex; flex-direction: column; gap: 16px; }
  .gest-shell .qk-conti > .cassa-tables { order: -1; }
  .gest-shell .qk-conti > * { margin-top: 0; margin-bottom: 0; }
  /* sul tastierino il dito scrive e basta: niente scorrimento della pagina mentre digiti */
  .gest-shell .qk-keys, .gest-shell .qk-amount, .gest-shell .qk-plus, .gest-shell .qk-key { touch-action: none; -webkit-user-select: none; user-select: none; }
  /* i tasti restano tondi: e' la larghezza del tastierino ad adattarsi all'altezza dello schermo */
  .gest-shell .qk { --qk-gap: clamp(10px, 3.4vw, 16px); }
  .gest-shell .qk-keys { max-width: clamp(200px, calc(100dvh - 505px), 372px); }
  /* schermi meno alti (iPhone nel browser, con le barre di Safari): sopra il tastierino tutto piu' compatto */
  @media (max-height: 780px) {
    .gest-shell > .page-shell:has(> .qk) { padding-top: 8px; }
    .gest-shell > .page-shell:has(> .qk) > .qk-tabs { margin-bottom: 8px; }
    .gest-shell .qk-tabs button { min-height: 36px; white-space: nowrap; }
    .gest-shell > .page-shell:has(> .qk) > .qk { gap: 8px; }
    .gest-shell .qk-modes button { min-height: 30px; }
    .gest-shell .qk-amount { font-size: 46px; margin-top: 0; }
    .gest-shell .qk-pad > .qk-desc { min-height: 28px; }
    .gest-shell .qk-keys { margin-top: 4px; }
    .gest-shell .qk-keys { max-width: clamp(200px, calc(100dvh - 462px), 372px); }
  }
  .gest-shell .qk-pad { gap: 6px; }
  .gest-shell .qk-amount { margin-top: 4px; }
  /* "Incassa" sempre visibile, sopra la barra in basso; l'assistente lascia libero il tastierino */
  .gest-shell .qk-bar { bottom: calc(84px + env(safe-area-inset-bottom)); padding: 12px 0; background: var(--bg); }
  /* telefoni bassissimi (iPhone SE nel browser): non ci sta tutto, quindi la pagina scorre normalmente
     (niente calamita, vedi app-telefono.js) e Incassa segue il tastierino invece di coprirlo */
  @media (max-height: 620px) {
    .gest-shell > .page-shell:has(> .qk) { padding-top: 4px; }
    .gest-shell .qk-amount { font-size: 38px; }
    .gest-shell .qk { --qk-gap: 10px; }
    .gest-shell .qk-keys { max-width: 250px; }
    .gest-shell .qk-bar { position: static; padding: 8px 0; }
    .gest-shell .qk-bar .qk-go, .gest-shell .qk-bar .qk-cart { min-height: 46px; height: 46px; }
    .gest-shell .qk-bar .qk-cart { width: 46px; }
  }
  body:has(.page-shell > .qk:not([hidden])) .ast-fab { display: none; }
}

/* ---------- moduli su una colonna (schermi stretti): le righe "larghe due" non creano colonne fantasma fuori schermo ---------- */
@media (max-width: 1100px) { .gest-shell .form-grid > .span-2 { grid-column: 1 / -1; } }

/* ---------- iPad in verticale o diviso a metà (e tablet): il Menu a riquadri usa tutta la larghezza ---------- */
@media (min-width: 641px) and (max-width: 900px) {
  .gest-shell > .sidebar.is-open { padding-left: 20px; padding-right: 20px; }
  .gest-shell > .sidebar.is-open > .side-nav,
  .gest-shell > .sidebar.is-open .nav-group { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
  .gest-shell > .sidebar.is-open .side-nav a { min-height: 76px; font-size: 13px; }
  .gest-shell > .sidebar.is-open .side-nav a svg { width: 22px; height: 22px; }
  .gest-shell > .page-shell { padding-left: 24px; padding-right: 24px; }
}
/* iPad in orizzontale (menu a sinistra): voci un po' piu' alte, comode da toccare col dito */
@media (min-width: 901px) and (pointer: coarse) {
  .gest-shell > .sidebar .side-nav a, .gest-shell > .sidebar .side-nav .nav-drop-btn { min-height: 44px; }
}

/* ---------- schede in alto (Sala: Tavoli, Banco, Asporto, Domicilio...): tutte visibili, vanno a capo se servono ---------- */
@media (max-width: 640px) {
  .gest-shell .sala-tabs { flex-wrap: wrap; overflow: visible; }
  .gest-shell .sala-tabs a { flex: 1 1 auto; min-height: 40px; padding: 0 10px; font-size: 14px; }
  .gest-shell .qk-tabs { overflow: visible; }
  .gest-shell .qk-tabs button { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 14px; line-height: 1.2; white-space: normal; text-align: center; }
}

/* ---------- titoli delle pagine su una colonna, a sinistra (prima andavano a destra e uscivano dallo schermo) ---------- */
@media (max-width: 760px) {
  .gest-shell .page-heading { align-items: flex-start; gap: 14px; }
  .gest-shell .page-heading > * { min-width: 0; max-width: 100%; }
  .gest-shell .page-heading .week-nav, .gest-shell .page-heading .page-actions { flex-wrap: wrap; }
}

/* ---------- iPad e schermi medi: titolo sopra, pulsanti sotto in fila (prima stavano in una colonna stretta a destra) ---------- */
@media (max-width: 1200px) {
  .gest-shell .page-heading { flex-direction: column; align-items: flex-start; gap: 14px; }
  .gest-shell .page-heading > * { min-width: 0; max-width: 100%; }
  .gest-shell .page-heading > div:first-child .muted { max-width: 68ch; }
  .gest-shell .page-heading .heading-actions, .gest-shell .page-heading .week-nav, .gest-shell .page-heading .page-actions { flex-wrap: wrap; justify-content: flex-start; }
}
.gest-shell .reopen-guide { margin: -8px 0 16px; }

/* ---------- "La tua barra in basso" (tieni premuta la barra o Menu › Personalizza) ---------- */
@media (min-width: 641px) { .app-shell .bar-sheet { width: min(520px, calc(100vw - 32px)); } }
.app-shell .bar-sheet .sheet-body { padding-bottom: 8px; }
.bar-label { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 8px; font-size: 14px; }
.bar-label span { color: var(--muted); font-size: 13px; }
.bar-slots, .bar-pool { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bar-pool { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bar-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0;
  min-height: 64px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; overflow-wrap: anywhere; cursor: pointer; }
.bar-tile svg { width: 20px; height: 20px; flex: none; }
.bar-tile span { max-width: 100%; }
.bar-slots .bar-tile { font-size: 10.5px; letter-spacing: -.1px; }
.bar-slots .bar-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-tile i { position: absolute; top: 4px; right: 5px; font-style: normal; font-size: 11px; color: var(--muted); }
.bar-slot { position: relative; display: grid; min-width: 0; }
.bar-slot .bar-tile { width: 100%; padding-top: 12px; }
.bar-x { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 2px solid var(--surface);
  border-radius: 999px; background: var(--st-danger); color: #FFFFFF; font: 700 11px/1 var(--font, system-ui), sans-serif; cursor: pointer; }
.bar-tile.is-picked { outline: 3px solid #FF6A3D; outline-offset: 2px; transform: translateY(-2px); }
.bar-tile.is-empty.is-target { border-color: #FF6A3D; color: #FF6A3D; font-weight: 600; cursor: pointer; }
.bar-tile.is-in { background: #1B1B1F; border-color: #1B1B1F; color: #FFFFFF; }
.bar-tile.is-in i { color: rgba(255, 255, 255, .7); }
html[data-theme="dark"] .bar-tile.is-in { background: #F2F2F4; border-color: #F2F2F4; color: #141416; }
html[data-theme="dark"] .bar-tile.is-in i { color: rgba(20, 20, 22, .6); }
.bar-tile.is-empty { border-style: dashed; background: transparent; color: var(--muted); font-weight: 500; cursor: default; }
.bar-sheet [data-bar-msg]:empty { display: none; }
.bar-sheet [data-bar-msg] { margin: 10px 0 0; color: var(--st-attn); font-weight: 600; }
.bar-sheet .sheet-head .muted b { color: var(--ink); }
.bar-sheet .sheet-foot .button[disabled] { opacity: .45; }

/* ---------- pagina "Sul telefono" ---------- */
.app-how { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; }
.app-how .card { margin: 0; }
.app-how .card.is-mine { border: 1.5px solid var(--ink); }
.app-how ol { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.app-how li { line-height: 1.45; }
.app-how .app-key { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.app-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.app-hero img { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 0 0 1px rgba(10, 10, 20, .12), var(--shadow-card); flex: none; }
.app-done { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--st-ready-bg); color: var(--ink); font-weight: 600; }

/* ---------- 2.08 moduli sul telefono (foto di Antonio, Dati del locale) ---------- */
/* Su iPhone le caselle data e ora hanno una larghezza minima loro e uscivano dal riquadro o finivano sotto la ✕. */
@media (max-width: 900px) {
  .gest-shell input[type="date"], .gest-shell input[type="time"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
  .gest-shell input[type="date"]::-webkit-date-and-time-value { text-align: left; }
  .gest-shell input[type="time"]::-webkit-date-and-time-value { text-align: center; }
  /* due colonne con etichette di altezza diversa: le caselle restano allineate in basso */
  .gest-shell .form-grid > label { display: flex; flex-direction: column; justify-content: flex-end; }
  .gest-shell .form-grid > label > input, .gest-shell .form-grid > label > select { margin-top: auto; }
  /* orari: nome della fascia sopra, poi apre – chiude e la ✕, tutto dentro il riquadro */
  .gest-shell .hours-slot { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 32px; row-gap: 4px; }
  .gest-shell .hours-slot .slot-name { grid-column: 1 / -1; min-height: 30px; padding-left: 0; }
  .gest-shell .hours-slot .slot-remove { justify-self: end; }
  /* Turni del personale: "Arrivano [30] minuti prima" in colonna, caselle allineate */
  .gest-shell .shift-offsets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .gest-shell .shift-offsets label { display: grid; grid-template-columns: 72px 64px minmax(0, 1fr); align-items: center; gap: 10px; }
  .gest-shell .shift-offsets input { width: 64px; }
  /* chiusure: il motivo prende tutta la riga */
  .gest-shell #chiusure .form-grid > label:nth-of-type(3) { grid-column: 1 / -1; }
  /* coperto: casella e Salva sulla stessa riga */
  .gest-shell .cover-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .gest-shell .cover-form .form-actions { grid-column: auto; }
  /* email: Salva e Invia email di prova uno sotto l'altro, larghi uguali */
  .gest-shell #email .form-actions { flex-wrap: wrap; justify-content: stretch; }
  .gest-shell #email .form-actions .button { flex: 1 1 100%; }
  .gest-shell #email .form-actions .sc-check { flex: 1 1 100%; }
  .gest-shell #email form.form-actions { margin-top: 10px; }
  .gest-shell .shift-offsets + .form-actions { margin-top: 14px; }
  .gest-shell .cover-form + .form-hint { margin-top: 14px; }
}

/* 2.09 App e notifiche (/dashboard/telefono): attiva su questo dispositivo, avvisi accesi/spenti con il loro suono */
.app-shell .nt-wrap { max-width: 760px; margin-bottom: 28px; }
.app-shell .nt-device { display: grid; gap: 12px; padding: 18px; }
.app-shell .nt-device-head { display: flex; gap: 12px; align-items: flex-start; }
.app-shell .nt-device-head h2 { margin: 0 0 4px; font-size: 18px; }
.app-shell .nt-device-head p { margin: 0; }
.app-shell .nt-bell { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); font-size: 22px; }
.app-shell .nt-state { margin: 0; font-size: 14px; }
.app-shell .nt-state:empty { display: none; }
.app-shell .nt-state.is-bad { color: var(--st-danger, #c0392b); }
.app-shell .nt-device .button { justify-self: start; }
.app-shell .nt-row, .app-shell .nt-dev { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.app-shell .nt-row:first-child, .app-shell .nt-dev:first-child { border-top: 0; }
.app-shell .nt-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.app-shell .nt-text strong { font-size: 15px; }
.app-shell .nt-text small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.app-shell .nt-controls { display: flex; align-items: center; gap: 8px; flex: none; }
.app-shell .nt-sound select { min-height: 38px; padding: 6px 30px 6px 10px; border-radius: 10px; font-size: 14px; }
.app-shell .nt-play { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 13px; cursor: pointer; }
.app-shell .nt-switch { position: relative; display: inline-block; flex: none; width: 50px; height: 30px; cursor: pointer; }
.app-shell .nt-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.app-shell .nt-switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong, rgba(127,127,127,.35)); transition: background .18s; pointer-events: none; }
.app-shell .nt-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.app-shell .nt-switch input:checked ~ i { background: var(--st-ok, #34c759); }
.app-shell .nt-switch input:checked ~ i::after { transform: translateX(20px); }
.app-shell .nt-switch input:focus-visible ~ i { outline: 3px solid var(--focus); outline-offset: 2px; }
.app-shell .nt-row.is-off .nt-text, .app-shell .nt-row.is-off .nt-sound, .app-shell .nt-row.is-off .nt-play { opacity: .5; }
.app-shell .nt-saved { position: absolute; right: 16px; bottom: 4px; color: var(--st-ok, #2e7d32); font-size: 11.5px; }
.app-shell .nt-empty { margin: 0; padding: 16px; }
.app-shell .nt-wrap > .button { margin-top: 12px; }
.app-shell .nt-section-title { margin: 8px 0 4px; font-size: 20px; }
@media (max-width: 620px) {
  .app-shell .nt-row { flex-wrap: wrap; }
  .app-shell .nt-row .nt-text { flex-basis: 100%; padding-right: 64px; box-sizing: border-box; }
  .app-shell .nt-row .nt-controls { width: 100%; }
  .app-shell .nt-row .nt-sound { flex: 1; }
  .app-shell .nt-row .nt-sound select { width: 100%; }
  .app-shell .nt-row .nt-switch { position: absolute; top: 14px; right: 16px; }
  .app-shell .nt-row .nt-controls { padding-right: 0; }
}
