/* ---------- telefono in orizzontale ----------
   Lo schermo è basso (circa 400 px): le sezioni passano in una colonna a sinistra, la barra in alto
   scorre via con la pagina e "Oggi" mette i tre riquadri affiancati e scorre se serve. */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 560px) and (max-width: 1023px) {
  :root { --rail: calc(76px + var(--sa-l)); }
  .app { padding: 0 0 0 var(--rail); }
  .mainnav {
    top: 0; right: auto; width: var(--rail); grid-template-columns: minmax(0, 1fr); align-content: center;
    padding: max(4px, var(--sa-t)) 4px max(4px, var(--sa-b)) max(4px, var(--sa-l));
    border-top: 0; border-right: 1px solid var(--line); box-shadow: none; overflow-y: auto;
  }
  .navbtn { font-size: 0.6875rem; }
  /* il lato sinistro è già coperto dalla colonna: dentro bastano i margini normali */
  .topbar { position: static; padding-left: 16px; }
  .view, .mode-note { padding-left: 16px; margin-left: 0; }
  .mh-sticky, .catjump { top: max(6px, var(--sa-t)); }
  #sections > [id^="sec-"] { scroll-margin-top: 72px; }
  .page-foot { left: var(--rail); bottom: 0; padding: 6px max(16px, var(--sa-r)) max(6px, var(--sa-b)) 16px; }
  body.can-edit-menu #view-dishes, body.can-edit-menu #view-categories { padding-bottom: 90px; }
  .toasts { bottom: max(12px, var(--sa-b)); }
  body[data-view="today"] .app { height: auto; min-height: 100dvh; padding-bottom: 0; }
  body[data-view="today"] #view-today { flex: none; padding-bottom: max(12px, var(--sa-b)); }
  body[data-view="today"] .today { flex: none; overflow: visible; container-type: inline-size; }
  body[data-view="today"] .today > .quad {
    flex: none; min-height: 0; max-height: none; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto;
  }
  body[data-view="today"] .tl-wide { grid-column: auto; }
}

/* ---------- nuova prenotazione e giorni chiusi (design/nuova-prenotazione.html) ---------- */
.fab {
  position: fixed; right: max(16px, var(--sa-r)); bottom: calc(63px + max(6px, var(--sa-b)) + 14px); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 16px;
  background: var(--bk); color: var(--surface); font: inherit; font-size: 1rem; font-weight: 600; box-shadow: var(--shadow); cursor: pointer;
}
.fab[hidden] { display: none; }
.fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
#view-bookings { padding-bottom: 84px; }
.bk-day.is-closed .bk-day-num, .np-day.is-closed b { text-decoration: line-through; color: var(--danger); }
.bk-day[aria-pressed="true"].is-closed .bk-day-num { color: var(--bg); }
.bk-closed { color: var(--danger); }
.np { display: flex; flex-direction: column; gap: 18px; }
.np-step { display: grid; gap: 8px; min-width: 0; }
.np-step[hidden] { display: none; }
.np-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: .875rem; font-weight: 600; color: var(--text-2); }
.np-label small { font-size: .75rem; font-weight: 400; color: var(--muted); }
.np .field, .np-opt { scroll-margin-top: 8px; }
.np .field { scroll-margin-top: 8px; }
.np-days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.np-days::-webkit-scrollbar { display: none; }
.np-day { position: relative; flex: none; width: 58px; min-height: 64px; display: grid; justify-items: center; align-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.np-day small { font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.np-day b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.np-day[aria-pressed="true"], .np-day.is-picked { background: var(--text); border-color: var(--text); }
.np-day[aria-pressed="true"] small, .np-day[aria-pressed="true"] b, .np-day.is-picked small, .np-day.is-picked b { color: var(--bg); }
.np-cal svg { width: 22px; height: 22px; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.np-cal input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; cursor: pointer; }
.np-cal input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.np-cal:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.np-pax { display: flex; align-items: center; gap: 6px; width: max-content; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.np-pax button { width: 48px; height: 48px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; touch-action: manipulation; }
.np-pax output { min-width: 64px; text-align: center; font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.np-pax output small { display: block; font-size: .6875rem; font-weight: 400; color: var(--muted); }
.np-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; }
.np-time { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.np-time[aria-pressed="true"] { background: var(--bk); border-color: var(--bk); color: var(--surface); }
.np-warn { margin: 0; padding: 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: .875rem; line-height: 1.45; }
.np-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.np-seg button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; }
.np-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.np-seg button:disabled { opacity: .55; }
.np-soon { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .6875rem; }
.np-areas { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.np-areas li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .9375rem; }
.np-areas span { color: var(--bk); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.np-confirm { display: grid; gap: 4px; }
/* Tavoli scelti a mano, per sala. */
.np-area { display: grid; gap: 6px; }
.np-area b { font-size: .875rem; }
.np-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.np-chip { min-width: 52px; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.np-chip[aria-pressed="true"] { background: var(--bk); border-color: var(--bk); color: var(--surface); }
.np-diff { margin: 0; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: .875rem; line-height: 1.5; }
.np-diff[hidden] { display: none; }
.np-opt { display: grid; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.np-tel { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
.np-typo { justify-self: start; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: .875rem; font-weight: 600; text-decoration: underline; cursor: pointer; }
.np-typo[hidden] { display: none; }
.np-error { margin: 0; padding: 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: .875rem; }
.np-error[hidden] { display: none; }
.np-ok { display: grid; justify-items: center; gap: 8px; padding: 16px 8px 0; text-align: center; }
.np-ok h3 { margin: 4px 0 0; font-size: 1.25rem; }
.np-ok p { margin: 0; color: var(--text-2); line-height: 1.5; }
.np-ok p::first-letter { text-transform: uppercase; }
.np-tick { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.np-tick svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* Con la tastiera aperta serve spazio sotto, perché anche l'ultimo campo possa salire in alto. */
body.kb-open .drawer-body { padding-bottom: 45vh; }
body.kb-open .drawer .sheet-foot { position: static; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .fab { bottom: max(24px, var(--sa-b)); right: 24px; }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 560px) and (max-width: 1023px) {
  .fab { bottom: max(12px, var(--sa-b)); }
}
